Subsection 5.2.4 The chromatic polynomial of a graph
¶We defined a graph to consist of set \(V\) of elements called vertices and a set \(E\) of elements called edges such that each edge joins two vertices. A coloring of a graph by the elements of a set \(C\) (of colors) is an assignment of an element of \(C\) to each vertex of the graph; that is, a function from the vertex set \(V\) of the graph to \(C\text{.}\) A coloring is called proper if for each edge joining two distinct vertices 2 , the two vertices it joins have different colors. You may have heard of the famous four color theorem of graph theory that says if a graph may be drawn in the plane so that no two edges cross (though they may touch at a vertex), then the graph has a proper coloring with four colors. Here we are interested in a different, though related, problem: namely, in how many ways may we properly color a graph (regardless of whether it can be drawn in the plane or not) using \(k\) or fewer colors? When we studied trees, we restricted ourselves to connected graphs. (Recall that a graph is connected if, for each pair of vertices, there is a walk between them.) Here, disconnected graphs will also be important to us. Given a graph which might or might not be connected, we partition its vertices into blocks called connected components as follows. For each vertex \(v\) we put all vertices connected to it by a walk into a block together. Clearly each vertex is in at least one block, because vertex \(v\) is connected to vertex \(v\) by the trivial walk consisting of the single vertex \(v\) and no edges. To have a partition, each vertex must be in one and only one block. To prove that we have defined a partition, suppose that vertex \(v\) is in the blocks \(B_1\) and \(B_2\text{.}\) Then \(B_1\) is the set of all vertices connected by walks to some vertex \(v_1\) and \(B_2\) is the set of all vertices connected by walks to some vertex \(v_2\text{.}\)
Problem 241
(Relevant in Appendix C as well as this section.) Show that \(B_1=B_2\text{.}\)
Since \(B_1=B_2\text{,}\) these two sets are the same block, and thus all blocks containing \(v\) are identical, so \(v\) is in only one block. Thus we have a partition of the vertex set, and the blocks of the partition are the connected components of the graph. Notice that the connected components depend on the edge set of the graph. If we have a graph on the vertex set \(V\) with edge set \(E\) and another graph on the vertex set \(V\) with edge set \(E'\text{,}\) then these two graphs could have different connected components. It is traditional to use the Greek letter \(\gamma\) (gamma) 3 to stand for the number of connected components of a graph; in particular, \(\gamma(V,E)\) stands for the number of connected components of the graph with vertex set \(V\) and edge set \(E\text{.}\) We are going to show how the principle of inclusion and exclusion may be used to compute the number of ways to properly color a graph using colors from a set \(C\) of \(c\) colors.
Problem 242
Suppose we have a graph \(G\) with vertex set \(V\) and edge set \(E\text{.}\) Suppose \(F\) is a subset of \(E\text{.}\) Suppose we have a set \(C\) of \(c\) colors with which to color the vertices.
(a)
In terms of \(\gamma(V,F)\text{,}\) in how many ways may we color the vertices of \(G\) so that each edge in \(F\) connects two vertices of the same color?
HintFor each edge in \(F\) to connect two vertices of the same color, we must have all the vertices in a connected component of the graph with vertex set \(V\) and edge set \(F\) colored the same color.
(b)
Given a coloring of \(G\text{,}\) for each edge \(e\) in \(E\text{,}\) let us consider the property that the endpoints of \(e\) are colored the same color. Let us call this property “property \(e\text{.}\)” In this way each set of properties can be thought of as a subset of \(E\text{.}\) What set of properties does a proper coloring have?
(c)
Find a formula (which may involve summing over all subsets \(F\) of the edge set of the graph and using the number \(\gamma(V,F)\) of connected components of the graph with vertex set \(V\) and edge set \(F\)) for the number of proper colorings of \(G\) using colors in the set \(C\text{.}\)
HintHow does the number you are trying to compute relate to the union of the sets \(A_i\text{?}\)
The formula you found in Problem 242.c is a formula that involves powers of \(c\text{,}\) and so it is a polynomial function of \(c\text{.}\) Thus it is called the chromatic polynomial of the graph \(G\text{.}\) Since we like to think about polynomials as having a variable \(x\) and we like to think of \(c\) as standing for some constant, people often use \(x\) as the notation for the number of colors we are using to color \(G\text{.}\) Frequently people will use \(\chi_G(x)\) to stand for the number of way to color \(G\) with \(x\) colors, and call \(\chi_G(x)\) the chromatic polynomial of \(G\text{.}\)