Chapter 18: Counting Inequivalent Colorings

Concepts: Graph , vertex and edge coloring, equivalent color- ings, equivalence class of colorings, number of inequivalent colorings, color- fixing , fixed points of an automorphism, formula for number of inequivalent colorings, formula for number of restricted colorings. 1. Automorphisms of a graph: Permutations of the vertices that don’t change the edge set.

Example 1.1: There are 8 automorphisms of C4:

1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 , , , , 1 2 3 4 1 4 3 2 2 1 4 3 2 3 4 1

1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 , , , . 3 2 1 4 3 4 1 2 4 1 2 3 4 3 2 1

To find these, we can either work out all 24 permutations of C4 and see which ones fix C4, or we can construct them as follows: any permutation must produce the cycle 1-2-3-4-1. There are four permutations which produce this cycle in the clockwise orientation and there are four permutations which produce this cycle in the counter-clockwise direction.

Illustration 1.2: Permutations applied to C4. 2. C-coloring of a graph: A function c : V → C to a finite set of colors C. The color of the vertex v is c(v). The number of C-colorings of an n-vertex graph is n|C|. 2 Example 2.1: There are 4 = 16 {R,B}-colorings of C4.

Illustration 2.2: {R,B} colorings of C4 3. Action of a graph automorphism on a coloring: Given a graph automorphism f of a graph G, and a coloring c of the vertices of G, permute the vertices of G using f, leaving the colors in place, obtaining a coloring  1 2 ··· n   1 2 ··· n  f ∗c of G. If c = and f = c(1) c(2) ··· c(n) f(1) f(2) ··· f(n) then f(1) f(2) ··· f(n) f ∗ c = . c(1) c(2) ··· c(n)

1  1 2 3 4  1 2 3 4 Example 3.1: Let c = and f = . Then BRRR 2 1 4 3

 2 1 4 3   1 2 3 4  f ∗ c = = . BRRR RBRR

4. Equivalence classes of colorings: We say that two colorings c1 and c2 are equivalent if there is a graph automorphism f which transforms c1 into c2: f ∗ c1 = c2. If f ∗ c1 6= c2 for any graph automorphism f, then we say 0 0 that c1 and c2 are inequivalent. Given a coloring c, we set [c] = {c : c ∼ c }. The distinct sets [c] form a partition of the set of all colorings. Terminology in textbook: [c] is the orbit of c under the action of automor- phisms and is denoted by cG. See page 457, Definition 18.15. Example 4.1: Example 3.1 implies

 1 2 3 4   1 2 3 4  ∼ . BRRR RBRR

In fact, all colorings with 3 Rs and 1 B are equivalent, and we have

 1 2 3 4  = BRRR

 1 2 3 4   1 2 3 4   1 2 3 4   1 2 3 4  , , , . BRRR RBRR RRBR RRRB

 1 2 3 4   1 2 3 4  Example 4.2: Let c = and c = . There 1 BBRR 2 BRBR is no automorphism that sends the subset {1, 2} to the subset {1, 3}, there- fore f ∗ c1 6= c2 for any f. Hence c1 and c2 are inequivalent colorings. Geometrically, every time we rotate or flip c1 we obtain a coloring in which the two blue vertices are joined by an edge. Since c2 doesn’t have two blue vertices joined by an edge, we never never obtain c2 by acting on c1 by an automorphism.

Illustration 4.3: Equivalence classes of {R,B}-colorings of C4. 5. Partitioning automorphisms: Let c be a coloring. Then for each automorphism f, f ∗ c is a coloring equivalent to c. If [c] = {c1, c2, . . . , ck}

2 where c1 = c, then we can partition the elements of the automorphism via G = G1 ∪ G2 ∪ · · · ∪ Gk, where Gi = {f ∈ G : f ∗ c1 = ci}.

 1 2 3 4  f(1) f(2) f(3) f(4) Example 5.1: Let c = . Then f∗c = . BRRR BRRR If we denote by ci the coloring in which the vertex i is colored blue and the other vertices are colored red, then we have f ∗ c1 = cf(1) for all f. Therefore Gi = {f ∈ G : f(1) = i} and

G = G1 ∪ G2 ∪ G3 ∪ G4.

Looking at G in Part 1 above we see that |G1| = |G2| = |G3| = |G4| = 2.  1 2 3 4  f(1) f(2) f(3) f(4) Example 5.2: Let c = . Then f∗c = . BRBR BRBR If we denote by c{i,j} the coloring in which vertices i and j are colored blue and the other two vertices are colored red, then we have f ∗ c = c{f(1),f(3)} for all f. Therefore G{i,j} = {f ∈ G : {f(1), f(3)} = {i, j}} and

G = G{1,3} ∪ G{2,4}.

Looking at G in Part 1 above we see that |G{1,3}| = |G{2,4}| = 4. We will see in Theorem 8 below that whenever we partition the automor- phism this way, each set in the partition contains the same number of auto- morphisms. 6. Color-fixing automorphisms: Let c be a coloring and let f be an automorphism. We say that f fixes c if f ∗ c = c. See the illustrations for examples. The set of all color-fixing automorphisms of c is

G(c) = {f ∈ G : f ∗ c = c}.

Terminology in textbook: G(c) is the stabilizer of c, denoted Gc. See page 456, Definition 18.11.

3 7. Fixed-points of an automorphism: Let c be a coloring and let f be a automorphism. We say that c is a fixed-point of f is f ∗ c = c. See the illustrations for examples. The set of all fixed-points of an automorphism f is C(f) = {c : f ∗ c = c}.

Terminology in textbook: C(f) is the set of fixed points of the automorphism f, denoted by Ff . See page 458, Definition 18.19.

Theorem 8: Let c be a coloring, let [c] = {c1, . . . , ck}, and let

Gi = {f ∈ G : f ∗ c1 = ci}.

Then |Gi| = |Gj| for all i and j.

Proof: It suffices to prove that |Gi| ≤ |Gj| for any i and j. Choose a fixed automorphism gij that satisfies gij ∗ ci = cj. We will use this to construct a mapping from Gi to Gj. Given f ∈ Gi we have c1 7→ ci using f, therefore c1 7→ ci 7→ cj using gij ◦ f, therefore gij ◦ fi ∈ Gj. The mapping f 7→ gij ◦ f 0 −1 −1 0 0 is injective: gij ◦ f = gij ◦ f =⇒ gij ◦ gij ◦ f = gij ◦ gij ◦ f =⇒ f = f . Since the mapping is injective, |Gi| ≤ |Gj|. Theorem 9: For each coloring c, |[c]| · |G(c)| = |G|. This is equivalent to Lemma 18.16, p. 457.

Proof: Write [c] = {c1, . . . , ck} where c1 = c. Then by Theorem 8,

|G| = |G1| + ··· + |Gk| = k · |G1| = |[c]| · |G(c)|.

Theorem 10: Assume there are m different equivalence classes of colorings. Then X |G(c)| = m|G|. c

Proof: By Theorem 2 we have

X X |G| |G(c)| = . |[c]| c c

4 However, given [c] = {c1, . . . , ck}, we have

X |G| X |G| |G| = = k = |G|, |[ci]| |[c]| |[c]| ci∈[c] ci∈[c] so given that there are m different equivalent equivalence classes of colorings, the entire sum is |G| + |G| + ... |G| = m|G|. Theorem 11: Assume there are m different equivalence classes of colorings. Then 1 X m = |C(f)|. |G| f This is equivalent to Theorem 18.20, page 458. Proof: Using Theorem 10, we have X X X X X X m|G| = |G(c)| = 1 = 1 = |C(f)|. c c f f c f f∗c=c f∗c=c

Theorem 12: Let f be an automorphism with k cycles. Then |C(f)| = |C|k. 1 2 3 4 Example 12.1: Let f = be an automorphism of C . We 2 1 4 3 4 count the number of colorings {R,B}-colorings c that f fixes using a counting  1 2 3 4  argument. Let c = be a coloring fixed by f. Then c(1) c(2) c(3) c(4) c = f ∗ c implies

 1 2 3 4   2 1 4 3  = . c(1) c(2) c(3) c(4) c(1) c(2) c(3) c(4)

It is required that c(1) = c(2) and c(3) = c(4). There are 2 ways to choose the common color of c(1) and c(2) and 2 ways to choose the common color of c(3) and c(4), for a total of 22 colorings fixed by f. Proof of Theorem 12: A coloring c fixed by f must satisfy c(i) = c(f(i)) for each i. This implies c(1) = c(f(1)) = c(f(f(1))) = ··· , c(2) = c(f(2)) = c(f(f(2))) = ··· , etc. Decompose f into disjoint cycles and choose a color arbitrarily for all the vertices in a given cycle. If f has k different cycles and there are |C| colors to choose from, then |C(f)| = |C|k.

5 Theorem 13: Assume there are m different equivalence classes of colorings. Then 1 X m = |C|cycles(f). |G| f

Proof: Substitute Theorem 12 into Theorem 11.

Example 13.1: The cycle structure of each automorphism of C4 is

1 2 3 4 1 2 3 4 ↔ (1)(2)(3)(4), ↔ (1)(2, 4)(3), 1 2 3 4 1 4 3 2

1 2 3 4 1 2 3 4 ↔ (1, 2)(3, 4), ↔ (1, 2, 3, 4), 2 1 4 3 2 3 4 1 1 2 3 4 1 2 3 4 ↔ (1, 3)(2)(4), ↔ (1, 3)(2, 4), 3 2 1 4 3 4 1 2 1 2 3 4 1 2 3 4 ↔ (1, 4, 3, 2), ↔ (1, 4)(2, 3). 4 1 2 3 4 3 2 1 Therefore 1 48 m = (24 + 23 + 22 + 21 + 23 + 22 + 21 + 22) = = 6. 8 8

14. Application to Example 18.23. Instead of coloring vertices, we color edges and interpret graph automorphisms according to how they permute the edges. Any automorphism is going to fix the edges 1, 2, 3 and permute the edges 4, 5, 6 and permute the edges 7,8. So the permutations are in the set

{(1)(2)(3)}×{(4)(5)(6), (45)(6), (46)(5), (4)(56), (456), (465)}×{(7)(8), (78)}.

There are 12 permutations in all. A generating function for the number of cycles in these permutations is

x3(x3 + 3x2 + 2x)(x2 + x) = 2x5 + 5x6 + 4x7 + x8.

Evaluating at x = 3 colors and dividing by |G| = 12 automorphisms yields 1620 inequivalent colorings. A confirmation of this: there are 3 choices of

6 color for each cycle edge, so 27 ways to color the cycle. On the left, the number of color assignments is equal to the number of solutions to R+B+G = 3, namely 10, and on the right the number of color assignments is equal to the number of solutions to R+B+G = 2, namely 6. Total: 27∗10∗6 = 1620. 15. Counting inequivalent restricted colorings with respect to a subgroup of automorphisms: The counting formulas we have derived are based on the identity 1 X m = |C(f)|. |G| f We proved this identity under the assumption that G is the full group of automorphisms of a graph. However, it holds for any subgroup of G that is closed with respect to multiplication of automorphisms and formation of inverse automorphisms (the properties we used to prove Theorem 8).

Example 15.1: Consider the graph obtained by connecting two copies of C3 by an edge. The full group of automorphisms, G, contains 8 elements (one can independently flip the left hand side, flip the right hand side, and flip the whole figure from left to right). The subgroup of automorphisms that restrict actions to the plane, H, consists of only two elements: do nothing, or rotate the figure 180 degrees counterclockwise. We will count the number of inequivalent colorings with with the colors R, B, and G with respect to both G and H.

Illustration 15.2: C3 − C3 The automorphisms in G are

(1)(2)(3)(4)(5)(6), (1, 2)(3)(4)(5)(6), (1)(2)(3)(4)(5, 6), (1, 2)(3)(4)(5, 6),

(1, 5)(2, 6)(3, 4), (1, 5, 2, 6)(3, 4), (1, 6, 2, 5)(3, 4), (1, 6)(2, 5)(3, 4). The first four do not involve a left-right flip, and the last four do. Hence 1 m = (36 + 35 + 35 + 34 + 33 + 32 + 32 + 33) = 171. 8

The automorphisms in H are

(1)(2)(3)(4)(5)(6), (1, 6)(2, 5)(3, 4).

7 Hence 1 m = (36 + 33) = 378. 2

16. Counting inequivalent restricted colorings: Instead of counting all ways to color a graph, we can restrict ourselves to colorings with a specified number of vertices of each color. If c is such a coloring and f is any graph automorphism then f ∗ c is another such coloring. The counting formula 1 P m = |G| f |C(f)| is still valid, but the computation of |C(f)| has to be restricted accordingly.

Theorem 17: Let f be an automorphism with x1 1-cycles, x2 2-cycles, ..., xn n-cycles. Restricting the set of permissible colorings to those in which color 1 appears n1 times, color 2 appears n2 times, ..., color k appears nk times, we have

n1 n2 nk x1 2 2 2 x2 n n n xn C(f) = [z1 z2 ··· zk ](z1+z2+···+zk) (z1+z2+···+zk) ··· (z1 +z2 +···+zk ) .

Proof: We must choose a color for all the vertices of each cycle in such a way that each color appears the right number of times.

First, choose the cycles to be colored with the color 1: a1 of the 1-cycles, b1 of the 2-cycles, c1 of the 3-cycles, and so on. There are x x x  1 2 3 ··· a1 b1 c1 ways to do this. We must have a1 + 2b1 + 3c1 + ··· = n1.

Second, choose the cycles to be colored with the color 2: a2 of the 1-cycles, b2 of the 2-cycles, and so on. There are x − a x − b x − c  1 1 2 1 3 1 ··· a2 b2 c2 ways to do this. We must have a2 + 2b2 + 3c2 + ··· = n2. Keep on going and multiply all the numbers together, obtaining x ! x ! x ! 1 2 3 ··· . a1!a2! ··· ak! b1!b2! ··· bk! c1!c2! · ck!

8 We must have a1+a2+···+ak = x1, b1+b2+···+bk = x2, c1+c2+···+ck = x3, etc. By the multinomial theorem, this is a contribution to the coefficient of n1 n2 nk z1 z2 ··· zk in

x1 2 2 2 x2 n n n xn (z1 + z2 + ··· + zk) (z1 + z2 + ··· + zk) ··· (z1 + z2 + ··· + zk ) .

For convenience, we will write

i i i Zi = z1 + z2 + ··· + zk where k is the number of colors used. Then Theorem 14 can be stated as

n1 nk 1-cycles of f 2-cycles of f k-cycles of f |C(f)| = [z1 ··· zk ]Z1 Z2 ··· Zk .

Theorem 18: Let m be the number of inequivalent colorings with n1 vertices colored 1, n2 vertices colored 2, ..., nk vertices colored k. Then ! 1 X 1-cycles of f 2-cycles of f k-cycles of f m = [zn1 ··· znk ] Z Z ··· Z . 1 k |G| 1 2 k f

Proof: Substitute the formula for |C(f)| in Theorem 17 into Theorem 11.

Example 18.1: The generating function for the inequivalent colorings of C4 is 1 (Z4 + 2Z2Z + 3Z2 + 2Z ) = z4 + z3z + 2z2z2 + z z3 + z4. 8 1 1 2 2 4 1 1 2 1 2 1 2 2 Therefore there are 1 inequivalent colorings using R4, 1 inequivalent colorings using R3B1, 2 inequivalent colorings using R2B2, 1 inequivalent colorings using R1B3, and 1 inequivalent colorings using B4. Note that the total number of inequivalent unrestricted colorings is just the sum of the coefficients in the generating function. So we can solve any prob- lem, whether restricted or unrestricted, by first working out the generating function 1 X 1-cycles of f 2-cycles of f k-cycles of f Z Z ··· Z . |G| 1 2 k f

9 Example 19.1: Consider the graph obtained by connecting two copies of C3 by an edge. The full group of automorphisms, G, contains 8 elements (one can independently flip the left hand side, flip the right hand side, and flip the whole figure from left to right). The subgroup of automorphisms that restrict actions to the plane, H, consists of only two elements: do nothing, or rotate the figure 180 degrees counterclockwise. We will count the number of inequivalent colorings with 1 red vertices, 1 blue vertices, and 4 green vertices with respect to both G and H.

Illustration 19.2: C3 − C3 The automorphisms in G are

(1)(2)(3)(4)(5)(6), (1, 2)(3)(4)(5)(6), (1)(2)(3)(4)(5, 6), (1, 2)(3)(4)(5, 6),

(1, 5)(2, 6)(3, 4), (1, 5, 2, 6)(3, 4), (1, 6, 2, 5)(3, 4), (1, 6)(2, 5)(3, 4). The first four do not involve a left-right flip, and the last four do. The generating function for this problem is 1 (Z6 + 2Z4Z + Z2Z2 + 2Z3 + 2Z Z ) 8 1 1 2 1 2 2 2 4

2 2 2 4 4 4 where Z1 = z1 + z2 + z3, Z2 = z1 + z2 + z3, Z4 = z1 + z2 + z3. Illustration 19.3: Mathematica calucation using G. Using Mathematica to expand this out we see that there are 171 inequivalent colorings using three colors, 7 of which involve 1 red vertex, 1 blue vertex, and 4 green vertices. Exercise 19.4: Find these 7 inequivalent colorings. The automorphisms in H are

(1)(2)(3)(4)(5)(6), (1, 6)(2, 5)(3, 4).

The generating function is 1 (Z6 + Z2). 2 1 3

Illustration 19.5: Mathematica calculation using H.

10 Using Mathematica to expand this out we see that there are 378 inequivalent colorings using three colors, 15 of which involve 1 red vertex, 1 blue vertex, and 4 green vertices. Exercise 19.6: (a) Find these 15 inequivalent colorings. (b) Classify these 15 inequivalent colorings by equivalence class with respect to the group G.

Chapter 18 Exercises, p. 473: (6) There are 12 automorphisms of C6: 6 choices for where to send 1, and 2 choices for where to send 2. (7) There are 24 automorphisms of the : where to send 1, and how to permute the other three vertices. (8) There are 16 automorphisms of C8. (9) There are four choices of outer corner for 1, and 2 choices for the relative positions of its outer neighbors. This yields 8 automorphisms. We get another 8 by sending 1 to an inner position. Total: 16 automorphisms. Chapter 18 Supplementary Exercises, p. 476: (25) same as (10). (26) same as (8). (27) same as (7).

11