A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Chromatic Polynomial and Counting Proper Colorings

College Depth 67 in the knowledge graph ☐ I know this ☆ Set as goal
14topics build on this
284prerequisites beneath it
See this on the map →
Graph Coloring and Chromatic Number→→Trees, Forests, and Spanning TreesWalks, Trails, Paths, and Cycles in Graphs
graph-theory chromatic-polynomial

Core Idea

The chromatic polynomial P(G, k) counts the number of proper k-colorings of graph G. It can be computed using deletion-contraction: P(G,k) = P(G-e,k) - P(G/e,k), where G-e removes edge e and G/e contracts it. The chromatic number is the smallest k where P(G,k) > 0.

Explainer

You already know from graph coloring that the chromatic number χ(G) is the minimum number of colors needed to properly color a graph. The chromatic polynomial takes this idea further: instead of just asking "what is the minimum?", it asks "for a given k, in exactly how many ways can we properly color G?" The answer, P(G, k), turns out to be a polynomial in k — a remarkable fact that connects discrete graph structure to algebraic objects.

The key computational tool is deletion-contraction. Pick any edge e = {u, v}. There are two cases for any proper k-coloring: either u and v get different colors (which is exactly a proper coloring of the graph G − e with the extra constraint that u ≠ v), or they could share a color (which corresponds to a proper coloring of the contracted graph G/e, where u and v are merged into one vertex). The formula P(G, k) = P(G − e, k) − P(G/e, k) captures this: total colorings of G-without-the-edge-constraint, minus the colorings where u and v happen to be the same color. You subtract because those colorings violate the edge constraint.

To build intuition, consider a tree on n vertices. No cycles means you can color it greedily: the root gets k choices, and each subsequent vertex just needs to avoid its one parent, giving k − 1 choices. So P(Tree_n, k) = k(k−1)n−1. For a complete graph Kₙ, every vertex must differ from every other, giving P(Kₙ, k) = k(k−1)(k−2)···(k−n+1) — falling factorial. These two extremes bracket the general case: sparse graphs have more colorings, dense graphs fewer.

The chromatic polynomial encodes χ(G) as its smallest positive integer root: P(G, k) = 0 for k = 0, 1, ..., χ(G) − 1, and P(G, χ(G)) > 0. This means you can read off the chromatic number by finding where the polynomial first becomes positive. The degree of P(G, k) equals the number of vertices, the leading coefficient is 1, and the signs of coefficients alternate — these algebraic signatures reflect structural properties of the graph. Deletion-contraction eventually bottoms out at empty graphs (P(∅, k) = 1) and single edges (P(K₂, k) = k(k−1)), giving a complete recursive recipe for computing P(G, k) for any graph.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Making 10 as an Addition Strategy → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts Through 10 → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Opposites and Additive Inverses → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Graph Coloring and Chromatic Number → Chromatic Polynomial and Counting Proper Colorings

Longest path: 68 steps · 284 total prerequisite topics

Prerequisites (1)

Leads To (2)