Mastering Graph Coloring: Solved Example Problems

Nicole Jul 28, 2026

Graph coloring, a fundamental concept in graph theory, involves assigning colors to the vertices of a graph such that no two adjacent vertices share the same color. This process helps in understanding and visualizing complex networks, and has numerous applications in computer science, mathematics, and other fields. Let's explore some example problems and solutions to illustrate this fascinating topic.

the simpsons face is drawn on graph paper, and it looks like he's going to
the simpsons face is drawn on graph paper, and it looks like he's going to

Graph coloring problems often involve determining the minimum number of colors required to color a given graph, known as the chromatic number. This number is crucial in various contexts, such as scheduling problems, frequency assignment in wireless networks, and map coloring puzzles.

an image of a green mushroom with two eyes on it's side, and the graph paper below
an image of a green mushroom with two eyes on it's side, and the graph paper below

Four-Color Theorem

The four-color theorem is one of the most famous results in graph coloring. It states that every planar map (a graph that can be drawn in the plane without edges crossing) can be colored using no more than four colors such that no two adjacent regions have the same color. This theorem was first proposed by Augustus De Morgan in 1852 and finally proven by Kenneth Appel and Wolfgang Haken in 1976 using a computer-assisted proof.

a worksheet for kids to learn how to make their own numbers and colors
a worksheet for kids to learn how to make their own numbers and colors

To understand the four-color theorem, consider the following example: try to color the map of the United States using only four colors, ensuring that no two adjacent states share the same color. This task is challenging but possible, demonstrating the power of the four-color theorem.

Planar Graphs

Chicken Coordinate Graphing Picture Quadrant 1 & All 4 Quadrants
Chicken Coordinate Graphing Picture Quadrant 1 & All 4 Quadrants

Planar graphs are central to the four-color theorem. A graph is planar if it can be embedded in the plane without any edges crossing. Examples of planar graphs include complete graphs with fewer than five vertices (K4 and smaller) and cycles of any length (Cn). Non-planar graphs, such as K5 and K3,3, require at least one edge crossing in any planar representation.

To determine if a graph is planar, you can use Kuratowski's theorem, which states that a graph is non-planar if and only if it contains a subgraph homeomorphic to K5 or K3,3 as a minor. This theorem provides a systematic way to check planarity and is essential for understanding the four-color theorem's scope.

Chromatic Polynomial

Mathematic Fanatic
Mathematic Fanatic

The chromatic polynomial is a crucial tool in graph coloring, providing a concise way to represent the chromatic number for a given graph. For a graph G, its chromatic polynomial P(G, k) is defined as the number of ways to color the vertices of G using k colors. The chromatic number of G is the smallest integer k for which P(G, k) > 0.

For example, consider the complete graph K4. Its chromatic polynomial is P(K4, k) = k(k-1)(k-2)(k-3), which equals 0 for k ≤ 3 and is positive for k ≥ 4. Thus, the chromatic number of K4 is 4, as expected from the four-color theorem.

Graph Coloring Algorithms

an image of mario in the style of graphing with squares and grids to make it look like he is pointing at something
an image of mario in the style of graphing with squares and grids to make it look like he is pointing at something

Several algorithms exist to find the chromatic number or color a graph using a given number of colors. These algorithms range from simple greedy approaches to complex heuristics and exact methods. Here, we'll discuss two popular algorithms: the greedy algorithm and the DSatur algorithm.

Before diving into these algorithms, let's consider an example problem: color the vertices of the following graph using the minimum number of colors, ensuring that no two adjacent vertices share the same color.

an image of a cartoon character made out of graphing paper with the words graphing spring
an image of a cartoon character made out of graphing paper with the words graphing spring
Mystery Graph Picture Worksheets
Mystery Graph Picture Worksheets
Graph Theory | Brilliant Math & Science Wiki
Graph Theory | Brilliant Math & Science Wiki
Graph Worksheets | Learning to Work with Charts and Graphs
Graph Worksheets | Learning to Work with Charts and Graphs
Free Mystery Graphs for 4th Grade Math Practice | Graphing Coordinates
Free Mystery Graphs for 4th Grade Math Practice | Graphing Coordinates
Line Graph Worksheets
Line Graph Worksheets
Free Spring Coordinate Graphing Worksheets for Upper Elementary
Free Spring Coordinate Graphing Worksheets for Upper Elementary
Spring coordinate graphing mystery pictures (Free Printables)
Spring coordinate graphing mystery pictures (Free Printables)
the favorite color graph with pencils and crayons on it for kids to draw
the favorite color graph with pencils and crayons on it for kids to draw
주소와이 - 2026년 최고의 인기 주소
주소와이 - 2026년 최고의 인기 주소
Pie Graph Worksheets
Pie Graph Worksheets
Graphing Worksheets | Single Quadrant Graphing Characters Worksheets
Graphing Worksheets | Single Quadrant Graphing Characters Worksheets
printable worksheet for comparing numbers from 1 to 10
printable worksheet for comparing numbers from 1 to 10
Preschool bar graph worksheet
Preschool bar graph worksheet
MindWare — Mystery Mosaics Coloring Books — Leslie McDougall
MindWare — Mystery Mosaics Coloring Books — Leslie McDougall
Bar Graph For Kindergarten | Templates at allbusinesstemplates.com
Bar Graph For Kindergarten | Templates at allbusinesstemplates.com
Graph Analysis Coloring Activity
Graph Analysis Coloring Activity
a basket filled with lots of different colored items on top of a graphing paper
a basket filled with lots of different colored items on top of a graphing paper
Problems on Histogram | Reading Histograms | Histograms Examples
Problems on Histogram | Reading Histograms | Histograms Examples
Google Image Result for https://ecdn.teacherspayteachers.com/thumbitem/Cartoon-Character-Coordinate-Plane-Graphing-Picture-Snoopy-8359668-1674222320/original-8359668-2.jpg
Google Image Result for https://ecdn.teacherspayteachers.com/thumbitem/Cartoon-Character-Coordinate-Plane-Graphing-Picture-Snoopy-8359668-1674222320/original-8359668-2.jpg

Greedy Algorithm

The greedy algorithm for graph coloring works by iteratively assigning the smallest available color to each vertex. It starts with an arbitrary color and assigns it to the first vertex. For each subsequent vertex, it assigns the smallest color not used by any of its previously colored neighbors.

Applying the greedy algorithm to our example graph, we might obtain the following coloring: {1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4}. This coloring uses four colors, but it's not the optimal solution. The greedy algorithm's performance depends on the graph's structure, and it may not always find the minimum number of colors required.

DSatur Algorithm

The DSatur algorithm is a more sophisticated heuristic for graph coloring, designed to improve upon the greedy algorithm's performance. It works by iteratively selecting the vertex with the highest "satisfaction" value, which considers both the number of distinct colors used by its neighbors and the number of vertices sharing those colors.

Applying the DSatur algorithm to our example graph, we might obtain the following optimal coloring: {1, 2, 3, 4, 2, 3, 4, 1, 3, 4, 1, 2}. This coloring uses only three colors, demonstrating the DSatur algorithm's ability to find better solutions than the greedy algorithm.

In the realm of graph coloring, there's always more to explore and understand. From the four-color theorem to advanced coloring algorithms, this fascinating topic offers countless opportunities for discovery and application. So, grab a graph and some colors, and start exploring the vibrant world of graph coloring!