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

Graph Coloring and Chromatic Numbers

College Depth 78 in the knowledge graph ☐ I know this ☆ Set as goal
18topics build on this
392prerequisites beneath it
See this on the map →
Graph Coloring and the Chromatic Number→→Bipartite Graphs and Matching Problems
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

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 → Number Bonds to 10 → 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 (0s, 1s, 2s, 5s, 10s) → 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 → Comparing and Ordering Integers → 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 → Propositional Logic Foundations → Logical Equivalences → Set Operations: Union, Intersection, and Complement → Proof by Cases → Proving by Cases and Exhaustion → Vacuous Truth and Trivial Cases → Proof by Cases (Proof by Exhaustion) → Mathematical Induction → Graph Paths, Cycles, and Connectivity → Trees and Spanning Trees → Planar Graphs and Euler's Formula → Graph Coloring and the Chromatic Number → Graph Coloring and Chromatic Numbers

Longest path: 79 steps · 392 total prerequisite topics

Prerequisites (1)

Leads To (1)