Chromatic Number

DOWNLOAD Mathematica Notebook EXPLORE THIS TOPIC IN the MathWorld Classroom ChromaticNumber

The chromatic number of a graph G is the smallest number of colors needed to color the vertices of G so that no two adjacent vertices share the same color (Skiena 1990, p. 210), i.e., the smallest value of k possible to obtain a k-coloring. Minimal colorings and chromatic numbers for a sample of graphs are illustrated above.

The chromatic number of a graph G is most commonly denoted chi(G) (e.g., Skiena 1990, West 2000, Godsil and Royle 2001, Pemmaraju and Skiena 2003), but occasionally also gamma(G).

Empty graphs have chromatic number 1, while non-empty bipartite graphs have chromatic number 2.

The chromatic number of a graph G is also the smallest positive integer z such that the chromatic polynomial pi_G(z)>0. Calculating the chromatic number of a graph is an NP-complete problem (Skiena 1990, pp. 211-212). Or, in the words of Harary (1994, p. 127), "no convenient method is known for determining the chromatic number of an arbitrary graph." However, Mehrotra and Trick (1996) devised a column generation algorithm for computing chromatic numbers and vertex colorings which solves most small to moderate-sized graph quickly.

The chromatic number of a graph can be computed (very inefficiently) in the Wolfram Language using the following code:

  MinValue[{x, ChromaticPolynomial[g, x] > 0&& x > 0}, x, Integers]

Precomputed chromatic numbers for many named graphs can be obtained using GraphData[graph, "ChromaticNumber"].

The chromatic number of a graph must be greater than or equal to its clique number. A graph is called a perfect graph if, for each of its induced subgraphs g_i, the chromatic number of g_i equals the largest number of pairwise adjacent vertices in g_i. A graph for which the clique number is equal to the chromatic number (with no further restrictions on induced subgraphs) is said to be weakly perfect.

By definition, the edge chromatic number of a graph G equals the chromatic number of the line graph L(G).

Brooks' theorem states that the chromatic number of a graph is at most the maximum vertex degree Delta, unless the graph is complete or an odd cycle, in which case Delta+1 colors are required.

A graph with chromatic number <=2 is said to be bicolorable, and a graph with chromatic number <=3 is said to be three-colorable. In general, a graph with chromatic number k is said to be an k-chromatic graph, and a graph with chromatic number <=k is said to be k-colorable.

The following table gives the chromatic numbers for some named classes of graphs.

graph Ggamma(G)
complete graph K_nn
cycle graph C_n, n>1{3   for n odd; 2   for n even
star graph S_n, n>12
wheel graph W_n, n>2{3   for n odd; 4   for n even

For any two positive integers g and k, there exists a graph of girth at least g and chromatic number at least k (Erdős 1961; Lovász 1968; Skiena 1990, p. 215).

The chromatic number of a surface of genus g is given by the Heawood conjecture,

 gamma(g)=|_1/2(7+sqrt(48g+1))_|,

where |_x_| is the floor function. gamma(g) is sometimes also denoted chi(g) (which is unfortunate, since chi(g)=2-2g commonly refers to the Euler characteristic). For g=0, 1, ..., the first few values of chi(g) are 4, 7, 8, 9, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, ... (OEIS A000934).

Erdős (1959) proved that there are graphs with arbitrarily large girth and chromatic number (Bollobás and West 2000).

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.