Computation of the cycle index polynomial of a CS497-report

Rohit Gurjar Y5383 Supervisor: Prof Piyush P. Kurur Dept. Of Computer Science and Engineering, IIT Kanpur November 13, 2008

Abstract Computing cycle index polynomial of a is known to be #P -complete. In this report we give some introduction to the problem and describe some permutation groups for which the computation of cycle index polynomial is easy.

1 Introduction

Definition 1. Cycle index polynomial of a group G of degree n is defined as

1 X c (g) c (g) P (z , z . . . z ) = z 1 z 2 . . . zcn(g) G 1 2 n |G| 1 2 n g∈G where ci(g) represents the number of cycles of length i in the disjoint cycle decomposition of g.

1.1 Application Let G be a permutation group acting on X = {0, 1, . . . n − 1} and Ω = {f : f is a function from X to C}, where C be a finite of alphabet of cardinality k. We define a on the set Ω by g(φ)(x) = φ(g−1(x)) for each φ ∈ Ω The action of G partitions Ω into a number of orbits, being the equivalence classes of Ω under the equivalence relation that identifies α and β whenever there exists g ∈ G mapping α to β. Then we know the following theorem.

1 Theorem 1. Let C, X and G be defined as above. Then the number of orbits of Ω under the action of G is

PG(k, k, . . . k).

C can be a set of colors. Then the expression PG(k, k, . . . k) gives the num- ber of different color patterns of X.

Definition 2. Let w : C → R be a map which assigns a weight from R (or any ring) to each element of C. Then the weight of φ ∈ Ω, with respect to the weight Q function w is given by, w(φ) = x∈X w(φ(x)). Now, for each g ∈ G and φ ∈ Ω, Y Y Y w (g(φ)) = w (g(φ)(x)) = w φ(g−1(x)) = w (φ(x)) = w(φ) x∈X x∈X x∈X

So, the elements of Ω in the same orbit, under the action of G, will have same weight. So we can define the following.

Definition 3. Suppose ∆ ⊂ Ω be an orbit under the action of G. Then the weight of ∆, denoted w(∆), is defined to be equal to w(φ) for any φ ∈ ∆.

Theorem 2 (Polya’s Enumeration Theorem). With the above definitions and notations X I = w(∆) = PG(x1, x2 . . . xn), ∆ where the summation goes over distinct orbits of Ω under the action of G and P i xi = c∈C w(c) . We can see that cycle index polynomial of a permutation group G may be computed at a specified point, directly from definition(1) by explicit enumera- tion of the elements of G. In general, however, the order of G is exponentially larger than its input size, say a list of generators. Generally, degree n of the permutation group G is taken as the measure of input size. So, we want to compute the cycle index polynomial at a specified point in the time polynomial in degree n. It is known that the problem of computing cycle index polynomial for a group is #P -complete. The proof (given in [1]) involves a polynomial-time reduction from finding number of independent sets in a graph(a #P -complete problem) to computing cycle index polynomial of a permutation group. The proof suggests that that the problem of computing cycle index polynomial is #P -complete even for abelian groups. Here we describe some special permuta- tion groups for which the computation of cycle index polynomial is easy (can be computed in polynomial time).

2 2 Special Permutation Groups

Notation 1. Let G be a permutation group with degree n. Consider the permu- tation g ∈ G, if g is the product of a cycle of length l1, a cycle of length l2 and so on till cycle of length lk, then we say g has a cycle struture P (g) = zl1 zl2 . . . zlk . Notation 2. Let G be a permutation group with degree n. Consider a set of H ⊂ G, then we say X P (H) = P (g) g∈H

2.1 Cyclic Groups Suppose the G with degree n acting on Ω = {1, 2, . . . n}, is generated by g having cycle structure P (g) = zl1 zl2 . . . zlk where 1 ≤ li ≤ n ∀i. It is easy to see that |G| = lcm{l1, l2 . . . lk} which can be exponential in n. In general we do not see any easy way to compute cycle index polynomial for cyclic groups. But it is easy in some special cases given below.

Case 1 When k = 1 i.e., g = (1, 2, 3 . . . n) and |G| = n. So, the cycle index polynomial can be computed very easily. It is given by

1 1 X n/d P (G) = φ(d)z n n d d|n .

Case 2

m |G| = p , where p is a prime, this case is also easy. Because |G| = lcm{l1, l2 . . . lk} = m m m p so, ∃li s.t. li = p . Hence |G| = p ≤ n. The cycle index polynomial is given by m 1 1 X i P (G) = φ(pm−i)P (gp ) pm pm i=1 .

Case 3

If li 6= lj then gcd{li, lj} = 1 ∀i, j ∈ {1, 2 . . . k}, i.e., distinct lis are pairwise relatively prime. Let us assume that all lis are distinct. The results can be easily generalised to the other case.

Let Si ⊂ Ω be the set of elements in the li-cycle of g. Consider the l1 H0 = hg i of group G. This is the subgroup of all permutations in G, which

fixes all elements in S1. Let right cosets of H0 in G be {H0,H1,...Hl1−1} and

3 the corresponding representatives are {g0, g1 . . . gl1−1}. It is easy to see that Pl1−1 P (G) = i=0 P (Hi)

0 Let G1 and G1 be permutation groups acting on S1 and Ω\S1 respectively 0 0 0 and for every h ∈ G we can write h = h1 × h1 where, h1 ∈ G1 and h1 ∈ G1, 0 0 s.t. h1(i) = h(i) ∀i ∈ S1 and h1(i) = h(i) ∀i ∈ Ω\S1. Let g = g1 × g1, where 0 0 l1 0 l1 g1 ∈ G1 and g1 ∈ G1. Now, we can see that H0 = hg i ≈ hg1 i. Now, because 0 l1 0 0 ∀j ∈ {1, 2, . . . k} l1 and lj are relatively prime, hg1 i = G1. So, G1 ≈ H0. Now, i Hi = g H0 i 0 i Hi = (g1 × g1 )H0 i 0 i 0 Hi = (g1 × g1 )G1 0 i 0 0 i 0 0 g1 ∈ G1, so g1 G1 = G1. Hence,

i 0 Hi = g1 × G1

So, l1−1 ! X i 0 P (G) = P (g1) × P (G1) i=0 0 P (G) = P (G1) × P (G1)

Inductively, P (G) = P (G1)×P (G2) · · ·×P (Gk), where for every j ∈ {1, 2 . . . k}, Gj be permutation group acting on Sj, and for every h ∈ G we can write h = h1 × h2 · · · × hk where, hj ∈ Gj s.t. hj(i) = h(i) ∀i ∈ Sj. Now, |Gj| = lj ≤ n, so P (Gj) can be computed easily for all j ∈ {1, 2 . . . k}. Then the cycle index polynomial will be given by 1 1 P (G) = (P (G ) × P (G ) · · · × P (G )) |G| |G| 1 2 k

2.2 Computing cycle index polynomial for symmetric group(whole permutation group) can be done easily because of its symmetry. Let G be the symmet- ric group acting on Ω = {a1, a2, . . . an}. Consider the following definition for group G ∀i ∈ {1, 2, . . . n}, X Pi(G) = P (g) g∈G an is in a i−cycle in g

Pn We can see that P (G) = i=1 Pi(G). Consider the subgroup H0 of all permu- tations in G which fixes an. Consider H ≈ H0 as acting on Ω\{an}. For H,

4 Pi(H), would be defined like this, X Pi(H) = P (g) g∈H an−1 is in a i−cycle in g

Note that Pn(H) = 0. Because in any g ∈ H maximum length of a cycle can be n − 1. We give the following recursive algorithm for computing cycle index polynomial for a symmetric group at the point (z1, z2 . . . zn).

Algorithm 1 cycle-index(G) Require: A symmetric group G with degree n. Ensure: P (G) and Pi(G) ∀i ∈ {1, 2, . . . n} at the point (z1, z2 . . . zn) 1: if n == 1 then 2: return {z1, z1} 3: else 4: {P (H),P1(H),P2(H) ...Pn−1(H)} ← cycle-index(H) 5: P1(G) ← z1P (H) 6: for i ← 2 to n do   zi 7: Pi(G) ← (n − 1) Pi−1(H) zi−1 8: end for 9: P (G) ← P1(G) + P2(G) ··· + Pn(G) 10: return {P (G),P1(G),P2(G) ...Pn(G)} 11: end if

1 Then the cycle index polynomial of G will be given by n! P (G). We can see that the algorithm takes O(n2) time.

Theorem 3. With the notations given above, P1(G) = z1P (H) and Pi(G) =   zi (n − 1) Pi−1(H) ∀i ∈ {2, 3, . . . n}. And hence, the algorithm is correct. zi−1

Proof. Consider the case when i = 1. Note that, {g ∈ G|an is in a 1 − cycle in g} = {g ∈ G|g fixes an} = H0. So, P1(G) = P (H0) = z1P (H). Now, when i ≥ 2, let us say the right cosets of H0 in G are {H0,H1,H2 ...Hn−1} and the corresponding representatives are {I, (an, a1), (an, a2) ... (an, an−1)}, where Pn−1 I is the identity element of G. Now, we can see that, P (G) = j=0 P (Hj). We can also write that n−1 X Pi(G) = Pi(Hj) (1) j=0 X where Pi(Hj) = P (g).

g∈Hj an is in a i−cycle in g

5 We know that Hn−1 = H0gn−1, where gn−1 = (an, an−1). We can easily see that (b, c, d, e . . . ).(a, b) = (a, b, c, d, e . . . )

So, suppose h ∈ H0 s.t. P (h) = z1zl1 zl2 . . . zlk , and an−1 is in l1-cycle. Then

P (hgn−1) = zl1+1zl2 . . . zlk . So, it is clear that ∀i ≥ 2   zi Pi(H0gn−1) = Pi−1(H) zi−1   zi Pi(Hn−1) = Pi−1(H) (2) zi−1 Notation 3. For any g ∈ G, let ( P (g) if an is in a i-cycle in g Pi(g) = 0 otherwise. X So, we can say that Pi(Hj) = Pi(g).

g∈Hj Let h ∈ Hn−1, consider the function f s.t. f(h) = (aj, an−1)h(aj, an−1) for some j ∈ {1, 2 . . . n − 2}. For some h0 ∈ H0, we can write h = h0(an, an−1), and so f(h) = (aj, an−1)h0(an, an−1)(aj, an−1) = (aj, an−1)h0(aj, an−1)(an, aj) = 0 0 h0(an, aj). It is easy to see that h0 = (aj, an−1)h0(aj, an−1) ∈ H0. So, f(h) ∈ Hj. The cycle structures of h and f(h) are same, except that the positions of an−1 and aj are swapped. So, we can say that Pi(h) = Pi(f(h)) ∀i ∈ {1, 2, . . . n}. Also, it is easy to see that f : Hn−1 → Hj is a . So, X Pi(Hn−1) = Pi(h)

h∈Hn−1 X = Pi(f(h))

h∈Hn−1 X 0 = Pi(h ) 0 h ∈Hj

= Pi(Hj) ∀j ∈ {1, 2, . . . n − 2} (3) From (1), n−1 X Pi(G) = Pi(Hj) j=0 n−1 X = Pi(Hj) {∵ H0 fixes an j=1

= (n − 1)Pi(Hn−1) {from (3)   zi = (n − 1) Pi−1(H) {from (2) zi−1

6 2.3 Let G be a permutation group with degree n and H be a subset of G such that H = {g|g ∈ G and g is an even permutation}. It is easy to see that H is a subgroup of G. So, consider the following Lemma 1. |G| = 2 × |H|

Proof. Let the left cosets of H in G be {H,H1,H2 ...Hk} and their represen- tatives are {I, a1, a2 . . . ak} respectively. It is easy to see that ai is an odd −1 permutation for all 1 ≤ i ≤ k. So, for all 1 ≤ i, j ≤ k, the element aiaj , will −1 be an even permutation and so aiaj ∈ H. Hence ai and aj are in same coset. And this is true for all 1 ≤ i, j ≤ k. So k = 1, and there are only two left cosets of H in G. Hence, |G| = 2 × |H|. Theorem 4.

PH (z1, z2 . . . zn) = PG(z1, z2 . . . zn) + PG(x1, x2 . . . xn) i−1 where xi = (−1) zi. Proof.

1 X c (g) c (g) P (x , x . . . x ) = x 1 x 2 . . . xcn(g) G 1 2 n |G| 1 2 n g∈G

1 X P c (g)(i−1) c (g) c (g) = (−1) i i z 1 z 2 . . . zcn(g) |G| 1 2 n g∈G

1 X c (g) c (g) = sgn(g)z 1 z 2 . . . zcn(g) |G| 1 2 n g∈G where ( 1 if g is an even permutation, sgn(g) = −1 if g is an odd permutation. Now, it is easy to see that

1 X c (g) c (g) P (x , x . . . x ) + P (z , z . . . z ) = 2 × z 1 z 2 . . . zcn(g) G 1 2 n G 1 2 n |G| 1 2 n g∈H

1 X c (g) c (g) = z 1 z 2 . . . zcn(g) |H| 1 2 n g∈H

= PH (z1, z2 . . . zn)

So, cycle index polynomial at any point for the alternating group can be computed by computing the cycle index polynomial for the symmetric group at two points.

7 3 Another Approach

The problem of counting the number of matchings in a graph is also known to be #P -complete. Another version of this problem is to find the sum of weights of all matchings of a weighted graph, where weight of a matching is the prod- uct of weights of edges in the matching. In the special case, when the graph is planar, the problem is easy and known to be in class NC. Now, computing the sum of weights of all matchings of a weighted graph and computing cycle index polynomial of a permutation group can be reduced to each other. So, the idea is to see for which groups the cycle index problem reduces to the matching problem with the planar graph case. For those groups computing cycle index polynomial will be easy.

For example consider the graph G1 with vertex set V = {v1, v2 . . . v2n}, and edge set E = {(vi, vn+i)|1 ≤ i ≤ n}, with all the weights z1. It is easy to see that computing cycle index polynomial for the trivial group reduces to the matching problem for G1.

However the reduction does not look easy for any nontrivial group even in very simple cases. And any such nontrivial groups could not be found.

4 Acknowledgements

I would like to sincerely thank Prof. Piyush P. Kurur, for his constant encour- agement and guidance throughout this work.

References

[1] Mark Jerrum, Computational P´olya Theory, In Surveys in (1995), 103-118.

[2] A.K. Lal, Lecture Notes on Discrete Mathematics, available at http:// home.iitk.ac.in/∼arlal/book/mth202.pdf

[3] Peter J. Cameron, Notes on Counting, available at http://www.maths.qmw. ac.uk/∼pjc/notes/counting.pdf

8