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.

##### Discussion5.20

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.

##### Proof

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.

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.

# 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{.}$

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.

##### Proof

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.