Graph Coloring Example Problems & Solutions PDF

Donna Jul 28, 2026

Graph coloring is a fundamental concept in computer science and mathematics, with wide-ranging applications in scheduling, map coloring, and circuit design. It involves assigning colors to vertices in a graph such that no two adjacent vertices share the same color. Here, we'll explore some example problems along with their solutions, focusing on the most common types: vertex coloring and edge coloring. We'll also provide PDF resources for further learning.

the wiring diagram for an electrical system
the wiring diagram for an electrical system

Before diving into the examples, let's quickly recap the basics. A graph G = (V, E) consists of a set of vertices V and a set of edges E, where each edge connects two vertices. A coloring of a graph is an assignment of colors to its vertices or edges, subject to certain constraints.

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

Vertex Coloring

In vertex coloring, the goal is to assign colors to vertices such that no two adjacent vertices share the same color. The chromatic number χ(G) of a graph G is the smallest number of colors required to color the vertices of G.

a drawing of a bird with an arrow on it's head is shown in graph paper
a drawing of a bird with an arrow on it's head is shown in graph paper

Let's consider a few examples:

Example 1: Complete Graph K_n

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

The complete graph K_n has n vertices, and every pair of vertices is connected by an edge. The chromatic number of K_n is n, as each vertex must have a unique color.

For instance, K_3 (the complete graph with 3 vertices) requires 3 colors. A valid coloring is: {1, 2, 3} → {1, 1, 2}, {2, 2, 3}, {3, 1, 3}.

Example 2: Cycle Graph C_n

Graphing Worksheets | Four Quadrant Graphing Characters Worksheets
Graphing Worksheets | Four Quadrant Graphing Characters Worksheets

The cycle graph C_n has n vertices arranged in a circle, with each vertex connected to its two neighbors. The chromatic number of C_n is 2 for even n and 3 for odd n.

For C_4, a valid coloring is: {1, 2} → {1, 2, 1, 2}. For C_5, a valid coloring is: {1, 2, 3} → {1, 2, 3, 1, 2}.

Edge Coloring

the bar graph worksheet with pencils and money
the bar graph worksheet with pencils and money

In edge coloring, the goal is to assign colors to edges such that no two incident edges (edges sharing a common vertex) have the same color. The chromatic index χ'(G) of a graph G is the smallest number of colors required to color the edges of G.

Let's look at an example:

a christmas tree graphing page with the words free coordinate graphing pages on it
a christmas tree graphing page with the words free coordinate graphing pages on it
Pumpkin Math Coordinate Graphing Mystery Picture Fall Activities
Pumpkin Math Coordinate Graphing Mystery Picture Fall Activities
Coloring Grid Worksheets
Coloring Grid Worksheets
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
Graphing Worksheets | Four Quadrant Graphing Characters Worksheets
Graphing Worksheets | Four Quadrant Graphing Characters Worksheets
Mystery Mosaics - 10 Free PDF Printables | Printablee
Mystery Mosaics - 10 Free PDF Printables | Printablee
a drawing of a bunny in an egg
a drawing of a bunny in an egg
a graph that shows the average temperature for different cities in the world, and is shown below
a graph that shows the average temperature for different cities in the world, and is shown below
Graphing Worksheets | Four Quadrant Graphing Characters Worksheets
Graphing Worksheets | Four Quadrant Graphing Characters Worksheets
Graph Worksheets | Learning to Work with Charts and Graphs
Graph Worksheets | Learning to Work with Charts and Graphs
Coordinate Grid Coloring Pages: Easy Animal Graphing Activities for Kids
Coordinate Grid Coloring Pages: Easy Animal Graphing Activities for Kids
Mystery Graph Picture Worksheets
Mystery Graph Picture Worksheets
Coordinate Graphing Mystery Picture: Coffee Mug; Math, ordered pairs, graphs
Coordinate Graphing Mystery Picture: Coffee Mug; Math, ordered pairs, graphs
Line Graphs Worksheets
Line Graphs Worksheets
Bar Graph Worksheet with Colors Theme | All Kids Network
Bar Graph Worksheet with Colors Theme | All Kids Network
Bar Graph For Kindergarten | Templates at allbusinesstemplates.com
Bar Graph For Kindergarten | Templates at allbusinesstemplates.com
graphing christmas tree with blue snowflakes on the bottom and black dots in the middle
graphing christmas tree with blue snowflakes on the bottom and black dots in the middle
Bar Graph DJ worksheet
Bar Graph DJ worksheet
📚 Graph Data Structure – Connecting the Dots! 🌐🔗

How do we model complex relationships like social networks or road maps? 🚀 With Graph Data Structures!

This infographic explains the fundamental concepts of a Graph Data Structure, a non-linear data structure consisting of nodes (vertices) and edges (links). Learn about different types of graphs and their applications.

✨ What you'll learn:
✅ **Vertex (Node):** The entities in the graph.
✅ **Edge (Link):** The connections between vertices.
✅ ... Types Of Graphs, Connect The Dots, Social Networks, Dots, Map
📚 Graph Data Structure – Connecting the Dots! 🌐🔗 How do we model complex relationships like social networks or road maps? 🚀 With Graph Data Structures! This infographic explains the fundamental concepts of a Graph Data Structure, a non-linear data structure consisting of nodes (vertices) and edges (links). Learn about different types of graphs and their applications. ✨ What you'll learn: ✅ **Vertex (Node):** The entities in the graph. ✅ **Edge (Link):** The connections between vertices. ✅ ... Types Of Graphs, Connect The Dots, Social Networks, Dots, Map
750f-3555003-3.jpg (612×792)
750f-3555003-3.jpg (612×792)

Example 3: Complete Bipartite Graph K_m,n

The complete bipartite graph K_m,n has two sets of vertices, A and B, with m and n vertices respectively, and every vertex in A is connected to every vertex in B. The chromatic index of K_m,n is m + n.

For K_2,3, a valid coloring is: {1, 2, 3} → {1, 2, 1}, {2, 3, 2}, {3, 1, 3}. Here, each color appears exactly once on each vertex, ensuring no two incident edges share the same color.

Further Learning

For more examples and in-depth discussions, check out these PDF resources:

Graph coloring is a fascinating topic with numerous open problems and applications. By understanding and practicing these examples, you'll gain a solid foundation to tackle more complex graph coloring problems. Happy learning!