
- Graph Theory - Home
- Graph Theory - Introduction
- Graph Theory - History
- Graph Theory - Fundamentals
- Graph Theory - Applications
- Types of Graphs
- Graph Theory - Types of Graphs
- Graph Theory - Simple Graphs
- Graph Theory - Multi-graphs
- Graph Theory - Directed Graphs
- Graph Theory - Weighted Graphs
- Graph Theory - Bipartite Graphs
- Graph Theory - Complete Graphs
- Graph Theory - Subgraphs
- Graph Theory - Trees
- Graph Theory - Forests
- Graph Theory - Planar Graphs
- Graph Theory - Hypergraphs
- Graph Theory - Infinite Graphs
- Graph Theory - Random Graphs
- Graph Representation
- Graph Theory - Graph Representation
- Graph Theory - Adjacency Matrix
- Graph Theory - Adjacency List
- Graph Theory - Incidence Matrix
- Graph Theory - Edge List
- Graph Theory - Compact Representation
- Graph Theory - Incidence Structure
- Graph Theory - Matrix-Tree Theorem
- Graph Properties
- Graph Theory - Basic Properties
- Graph Theory - Coverings
- Graph Theory - Matchings
- Graph Theory - Independent Sets
- Graph Theory - Traversability
- Graph Theory Connectivity
- Graph Theory - Connectivity
- Graph Theory - Vertex Connectivity
- Graph Theory - Edge Connectivity
- Graph Theory - k-Connected Graphs
- Graph Theory - 2-Vertex-Connected Graphs
- Graph Theory - 2-Edge-Connected Graphs
- Graph Theory - Strongly Connected Graphs
- Graph Theory - Weakly Connected Graphs
- Graph Theory - Connectivity in Planar Graphs
- Graph Theory - Connectivity in Dynamic Graphs
- Special Graphs
- Graph Theory - Regular Graphs
- Graph Theory - Complete Bipartite Graphs
- Graph Theory - Chordal Graphs
- Graph Theory - Line Graphs
- Graph Theory - Complement Graphs
- Graph Theory - Graph Products
- Graph Theory - Petersen Graph
- Graph Theory - Cayley Graphs
- Graph Theory - De Bruijn Graphs
- Graph Algorithms
- Graph Theory - Graph Algorithms
- Graph Theory - Breadth-First Search
- Graph Theory - Depth-First Search (DFS)
- Graph Theory - Dijkstra's Algorithm
- Graph Theory - Bellman-Ford Algorithm
- Graph Theory - Floyd-Warshall Algorithm
- Graph Theory - Johnson's Algorithm
- Graph Theory - A* Search Algorithm
- Graph Theory - Kruskal's Algorithm
- Graph Theory - Prim's Algorithm
- Graph Theory - Borůvka's Algorithm
- Graph Theory - Ford-Fulkerson Algorithm
- Graph Theory - Edmonds-Karp Algorithm
- Graph Theory - Push-Relabel Algorithm
- Graph Theory - Dinic's Algorithm
- Graph Theory - Hopcroft-Karp Algorithm
- Graph Theory - Tarjan's Algorithm
- Graph Theory - Kosaraju's Algorithm
- Graph Theory - Karger's Algorithm
- Graph Coloring
- Graph Theory - Coloring
- Graph Theory - Edge Coloring
- Graph Theory - Total Coloring
- Graph Theory - Greedy Coloring
- Graph Theory - Four Color Theorem
- Graph Theory - Coloring Bipartite Graphs
- Graph Theory - List Coloring
- Advanced Topics of Graph Theory
- Graph Theory - Chromatic Number
- Graph Theory - Chromatic Polynomial
- Graph Theory - Graph Labeling
- Graph Theory - Planarity & Kuratowski's Theorem
- Graph Theory - Planarity Testing Algorithms
- Graph Theory - Graph Embedding
- Graph Theory - Graph Minors
- Graph Theory - Isomorphism
- Spectral Graph Theory
- Graph Theory - Graph Laplacians
- Graph Theory - Cheeger's Inequality
- Graph Theory - Graph Clustering
- Graph Theory - Graph Partitioning
- Graph Theory - Tree Decomposition
- Graph Theory - Treewidth
- Graph Theory - Branchwidth
- Graph Theory - Graph Drawings
- Graph Theory - Force-Directed Methods
- Graph Theory - Layered Graph Drawing
- Graph Theory - Orthogonal Graph Drawing
- Graph Theory - Examples
- Computational Complexity of Graph
- Graph Theory - Time Complexity
- Graph Theory - Space Complexity
- Graph Theory - NP-Complete Problems
- Graph Theory - Approximation Algorithms
- Graph Theory - Parallel & Distributed Algorithms
- Graph Theory - Algorithm Optimization
- Graphs in Computer Science
- Graph Theory - Data Structures for Graphs
- Graph Theory - Graph Implementations
- Graph Theory - Graph Databases
- Graph Theory - Query Languages
- Graph Algorithms in Machine Learning
- Graph Neural Networks
- Graph Theory - Link Prediction
- Graph-Based Clustering
- Graph Theory - PageRank Algorithm
- Graph Theory - HITS Algorithm
- Graph Theory - Social Network Analysis
- Graph Theory - Centrality Measures
- Graph Theory - Community Detection
- Graph Theory - Influence Maximization
- Graph Theory - Graph Compression
- Graph Theory Real-World Applications
- Graph Theory - Network Routing
- Graph Theory - Traffic Flow
- Graph Theory - Web Crawling Data Structures
- Graph Theory - Computer Vision
- Graph Theory - Recommendation Systems
- Graph Theory - Biological Networks
- Graph Theory - Social Networks
- Graph Theory - Smart Grids
- Graph Theory - Telecommunications
- Graph Theory - Knowledge Graphs
- Graph Theory - Game Theory
- Graph Theory - Urban Planning
- Graph Theory Useful Resources
- Graph Theory - Quick Guide
- Graph Theory - Useful Resources
- Graph Theory - Discussion
Graph Theory - Chromatic Polynomial
Chromatic Polynomial
The chromatic polynomial of a graph expresses the number of ways a graph can be colored using a specific number of colors, while ensuring that no two adjacent vertices share the same color.
It provides a detail into the coloring properties of a graph and is useful for understanding the behavior of graph colorings with respect to different numbers of colors.
Mathematically, the chromatic polynomial is denoted as −
P(G, x) = the number of ways to color G with x colors
The formula for the chromatic polynomial P(G, x) of a simple graph G is given as −
P(G, x) = (x - 1)|V| ∏v ∈ V(G) (x - deg(v))
Where,
- P(G, x) is the chromatic polynomial of graph G.
- |V| is the number of vertices in the graph G.
- deg(v) is the degree of a vertex v in the graph.
- x represents the number of colors available.
This formula calculates the number of ways to color the vertices of the graph such that no two adjacent vertices have the same color, using x colors.
For example,
- Chromatic Polynomial for x=3: P(G, 3) = 6
- Chromatic Polynomial for x=4: P(G, 4) = 24
- Chromatic Polynomial for x=5: P(G, 5) = 60
In simpler terms, it gives the number of valid colorings possible with x colors, considering the graph's structure and adjacency constraints.

The above image represents the chromatic polynomial of a triangular graph K3.
Properties of Chromatic Polynomial
The chromatic polynomial has several important properties that help in analyzing its behavior and solving graph coloring problems −
- Evaluation at x = 0: The chromatic polynomial evaluated at x = 0 represents the number of ways to color the graph with zero colors. This value is always 0, as it is impossible to color a graph with no colors.
- Evaluation at x = 1: The chromatic polynomial evaluated at x = 1 counts the number of ways to color the graph with exactly one color. If the graph is not a complete graph, the result is 0, as it is impossible to color the graph with only one color if there are any edges.
- Evaluation at x = 2: The chromatic polynomial evaluated at x = 2 counts the number of ways to color the graph with exactly two colors. This value is particularly useful for bipartite graphs, as a bipartite graph is 2-colorable, and the chromatic polynomial at x = 2 will give a non-zero result.
- Degree of the Polynomial: The degree of the chromatic polynomial is equal to the number of vertices in the graph. For graphs with n vertices, the chromatic polynomial will be a polynomial of degree n.
- Monotonicity: The chromatic polynomial is a decreasing function of x, meaning that as the number of colors increases, the number of valid colorings also increases.
Applications of Chromatic Polynomial
The chromatic polynomial is used in various applications, such as −
- Graph Coloring: The chromatic polynomial helps in understanding the number of valid colorings for a graph, which is useful in solving graph coloring problems, such as scheduling, task allocation, and resource management.
- Counting Colorings: The chromatic polynomial can be used to count the number of distinct ways to color a graph using a specific number of colors, which is important in combinatorics and optimization problems.
- Planar Graphs: For planar graphs, the chromatic polynomial is used to analyze the structure and behavior of graph colorings, especially in cases where the Four Color Theorem applies.
- Graph Theory Research: The chromatic polynomial is an important tool in graph theory research, helping to explore the properties of graphs, including their structure, coloring properties, and relationship to other graph invariants.
Let us look at some examples to understand how to calculate the chromatic polynomial for various types of graphs.
Chromatic Polynomial of Complete Graph
A complete graph Kn is a graph where every pair of vertices is connected by an edge. The chromatic polynomial of a complete graph with n vertices is given by −
P(Kn, x) = x(x - 1)(x - 2)...(x - n + 1)
This is because, in a complete graph, each vertex must be assigned a unique color to ensure that no two adjacent vertices share the same color. Thus, the chromatic polynomial counts the number of ways to assign unique colors to the vertices of the complete graph.
For example, if we have a complete graph with 4 vertices (K4), the chromatic polynomial is −
P(K4, x) = x(x - 1)(x - 2)(x - 3)
Where, x is the number of colors −
- Number of ways to color K4 with 4 colors: 24
- Number of ways to color K4 with 5 colors: 120
- Number of ways to color K4 with 6 colors: 360

The above image represents the chromatic polynomial of a complete graph K4.
Chromatic Polynomial of a Bipartite Graph
A bipartite graph is a graph whose vertices can be divided into two disjoint sets, such that no two vertices within the same set are adjacent. The chromatic polynomial of a bipartite graph is always 2, because a bipartite graph can be colored with exactly two colors. This applies to all bipartite graphs, regardless of their size or structure.
For example, consider a bipartite graph with two sets of vertices: {A, B} and {1, 2}. The edges are: A-1, B-2. The chromatic polynomial of this graph is −
P(G, x) = 2

Chromatic Polynomial of a Cycle (Cn)
A cycle graph Cn is a graph with n vertices connected in a closed loop, where each vertex is adjacent to two other vertices. The chromatic polynomial of a cycle graph is given by −
P(Cn, x) = (x - 1)n + (-1)n
This polynomial counts the number of valid colorings for the cycle graph, ensuring that no adjacent vertices share the same color.
For example, if we have a cycle graph with 4 vertices (C4), the chromatic polynomial is −
P(C4, x) = (x - 1)4 + (-1)4
Here, x is the number of colours used −
- Number of ways to color C4 with 2 colors: 2
- Number of ways to color C4 with 3 colors: 17

The above image visualizes the chromatic polynomial of a cycle graph "C4" with 2 colors.
Similarly, for C5 (5 vertices):
- Number of ways to color C5 with 2 colors: 0 [P(C5, 2 = (2-1)5 + (-1)5]
- Number of ways to color C5 with 3 colors: 31
Challenges in Chromatic Polynomial
Determining the chromatic polynomial of a graph can be a complex task, particularly for graphs with many vertices and edges. Some of the major challenges are −
- Complexity for Large Graphs: For large graphs, calculating the chromatic polynomial can be demanding, as it involves considering many possible colorings and evaluating polynomial functions.
- Non-trivial Graphs: For non-trivial graphs with intricate structures, finding an explicit expression for the chromatic polynomial may not be easy, and may require advanced techniques.
- Inexact Formulas: In some cases, approximating the chromatic polynomial or finding bounds for it can be difficult, especially for graphs with complex topologies.