Graph Theory
Graph Theory
Chromatic polynomial[edit]
All non-isomorphic graphs on 3 vertices and their chromatic polynomials. The
empty graph E3 (red) admits a 1-coloring; the others admit
Main article: Chromatic polynomial
The chromatic polynomial counts the number of ways a graph can be colored
using some of a given number of colors. For example, using three colors, the
graph in the adjacent image can be colored in 12 ways. With only two colors, it
cannot be colored at all. With four colors, it can be colored in 24 + 4⋅12 = 72
ways: using all four colors, there are 4! = 24 valid colorings (every assignment
of four colors to any 4-vertex graph is a proper coloring); and for every choice
of three of the four colors, there are 12 valid 3-colorings. So, for the graph in
the example, a table of the number of valid colorings would start like this:
Available colors 1 2 3 4 …
Number of
0 0 12 72 …
colorings
Triangle K3
Complete graph Kn
Tree with n vertices
Cycle Cn
Petersen graph
Edge coloring[edit]
Main article: Edge coloring
An edge coloring of a graph is a proper coloring of the edges, meaning an
assignment of colors to edges so that no vertex is incident to two edges of
the same color. An edge coloring with k colors is called a k-edge-coloring
and is equivalent to the problem of partitioning the edge set
into k matchings. The smallest number of colors needed for an edge coloring
of a graph G is the chromatic index, or edge chromatic number, χ′(G).
A Tait coloring is a 3-edge coloring of a cubic graph. The four color
theorem is equivalent to the assertion that every planar
cubic bridgeless graph admits a Tait coloring.
Total coloring[edit]
Main article: Total coloring
Total coloring is a type of coloring on the vertices and edges of a graph.
When used without any qualification, a total coloring is always assumed to
be proper in the sense that no adjacent vertices, no adjacent edges, and no
edge and its end-vertices are assigned the same color. The total chromatic
number χ″(G) of a graph G is the fewest colors needed in any total coloring
of G.
Unlabeled coloring[edit]
An unlabeled coloring of a graph is an orbit of a coloring under the action
of the automorphism group of the graph. Note that the colors remain labeled;
it is the graph that is unlabeled. There is an analogue of the chromatic
polynomial which counts the number of unlabeled colorings of a graph from
a given finite color set.
If we interpret a coloring of a graph on vertices as a vector in , the action of
an automorphism is a permutation of the coefficients in the coloring vector.
Properties[edit]
Upper bounds on the chromatic number[edit]
Assigning distinct colors to distinct vertices always yields a proper coloring,
so
The only graphs that can be 1-colored are edgeless graphs. A complete
graph of n vertices requires colors. In an optimal coloring there must be at
least one of the graph’s m edges between every pair of color classes, so
If G contains a clique of size k, then at least k colors are needed to color
that clique; in other words, the chromatic number is at least the clique
number:
For perfect graphs this bound is tight. Finding cliques is known as
the clique problem.
More generally a family of graphs is -bounded if there is some function such
that the graphs in can be colored with at most colors, for the family of the
perfect graphs this function is .
The 2-colorable graphs are exactly the bipartite graphs, including trees and
forests. By the four color theorem, every planar graph can be 4-colored.
A greedy coloring shows that every graph can be colored with one more color
than the maximum vertex degree,
Complete graphs have and , and odd cycles have and , so for these
graphs this bound is best possible. In all other cases, the bound can be
slightly improved; Brooks’ theorem[4] states that
Brooks’ theorem: for a connected, simple graph G, unless G is a complete
graph or an odd cycle.
Lower bounds on the chromatic number[edit]
Several lower bounds for the chromatic bounds have been discovered over the
years:
Hoffman's bound: Let be a real symmetric matrix such that whenever is not
an edge in . Define , where are the largest and smallest eigenvalues of . Define ,
with as above. Then:
.
Vector chromatic number: Let be a positive semi-definite matrix such
that whenever is an edge in . Define to be the least k for which such a
matrix exists. Then
Lovász number: The Lovász number of a complementary graph is also a lower
bound on the chromatic number:
Fractional chromatic number: The fractional chromatic number of a graph is
a lower bound on the chromatic number as well:
These bounds are ordered as follows:
Graphs with high chromatic number[edit]
Graphs with large cliques have a high chromatic number, but the opposite is not
true. The Grötzsch graph is an example of a 4-chromatic graph without a
triangle, and the example can be generalized to the Mycielskians.
Theorem (William T. Tutte 1947,[5] Alexander Zykov 1949, Jan
Mycielski 1955): There exist triangle-free graphs with arbitrarily high
chromatic number.
To prove this, both, Mycielski and Zykov, each gave a construction of an
inductively defined family of triangle-free graphs but with arbitrarily large
chromatic number.[6] Burling (1965)[7] constructed axis aligned boxes
in whose intersection graph is triangle-free and requires arbitrarily many colors
to be properly colored. This family of graphs is then called the Burling graphs.
The same class of graphs is used for the construction of a family of triangle-free
line segments in the plane, given by Pawlik et. al. (2014).[8] It shows that the
chromatic number of its intersection graph is arbitrarily large as well. Hence,
this implies that axis aligned boxes in as well as line segments in are not χ-
bounded.[8]
From Brooks’s theorem, graphs with high chromatic number must have high
maximum degree. But colorability is not an entirely local phenomenon: A graph
with high girth looks locally like a tree, because all cycles are long, but its
chromatic number need not be 2:
Theorem (Erdős): There exist graphs of arbitrarily high girth and chromatic
number.[9]
Bounds on the chromatic index[edit]
An edge coloring of G is a vertex coloring of its line graph , and vice versa.
Thus,
There is a strong relationship between edge colorability and the graph’s
maximum degree . Since all edges incident to the same vertex need their own
color, we have
Moreover, Kőnig’s theorem: if G is bipartite.
In general, the relationship is even stronger than what Brooks’s theorem gives
for vertex coloring:
Vizing’s Theorem: A graph of maximal degree has edge-chromatic
number or .
Other properties[edit]
A graph has a k-coloring if and only if it has an acyclic orientation for which
the longest path has length at most k; this is the Gallai–Hasse–Roy–Vitaver
theorem (Nešetřil & Ossona de Mendez 2012).
For planar graphs, vertex colorings are essentially dual to nowhere-zero flows.
About infinite graphs, much less is known. The following are two of the few
results about infinite graph coloring:
Open problems[edit]
As stated above, A conjecture of Reed from 1998 is that the value is essentially
closer to the lower bound,
The chromatic number of the plane, where two points are adjacent if they have
unit distance, is unknown, although it is one of 5, 6, or 7. Other open
problems concerning the chromatic number of graphs include the Hadwiger
conjecture stating that every graph with chromatic number k has a complete
graph on k vertices as a minor, the Erdős–Faber–Lovász conjecture bounding
the chromatic number of unions of complete graphs that have at most one vertex
in common to each pair, and the Albertson conjecture that among k-chromatic
graphs the complete graphs are the ones with smallest crossing number.
When Birkhoff and Lewis introduced the chromatic polynomial in their attack
on the four-color theorem, they conjectured that for planar graphs G, the
polynomial has no zeros in the region . Although it is known that such a
chromatic polynomial has no zeros in the region and that , their conjecture is
still unresolved. It also remains an unsolved problem to characterize graphs
which have the same chromatic polynomial and to determine which
polynomials are chromatic.
Algorithms[edit]
Graph coloring
Decision
Complexity NP-complete
Garey–Johnson GT4
Optimisation
Input Graph G with n vertices.
Output χ(G)
Complexity NP-hard
Counting problem
Complexity #P-complete
Polynomial time[edit]
Determining if a graph can be colored with 2 colors is equivalent to determining
whether or not the graph is bipartite, and thus computable in linear
time using breadth-first search or depth-first search. More generally, the
chromatic number and a corresponding coloring of perfect graphs can be
computed in polynomial time using semidefinite programming. Closed
formulas for chromatic polynomial are known for many classes of graphs, such
as forests, chordal graphs, cycles, wheels, and ladders, so these can be evaluated
in polynomial time.
If the graph is planar and has low branch-width (or is nonplanar but with a
known branch decomposition), then it can be solved in polynomial time using
dynamic programming. In general, the time required is polynomial in the graph
size, but exponential in the branch-width.
Exact algorithms[edit]
Brute-force search for a k-coloring considers each of the assignments
of k colors to n vertices and checks for each if it is legal. To compute the
chromatic number and the chromatic polynomial, this procedure is used for
every , impractical for all but the smallest input graphs.
Using dynamic programming and a bound on the number of maximal
independent sets, k-colorability can be decided in time and space .[11] Using the
principle of inclusion–exclusion and Yates’s algorithm for the fast zeta
transform, k-colorability can be decided in time [10] for any k. Faster algorithms
are known for 3- and 4-colorability, which can be decided in time [12] and ,
[13]
respectively.
Contraction[edit]
The contraction of a graph G is the graph obtained by identifying the
vertices u and v, and removing any edges between them. The remaining edges
originally incident to u or v are now incident to their identification. This
operation plays a major role in the analysis of graph coloring.
The chromatic number satisfies the recurrence relation:
due to Zykov (1949), where u and v are non-adjacent vertices, and is the
graph with the edge uv added. Several algorithms are based on evaluating
this recurrence and the resulting computation tree is sometimes called a
Zykov tree. The running time is based on a heuristic for choosing the
vertices u and v.
The chromatic polynomial satisfies the following recurrence relation
where u and v are adjacent vertices, and is the graph with the
edge uv removed. represents the number of possible proper colorings of
the graph, where the vertices may have the same or different colors. Then
the proper colorings arise from two different graphs. To explain, if the
vertices u and v have different colors, then we might as well consider a
graph where u and v are adjacent. If u and v have the same colors, we
might as well consider a graph where u and v are contracted. Tutte’s
curiosity about which other graph properties satisfied this recurrence led
him to discover a bivariate generalization of the chromatic polynomial,
the Tutte polynomial.
These expressions give rise to a recursive procedure called the deletion–
contraction algorithm, which forms the basis of many algorithms for graph
coloring. The running time satisfies the same recurrence relation as
the Fibonacci numbers, so in the worst case the algorithm runs in time within a
polynomial factor of for n vertices and m edges.[14] The analysis can be
improved to within a polynomial factor of the number of spanning trees of the
input graph.[15] In practice, branch and bound strategies and graph
isomorphism rejection are employed to avoid some recursive calls. The running
time depends on the heuristic used to pick the vertex pair.
Greedy coloring[edit]
Main
article: Greed
y
coloring
Two greedy colorings of the same graph using different vertex orders. The right
example generalizes to 2-colorable graphs with n vertices, where the greedy
algorithm expends colors.
The greedy algorithm considers the vertices in a specific order ,…, and assigns
to the smallest available color not used by ’s neighbours among ,…,, adding a
fresh color if needed. The quality of the resulting coloring depends on the
chosen ordering. There exists an ordering that leads to a greedy coloring with
the optimal number of colors. On the other hand, greedy colorings can be
arbitrarily bad; for example, the crown graph on n vertices can be 2-colored, but
has an ordering that leads to a greedy coloring with colors.
For chordal graphs, and for special cases of chordal graphs such as interval
graphs and indifference graphs, the greedy coloring algorithm can be used to
find optimal colorings in polynomial time, by choosing the vertex ordering to be
the reverse of a perfect elimination ordering for the graph. The perfectly
orderable graphs generalize this property, but it is NP-hard to find a perfect
ordering of these graphs.
If the vertices are ordered according to their degrees, the resulting greedy
coloring uses at most colors, at most one more than the graph’s maximum
degree. This heuristic is sometimes called the Welsh–Powell algorithm.
[16]
Another heuristic due to Brélaz establishes the ordering dynamically while
the algorithm proceeds, choosing next the vertex adjacent to the largest number
of different colors.[17] Many other graph coloring heuristics are similarly based
on greedy coloring for a specific static or dynamic strategy of ordering the
vertices, these algorithms are sometimes called sequential coloring algorithms.
The maximum (worst) number of colors that can be obtained by the greedy
algorithm, by using a vertex ordering chosen to maximize this number, is called
the Grundy number of a graph.
Parallel and distributed algorithms[edit]
In the field of distributed algorithms, graph coloring is closely related to the
problem of symmetry breaking. The current state-of-the-art randomized
algorithms are faster for sufficiently large maximum degree Δ than
deterministic algorithms. The fastest randomized algorithms employ the multi-
trials technique by Schneider et al.[18]
In a symmetric graph, a deterministic distributed algorithm cannot find a proper
vertex coloring. Some auxiliary information is needed in order to break
symmetry. A standard assumption is that initially each node has a unique
identifier, for example, from the set {1, 2, ..., n}. Put otherwise, we assume that
we are given an n-coloring. The challenge is to reduce the number of colors
from n to, e.g., Δ + 1. The more colors are employed, e.g. O(Δ) instead of Δ + 1,
the fewer communication rounds are required.[18]
A straightforward distributed version of the greedy algorithm for (Δ + 1)-
coloring requires Θ(n) communication rounds in the worst case − information
may need to be propagated from one side of the network to another side.
The simplest interesting case is an n-cycle. Richard Cole and Uzi
Vishkin[19] show that there is a distributed algorithm that reduces the number of
colors from n to O(log n) in one synchronous communication step. By iterating
the same procedure, it is possible to obtain a 3-coloring of an n-cycle
in O(log* n) communication steps (assuming that we have unique node
identifiers).
The function log*, iterated logarithm, is an extremely slowly growing function,
"almost constant". Hence the result by Cole and Vishkin raised the question of
whether there is a constant-time distributed algorithm for 3-coloring an n-
cycle. Linial (1992) showed that this is not possible: any deterministic
distributed algorithm requires Ω(log* n) communication steps to reduce an n-
coloring to a 3-coloring in an n-cycle.
The technique by Cole and Vishkin can be applied in arbitrary bounded-degree
graphs as well; the running time is poly(Δ) + O(log* n).[20] The technique was
extended to unit disk graphs by Schneider et al.[21] The fastest deterministic
algorithms for (Δ + 1)-coloring for small Δ are due to Leonid Barenboim,
Michael Elkin and Fabian Kuhn.[22] The algorithm by Barenboim et al. runs in
time O(Δ) + log*(n)/2, which is optimal in terms of n since the constant factor
1/2 cannot be improved due to Linial's lower bound. Panconesi & Srinivasan
(1996) use network decompositions to compute a Δ+1 coloring in time .
The problem of edge coloring has also been studied in the distributed
model. Panconesi & Rizzi (2001) achieve a (2Δ − 1)-coloring in O(Δ + log* n)
time in this model. The lower bound for distributed vertex coloring due to Linial
(1992) applies to the distributed edge coloring problem as well.
Decentralized algorithms[edit]
Decentralized algorithms are ones where no message passing is allowed (in
contrast to distributed algorithms where local message passing takes places),
and efficient decentralized algorithms exist that will color a graph if a proper
coloring exists. These assume that a vertex is able to sense whether any of its
neighbors are using the same color as the vertex i.e., whether a local conflict
exists. This is a mild assumption in many applications e.g. in wireless channel
allocation it is usually reasonable to assume that a station will be able to detect
whether other interfering transmitters are using the same channel (e.g. by
measuring the SINR). This sensing information is sufficient to allow algorithms
based on learning automata to find a proper graph coloring with probability one.
[23]
Computational complexity[edit]
Graph coloring is computationally hard. It is NP-complete to decide if a given
graph admits a k-coloring for a given k except for the cases k ∈ {0,1,2} . In
particular, it is NP-hard to compute the chromatic number.[24] The 3-coloring
problem remains NP-complete even on 4-regular planar graphs.[25] However, for
every k > 3, a k-coloring of a planar graph exists by the four color theorem, and
it is possible to find such a coloring in polynomial time.
The best known approximation algorithm computes a coloring of size at most
within a factor O(n(log log n)2(log n)−3) of the chromatic number.[26] For
all ε > 0, approximating the chromatic number within n1−ε is NP-hard.[27]
It is also NP-hard to color a 3-colorable graph with 4 colors[28] and a k-colorable
graph with k(log k ) / 25 colors for sufficiently large constant k.[29]
Computing the coefficients of the chromatic polynomial is #P-hard. In fact,
even computing the value of is #P-hard at any rational point k except for k = 1
and k = 2.[30] There is no FPRAS for evaluating the chromatic polynomial at any
rational point k ≥ 1.5 except for k = 2 unless NP = RP.[31]
For edge coloring, the proof of Vizing’s result gives an algorithm that uses at
most Δ+1 colors. However, deciding between the two candidate values for the
edge chromatic number is NP-complete.[32] In terms of approximation
algorithms, Vizing’s algorithm shows that the edge chromatic number can be
approximated to within 4/3, and the hardness result shows that no (4/3 − ε )-
algorithm exists for any ε > 0 unless P = NP. These are among the oldest results
in the literature of approximation algorithms, even though neither paper makes
explicit use of that notion.[33]
Applications[edit]
Scheduling[edit]
Vertex coloring models to a number of scheduling problems.[34] In the cleanest
form, a given set of jobs need to be assigned to time slots, each job requires one
such slot. Jobs can be scheduled in any order, but pairs of jobs may be
in conflict in the sense that they may not be assigned to the same time slot, for
example because they both rely on a shared resource. The corresponding graph
contains a vertex for every job and an edge for every conflicting pair of jobs.
The chromatic number of the graph is exactly the minimum makespan, the
optimal time to finish all jobs without conflicts.
Details of the scheduling problem define the structure of the graph. For
example, when assigning aircraft to flights, the resulting conflict graph is
an interval graph, so the coloring problem can be solved efficiently.
In bandwidth allocation to radio stations, the resulting conflict graph is a unit
disk graph, so the coloring problem is 3-approximable.
Register allocation[edit]
Main article: Register allocation
A compiler is a computer program that translates one computer language into
another. To improve the execution time of the resulting code, one of the
techniques of compiler optimization is register allocation, where the most
frequently used values of the compiled program are kept in the fast processor
registers. Ideally, values are assigned to registers so that they can all reside in
the registers when they are used.
The textbook approach to this problem is to model it as a graph coloring
problem.[35] The compiler constructs an interference graph, where vertices are
variables and an edge connects two vertices if they are needed at the same time.
If the graph can be colored with k colors then any set of variables needed at the
same time can be stored in at most k registers.
Other applications[edit]
The problem of coloring a graph arises in many practical areas such as pattern
matching, sports scheduling, designing seating plans, exam timetabling, the
scheduling of taxis, and solving Sudoku puzzles.[36]
Other colorings[edit]
Ramsey theory[edit]
Main article: Ramsey theory
An important class of improper coloring problems is studied in Ramsey theory,
where the graph’s edges are assigned to colors, and there is no restriction on the
colors of incident edges. A simple example is the friendship theorem, which
states that in any coloring of the edges of , the complete graph of six vertices,
there will be a monochromatic triangle; often illustrated by saying that any
group of six people either has three mutual strangers or three mutual
acquaintances. Ramsey theory is concerned with generalisations of this idea to
seek regularity amid disorder, finding general conditions for the existence of
monochromatic subgraphs with given structure.
Other colorings[edit]
Adjacent-vertex-distinguishing-total coloring
A total coloring with the additional restriction that any two adjacent vertices have different color sets Takes into account orientation of edges of the graph
Acyclic coloring
Every 2-chromatic subgraph is acyclic Models a routing problem in graphs
B-coloring
a coloring of the vertices where each color class contains a vertex that has a neighbor in all other color classes. Sum of the distance between the vertices and the differenc
Circular coloring
Motivated by task systems in which production proceeds in a cyclic way If two vertices have the same color i, then every path betw
Cocoloring
An improper vertex coloring where every color class induces an independent set or a clique An improper vertex coloring where every color class indu
Complete coloring
Every pair of colors appears on at least one edge The criterion of minimalization is the sum of colors
Defective coloring
An improper vertex coloring where every color class induces a bounded degree subgraph. Every 2-chromatic subgraph is a disjoint collection of star
Distinguishing coloring
An improper vertex coloring that destroys all the symmetries of the graph Every color appears in every partition of equal size exactl
Equitable coloring
The sizes of color classes differ by at most one Edges are colored such that each color class induces a mat
Exact coloring
Every pair of colors appears on exactly one edge Absolute value of the difference between two colors of ad
Fractional coloring
Vertices may have multiple colors, and on each edge the sum of the color parts of each vertex is not greater than one Vertices and edges are colored
Hamiltonian coloring
Uses the length of the longest path between two vertices, also known as the detour distance Every connected induced subgraph has a color that is used
Harmonious coloring
Every pair of colors appears on at most one edge
Incidence coloring The edges are colored so that each color class forms a tria
Each adjacent incidence of vertex and edge is colored with distinct colors
Interval edge coloring An improper vertex coloring where every non-isolated no
A color of edges meeting in a common vertex must be contiguous
List coloring
Each vertex chooses from a list of colors
List edge-
coloring
Each edge chooses from a list of colors
L(h, k)-
coloring
Difference of colors at adjacent vertices is at least h and difference of colors of vertices at a distance two is at least k. A particular
case is L(2,1)-coloring.
Vertex Coloring
Vertex coloring is an assignment of colors to the vertices of a graph ‘G’ such that no
two adjacent vertices have the same color. Simply put, no two vertices of an edge
should be of the same color.
Chromatic Number
The minimum number of colors required for vertex coloring of graph ‘G’ is called as
the chromatic number of G, denoted by X(G).
χ(G) = 1 if and only if 'G' is a null graph. If 'G' is not a null graph, then χ(G) ≥ 2.
Example
Note − A graph ‘G’ is said to be n-coverable if there is a vertex coloring that uses at
most n colors, i.e., X(G) ≤ n.
Region Coloring
Region coloring is an assignment of colors to the regions of a planar graph such
that no two adjacent regions have the same color. Two regions are said to be
adjacent if they have a common edge.
Example
Take a look at the following graph. The regions ‘aeb’ and ‘befc’ are adjacent, as
there is a common edge ‘be’ between those two regions.
Similarly, the other regions are also coloured based on the adjacency. This graph is
coloured as follows −
Example
The chromatic number of Kn is
n
n–1
[n/2]
[n/2]
Consider this example with K4.
Clustering
Data mining
Image capturing
Image segmentation
Networking
Resource allocation
Processes scheduling