Graph Coloring Applications
127 words
1 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Graph Coloring Applications ## Scheduling **Problem:** Schedule exams so no student has two at the same time. **Model:** Vertices = exams, edge if shared student.

Graph Coloring Applications
Scheduling
Problem: Schedule exams so no student has two at the same time. Model: Vertices = exams, edge if shared student. Chromatic number = minimum time slots.
Map Coloring
Four Color Theorem: Every planar graph is 4-colorable (Appel & Haken, 1976).
Proof: First major theorem proved by computer. 1936 configurations checked by program.
Greedy Coloring Algorithm
pythondef greedy_coloring(graph): colors = {} for v in sorted(graph, key=lambda x: len(graph[x]), reverse=True): used = {colors[n] for n in graph[v] if n in colors} color = 0 while color in used: color += 1 colors[v] = color return colors
The greedy algorithm uses at most Δ+1 colors (where Δ is max degree).
Join Discord
PreviousGraph Coloring & PlanarityNextEulerian & Hamiltonian