Graph Coloring and Chromatic Numbers

College Depth 62 in the knowledge graph I know this Set as goal
Unlocks 18 downstream topics
coloring chromatic-number greedy-coloring bounds

Core Idea

A proper graph coloring assigns colors to vertices so adjacent vertices have different colors. The chromatic number χ(G) is the minimum colors needed. Computing χ(G) is NP-hard in general, but bounds exist: χ(G) ≤ Δ(G) + 1, where Δ is max degree.

How It's Best Learned

Find the chromatic number of small graphs by hand. Implement a greedy coloring algorithm. Understand special cases: bipartite graphs have χ = 2; complete graphs have χ = n; cycles of odd length have χ = 3.

Common Misconceptions

The four-color theorem applies to planar graphs, not all graphs. χ(G) = 2 iff G is bipartite (no odd cycles). Greedy coloring doesn't always find the optimal number.

Explainer

Building on your understanding of graph coloring, the chromatic number χ(G) answers the optimization question: what is the *minimum* number of colors needed for a proper coloring? Think of the classic scheduling problem — you want to assign time slots for university exams so that no two courses sharing a student are scheduled at the same time. Each course is a vertex; a shared student creates an edge. Colors are time slots. A proper coloring corresponds to a valid schedule, and χ(G) is the fewest time slots you need.

The upper bound χ(G) ≤ Δ(G) + 1 (where Δ is the maximum vertex degree) comes from a simple greedy algorithm: process vertices in any order, and assign each vertex the smallest color not used by any of its neighbors. At the moment you color a vertex with at most Δ neighbors, at most Δ colors are already excluded, so the (Δ+1)th color is always available. This guarantees the bound, but greedy often does better — and the bound isn't always tight.

Special graph families reveal what χ(G) actually measures. A complete graph Kₙ has every pair of vertices adjacent, so all n vertices must get different colors: χ(Kₙ) = n. A bipartite graph can be 2-colored — label one partition class with color 1 and the other with color 2 — and χ(G) = 2 characterizes exactly the bipartite graphs (those with no odd cycles). An odd cycle like C₅ (a pentagon) needs 3 colors: you can alternate 2 colors around most of the cycle, but the last vertex ends up adjacent to vertices of both colors, forcing a third.

The bad news for algorithms: computing χ(G) exactly for an arbitrary graph is NP-hard. No polynomial-time algorithm is known. This is why graph coloring appears in so many "hard optimization" contexts — the scheduling, register allocation, and frequency assignment problems it models are genuinely difficult. In practice, one bounds χ(G) between the size of the largest clique (complete subgraph) below and Δ+1 above, and applies heuristics in between.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineOpposites and Additive InversesAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersDividing IntegersUnit RatesProportionsPercent ConceptConverting Between Fractions, Decimals, and PercentsOperations with Rational NumbersTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesLiteral EquationsSlope-Intercept FormPoint-Slope FormWriting Linear EquationsParallel and Perpendicular Line SlopesGraphing Linear EquationsSystems of Equations — Graphing MethodSystems of Equations — Elimination MethodSystems of Three VariablesMatrices IntroductionGraph Representation: Matrices and ListsGraph Paths, Cycles, and ConnectivityTrees and Spanning TreesPlanar Graphs and Euler's FormulaGraph Coloring and the Chromatic NumberGraph Coloring and Chromatic Numbers

Longest path: 63 steps · 274 total prerequisite topics

Prerequisites (1)

Leads To (1)