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 Number

College Depth 66 in the knowledge graph ☐ I know this ☆ Set as goal
15topics build on this
283prerequisites beneath it
See this on the map →
Introduction to Graph Theory→→Chromatic Polynomial and Counting Proper Colorings
graph-theory coloring

Core Idea

A proper vertex coloring assigns colors to vertices such that adjacent vertices receive different colors. The chromatic number χ(G) is the minimum number of colors needed. Graph coloring has applications in scheduling, register allocation, and map coloring.

Explainer

From graph theory fundamentals, you know that adjacency captures "connected by an edge." Graph coloring adds a constraint: adjacent vertices must receive different colors (which in practice represent any distinguishable labels). A proper coloring is any assignment of colors to vertices that satisfies this constraint. The question is: what is the minimum number of colors required?

That minimum is the chromatic number χ(G) (chi of G). For a path or tree, two colors always suffice — you alternate colors as you traverse. For a triangle (a 3-cycle), you need at least three colors because all three vertices are mutually adjacent. For a complete graph Kₙ, where every vertex touches every other, you need exactly n colors. Recognizing the structure of a graph gives you bounds on its chromatic number before you even start coloring.

The greedy coloring algorithm provides an upper bound: process vertices one by one, assigning the smallest color not already used by a neighbor. Greedy does not always find the optimal coloring, but it uses at most Δ(G)+1 colors, where Δ(G) is the maximum degree. A graph's clique number ω(G) — the size of its largest complete subgraph — gives a lower bound: you need at least ω(G) colors because that clique alone forces them all. So ω(G) ≤ χ(G) ≤ Δ(G)+1, though χ can be much larger than ω in general graphs.

The applications make the abstraction concrete. In scheduling, vertices are tasks and edges connect tasks that must not run simultaneously (they share a resource); coloring with k colors gives a schedule using k time slots. In register allocation in compilers, variables that are "live" at the same time cannot share a register; the register conflict graph's chromatic number is the minimum number of registers needed. In map coloring, regions sharing a border cannot share a color — the celebrated Four Color Theorem proves that planar graphs (maps drawn without edge crossings) always have χ(G) ≤ 4.

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

Longest path: 67 steps · 283 total prerequisite topics

Prerequisites (1)

Leads To (1)