Chromatic Number Calculator

χ(G) = min colors

CalculatorsFreeNo Signup
4.3(232 reviews)
All Tools

Loading tool...

About Chromatic Number Calculator

A chromatic number calculator finding χ(G): the minimum k such that adjacent vertices get different colors. χ(K_n)=n, χ(C_{2n+1})=3, χ(K_{m,n})=2. Four Color Theorem: χ(planar)≤4. NP-hard in general. Client-side for small graphs.

Chromatic Number Calculator Features

  • χ(G) value
  • Coloring display
  • Common graphs
  • Four Color Theorem
  • Greedy bound
Chromatic number χ(G): minimum colors for proper vertex coloring (adjacent vertices differ). χ(K_n)=n, χ(tree)=2, χ(C_{odd})=3, χ(planar)≤4 (Four Color Theorem). Computing χ is NP-hard, but bounds exist: ω(G)≤χ(G)≤Δ(G)+1.

How to Use

Select a graph:

  • χ(G): Chromatic number
  • Coloring: Example assignment
  • Bounds: Clique and degree

Four Color Theorem

Every planar graph has χ≤4. Proved by Appel-Haken (1976) using computers — the first major theorem proved by computer. Verified independently by Robertson-Sanders-Seymour-Thomas (1997). Still no human-only proof exists!

Bounds

Lower: ω(G)≤χ(G) (clique number). Upper: χ(G)≤Δ(G)+1 (greedy). Brooks: χ≤Δ unless G is complete or odd cycle. Perfect graphs: χ=ω (Lovász, SPGT 2006).

Step-by-Step Instructions

  1. 1Select graph.
  2. 2Compute χ(G).
  3. 3View coloring.
  4. 4Check bounds.
  5. 5Compare to clique.

Chromatic Number Calculator — Frequently Asked Questions

Why is this NP-hard?+

Even deciding if χ(G)≤3 (3-colorability) is NP-complete. This means no known polynomial-time algorithm works for all graphs. Current best: exact algorithms are O*(2^n), approximation within n^{1-ε} is also hard.

What are perfect graphs?+

Graphs where χ(H)=ω(H) for every induced subgraph H. Examples: bipartite, chordal, comparability. The Strong Perfect Graph Theorem (Chudnovsky et al., 2006): G is perfect iff it has no odd hole or antihole.

What's the greedy coloring?+

Process vertices in some order, assign the smallest available color. Always uses ≤Δ+1 colors. The optimal ordering gives χ(G) colors, but finding that ordering is as hard as computing χ(G) itself.

Share this tool: