Tutorials › Graph Theory (Undergraduate) › Chromatic Numbers of Complete Graphs

Vertex Coloring and Chromatic Number · Tutorial 341 of 799

Chromatic Numbers of Complete Graphs

See why a complete graph on \(n\) vertices requires exactly \(n\) colors, and verify the answer using colorings and clique bounds.

Intermediate 8 min read

What You'll Learn

  • Define a proper coloring and the chromatic number used for complete graphs.
  • Prove that every clique gives a lower bound on the number of colors.
  • Construct a proper coloring of \(K_n\) using \(n\) colors.
  • Prove the exact chromatic-number formula for complete graphs.
  • Check the formula on explicit edge lists, including a graph with no edges.
  • Identify why reusing a color on adjacent vertices invalidates a coloring.

Coloring a Complete Graph

A complete graph places an edge between every pair of distinct vertices. This makes its coloring requirement especially direct: no two vertices can share a color. The key is to match that restriction with a coloring that uses no more colors than necessary. Together, these two checks determine the chromatic number exactly.

All graphs in this tutorial are finite and simple. A proper vertex coloring assigns a color to each vertex so that the endpoints of every edge receive different colors. A color may be represented by a label such as \(1\), \(2\), or \(3\); only whether labels agree or differ matters. The chromatic number, denoted \(\chi(G)\), is the smallest number of colors used in any proper coloring of \(G\).

Definition: The complete graph \(K_n\), for a positive integer \(n\), has \(n\) vertices and an edge between every pair of distinct vertices. A set of pairwise adjacent vertices is a clique. Thus all \(n\) vertices of \(K_n\) form a clique.

For example, if \(V(K_4)=\{1,2,3,4\}\), then its edges are precisely \(12,13,14,23,24,34\). Each pair of distinct vertices appears as an edge. This property, rather than any particular drawing or vertex labels, drives the coloring argument.

The Clique Lower Bound

Lemma: If a graph \(G\) contains a clique of size \(r\), then \(\chi(G)\ge r\).

Proof. Consider any proper coloring of \(G\), and let \(S\) be a clique with \(r\) vertices. Every two distinct vertices of \(S\) are adjacent. By properness, adjacent vertices receive different colors, so all \(r\) vertices of \(S\) must receive pairwise different colors. The coloring therefore uses at least \(r\) colors. This holds for every proper coloring, so the minimum number of colors satisfies \(\chi(G)\ge r\). \(\square\)

This is a lower bound: it says that fewer than \(r\) colors cannot work. By itself, it does not show that \(r\) colors suffice. To determine a chromatic number exactly, we also need an upper bound, usually supplied by exhibiting a proper coloring with the required number of colors.

The Chromatic Number of \(K_n\)

Theorem: For every positive integer \(n\), \(\chi(K_n)=n\).

Proof. Fix a positive integer \(n\). Since every pair of distinct vertices of \(K_n\) is adjacent, its \(n\) vertices form a clique. The clique lower bound gives \(\chi(K_n)\ge n\).

For the reverse inequality, assign a different color to each vertex. This uses \(n\) colors. Every edge has two distinct endpoints, and those endpoints were assigned different colors, so this is a proper coloring. Hence \(\chi(K_n)\le n\). Combining the two inequalities gives \(\chi(K_n)=n\). The argument includes \(n=1\): there is one vertex, no edge to violate properness, and one color suffices; the clique lower bound requires at least one. \(\square\)

There is another way to understand the upper-bound construction. In any proper coloring of a complete graph, each color class contains at most one vertex: if a color appeared on two distinct vertices, the edge between them would have equal-colored endpoints. Thus \(n\) vertices require at least \(n\) nonempty color classes. Giving each vertex its own color achieves exactly that number. The clique argument expresses the same restriction as a general lower bound that can also be used in graphs that are not complete.

Worked Example: The Single-Vertex Graph \(K_1\)

Let \(V(K_1)=\{a\}\) and \(E(K_1)=\varnothing\). The edge set is empty because there is no pair of distinct vertices to join. Assign color red to \(a\). There are no edges whose endpoints could violate properness, so this is a proper coloring using one color. The vertex \(\{a\}\) is a clique of size \(1\), so the clique lower bound gives \(\chi(K_1)\ge1\). The coloring gives \(\chi(K_1)\le1\), and therefore \(\chi(K_1)=1\).

Check: the general formula gives \(n=1\), so \(\chi(K_1)=1\), agreeing with both the coloring and the lower bound.

Worked Example: Coloring \(K_3\)

Let \(V(K_3)=\{1,2,3\}\) and \(E(K_3)=\{12,13,23\}\). Assign color red to vertex \(1\), blue to vertex \(2\), and green to vertex \(3\). Check the full edge list: edge \(12\) has red and blue endpoints; edge \(13\) has red and green endpoints; edge \(23\) has blue and green endpoints. Each edge has differently colored endpoints, so the coloring is proper and \(\chi(K_3)\le3\).

All three vertices are pairwise adjacent, so they form a clique of size \(3\). The clique lower bound gives \(\chi(K_3)\ge3\). The bounds agree, giving \(\chi(K_3)=3\).

Check: the formula \(\chi(K_n)=n\) gives \(\chi(K_3)=3\), the same value certified by the explicit coloring and the clique.

Worked Example: Coloring \(K_4\)

Let \(V(K_4)=\{1,2,3,4\}\) and \(E(K_4)=\{12,13,14,23,24,34\}\). Assign colors \(A,B,C,D\) to vertices \(1,2,3,4\), respectively. Checking the edges in their listed order gives: \(12\) has colors \(A,B\); \(13\) has \(A,C\); \(14\) has \(A,D\); \(23\) has \(B,C\); \(24\) has \(B,D\); and \(34\) has \(C,D\). In every case the endpoint colors differ. Thus the coloring is proper and \(\chi(K_4)\le4\).

The set \(\{1,2,3,4\}\) is a clique of size \(4\), so the clique lower bound gives \(\chi(K_4)\ge4\). Hence \(\chi(K_4)=4\).

Check: there are \(4\) listed vertices, and the formula gives \(\chi(K_4)=4\). The edge list also has \(6\) edges: the six distinct pairs are \(12,13,14,23,24,34\). The count confirms that every pair has been checked in this coloring.

Worked Example: Coloring \(K_5\)

Let \(V(K_5)=\{1,2,3,4,5\}\) and \(E(K_5)=\{12,13,14,15,23,24,25,34,35,45\}\). Assign colors \(c_1,c_2,c_3,c_4,c_5\) to vertices \(1,2,3,4,5\), respectively. Each listed edge \(ij\) joins vertices \(i\) and \(j\), which have the distinct labels \(c_i\) and \(c_j\). Explicitly, the ten edges \(12,13,14,15,23,24,25,34,35,45\) have endpoint-color pairs \((c_1,c_2),(c_1,c_3),(c_1,c_4),(c_1,c_5),(c_2,c_3),(c_2,c_4),(c_2,c_5),(c_3,c_4),(c_3,c_5),(c_4,c_5)\). Each pair consists of different colors. The coloring is proper, so \(\chi(K_5)\le5\).

The five vertices are pairwise adjacent, forming a clique of size \(5\). Therefore \(\chi(K_5)\ge5\), and the two bounds give \(\chi(K_5)=5\).

Check: the edge list contains \(4+3+2+1=10\) pairs: four beginning with \(1\), three beginning with \(2\), two beginning with \(3\), and one beginning with \(4\). This accounts for every pair of distinct vertices, as required for \(K_5\). The formula gives \(\chi(K_5)=5\), matching the certificate.

Why the Two Bounds Matter

A coloring with \(n\) colors proves only that \(\chi(K_n)\le n\). It does not rule out the possibility that some different coloring uses fewer colors. The clique lower bound supplies precisely that missing argument: because every pair of vertices is adjacent, no two vertices can share a color. The complete graph's chromatic number is exact because the lower and upper bounds meet.

This proof pattern is useful beyond complete graphs. For any graph, a clique of size \(r\) certifies that at least \(r\) colors are needed; a separate coloring may show that \(r\) colors suffice. If both statements hold, the chromatic number is \(r\). In \(K_n\), the whole vertex set is already a clique, and assigning each vertex its own color provides the matching coloring.

Common Pitfall: A Proposed Coloring Must Check Every Edge

Consider \(K_4\) with the vertex and edge sets from the worked example. A tempting but incorrect calculation is to use three colors by assigning red to \(1\) and \(4\), blue to \(2\), and green to \(3\). The edges \(12,13,23,24,34\) have differently colored endpoints, but the edge \(14\) has red at both endpoints. Since \(14\in E(K_4)\), this assignment is not a proper coloring and cannot establish \(\chi(K_4)\le3\).

The correction is to check every edge in the specified edge set, not just a selection of edges. In \(K_4\), every pair is adjacent, so the clique lower bound already gives \(\chi(K_4)\ge4\); a three-coloring is impossible. Assigning four distinct colors is proper, so \(\chi(K_4)=4\).

For the empty graph on no vertices, some conventions write \(K_0\) and define its chromatic number to be \(0\): the empty assignment is a proper coloring using no colors, and no number of colors can be smaller than \(0\). The theorem above is stated for positive \(n\), which avoids relying on a convention for \(K_0\); if this convention is adopted, the same numerical formula extends to \(n=0\).

Check Your Understanding

For each question, distinguish the proper-coloring upper bound from the clique lower bound.

  1. Let \(V=\{a,b\}\) and \(E=\{ab\}\). Give a proper coloring and use a clique to determine the chromatic number.
  2. Explain why any proper coloring of \(K_n\) must assign different colors to every pair of distinct vertices.
  3. For \(K_4\) with edges \(12,13,14,23,24,34\), identify the edge that invalidates the assignment \(1,4\) red; \(2\) blue; \(3\) green.
  4. State which part of the proof of \(\chi(K_n)=n\) gives a lower bound and which part gives an upper bound.
  5. If \(K_0\) is defined to have chromatic number \(0\), what does the formula \(\chi(K_n)=n\) give in that case?