Chromatic Number — Definition, Formula & Examples
The chromatic number of a graph is the smallest number of colors needed to color every vertex so that no two adjacent vertices share the same color.
For a graph , the chromatic number is the minimum positive integer such that there exists a proper -coloring of —that is, a function satisfying for every edge .
Key Formula
Where:
- = Chromatic number of graph G
- = Clique number — size of the largest complete subgraph of G
- = Maximum degree of any vertex in G
How It Works
To determine the chromatic number, you try to color the graph with as few colors as possible while ensuring no edge connects two same-colored vertices. Start by checking whether the graph is 1-colorable (only possible if it has no edges), then 2-colorable (bipartite), and so on. A useful lower bound is the clique number , since every vertex in a clique needs a distinct color. An upper bound is , where is the maximum vertex degree (Brooks' theorem tightens this for most graphs). In general, finding exactly is NP-hard, so for large graphs you often rely on bounds and heuristics.
Worked Example
Problem: Find the chromatic number of the cycle graph (a 5-vertex cycle).
Step 1: Label the vertices around the cycle. Try a 2-coloring: alternate colors red and blue. Assign red to , blue to , red to , blue to . When you reach , it is adjacent to both (blue) and (red), so neither color works.
Step 2: Since 2 colors fail, try 3 colors. Assign red to , blue to , red to , blue to , and green to . Now is adjacent to (blue) and (red), and green differs from both. Every edge connects vertices of different colors.
Step 3: We showed 2 colors are insufficient and 3 colors suffice.
Answer: The chromatic number of is 3.
Why It Matters
Chromatic numbers appear in scheduling problems—assigning exam time slots so no student has two exams at once maps directly to graph coloring. They also arise in compiler register allocation and frequency assignment in wireless networks.
Common Mistakes
Mistake: Assuming the chromatic number always equals the clique number.
Correction: The clique number is only a lower bound. Many triangle-free graphs (where ) still require 3 or more colors— is a classic example.
