The assignment of colors to vertices (or edges) of a graph such that no 2 adjacent vertices share the same color.
Chromatic Number
The chromatic number is the minimum number of colors needed to properly color the vertices of .
Bounds:
- for any non-empty graph
- , where is the clique number (size of the largest complete subgraph)
- , where is the maximum vertex degree (Brooks’ theorem tightens this for non-complete non-odd-cycle graphs to )
Special cases:
- iff has no edges
- iff is bipartite
- for the complete graph on vertices
Four-Color Theorem
Any planar graph satisfies . The converse does not hold: a graph with need not be planar.
Algorithms
Determining exactly is NP-hard.
- Greedy coloring assigns colors in vertex order, using the smallest color not taken by any neighbor. Produces at most colors. Not globally optimal.
- Backtracking search finds the exact chromatic number but is exponential in the worst case.
- Heuristic methods (DSATUR, RLF) give near-optimal colorings for large graphs.
Applications
- Register allocation in compilers: variables are vertices, edges connect variables live simultaneously, colors are registers.
- Scheduling: tasks are vertices, conflicts are edges, colors are time slots.
- Map coloring: regions are vertices, shared borders are edges.