Graph coloring, a fundamental concept in graph theory, is a way of assigning colors to the vertices (or nodes) of a graph such that no two adjacent vertices share the same color. This concept has numerous applications in computer science, mathematics, and other fields. Let's explore some graph coloring examples to illustrate this concept.

Graph coloring is often used to represent complex relationships or constraints, where the colors represent different categories or groups. For instance, in a social network, vertices could represent individuals, and colors could represent different social circles or interests. The absence of adjacent vertices with the same color would ensure that no two individuals in the same social circle are connected.

Graph Coloring with Two Colors
One of the simplest forms of graph coloring involves using only two colors. This is known as vertex 2-coloring or bipartite graph coloring.

Consider a social network where individuals are either male or female. In this case, we can use two colors, say blue for males and pink for females, to color the vertices. Since no two adjacent individuals can be of the same gender, the graph will be properly colored with no adjacent vertices sharing the same color.
Bipartite Graph Example

A bipartite graph is a graph whose vertices can be divided into two disjoint sets U and V such that every edge connects a vertex in U to one in V. An example of a bipartite graph is a friendship network where one set of vertices represents students and the other set represents teachers. Since students and teachers cannot be friends with each other, the graph is bipartite.
To color this graph with two colors, we can assign one color to all student vertices and the other color to all teacher vertices. This ensures that no two adjacent vertices share the same color, satisfying the condition for bipartite graph coloring.
Odd Cycle Graph Example

An odd cycle graph is a cycle graph with an odd number of vertices. These graphs are not bipartite and thus require more than two colors for vertex coloring. However, they can be colored with two colors if we consider edge coloring instead.
In edge coloring, we color the edges of the graph instead of the vertices. For an odd cycle graph, we can use two colors, say red and blue, to color the edges in an alternating pattern. This ensures that no two adjacent edges share the same color, satisfying the condition for edge 2-coloring.
Graph Coloring with More Than Two Colors

For more complex graphs, we may need to use more than two colors. The minimum number of colors required to color a graph is known as its chromatic number.
Consider a graph representing a high school where each vertex represents a student, and two vertices are connected if the corresponding students have at least one class together. In this case, we need to use more than two colors to ensure that no two students in the same class are connected by an edge of the same color.



















Chromatic Number Example
The chromatic number of a graph is the smallest number of colors needed to color the graph. For instance, the chromatic number of a complete graph K_n, where every vertex is connected to every other vertex, is n. This is because we need n colors to ensure that no two adjacent vertices share the same color.
On the other hand, the chromatic number of a path graph P_n, where vertices are connected in a linear fashion, is 2 for even n and 3 for odd n. This is because a path graph can be colored with two colors if it has an even number of vertices, and it requires three colors if it has an odd number of vertices.
Four-Color Theorem Example
The four-color theorem is a famous result in graph theory that states any map in the plane can be colored with four colors, such that no two adjacent countries share the same color. This theorem is a special case of graph coloring, where the vertices represent countries, and the edges represent shared borders.
While the four-color theorem is a significant result, it's important to note that it was not proven using traditional mathematical methods. Instead, it was proven using a computer-assisted proof, which involved checking a large number of cases.
Graph coloring is a powerful tool with many applications, from scheduling problems to map coloring. Understanding different graph coloring examples can help us appreciate the versatility and complexity of this fundamental concept in graph theory. As we continue to explore the world of graphs, we can expect to find even more fascinating applications of graph coloring.