The Bound and Its Key Counting Idea
Greedy coloring makes each decision using only the vertices that have already been colored. The choice of vertex order can affect the result, but there is a limit that holds for every order: no vertex can be blocked by more colors than it has neighbors. This gives a general upper bound on the number of colors needed, even when the order is not chosen carefully.
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 have different colors. The chromatic number \(\chi(G)\) is the smallest number of colors in any proper coloring of \(G\). For a nonempty graph, \(\Delta(G)\) is its maximum vertex degree: the largest number of neighbors of any one vertex.
The word “distinct” matters. A vertex may have several already colored neighbors, but if some of them share a color, that color is forbidden only once. In any case, the number of forbidden colors is at most the number of already colored neighbors, which is at most the vertex’s degree.
An Order-Specific Bound
Before using the maximum degree, it helps to record exactly what the chosen order contributes. For each vertex, count its neighbors that occur earlier in the order. Let \(k\) be the largest of these counts.
Proof. Process the vertices in the given order, using the greedy rule. Suppose \(v_i\) has \(r_i\) earlier neighbors. Only those \(r_i\) vertices can forbid colors at the step for \(v_i\), since later vertices have not yet been colored. Thus the set of forbidden colors has at most \(r_i\) elements. Since \(r_i\leq k\), at most \(k\) colors are forbidden. Among the \(k+1\) colors \(1,2,\ldots,k+1\), at least one is therefore not forbidden, and the greedy rule assigns \(v_i\) a color in this set.
It remains to check that the assignments form a proper coloring. If \(v_iv_j\) is an edge with \(i<j\), then \(v_i\) is already colored when \(v_j\) is processed. The color of \(v_i\) is forbidden at that step, so \(v_j\) receives a different color. This holds for every edge. Hence the procedure gives a proper coloring using at most \(k+1\) colors. \(\square\)
This proposition isolates the counting argument: at a given step, the relevant neighbors are the earlier ones, not all neighbors. The maximum degree gives a bound that works without knowing anything special about the order.
Proof. Fix any order of the vertices. Each vertex has at most \(\Delta(G)\) neighbors altogether, so it has at most \(\Delta(G)\) earlier neighbors. Thus the value \(k\) in the proposition satisfies \(k\leq\Delta(G)\). The proposition gives a proper greedy coloring using at most \(k+1\leq\Delta(G)+1\) colors. Since \(\chi(G)\) is the minimum number of colors in a proper coloring, it too is at most \(\Delta(G)+1\). No connectedness assumption is needed: the argument checks every vertex and every edge, including those in different components. \(\square\)
The theorem is an upper bound, not a claim that every vertex has \(\Delta(G)\) forbidden colors, or that the algorithm must use \(\Delta(G)+1\) colors. A vertex can have fewer than \(\Delta(G)\) earlier neighbors; even when it has many, some may have the same color. The next examples make these counts explicit.
Tracing the Bound
Worked Example: Greedy Coloring a Path
Let \(G=(V,E)\), where \(V=\{1,2,3,4,5\}\) and \(E=\{12,23,34,45\}\). Use the order \(1,2,3,4,5\). The endpoint degrees are \(\deg(1)=\deg(5)=1\), and the other degrees are \(\deg(2)=\deg(3)=\deg(4)=2\). Therefore \(\Delta(G)=2\), and the theorem allows at most \(2+1=3\) colors.
| Vertex processed | Earlier neighbors and their colors | Forbidden colors | Greedy color |
|---|---|---|---|
| 1 | None | None | 1 |
| 2 | 1 has color 1 | \(\{1\}\) | 2 |
| 3 | 2 has color 2 | \(\{2\}\) | 1 |
| 4 | 3 has color 1 | \(\{1\}\) | 2 |
| 5 | 4 has color 2 | \(\{2\}\) | 1 |
The output coloring, in vertex order, is \(1,2,1,2,1\). To check it, the edge \(12\) has endpoint colors 1 and 2; \(23\) has colors 2 and 1; \(34\) has colors 1 and 2; and \(45\) has colors 2 and 1. Every edge has differently colored endpoints. The coloring uses 2 colors, which is within the bound of 3.
Worked Example: A Star with Leaves First
Let \(G=(V,E)\), where \(V=\{z,u_1,u_2,u_3,u_4\}\) and \(E=\{zu_1,zu_2,zu_3,zu_4\}\). The center \(z\) has degree 4, and each leaf \(u_i\) has degree 1, so \(\Delta(G)=4\). The theorem gives the bound \(4+1=5\). Use the order \(u_1,u_2,u_3,u_4,z\).
| Vertex processed | Earlier neighbors and their colors | Forbidden colors | Greedy color |
|---|---|---|---|
| \(u_1\) | None | None | 1 |
| \(u_2\) | None | None | 1 |
| \(u_3\) | None | None | 1 |
| \(u_4\) | None | None | 1 |
| \(z\) | \(u_1,u_2,u_3,u_4\), each with color 1 | \(\{1\}\) | 2 |
The center has four earlier neighbors, but they supply only one distinct forbidden color. The output gives each \(u_i\) color 1 and \(z\) color 2. Each of the four edges \(zu_i\) therefore joins colors 2 and 1, so the coloring is proper. It uses 2 colors, no more than the bound of 5.
Worked Example: Earlier Neighbors Can Repeat Colors
Let \(G=(V,E)\), where \(V=\{a,b,c,d,e\}\) and \(E=\{ab,ac,bc,bd,cd,de\}\). The degrees are \(\deg(a)=2\), \(\deg(b)=3\), \(\deg(c)=3\), \(\deg(d)=3\), and \(\deg(e)=1\). Hence \(\Delta(G)=3\), and the bound is \(3+1=4\). Use the order \(d,b,a,e,c\).
| Vertex processed | Earlier neighbors and their colors | Forbidden colors | Greedy color |
|---|---|---|---|
| \(d\) | None | None | 1 |
| \(b\) | \(d\) has color 1 | \(\{1\}\) | 2 |
| \(a\) | \(b\) has color 2 | \(\{2\}\) | 1 |
| \(e\) | \(d\) has color 1 | \(\{1\}\) | 2 |
| \(c\) | \(a,b,d\) have colors \(1,2,1\), respectively | \(\{1,2\}\) | 3 |
The last vertex has three earlier neighbors but only two distinct forbidden colors, because \(a\) and \(d\) both have color 1. The output assigns \(a,d\) color 1, \(b,e\) color 2, and \(c\) color 3. Check all edges: \(ab\) has colors 1 and 2; \(ac\) has 1 and 3; \(bc\) has 2 and 3; \(bd\) has 2 and 1; \(cd\) has 3 and 1; and \(de\) has 1 and 2. Thus the coloring is proper. It uses 3 colors, within the bound of 4.
Why the Counting Argument Works
At the step for a vertex \(v\), write \(S(v)\) for its earlier neighbors and \(F(v)\) for the set of their colors. The precise count is
The first inequality allows different earlier neighbors to share a color. The second holds because earlier neighbors are only some of all the neighbors of \(v\). The third is the definition of maximum degree. Consequently, among \(\Delta(G)+1\) available colors, at least one is not in \(F(v)\). This is the complete reason the greedy choice can be made within the palette.
The argument also explains the role of the hypotheses. The graph is finite, so its vertices can be processed in a finite order, and for a nonempty graph its maximum degree is defined. No assumption that the graph is connected is needed. If a nonempty graph has \(\Delta(G)=0\), it has no edges: every vertex has degree 0. Greedy coloring then gives every vertex color 1, which is a proper coloring using \(0+1=1\) color. If the graph has no vertices, there are no steps and the empty assignment is a proper coloring; the stated theorem is restricted to nonempty graphs because \(\Delta(G)\) is not defined for that graph under the usual convention.
Common Mistake
Mistake: Counting neighbors instead of distinct forbidden colors and concluding that the center in the star example needs five colors because it has four neighbors. That calculation treats the four leaf colors as four different colors. But the traced algorithm assigns each leaf color 1, so the center’s forbidden set is \(\{1\}\), not a set of four colors. The center receives color 2. In general, the valid bound is that the number of forbidden colors is at most the number of earlier neighbors; it need not equal that number or the full degree.
Another error is to argue that the vertex has at most \(\Delta(G)\) forbidden colors without identifying which vertices can forbid them. The relevant set is the set of already colored neighbors. Later neighbors have not yet received colors, so they cannot forbid anything at the current step. Once this is stated, the count is immediate and applies at every position in every order.
Check Your Understanding
For each question, identify the relevant earlier neighbors or state the counting step that gives the bound.
- In a fixed order, a vertex has 5 earlier neighbors whose colors are \(1,1,2,2,3\). What is its forbidden-color set, and how many colors are forbidden?
- A nonempty graph has maximum degree 6. How many colors does the maximum-degree plus one bound guarantee are sufficient for every vertex order?
- Explain why later neighbors of a vertex do not contribute to its forbidden colors when greedy coloring processes it.
- Suppose every vertex has at most 2 earlier neighbors in a particular order. What bound does the order-specific proposition give, even if the graph’s maximum degree is larger?
- Why does the theorem apply to a disconnected graph without requiring a separate argument for each component?