Skip to main content
\(\newcommand{\set}[1]{\{1,2,\dotsc,#1\,\}} \newcommand{\ints}{\mathbb{Z}} \newcommand{\posints}{\mathbb{N}} \newcommand{\rats}{\mathbb{Q}} \newcommand{\reals}{\mathbb{R}} \newcommand{\complexes}{\mathbb{C}} \newcommand{\twospace}{\mathbb{R}^2} \newcommand{\threepace}{\mathbb{R}^3} \newcommand{\dspace}{\mathbb{R}^d} \newcommand{\nni}{\mathbb{N}_0} \newcommand{\nonnegints}{\mathbb{N}_0} \newcommand{\dom}{\operatorname{dom}} \newcommand{\ran}{\operatorname{ran}} \newcommand{\prob}{\operatorname{prob}} \newcommand{\Prob}{\operatorname{Prob}} \newcommand{\height}{\operatorname{height}} \newcommand{\width}{\operatorname{width}} \newcommand{\length}{\operatorname{length}} \newcommand{\crit}{\operatorname{crit}} \newcommand{\inc}{\operatorname{inc}} \newcommand{\HP}{\mathbf{H_P}} \newcommand{\HCP}{\mathbf{H^c_P}} \newcommand{\GP}{\mathbf{G_P}} \newcommand{\GQ}{\mathbf{G_Q}} \newcommand{\AG}{\mathbf{A_G}} \newcommand{\GCP}{\mathbf{G^c_P}} \newcommand{\PXP}{\mathbf{P}=(X,P)} \newcommand{\QYQ}{\mathbf{Q}=(Y,Q)} \newcommand{\GVE}{\mathbf{G}=(V,E)} \newcommand{\HWF}{\mathbf{H}=(W,F)} \newcommand{\bfC}{\mathbf{C}} \newcommand{\bfG}{\mathbf{G}} \newcommand{\bfH}{\mathbf{H}} \newcommand{\bfF}{\mathbf{F}} \newcommand{\bfI}{\mathbf{I}} \newcommand{\bfK}{\mathbf{K}} \newcommand{\bfP}{\mathbf{P}} \newcommand{\bfQ}{\mathbf{Q}} \newcommand{\bfR}{\mathbf{R}} \newcommand{\bfS}{\mathbf{S}} \newcommand{\bfT}{\mathbf{T}} \newcommand{\bfNP}{\mathbf{NP}} \newcommand{\bftwo}{\mathbf{2}} \newcommand{\cgA}{\mathcal{A}} \newcommand{\cgB}{\mathcal{B}} \newcommand{\cgC}{\mathcal{C}} \newcommand{\cgD}{\mathcal{D}} \newcommand{\cgE}{\mathcal{E}} \newcommand{\cgF}{\mathcal{F}} \newcommand{\cgG}{\mathcal{G}} \newcommand{\cgM}{\mathcal{M}} \newcommand{\cgN}{\mathcal{N}} \newcommand{\cgP}{\mathcal{P}} \newcommand{\cgR}{\mathcal{R}} \newcommand{\cgS}{\mathcal{S}} \newcommand{\bfn}{\mathbf{n}} \newcommand{\bfm}{\mathbf{m}} \newcommand{\bfk}{\mathbf{k}} \newcommand{\bfs}{\mathbf{s}} \newcommand{\bijection}{\xrightarrow[\text{onto}]{\text{$1$--$1$}}} \newcommand{\injection}{\xrightarrow[]{\text{$1$--$1$}}} \newcommand{\surjection}{\xrightarrow[\text{onto}]{}} \newcommand{\nin}{\not\in} \newcommand{\prufer}{\mbox{prüfer}} \DeclareMathOperator{\fix}{fix} \DeclareMathOperator{\stab}{stab} \DeclareMathOperator{\var}{var} \newcommand{\inv}{^{-1}} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section5.4Graph Coloring

Let's return now to the subject of Example 1.5, 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 if \(\phi(x)\neq \phi(y)\) whenever \(xy\) is an edge in \(\bfG\text{.}\) 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)\). In Figure 5.19, 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.

<<SVG image is unavailable, or your browser cannot render it>>

Figure5.19A proper coloring using \(5\) colors

Everyone agrees that the graph \(\bfG\) in Figure 5.19 has chromatic number at most \(5\text{.}\) However, there's a bit of debate going on about if \(\chi(\bfG)=5\text{.}\) Bob figures the authors would not have used five colors if they didn't need to. Carlos says he's glad they're having the discussion, since all having a proper coloring does is provide them with an upper bound on \(\chi(\bfG)\text{.}\) Bob sees that the graph has a vertex of degree \(5\) and claims that must mean \(\chi(\bfG)=5\text{.}\) Alice groans and draws a graph with \(101\) vertices, one of which has degree \(100\text{,}\) but with chromatic number \(2\text{.}\) Bob is shocked, but agrees with her. Xing wonders if the fact that the graph does not contain a \(\bfK_3\) has any bearing on the chromatic number. Dave's in a hurry to get to the gym, but on his way out the door he says they can get a proper \(4\)-coloring pretty easily, so \(\chi(\bfG)\leq 4\text{.}\) The rest decide it's time to keep reading.

  • What graph did Alice draw that shocked Bob?

  • What changes did Dave make to the coloring in Figure 5.19 to get a proper coloring using four colors?

Subsection5.4.1Bipartite 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\text{,}\) 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 \(V\) into two sets \(A\) and \(B\) so that the subgraphs induced by \(A\) and \(B\) are independent graphs, i.e., no edge of \(\bfG\) has both of its endpoints in \(A\) or in \(B\text{.}\) 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\text{.}\) A concrete example of this graph for our favorite group of students is shown in Figure 5.22, although Alice isn't so certain there should be an edge connecting Dave and English.

<<SVG image is unavailable, or your browser cannot render it>>

Figure5.22A bipartite graph

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\text{.}\) It has an edge \(xy\) if and only if \(x\in V_1\) and \(y\in V_2\text{.}\) The complete bipartite graph \(\bfK_{3,3}\) is shown in Figure 5.23.

<<SVG image is unavailable, or your browser cannot render it>>

Figure5.23The complete bipartite graph \(\bfK_{3,3}\)

Subsection5.4.2Cliques 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|}\text{.}\) Equivalently, we can say that every pair of vertices in \(K\) are adjacent. The maximum clique size or clique number of a graph \(\bfG\text{,}\) denoted \(\omega(\bfG)\), is the largest \(t\) for which there exists a clique \(K\) with \(|K|=t\text{.}\) For example, the graph in Figure 5.14 has clique number \(4\) while the graph in Figure 5.19 has maximum clique size \(2\text{.}\)

For every graph \(\bfG\text{,}\) it is obvious that \(\chi(\bfG)\ge \omega(\bfG)\text{.}\) On the other hand, the inequality may be far from tight. Before proving showing how bad it can be, we need to introduce a more general version of the Pigeon Hole Principle. Consider a function \(f\colon X\to Y\) with \(|X| = 2|Y|+1\text{.}\) Since \(|X|>|Y|\text{,}\) the Pigeon Hole Principle as stated in Proposition 4.1 only tells us that there are distinct \(x,x'\in X\) with \(f(x)=f(x')\text{.}\) 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\text{.}\) 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, Proposition 5.25 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 Figure 5.19. The graph shown is \(\bfG_4\text{.}\) We will return to the topic of graphs with large chromatic number in Section 11.6 where we show that are there 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\text{.}\) In other words, there is a graph \(\bfG\) with \(\chi(\bfG)=10^6\) but no cycle with fewer than \(10^{10}\) vertices!

Subsection5.4.3Can We Determine Chromatic Number?

Suppose you are given a graph \(\bfG\text{.}\) It's starting to look like it is not easy to find an algorithm that answers the question “Is \(\chi(\bfG)\leq t\text{?}\)” 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\text{?}\)”, 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\}\text{.}\) 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\}\text{.}\)

<<SVG image is unavailable, or your browser cannot render it>>

Figure5.26Two orderings of the vertices of a bipartite graph.

Figure 5.26 shows two different orderings of the same graph. Exercise 5.9.24 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\text{.}\) 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 example—one that we will study again in the next chapter in a different context.

Given an indexed family of sets \(\cgF=\{S_\alpha:\alpha\in V\}\text{,}\) we associate with \(\cgF\) a graph \(\bfG\) defined as follows. The vertex set of \(\bfG\) is the set \(V\) and vertices \(x\) and \(y\) in \(V\) are adjacent in \(\bfG\) if and only if \(S_x\cap S_y \neq\emptyset\text{.}\) We call \(\bfG\) an intersection graph. It is easy to see that every graph is an intersection graph (Why?), so it makes sense to restrict the sets which belong to \(\cgF\text{.}\) For example, we call \(\bfG\) an interval graph if it is the intersection graph of a family of closed intervals of the real line \(\reals\text{.}\) For example, in Figure 5.27, we show a collection of six intervals of the real line on the left. On the right, we show the corresponding interval graph having an edge between vertices \(x\) and \(y\) if and only if intervals \(x\) and \(y\) overlap.

<<SVG image is unavailable, or your browser cannot render it>>

Figure5.27A collection of intervals and its interval graph

A graph \(\bfG\) is said to be perfect if \(\chi(\bfH)=\omega(\bfH)\) for every induced subgraph \(\bfH\text{.}\) Since an induced subgraph of an interval graph is an interval graph, Theorem 5.28 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.