maths.freeCombinatorics & Graph Theory › 5. Graph Theory › Graph Coloring

Graph Coloring

Let's return now to the subject of , assigning frequencies to radio stations so that they don't interfere.

Graph Coloring

Let's return now to the subject of , assigning frequencies to radio stations so that they don't interfere. The first thing that we will need to do is to turn the map of radio stations into a suitable graph, which should be pretty natural at this juncture. We define a graph \(\GVE\) in which \(V\) is the set of radio stations and \(xy\in E\) if and only if radio station \(x\) and radio station \(y\) are within \(200\) miles of each other. With this as our model, then we need to assign different frequencies to two stations if their corresponding vertices are joined by an edge. This leads us to our next topic, coloring graphs.

When \(\GVE\) is a graph and \(C\) is a set of elements called colors, a proper coloring of \(\bfG\) is a function \(\phi:V\to C\) such that \(\phi(x)\neq \phi(y)\) whenever \(xy\) is an edge in \(\bfG\). The least \(t\) for which \(\bfG\) has a proper coloring using a set \(C\) of \(t\) colors is called the chromatic number of \(\bfG\) and is denoted \(\chi(\bfG)\) \(\chi(\bfG)\) chromatic number of a graph \(\bfG\) . In , we show a proper coloring of a graph using \(5\) colors. Now we can see that our radio frequency assignment problem is the much-studied question of finding the chromatic number of an appropriate graph.

Bipartite Graphs

A graph \(\GVE\) with \(\chi(\bfG)\le 2\) is called a \(2\)-colorable graph. A couple of minutes of reflection should convince you that for \(n\geq 2\), the cycle \(\bfC_{2n}\) with \(2n\) vertices is \(2\)-colorable. On the other hand, \(\bfC_3\cong \bfK_3\) is clearly not \(2\)-colorable. Furthermore, no odd cycle \(\bfC_{2n+1}\) for \(n\geq 1\) is \(2\)-colorable. It turns out that the property of containing an odd cycle is the only impediment to being \(2\)-colorable, which means that recognizing \(2\)-colorable graphs is easy, as the following theorem shows.

A graph \(\bfG\) is called a bipartite graph when there is a partition of the vertex set \(V\) into two sets \(A\) and \(B\) so that the subgraphs induced by \(A\) and \(B\) are independent graphs, , no edge of \(\bfG\) has both of its endpoints in \(A\) or in \(B\). Evidently, bipartite graphs are \(2\)-colorable. On the other hand, when a \(2\)-colorable graph is disconnected, there is more than one way to define a suitable partition of the vertex set into two independent sets.

Bipartite graphs are commonly used as models when there are two distinct types of objects being modeled and connections are only allowed between two objects of different types. For example, on one side, list candidates who attend a career fair and on the other side list the available positions. The edges might naturally correspond to candidate/position pairs which link a person to a responsibility they are capable of handling.

As a second example, a bipartite graph could be used to visualize the languages spoken by a group of students. The vertices on one side would be the students with the languages listed on the other side. We would then have an edge \(xy\) when student \(x\) spoke language \(y\). A concrete example of this graph for our favorite group of students is shown in , although Alice isn't so certain there should be an edge connecting Dave and English.

One special class of bipartite graphs that bears mention is the class of complete bipartite graphs. The complete bipartite graph \(\bfK_{m,n}\) has vertex set \(V=V_1\cup V_2\) with \(|V_1|=m\) and \(|V_2|=n\). It has an edge \(xy\) if and only if \(x\in V_1\) and \(y\in V_2\). The complete bipartite graph \(\bfK_{3,3}\) is shown in .

Condensed — the full section is in Keller & Trotter, Applied Combinatorics.

Cliques and Chromatic Number

A clique in a graph \(\GVE\) is a set \(K\subseteq V\) such that the subgraph induced by \(K\) is isomorphic to the complete graph \(\bfK_{|K|}\). Equivalently, we can say that every pair of vertices in \(K\) are adjacent. The maximum clique size or clique number of a graph \(\bfG\), denoted \(\omega(\bfG)\) \(\omega(\bfG)\) clique number of \(\bfG\) , is the largest \(t\) for which there exists a clique \(K\) with \(|K|=t\). For example, the graph in has clique number \(4\) while the graph in has maximum clique size\(2\).

For every graph \(\bfG\), it is obvious that \(\chi(\bfG)\ge \omega(\bfG)\). On the other hand, the inequality may be far from tight. Before showing how bad it can be, we need to introduce a more general version of the . Consider a function \(f\colon X\to Y\) with \(|X| = 2|Y|+1\). Since \(|X|>|Y|\), the Pigeon Hole Principle as stated in only tells us that there are distinct \(x,x'\in X\) with \(f(x)=f(x')\). However, we can say more here. Suppose that each element of \(Y\) has at most two elements of \(X\) mapped to it. Then adding up the number of elements of \(X\) based on how many are mapped to each element of \(Y\) would only allow \(X\) to have (at most) \(2|Y|\) elements. Thus, there must be \(y\in Y\) so that there are three distinct elements \(x,x',x''\in X\) with \(f(x)=f(x')=f(x'')=y\). This argument generalizes to give the following version of the Pigeon Hole Principle:

We are now prepared to present the following proposition showing that clique number and chromatic number need not be close at all. We give two proofs. The first is the work of J. Kelly and L. Kelly, while the second is due to J. Mycielski.

Since a \(3\)-clique looks like a triangle, is often stated as There exist triangle-free graphs with large chromatic number. As an illustration of the construction in the proof of Mycielski, we again refer to . The graph shown is \(\bfG_4\). We will return to the topic of graphs with large chromatic number in where we show that there are graphs with large chromatic number which lack not only cliques of more than two vertices but also cycles of fewer than \(g\) vertices for any value of \(g\). In other words, there is a graph \(\bfG\) with \(\chi(\bfG)=10^6\) but no cycle with fewer than \(10^{10}\) vertices!

Condensed — the full section is in Keller & Trotter, Applied Combinatorics.

Can We Determine Chromatic Number?

Suppose you are given a graph \(\bfG\). It's starting to look like it is not easy to find an algorithm that answers the question Is \(\chi(\bfG)\leq t\)? It's easy to verify a certificate (a proper coloring using at most \(t\) colors), but how could you even find a proper coloring, not to mention one with the fewest number of colors? Similarly for the question Is \(\omega(\bfG)\geq k\)?, it is easy to verify a certificate. However, finding a maximum clique appears to be a very hard problem. Of course, since the gap between \(\chi(\bfG)\) and \(\omega(\bfG)\) can be arbitrarily large, being able to find one value would not (generally) help in finding the value of the other. No polynomial-time algorithm is known for either of these problems, and many believe that no such algorithm exists. In this subsection, we look at one approach to finding chromatic number and see a case where it does work efficiently.

A very naïve algorithmic way to approach graph coloring is the First Fit, or greedy, algorithm. For this algorithm, fix an ordering of the vertex set \(V=\{v_1,v_2,\dots v_n\}\). We define the coloring function \(\phi\) one vertex at a time in increasing order of subscript. We begin with \(\phi(v_1)=1\) and then we define \(\phi(v_{i+1})\) (assuming vertices \(v_1,v_2,\dots,v_i\) have been colored) to be the least positive integer color that has not already been used on any of its neighbors in the set \(\{v_1,\dots v_i\}\).

shows two different orderings of the same graph. demonstrates that the ordering of \(V\) is vital to the ability of the First Fit algorithm to color \(\bfG\) using \(\chi(\bfG)\) colors. In general, finding an optimal ordering is just as difficult as coloring \(\bfG\). Thus, this very simple algorithm does not work well in general. However, for some classes of graphs, there is a natural ordering that leads to optimal performance of First Fit. Here is one such exampleone that we will study again in the next chapter in a different context.

A graph \(\bfG\) is said to be perfect if \(\chi(\bfH)=\omega(\bfH)\) for every induced subgraph \(\bfH\). Since an induced subgraph of an interval graph is an interval graph, shows interval graphs are perfect. The study of perfect graphs originated in connection with the theory of communications networks and has proved to be a major area of research in graph theory for many years now.

Condensed — the full section is in Keller & Trotter, Applied Combinatorics.

Practice (3)

Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.

  1. Describe reasonably clearly a graph Alice could have drawn to shock Bob in .

  2. Describe a way in which Dave could have recolored the graph in to get a proper coloring using four colors.

  3. Use the First Fit algorithm to color the vertices of the graph in following each of the orderings given. How many colors does First Fit use when you use the ordering shown on the left? How many colors does First Fit use when you use the ordering shown on the right? Describe a generalization of this graph to a bipartite graph on \(2n\) vertices and ordering of its vertices that forces First Fit to use \(n\) colors.

Symbols used here

x \in A,\ A \subseteq B
element of, subset
x belongs to A; every element of A is in B.
A \cup B,\ A \cap B,\ A \setminus B
union, intersection, difference
In either; in both; in A but not B.
y',\ y''
first and second derivative of y
Prime notation for derivatives with respect to x (or t).
i
imaginary unit
i² = −1.
\leq,\ \geq
less/greater than or equal
Inequalities that allow equality; < and > exclude it.
\neq
not equal
The two sides are different.
n!
factorial
n × (n−1) × … × 1; the number of orderings of n things. 0! = 1.
\binom{n}{k}
binomial coefficient, "n choose k"
Number of k-element subsets of n things: n!/(k!(n−k)!).
\sum_{k=1}^{n} a_k
summation
Add a_k for k = 1 up to n.
\prod_{k=1}^{n} a_k
product
Multiply a_k for k = 1 up to n.
\emptyset,\ |A|
empty set, cardinality
The set with no elements; the number of elements of A.

Questions people ask

Permutation or combination?

Ask whether order matters. A lock code is a permutation (order matters); a hand of cards is a combination (it does not).

What is a graph in this sense?

Dots (vertices) joined by lines (edges) — not a plot. Road maps, social networks and molecules are graphs; questions like "is there a route" and "how few colours" are graph theory.

ನಿಮ್ಮದೇ ಆದದ್ದನ್ನು ಪ್ರಯತ್ನಿಸಿ

Parts of this page are adapted from Keller & Trotter, Applied Combinatorics (CC BY-SA 4.0). Condensed and re-explained here; errors are ours.

ಇನ್ನಷ್ಟು Combinatorics & Graph Theory