Explain Graph Coloring with Examples

Nicole Jul 28, 2026

Graph coloring, a fundamental concept in graph theory, is a problem of assigning colors to the vertices of a graph such that no two adjacent vertices share the same color. This concept has wide-ranging applications in computer science, mathematics, and other fields. Let's delve into the world of graph coloring, exploring its basics, key concepts, and real-world examples.

the different types of graphs are shown in this diagram, and there is also an info sheet
the different types of graphs are shown in this diagram, and there is also an info sheet

Graph coloring is a classic problem that has been studied for over a century. It's a prime example of a problem that is easy to understand but surprisingly difficult to solve. The goal is to color the vertices of a graph with the fewest colors possible, subject to the constraint that no two adjacent vertices share the same color.

Graphs And Data Infographic
Graphs And Data Infographic

Understanding Graph Coloring

Before we dive into the details, let's ensure we're on the same page with some key terminology. A graph is a collection of vertices (or nodes) and edges connecting them. Two vertices are adjacent if there's an edge connecting them. The degree of a vertex is the number of edges connected to it.

the info sheet shows how to describe graphs
the info sheet shows how to describe graphs

Now, let's discuss the two most common types of graph coloring: vertex coloring and edge coloring.

Vertex Coloring

a pie graph with ice cream on it and the number of scoops in each cone
a pie graph with ice cream on it and the number of scoops in each cone

Vertex coloring is the most common type, where we color the vertices of a graph. The chromatic number of a graph is the smallest number of colors needed to color the graph. For instance, a tree (a graph with no cycles) has a chromatic number of 2, as every vertex can be colored with one of two colors.

Here's a simple example: Consider a cycle of 4 vertices. It's impossible to color this graph with just 2 colors, as each vertex would have to share a color with one of its neighbors. However, it can be colored with 3 colors, making its chromatic number 3.

Edge Coloring

Displacement-Time Graph | Physics Motion Graph Study Notes
Displacement-Time Graph | Physics Motion Graph Study Notes

In edge coloring, we color the edges of a graph instead of the vertices. The chromatic index of a graph is the smallest number of colors needed to color its edges. For a complete graph (a graph where every vertex is connected to every other vertex), the chromatic index is always equal to the number of vertices.

For example, consider a complete graph with 4 vertices. It's impossible to color this graph with just 2 colors, as each edge would have to share a color with another edge connected to the same vertex. However, it can be colored with 3 colors, making its chromatic index 3.

Applications of Graph Coloring

an info sheet with different types of graphs and numbers on the bottom right hand corner
an info sheet with different types of graphs and numbers on the bottom right hand corner

Graph coloring has numerous applications in various fields. In computer science, it's used in scheduling problems, register allocation in compilers, and frequency assignment in wireless networks. In mathematics, it's a fundamental tool in proving theorems and understanding the structure of graphs.

One real-world application is in sports scheduling. Consider a league with multiple teams playing each other. We can represent this as a graph where each team is a vertex, and there's an edge between two vertices if the corresponding teams play each other. The goal is to schedule the games using the fewest colors (or time slots) possible, ensuring that no two games involving the same team are scheduled at the same time.

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
Distance-Time Graph | Physics Motion Graph Study Notes
Distance-Time Graph | Physics Motion Graph Study Notes
Free Bar Graph Worksheets for Kids: Enhancing Counting and Comparison Skills
Free Bar Graph Worksheets for Kids: Enhancing Counting and Comparison Skills
Graphing Favorite Colors
Graphing Favorite Colors
Velocity-Time Graph | Physics Motion Graph Study Notes
Velocity-Time Graph | Physics Motion Graph Study Notes
an apple diagram with different colors on it
an apple diagram with different colors on it
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
Bar Graph Worksheet with Colors Theme | All Kids Network
Bar Graph Worksheet with Colors Theme | All Kids Network
the pie graph is shown in this worksheet for students to practice their math skills
the pie graph is shown in this worksheet for students to practice their math skills
Preschool bar graph worksheet
Preschool bar graph worksheet
Bar Height from Scale Explained | Easy Bar Graph Math for Students
Bar Height from Scale Explained | Easy Bar Graph Math for Students
Pie Chart Examples and Templates
Pie Chart Examples and Templates
picture graph
picture graph
a graphing worksheet with the line graph and numbers in each column on it
a graphing worksheet with the line graph and numbers in each column on it
Bar Graphs & Picture Graphs: 2nd Grade Worksheets - Etsy
Bar Graphs & Picture Graphs: 2nd Grade Worksheets - Etsy
5th Grade Math Notes - Graphing (Line Plots & Stem & Leaf Plots)
5th Grade Math Notes - Graphing (Line Plots & Stem & Leaf Plots)
Line Graph Worksheets
Line Graph Worksheets
the simpsons face is drawn on graph paper
the simpsons face is drawn on graph paper
Easy graph lesson for children with printables - NurtureStore
Easy graph lesson for children with printables - NurtureStore
Bar Graph For Kindergarten | Templates at allbusinesstemplates.com
Bar Graph For Kindergarten | Templates at allbusinesstemplates.com

Four-Color Theorem

One of the most famous results in graph coloring is the Four-Color Theorem. This theorem states that every planar graph (a graph that can be drawn in the plane without edges crossing) can be colored with at most four colors, such that no two adjacent vertices share the same color.

Proving this theorem was a major milestone in mathematics, but it's also a great example of how graph coloring can help us understand the structure of graphs. By showing that every planar graph can be colored with four colors, we gain insight into the properties of these graphs.

Brooks' Theorem

Another important result is Brooks' Theorem, which provides an upper bound on the chromatic number of a graph in terms of its maximum degree. Specifically, it states that the chromatic number of a graph is at most the maximum degree of any vertex, or 4 if the graph is not regular (i.e., not every vertex has the same degree).

Brooks' Theorem is a powerful tool for bounding the chromatic number of a graph. It's often used as a starting point for more complex proofs about graph coloring. For example, it's used in the proof of the Four-Color Theorem.

Graph coloring is a fascinating topic that combines mathematical elegance with practical applications. Whether you're a mathematician, computer scientist, or just someone interested in puzzles, there's always more to explore in the world of graph coloring. So, grab your colors and start coloring!