On computing the distinguishing and distinguishing chromatic numbers of interval graphs and other results Christine T. Cheng Department of Computer Science University of Wisconsin–Milwaukee, Milwaukee, WI 53211, USA.
[email protected] April 1, 2009 Abstract A vertex k-coloring of graph G is distinguishing if the only automorphism of G that preserves the colors is the identity map. It is proper-distinguishing if the coloring is both proper and distinguishing. The distinguishing number of G, D(G), is the smallest integer k so that G has a distinguishing k-coloring; the distinguishing chromatic number of G, χD (G), is defined similarly. It has been shown recently that the distinguishing number of a planar graph can be determined efficiently by counting a related parameter – the number of inequivalent distinguishing colorings of the graph. In this paper, we demonstrate that the same technique can be used to compute the distinguishing number and the distinguishing chromatic number of an interval graph. We make use of PQ-trees, a classic data structure that has been used to recognize and test the isomorphism of interval graphs; our algorithms run in O(n3 log3 n) time for graphs with n vertices. We also prove a number of results regarding the computational complexity of determining a graph’s distinguishing chromatic number.
1
Introduction
A (vertex) k-coloring of graph G = (V, E) is a mapping φ : V → {1, 2, . . . , k}. The coloring is proper if no two adjacent vertices of G are assigned the same color. The coloring is distinguishing if the only automorphism of G that preserves the colors is the identity map. It is properdistinguishing if the coloring is both proper and distinguishing. The chromatic number of G, χ(G), is the smallest integer k so that G has a proper k-coloring; the distinguishing number of G, D(G), and the distinguishing chromatic number of G, χD (G), are defined similarly. Distinguishing numbers were first introduced by Albertson and Collins [2] in 1996. The parameter can be thought of as a measure of a graph’s symmetry; that is, if G and G0 have the same number of vertices but D(G) > D(G0 ), then G is more symmetric than G0 because more colors are needed to destroy its automorphisms than those of G0 . Of interest to us is the computational complexity of determining a graph’s distinguishing number. The best known result is due to Russell and Sundaram [17] who showed that the decision version of the problem belongs to AM, the set of languages for which there are Arthur and Merlin games. However, when G is restricted to certain graph families such as cycles, hypercubes, and acyclic graphs, the problem can be solved efficiently [2, 5, 7, 9, 4]. More recently, Arvind et al.[3] proved that when G is a planar graph, D(G) can be computed in O(n5 log3 n) time, where n is the number of vertices of G. Their approach, as was the case for trees [9, 4], involved counting a parameter related to D(G) – the number of inequivalent distinguishing k-colorings of G. This is similar to
1
Graph Family \ Problem G is an arbitrary graph G is a rooted tree G is a planar graph G is an interval graph
Is χ(G) ≤ k? NP-complete P NP-complete P
Is D(G) ≤ k? AM P P P∗
Is χD (G) ≤ k? NP-hard∗ P∗ NP-hard∗ P∗
Figure 1: The table summarizes the computational complexities of the problems on the top row. The contributions of this paper are marked with an asterisk. the idea of counting the number of proper k-colorings of a graph (i.e., its chromatic polynomial) to determine its chromatic number. What is interesting is that this seemingly roundabout method does lead to an efficient algorithm for computing D(G) when G is planar. An intriguing question is – for what other graph families will this approach work? Distinguishing chromatic numbers are due to Collins and Trenk [11] and were introduced in 2006. Not surprisingly, less is known about this graph parameter, although Collins and Trenk did determine the distinguishing chromatic numbers of paths and cycles among others, and bounded the corresponding numbers of trees and arbitrary connected graphs. In particular, as far as we know, the computational complexity of determining a graph’s distinguishing chromatic number has not been studied. In this paper, we prove the following. First, we show that the decision version of the problem of determining if a graph has a proper-distinguishing k-coloring is NP-hard when k ≥ 3. In fact, it remains NP-hard when k = 3 and the graph is planar with maximum degree at most 5. Second, we show that when T is a rooted tree with n vertices, χD (T ) can be determined in O(n3 log3 ∆(T )) time where ∆(T ) is the maximum degree in T . The technique we use is similar to the one for computing D(T ) [9, 4]. Third, and the most substantial of our results, we show that Arvind et al.’s approach can be generalized to compute the distinguishing numbers and the distinguishing chromatic numbers of interval graphs. We make use of PQ-trees [6, 16], a data structure that was invented in the mid-1970’s and was used for recognizing and testing the isomorphism of interval graphs. It also captures the automorphisms of an interval graph by decomposing it into a tree-like structure. When the graph has n vertices, our algorithms run in O(n3 log3 n) time. The table in Figure 1 summarizes our results in light of what was previously known. In Section 2, we prove the first of our results and review important facts about interval graphs and PQ-trees. We prove our second result in Section 3. We then present recursive counting formulas in Section 4 that serve as the basis of our third result – the algorithms that compute the distinguishing and distinguishing chromatic numbers of interval graphs described in Section 5. We conclude in Section 6. The input of our algorithms consists of a graph G and a positive integer k. When we say that they are efficient, we mean that their run-times are polynomial in the size of G and log k. Since the algorithms perform a significant amount of arithmetic operations and the computation of binomials involving numbers that are not necessarily small, we employ bit-level analysis in determining their run-times. We shall use the following simple facts (see [8] for more details). Let n and m be positive integers with n ≥ m. Then n + m and n − m can be determined n/m can be determined in O(log n log m) time. The binomial ¡inn ¢O(log n) time, while nm and 2 2 m can be computed in O(m log n) time. Note that these bounds are quite coarse; there are better estimates, for example, for multiplying two integers, etc. which we do not consider to simplify the run-time analysis of the algorithms.
2
Preliminaries
We shall refer to graph G colored by φ as (G, φ). We say that two colorings φ and φ0 of G are equivalent if there is an automorphism of G that maps (G, φ) to (G, φ0 ). Notice that if
2
φ is a distinguishing coloring, all colorings equivalent to it are also distinguishing. The same holds true when φ is a proper-distinguishing coloring. Let C(G, k) contain all the k-colorings of G. Let χ(G, k) denote the number of proper k-colorings of G, and L(G, k) be the number of distinguishing k-colorings of G. Define D(G, k) and χD (G, k) to be the number of equivalence classes in C(G, k) that contain (only) distinguishing colorings and (only) proper-distinguishing colorings of G respectively. Below we state a number of important facts about these parameters. The results for D(G) and D(G, k) were proved in [3]; the arguments extend to χD (G) and χD (G, k) in a straightforward manner. Fact 1 Let G be a connected graph and ΓG denote the automorphism group of G. Let k be a positive integer. (a) D(G) = min{k : D(G, k) > 0} and χD (G) = min{k : χD (G, k) > 0}. (b) Each equivalence class of C(G, k) that contains distinguishing colorings has size |ΓG |. Hence, G has D(G, k)×|ΓG | distinguishing k-colorings and χD (G, k)×|ΓG | proper-distinguishing k-colorings. (c) Let H = αG (i.e., H is made up of α copies of G). Then D(H) = min{k : D(G, k) ≥ α} and χD (H) = min{k : χD (G, k) ≥ α}. Fact 1(c) illustrates why throughout the paper we are more interested in counting the number of equivalence classes of C(G, k) that contain distinguishing and proper-distinguishing colorings than in counting the actual number of distinguishing and proper-distinguishing k-colorings of G – when there are multiple copies of G, we cannot just assign each one a distinguishing or a proper-distinguishing k-coloring, the colorings have to be pairwise-inequivalent as well. That is, the colorings have to come from different equivalence classes of C(G, k). Let us now consider the computational complexity of χ-DIST(G, k): Given a graph G and a positive integer k, does G have a proper-distinguishing k-coloring? It is easy to verify that except for the graph consisting of a single node, all other graphs have no proper-distinguishing 1-colorings. Thus, χ-DIST(G, 1) is computationally trivial. In contrast, we have the following result when k ≥ 3. Theorem 1 When k ≥ 3, χ-DIST(G, k) is NP-hard. Proof Recall that when k ≥ 3, determining if a graph G has a proper k-coloring is NPcomplete [13]. Let us now show that this decision problem can be polynomially-reduced to χ-DIST(G, k). Assume that G has n vertices and m edges. Denote the vertices of G as 1, 2, . . . , n. Let Hn,i be the gadget formed by a cycle of size 2(n + i) with an edge between its first and fourth vertices. Construct the graph G0 by attaching the second vertex of Hn,i to vertex i of G via an edge for i = 1, . . . , n. First, we note that G0 has O(n2 ) vertices and O(m + n2 ) edges. Also, it can be constructed in time polynomial in n and m. Second, G0 is rigid (i.e., it has no non-trivial automorphisms) because the gadgets break all the non-trivial automorphisms of G. To see this, notice that the largest cycle that a vertex of G can be a part of has length at most n, while the largest cycle that a vertex of Hn,i is a part of has length 2n + 2i for i = 1, . . . , n. Hence, every automorphism of G0 must map each Hn,i to itself. In particular, it must map the second vertex of Hn,i to itself, and, consequently, every vertex of Hn,i to itself. This implies that every automorphism of G0 must also fix the vertices of G. When k ≥ 3, every proper k-coloring of G can easily be extended to a proper k-coloring of G0 by additionally coloring each Hn,i with any two of the k colors, making sure that the color assigned to its second vertex is distinct from the one assigned to vertex i of G. And since G0 is rigid, a proper k-coloring of G0 is also distinguishing. Thus, when χ(G) ≤ k, χD (G0 ) ≤ k. On the other hand, every proper-distinguishing k-coloring of G0 when restricted to G is a proper k-coloring of G. Hence, when χD (G0 ) ≤ k, χ(G) ≤ k. We have shown that the problem of determining if χ(G) ≤ k, k ≥ 3, polynomially-reduces to χ-DIST(G, k). The theorem follows. 2
3
Corollary 1 Suppose that G is a planar graph with degree at most 5. Then χ-DIST(G, 3) remains NP-hard. Proof When G is a planar graph with maximum degree at most 4, determining if χ(G) ≤ 3 is still NP-complete [13]. The same reduction in Theorem 1 proves the theorem. What we only have to verify is that G0 is also a planar graph with maximum degree at most 5. But this immediately follows from the fact that (i) each Hn,i is planar and can be appended to vertex i of G without destroying the planarity of the overall graph, and (ii) the maximum degrees of the vertices in G and Hn,i are 4 and 3 respectively. 2 The reader may wonder why we are not trying to prove the NP-completeness of χ-DIST(G, k). The reason is that it is not clear that the problem is in NP. Suppose that φ is a k-coloring of G. It is easy to determine if φ is proper, but it is not obvious how one might verify if φ is distinguishing in an efficient manner. Simply applying the definition of distinguishing colorings will require that we determine the automorphisms of G and then check if any of the non-trivial automorphisms are preserved by φ – but this may not be efficient since G can have an exponential number of automorphisms. It is also interesting to consider what the corresponding results are for χ-DIST(G, 2). An obvious requirement for a graph to have a proper-distinguishing 2-coloring is that it should be a bipartite graph with distinguishing number at most 2. However, it is not sufficient; for example, χD (C6 ) = 4 and χD (C2n ) = 3 for n > 3, but χ(C2n ) = 2 and D(C2n ) = 2 for n ≥ 3.
2.1
Interval graphs and PQ-trees
A graph G = (V, E) is an interval graph if the vertices of G can be represented as intervals on the real line, and two vertices are adjacent if and only if their corresponding intervals have nonempty intersections. Interval graphs have been used to model problems in such diverse fields as biology, operations research, and archeology. They are also standard examples of graphs whose chromatic numbers can be computed efficiently [14, 18]. Consider an ordering of the maximal cliques of G. We shall say that it has the consecutiveness property if, for each vertex v of G, the maximal cliques containing v appear consecutively in the ordering. Here is a characterization of interval graphs due to Fulkerson and Gross. Theorem 2 [12] A graph G = (V, E) is an interval graph if and only if there is an ordering of its maximal cliques that satisfies the consecutiveness property. In the mid-1970’s, Booth and Lueker used Theorem 2 to recognize interval graphs in linear time. They invented a data structure called PQ-trees for this purpose, and it has proven to be very useful for designing algorithms on interval graphs. Our discussion below is based on their papers [6, 16]. A PQ-tree T is a rooted, ordered tree whose internal nodes (i.e., non-leaf nodes) are either P-nodes or Q-nodes. It is proper if each P-node has at least two children and each Q-node has at least three children. The frontier of T is the ordering of its leaves from left to right; the frontier of a node t in T is the frontier of the subtree rooted at t, Tt . To transform T is to either arbitrarily reorder the children of one of its P-nodes or to reverse the order of the children of one of its Q-nodes. An ordering of T ’s leaves is consistent with T if it is the frontier of a tree obtained by applying a sequence of transformations to T . The consistent set of T contains all orderings of the leaves of T that are consistent with T . In our figures, we shall follow the convention that P-nodes are drawn with circles, Q-nodes with rectangles, and leaves with dots. Given a graph G = (V, E), a PQ-tree for G is a PQ-tree whose leaves represent the maximal cliques of G, and whose consistent set is made up exactly of the orderings of the maximal cliques of G that satisfy the consecutiveness property. From Theorem 2, we know that if there is a PQtree for G, G is an interval graph. Booth and Lueker proved that every interval graph also has a PQ-tree.
4
17 16 15 14 13 11 9 1
10
2
3
4
12 5
6
7
8
16,17 14,15
9
13
11 10
3 1
12
2
4
6 7
8
5
Figure 2: The lower figure is the PQ-tree for the graph induced by the set of intervals at the top. The characteristic nodes of each vertex and the spans of the vertices whose characteristic nodes are Q-nodes are also shown. Theorem 3 [6] Let G = (V, E) be an interval graph. A proper PQ-tree for G can be constructed in O(|V | + |E|)-time. It has O(|V |) nodes and is unique up to a sequence of transformations. Figure 2 shows a set of intervals and the accompanying PQ-tree for the graph it induces. Henceforth, when we consider a PQ-tree for G, we shall denote it as TG , and assume that it is proper. The uniqueness of TG suggests that it can be used for testing the isomorphism of interval graphs. And this is indeed the case. When G and G0 are isomorphic, TG and TG0 are isomorphic.1 However, the converse turns out to be false – one can construct a pair of nonisomorphic interval graphs whose PQ-trees are isomorphic. The problem lies in the fact that a graph’s PQ-tree does not contain enough information about the graph. Booth and Lueker’s solution was to label the nodes of the PQ-tree with the missing information. For each vertex v of G, define the characteristic node of v in TG , char(v), as the deepest node t in TG so that the frontier of t includes all the maximal cliques containing v. Let t1 , t2 , . . . , tr 1
Since TG and TG0 are PQ-trees, an isomorphism from the vertices of TG to those of TG0 should not only preserve adjacencies, it should also map P-nodes to P-nodes and Q-nodes to Q-nodes. Furthermore, it should respect the behavior of Q-nodes. That is, if the isomorphism maps t, a Q-node in TG whose children are t1 , t2 , . . . , tr ordered from left to right, to t0 , whose children are t01 , t02 , . . . , t0r ordered from left to right, then it maps each ti to t0i or each ti to t0r+1−i .
5
denote the children of char(v), ordered from left to right. Interestingly, there is always a range of indices span(v) = [i, j] = {i, i + 1, . . . , j} so that the union of the frontiers of ti , ti+1 , . . . , tj consists precisely of all the maximal cliques containing v. In particular, if char(v) is a P-node, it is always the case that span(v) = [1, r]. Here is the Booth-Lueker labeling: • When t is a P-node or a leaf, set label(t) equal to |char−1 (t)| (i.e., the number of vertices of G that have t as their characteristic node). • When t is a Q-node, lexicographically sort the spans of all the vertices in char−1 (t) in a non-decreasing order, and then concatenate them to form label(t). If t is a Q-node and label(t) = [i1 , j1 ][i2 , j2 ] . . . [ir , jr ], the complement of label(t) is obtained by lexicographically sorting the spans [r + 1 − j1 , r + 1 − i1 ], [r + 1 − j2 , r + 1 − i2 ], . . . , [r + 1 − jr , r + 1 − ir ] in a non-decreasing order and then concatenating them. That is, the complement of label(t) is the label of t if the order of its children are reversed. Lemma 1 [16] The labeled PQ-tree of G = (V, E), TGL , contains enough information to reconstruct G up to isomorphism. Moreover, the labels can be created in O(|V | + |E|) time. Given the labeled PQ-trees of two graphs, we shall say that they are L-isomorphic if the PQtrees are isomorphic, corresponding P-nodes have the same labels, and corresponding Q-nodes either have the same labels or their labels are complements of each other. Theorem 4 [16] Two interval graphs G and G0 are isomorphic if and only if their labeled PQ-trees TGL and TGL0 are L-isomorphic. Booth and Lueker then presented a linear-time algorithm that takes TGL as an input and outputs a canonical labeling of the tree so that, for any two internal nodes t and t0 that are at the same distance from the root of TGL , t and t0 have the same canonical labels if and only if TtL and TtL0 are L-isomorphic. Using this same algorithm, they can also determine if two labeled PQ-trees TGL and TGL0 are L-isomorphic, allowing them to prove the following: Theorem 5 [16] Interval graph isomorphism can be decided in time linear in the sizes of the graphs. Colbourn and Booth extended these results further to the automorphisms of interval graphs. Theorem 6 [10] Let G be an interval graph and TG be its PQ-tree. Every automorphism of TG induces a distinct automorphism on G. Conversely, every automorphism of G is completely determined by an automorphism of TG together with a permutation of the vertices with the same characteristic nodes and spans.
3
Warm-up: Rooted trees
As a warm-up to our main results, we first consider the problem of computing the distinguishing chromatic number of a rooted tree T . Our solution mimics the one used in [9] for computing the distinguishing number of T . For each vertex v in T , let Tv denote the subtree of T rooted at v. A characterization of the distinguishing k-colorings of T was established in [9]. The next lemma extends this result to the proper-distinguishing k-colorings of T by additionally requiring the colorings to be proper. Lemma 2 Let T be a tree rooted at r∗ . A k-coloring φ of T is proper-distinguishing if and only if the following three conditions hold: (a) for each child v of r∗ , φ when restricted to Tv is proper-distinguishing, (b) for every pair of distinct children v and w of r∗ , (Tv , φ|Tv ) and (Tw , φ|Tw ) are not isomorphic, (c) the color assigned to r∗ is different from the colors assigned to the children of r∗ . Below is a formula for computing χD (T, k).
6
Theorem 7 Let T be a tree rooted at r∗ . Let T contain all the subtrees of T rooted at the children of r∗ . Suppose that T consists of g isomorphic classes, and the ith isomorphic class contains mi copies of the rooted tree Ti ; i.e., T = m1 T1 ∪ m2 T2 ∪ . . . ∪ mg Tg . Then ¶ g µ k−1 Y χD (Ti , k) k χD (T, k) = k . mi i=1 Proof From Lemma 2, an equivalence class of C(T, k) containing proper-distinguishing colorings only is characterized by (i) the color of r∗ and (ii) for i = 1, . . . , g, the set of mi equivalence classes of C(Ti , k) that contain the proper-distinguishing colorings of the mi copies of Ti , with the additional condition that the colors assigned to the roots of the mi copies Ti are different from the color assigned to r∗ . Now, there are k colors available for r∗ . Once the color for r∗ has been assigned, say c, there are χD (Ti , k)/k equivalence classes where the root of Ti is also colored c. Thus, colorings of the copies of Ti can only come from k−1 k χD (Ti , k) equivalence classes, mi of which must be chosen. By the product rule of counting, the above equation for χD (T, k) is correct. 2 In [9], a similar formula for D(T, k) was also proven: ¶ g µ Y D(Ti , k) D(T, k) = k . mi i=1 Since the formula in Theorem 7 is recursive – the value for the rooted tree T is based on the values for the smaller rooted subtrees Ti , i = 1, . . . , g – the same formula can be used repeatedly until we reach the “bottom” which, in this case, occurs when a tree consists of a leaf of T . What is key is that the total number of recursive steps is bounded by the size of T . Here is our algorithm for computing χD (T, k): do a postorder traversal of T (i.e., before processing a vertex, process all its children first). If v is a leaf, set χD (Tv , k) = k since all k-colorings of v are proper and distinguishing. If v is not a leaf, use the formula in Theorem 7 to compute χD (Tv , k). Return the value computed at the root, which must be χD (T, k). This leads us now to the following result: Theorem 8 Let T be a rooted tree with n vertices. Let ∆(T ) denote the largest degree of a vertex in T . Computing χD (T ) takes O(n3 log3 ∆(T )) time. Proof In [1], Aho et al. described a linear-time tree isomorphism algorithm that labels the vertices of a rooted tree so that two vertices that are at the same distance from the root are assigned the same label if and only if their respective subtrees are isomorphic.2 By scanning these labels, we can partition the subtrees rooted at the children of each vertex v into isomorphic classes and determine the Ti ’s and the mi ’s described in Theorem 7 in linear-time as well. Now, consider the formula in Theorem 7 for χD (Tv , k) given k, χD (Ti , k) and mi for i = 1, . . . , g. Let |Ti | denote the number of vertices in Ti . Since χD (Ti , k) ≤ k |Ti | and mi |Ti | ≤ n, ¡ ¢ D (Ti ,k)/k it is easy to show that computing the ith binomial (k−1)χm takes O(n2 log2 k) time, i so computing the g binomials take O(gn2 log2 k) time. And since χD (Tv , k) ≤ k n , multiplying together the g binomials and k takes O(gn2 log2 k) time as well. But g is bounded above by rv , the number of children of v. Hence, P the time spent computing the χD (Tv , k) values at all the internal vertices v of T takes O( v rv n2 log2 k) = O(n3 log2 k) time. Finally, Collins and Trenk [11] proved that the distinguishing chromatic number of a tree never exceeds its maximum degree. Using the algorithm we described above, we can do a binary search over the range [1, ∆(T )] to find the smallest k for which χD (T, k) > 0, so computing χD (T ) takes O(n3 log3 ∆(T )) time. 2 We leave it up to the reader to generalize the above technique to compute the distinguishing chromatic numbers of unrooted trees and forests by making use of the fact that every unrooted tree either has a unique center or two adjacent centers. 2
Booth and Lueker’s canonical labeling of labeled PQ-trees is based on this algorithm.
7
4
The formulas
Let G be an interval graph. In this section, we present formulas for D(G, k) and χD (G, k) similar to those for rooted trees in that they are based on smaller interval graphs. Our guide will be the PQ-tree for G, TG , because it captures the automorphisms of G. That is, as stated in Theorem 6, we can infer the automorphisms of G from the automorphisms of TG . For each node t of TG , let Gt be the subgraph of G induced by the set {v : char(v) is a vertex of Tt }. Clearly, each Gt is an interval graph as well. Theorem 9 Let G be an interval graph and TG its PQ-tree. Suppose that the root of TG , r∗ , is a P-node, there are g isomorphism classes in G = {Gt : t is a child of r∗ }, and the ith isomorphism class contains mi copies of Gti . Let nr∗ = |char−1 (r∗ )|. Then µ
k nr ∗
D(G, k) =
¶Y ¶ g µ D(Gti , k) mi i=1
and µ χD (G, k)
=
k nr ∗
¶Y ¶ g µ χD (Gti , k − nr∗ ) . mi i=1
Proof It is useful to view G as consisting of two parts. The upper part of G is the clique formed by the vertices in char−1 (r∗ ), while the lower part of G consists of the graphs Gt , t a child of r∗ , which, by assumption, is isomorphic to m1 Gt1 ∪ m2 Gt2 ∪ . . . ∪ mg Gtg . The vertices in the upper part are adjacent to all the vertices in the lower part. According to Theorem 6, every automorphism of G fixes the set char−1 (r∗ ). Hence, it is easy to establish that a k-coloring of G is distinguishing if and only if it assigns distinct colors to the vertices in char−1 (r∗ ), and pairwise inequivalent distinguishing k-colorings to the copies of Gti for i = 1, . . . , g. Thus, an equivalence class of C(G, k) containing only distinguishing colorings is characterized by (i) the set of nr∗ colors assigned to the vertices of char−1 (r∗ ), and (ii) the set of mi equivalence classes of C(Gti , k) that contain the inequivalent distinguishing colorings of the graphs isomorphic to ¡ ¢ Gti , i = 1, . . . , g. Given k colors, there are nkr∗ ways of picking the set of colors in (i), and ¡D(Gt ,k)¢ i ways of choosing the set of equivalence classes in (ii) for i = 1, . . . , g. By the product mi rule of counting, the first equation in the theorem follows. We take the same approach for solving χD (G, k), replacing distinguishing colorings with proper-distinguishing colorings in our discussion, with one important difference – the colors used for the upper part of G must be distinct from the colors used for the lower part of G since are available, are¢ ¡ k ¢ the overall coloring has to be proper. Hence, when k colors ¡χD (Gthere −1 ∗ ti ,k−nr ∗ ) ∗ sets of n colors that can be assigned to the vertices of char (r ) and r mi nr ∗ ways of choosing the set of mi equivalence classes containing the pairwise inequivalent properdistinguishing colorings of the graphs isomorphic to Gti , i = 1, . . . , g. By the product rule of counting, the second equation of the theorem follows. 2 Let us now consider the case when r∗ is a Q-node whose children are t1 , t2 , . . . , tr ordered from left to right. Let a and a0 be two vertices in char−1 (r∗ ). We say that a0 is a clone of a if span(a) = span(a0 ), and that a0 is a twin of a if span(a) = [ia , ja ] and span(a0 ) = [r + 1 − ja , r + 1 − ia ]. If a and a0 are twins, we designate a as the older twin if ia ≤ r + 1 − ja . (By our definition, every vertex a is a clone of itself, and if span(a) = [ia , ja ] and ia + ja = r + 1 then a is a twin of itself as well.) We also say that A ⊆ char−1 (r∗ ) is a representative set for char−1 (r∗ ) if it is a smallest-sized subset with the property that each a ∈ char−1 (r∗ ) has a clone in A. Furthermore, A0 ⊆ A is a sub-representative set for A if it is a smallest-sized subset with the property that each a ∈ char−1 (r∗ ) has a clone or an older twin in A0 . As suggested in the proof of Theorem 9, we shall again view the graph G as consisting of two parts. The upper part of G is the graph induced by the vertices in char−1 (r∗ ), where two
8
vertices are adjacent whenever their spans have a non-empty intersection. The lower part of G consists of the graphs Gt1 , Gt2 , . . . , Gtr . Each vertex a in the upper part is adjacent to all the vertices of Gti in the lower part whenever i ∈ span(a). Since every automorphism of TG maps r∗ to itself according to Theorem 6, it must also map the children of r∗ to themselves. But since r∗ is a Q-node, the latter has only two kinds of mapping: each ti is mapped to itself, or each ti is mapped to tr+1−i . Thus, there are also just two kinds of automorphisms of G – those that map each Gti to itself, or those that map each Gti to Gtr+1−i . Let Γ1 and Γ2 contain the automorphisms of G of the first and second kinds respectively. Notice that these automorphisms also induce certain actions on the upper part of G. The automorphisms in Γ1 map each vertex a ∈ char−1 (r∗ ) to one of its clones while the automorphisms in Γ2 map each vertex a ∈ char−1 (r∗ ) to one of its twins. Lemma 3 Let r∗ be a Q-node, t1 , t2 , . . . , tr be its children ordered from left to right, and A be a representative set of char−1 (r∗ ). For each a ∈ char−1 (r∗ ), let ma denote the number of clones of a in char−1 (r∗ ). For each ti , let Γti denote the automorphism group of Gti . Then |Γ1 | =
Y
ma !
r Y
|Γti |.
i=1
a∈A
And when Γ2 6= ∅, |Γ2 | = |Γ1 |. Proof Based on our definition of Γ1 , an automorphism of Γ1 is determined by a permutation of the clones of a for each a ∈ A and an automorphism of Gti for i = 1, . . . , r. Thus, |Γ1 | =
Y
ma !
r Y
|Γti |.
i=1
a∈A
Now, Γ1 is a subgroup of ΓG . When Γ2 6= ∅, it is a coset of Γ1 since πΓ1 = Γ2 when π ∈ Γ2 . It follows that |Γ1 | = |Γ2 |. 2 When Γ2 6= ∅, we say that t is reversible; otherwise, it is not reversible. We note that t is reversible if and only if the graphs Gti and Gtr+1−i are isomorphic for i = 1, . . . , r, and the number of clones of a is equal to the number of twins of a for each a ∈ char−1 (r∗ ). Theorem 10 Let G be an interval graph and TG its PQ-tree. Suppose that the root of TG , r∗ , is a Q-node whose children are t1 , . . . tr ordered from left to right. Let A be a representative set for char−1 (r∗ ) and A0 be a subrepresentative set for A. For each vertex a ∈ A, let ma denote the number of clones of a in char−1 (r∗ ). When t is not reversible, r Y µ k ¶Y D(G, k) = D(Gti , k); ma i=1 a∈A
otherwise, D(G, k) =
µ ¶ r Y µ k ¶ dr/2e Y 1 Y k Y D(Gti , k) − D(Gti , k) . ma i=1 ma i=1 2 0 a∈A
a∈A
Proof The approach in Theorem 9 will lead to the right formula for D(G, k) when t is not reversible. Here, we use a slightly different method so that we can unify our proofs for the case when t is not reversible and when it is reversible. A k-coloring of G destroys all the non-trivial automorphisms of Γ1 if and only if it assigns distinct colors to the clones of a for each a ∈ A and a distinguishing coloring to each Gti . Thus, there are r Y Y k! L1 = L(Gti , k) (k − ma )! i=1 a∈A
9
such k-colorings of G. When t is not reversible, L(G, k) = L1 and ΓG = Γ1 . Hence, D(G, k)
= = =
L(G, k) |ΓG | Q
k! a∈A (k−ma )!
Q
Qr i=1
Qr
L(Gti , k)
a∈A ma ! i=1 |Γti | µ ¶ r Y k Y D(Gti , k) ma i=1
a∈A
where the first and last equations follow from Fact 1b. When t is reversible, some of the k-colorings counted in L1 do not destroy all the automorphisms in Γ2 . We shall call such k-colorings bad. Based on our characterization of when Γ2 is not empty, a k-coloring is bad if and only if the set of distinct ma colors assigned to the clones of a is exactly the same as the set of colors assigned to the twins of a for each a ∈ A, and equivalent distinguishing k-colorings are assigned to Gti and Gtr+1−i for i = 1, . . . , r. In other words, every bad k-coloring of G can be constructed as follows. For each a ∈ A0 , assign distinct colors to the clones of a, and, when a is not a twin of itself, assign these same colors to the twins of a. For i = 1, . . . , dr/2e, pick a distinguishing k-coloring for Gti , and then pick an equivalent one for Gtr+1−i . Thus, there are Y
L2 =
a∈A0
k! (k − ma )!
Y
dr/2e
ma !
a∈A−A0
Y
L(Gti , k)
i=1
r Y
|Γti |
i=dr/2e+1
colorings in L1 that do not destroy all the automorphisms in Γ2 . Therefore, D(G, k) = =
L1 − L2 |Γ1 | + |Γ2 | µ ¶ r Y µ k ¶ dr/2e Y 1 Y k Y D(Gti , k) − D(Gti , k) . 2 ma i=1 ma i=1 0 a∈A
a∈A
2 Example continued. Consider the graph G induced by the intervals in Figure 2. Figure 3 shows the values of D(Gt , 2) at each node t of the PQ-tree. In particular, the root node r∗ is a reversible Q-node. According to Theorem 10, ·µ ¶µ ¶ µ ¶ ¸ 1 2 2 2 D(Gr∗ , 2) = × 2 × 12 × 2 − × 2 × 12 2 2 2 2 = (48 − 24)/2 = 12. The next lemma is needed to compute χD (G, k). We shall use the notation span(a) < span(a0 ) to mean that span(a) is lexicographically less than span(a0 ). Lemma 4 Let A be a representative set of char−1 (r∗ ). For each a ∈ A, let span(a) = [ia , ja ], and let ma denote the number of clones of a. When S ⊆ A, denote by HS the subgraph induced by the clones of the vertices in S. For each a ∈ S, let O(a, S) = {a0 ∈ S : span(a0 ) < span(a) and ia ∈ span(a0 )}. Then ¶ Y µk − P 0 ma0 χ(HS , k) a ∈O(a,S) Q . = ma a∈S ma ! a∈S
10
12
2
12
2
6 2 2
2
2
2
2
1
2
2
Figure 3: The numbers indicate the values of D(Gt , 2) at each node t of the PQ-tree. Proof Assume s = |S|. Order the vertices in S as a1 , a2 , . . . , as so that their spans are lexicographically increasing. (Note that since S ⊆ A and A is a representative set of char−1 (r∗ ), no two of these vertices have the same span.) Let Hi be the subgraph induced by the clones of a1 , . . . , ai . Notice that O(ai , S) consists of all vertices aj such that j < i and span(aj ) ∩ span(ai ) 6= ∅. That is, the clones of the vertices in O(ai , S) are precisely the neighbors of ai (and its clones) in Hi . Moreover, these neighbors of Pai form a clique since their spans all contain the left endpoint of the span of ai . Let Ki = k − a0 ∈O(ai ,S) ma0 . It follows that χ(Hi , k) = χ(Hi−1 , k)Ki (Ki − 1) · · · (Ki − mai + 1) since a proper k-coloring of Hi requires a proper k-coloring of Hi−1 together with a color assignment on ai and its clones that does not use any of the colors assigned to their neighbors. Hence, µ ¶ Y ¶ i µ χ(Hi , k) χ(Hi−1 , k) Ki Kj = Qi−1 = Qi mai m aj j=1 maj ! j=1 maj ! j=1 so
¶ s µ Y χ(H , k) χ(Hs , k) Kj Q S = Qs = . maj a∈S ma ! j=1 maj ! j=1
2 Theorem 11 Let G be an interval graph and TG its PQ-tree. Suppose that the root of TG , r∗ , is a Q-node whose children are t1 , . . . tr ordered from left to right. Let A be a representative set for char−1 (r∗ ) and A0 be a subrepresentative set for A. For each vertex a ∈ A, let span(a) = [ia , ja ] and let ma denote the number of clones of a. For S ⊆ char−1 (r∗ ), let HS be the subgraph of G induced by the clones of the vertices in S. For each a ∈ S, let O(a, S) = {a0 ∈ S : span(a0 ) < span(a) and ia ∈ span(a0 )}. For i = 1, . . . , r, let ni denote the number of vertices a ∈ char−1 (r∗ ) that has i ∈ span(a). When t is not reversible,
χD (G, k)
=
¶Y r Y µk − P 0 a ∈O(a,A) ma0 χD (Gti , k − ni ). ma i=1
a∈A
When t is reversible and there is a pair of adjacent twins a and a0 in char−1 (r∗ ) such that span(a) 6= span(a0 ),
11
P µ ¶ r 1 Y k − a0 ∈O(a,A) ma0 Y χD (Gti , k − ni ); 2 ma i=1
χD (G, k) =
a∈A
otherwise, χD (G, k) is equal to P µ ¶ r ¶ dr/2e Y µk − P 0 Y 0 1 Y k − a0 ∈O(a,A) ma0 Y m 0 a a ∈O(a,A ) χD (Gti , k − ni ) − χD (Gti , k − ni ) . 2 ma m a 0 i=1 i=1 a∈A
a∈A
Proof We begin with some observations that will help us with our proof. When HA , the upper part of G, is properly colored, adjacent vertices in HA are assigned different colors. Hence, for each a ∈ A, the clones of a are assigned distinct colors, and for i = 1, . . . , r, the vertices in HA which are adjacent to the vertices of Gti are assigned distinct colors as well. By using the characterization in the proof of Theorem 10, a k-coloring of G is proper and destroys all the non-trivial automorphisms of Γ1 if and only if it assigns HA a proper coloring, and it assigns each Gti a proper-distinguishing coloring using colors that are different from those used for the vertices in {a : a ∈ char−1 (r∗ ), i ∈ span(a)}. Given k colors, there are χ(HA , k) ways of properly coloring HA . Once HA is properly colored, there are χD (Gti , k − ni ) × |Γti | ways of choosing a proper-distinguishing coloring for Gti , i = 1, . . . , r. Therefore, the number of k-colorings of G that is proper and destroys all non-trivial automorphisms in Γ1 is L1 = χ(HA , k)
r Y
χD (Gti , k − ni ) × |Γti |.
i=1
Thus, when t is not reversible, χD (Gt , k) = = =
L1 |ΓG | Qr χ(HA , k) i=1 χD (Gti , k − ni ) × |Γti | Qr Q a∈A ma ! i=1 |Γti | r χ(H , k) Y Q A χD (Gti , k − ni ). a∈A ma ! i=1
When t is reversible, we differentiate between the case when there is a pair of adjacent twins a and a0 in char−1 (r∗ ) with span(a) 6= span(a0 ) and when there are no such vertices. In the first case, a proper coloring of HA immediately destroys every automorphism in Γ2 because the set of colors assigned to the clones of a must be completely distinct from those assigned to the twins of a. Hence, all the k-colorings counted in L1 also destroy all the automorphisms in Γ2 . χD (HA ,k) Qr Since t is reversible, |ΓG | = 2|Γ1 |, so χD (Gt , k) = Q i=1 χD (Gti , k − ni )/2. a∈A ma ! In the second case, every pair of adjacent twins have the same spans, making it possible for some of the k-colorings counted in L1 to not destroy all the automorphisms in Γ2 . Such bad colorings occur precisely when a proper coloring of HA assigned the same set of colors to the clones of a and to the twins of a for each a ∈ char−1 (r∗ ), and when equivalent properdistinguishing (k − ni )-colorings were assigned to Gti and Gtr+1−i for i = 1, . . . , r. Using the same analysis in the proof of Theorem 10, we note that these bad colorings on G are determined by the proper coloring assigned to HA0 and the proper-distinguishing coloring assigned to Gti for i = 1, . . . , dr/2e. Hence, there are L2 = χ(HA0 , k)
Y a∈A−A0
dr/2e
ma !
Y
χD (Gti , k − ni ) × |Γti |
i=1
r Y i=dr/2e+1
12
|Γti |
7
5
3
5
2 2 4
2
4
4
1
0
4
1
283,500
30
3
30
1 2 4
2
4
4
1
1
4
1
Figure 4: Let k = 7. The numbers on the top and lower PQ-trees indicate the values of kt and χD (Gt , kt ) respectively for each node t of the PQ-tree. k-colorings in L1 that do not destroy all the automorphisms in Γ2 . Therefore, χD (G, k)
= =
L1 − L2 |Γ1 | + |Γ2 | dr/2e r Y Y 0 1 χ(HA , k) χ(HA , k) Q χD (Gti , k − ni ) − Q χD (Gti , k − ni ) . 2 m ! a a∈A a∈A0 ma ! i=1 i=1
Applying Lemma 4, the formulas in the theorem follow. 2 Example continued. This time around, let us compute χD (G, 7) for the graph G induced by the intervals in Figure 2. Notice that in the recursive formulas we have developed for χD (G, k), the number of colors available for the smaller graphs Gt ’s can be smaller than k. In the algorithm we present in the next section, we use kt to keep track of the number of colors that can be used for Gt , for each node t in TGL . For k = 7, the top PQ-tree in Figure 4 shows the value of kt at
13
each node t. For example, the middle child of the root node has only 3 colors available because four of the seven colors will be used for vertices 14, 15, 16, 17. The lower PQ-tree in Figure 4 shows the value of D(Gt , kt ) at each node t. Since the root node r∗ is reversible and vertices 14 and 16 are adjacent twins with different spans in char−1 (r∗ ), according to Theorem 11, µ ¶µ ¶ 1 7 5 χD (Gr∗ , 7) = × 30 × 3 × 30 2 2 2 = 283, 500.
5
The algorithms
Our algorithms for computing D(G, k) and χD (G, k) when G is an interval graph are similar to the one we presented for rooted trees in Section 3. We shall use TGL , the labeled PQ-tree for G, since the labels of the nodes contain information that can be used to compute D(Gt , k) and χD (Gt , k) for each node t. We also note the recursive nature of TGL in the lemma below, which was somewhat implied in [16] and [10], and which we formally prove in the appendix. Lemma 5 Let G be an interval graph, and TGL its labeled PQ-tree. Let t be an internal node of TGL . Then TtL , the labeled subtree of TG at t, is the labeled PQ-tree for Gt . Together with Theorem 4, this lemma implies that for any two children of t, ti and tj , Gti and Gtj are isomorphic if and only if TtLi and TtLj are L-isomorphic. Hence, when the Booth-Lueker canonical labeling is applied to TGL , Gti and Gtj are isomorphic if and only if the canonical labels of ti and tj are the same. This observation allows us to easily partition {Gt0 : t0 is a child of t} into isomorphism classes when t is a P-node, and to determine whether Gti is isomorphic to Gtr+1−i , i = 1, . . . , r, when t is a Q-node and its number of children is r. We now describe our algorithm for computing D(G, k). DIST(G, k) Input: An interval graph G, a positive integer k. Output: D(G, k) 1. Construct TGL , the labeled PQ-tree for G. 2. Create a canonical labeling for TGL . 3. Do a postorder traversal of TGL . Let t be the current node. ¡ k ¢ a. When t is a leaf, set D(Gt , k) = label(t) . b. When t is a P-node, use Theorem 9. That is, for i = 1, . . . , g, identify a member Gti and deter¡ k ¢ Qg ¡D(Gt ,k)¢ i mine the size mi of the ith isomorphism class of G. Set D(Gt , k) = label(t) . i=1 mi c. When t is a Q-node, use Theorem 10. That is, determine the number ¡ ¢ Qmra of each a ∈ Q of clones A, where A is a representative set of char−1 (t). Set D(Gt , k) = a∈A mka i=1 D(Gti , k). Next, determine if t is reversible or not. If t is reversible, continue the post-order traversal of TGL ; else, obtain ma for each vertex a ∈ A0 , where A0 is a subrepresentative set of A. Subtract ¡ k ¢ Qdr/2e Q a∈A0 ma i=1 D(Gti , k) from D(Gt , k), and divide the result by 2. 4. Return D(Gr∗ , k). Theorem 12 Let G be an interval graph with n vertices. For any positive integer k, D(G, k) can be computed in O(n3 log2 k) time. Consequently, D(G) can be determined in O(n3 log3 n) time. ¡ k ¢ Proof When t is a leaf, Gt is a clique of size label(t) = |char−1 (t)|, and so D(Gt , k) = label(t) . The correctness of this base case, Theorems 9 and 10, and the fact that Gr∗ = G proves that DIST(G, k) outputs the correct answer.
14
For each node P t in TG , let rt denote the number of children of t. From Theorem 3, TG has O(n) nodes so t rt = O(n). We also note that since every vertex of G has a characteristic node P in TG , t |char−1 (t)| = n. Booth and Lueker has shown that steps 1 and 2 of the algorithm can be accomplished in time linear in the size of G. A post-order traversal of TGL takes O(n) time. The bottleneck of the algorithm clearly occurs in the computation of the D(Gt , k)’s at the nodes of TGL . Let us now carefully consider the amount of work performed when t is a leaf, a P-node or a Q-node. ¡ ¢ • When t is a leaf. Computing |chark−1 (t)| takes O(|char−1 (t)|2 log2 k) time. • When t is a P-node. Scanning the canonical labels of its children to determine g, Gti and mi for i = 1, . . . , g takes O(rt ) time. Since D(Gti , k) ≤ k |Gti | , where |Gti | denotes the number of ¡ ¢ vertices in Gti , and mi |Gti | ≤ n, it is straightforward to show that the ith binomial D(Gmtii ,k) takes O(n2 log2 k) time to compute. Thus, computing the g binomials take O(gn2 log2 k) time. ¡ ¢ k Again, computing |char−1 (t)| takes O(|char−1 (t)|2 log2 k) time. Finally, since D(Gt , k) ≤ k n ,
multiplying all the binomials together takes O(gn2 log2 k) time. Now, g ≤ rt so the amount of work performed at t takes O(|char−1 (t)|2 log2 k + rt n2 log2 k) time. • When t is a Q-node. Scanning label(t) (multiple times) to obtain ma and to determine if the number of clones of a and the number of twins of a are equal for each a ∈ A can be done in O(|char−1 (t)|2 ) time. Checking the canonical labels of t’s children to determine if Gti and Gtr+1−i for i = 1, . . . , r are isomorphic takes O(rt ) time. Hence, determining if t is reversible ¡ ¢ Q or not can be determined in O(|char−1 (t)|2 + rt ) time. Now, computing a∈A mka takes P O( a∈A m2a log2 k) = O(|char−1 (t)|2 log2 k) time. Since D(Gt , k) ≤ k n , computing the product ¡ k ¢ Qr Q 2 2 a∈A ma i=1 D(Gti , k) takes O((|A| + rt )n log k) time. Thus, regardless of whether t is reversible or not, the amount of work performed at t is O(|char−1 (t)|2 log2 k+|char−1 (t)|n2 log2 k+ rt n2 log2 k). Therefore, the run-time of DIST(G, k) is X O( |char−1 (t)|2 log2 k + |char−1 (t)|n2 log2 k + rt n2 log2 k) = O(n3 log2 k). t
To compute D(G), we use binary search to find the smallest k for which D(G, k) is positive. Since 1 ≤ D(G) ≤ n, this can be done by running DIST(G, k) O(log n) times, where k is bounded above by n each time. 2 Next, we present our algorithm for computing χD (G, k). As noted earlier, we use kt to keep track of the number of colors that can be used for Gt , for each node t in TGL . CHI-DIST(G, k) Input: An interval graph G, a positive integer k. Output: χD (G, k) 1. Construct TGL , the labeled PQ-tree for G. 2. Create a canonical labeling for TGL . 3. Do a preorder traversal of TGL (i.e., process a node first before any of its children). Set kr∗ = k. Let t be the current node. a. When t is a P-node, set kt0 = kt − label(t) for each child t0 of t. b. When t is a Q-node whose children are t1 , t2 , . . . , tr ordered from left to right, determine ni , the number of vertices in char−1 (t) that has i in their spans for i = 1, . . . , r. Set kti = kt −ni . c. When t is a leaf, continue the preorder traversal of TGL . 4. Do a postorder traversal of TGL . Let t be the current node. ¡ kt ¢ a. When t is a leaf, set χD (Gt , kt ) = label(t) .
15
b. When t is a P-node, use Theorem 9. That is, for i = 1, . . . , g, identify a member Gti and determine the size mi of the ith isomorphism class of G. Then, set χD (Gt , kt ) = ¡ kt ¢ Qg ¡χD (Gt ,kt )¢ i i . i=1 label(t) mi c. When t is a Q-node, use Theorem 11. That is, obtain ma and O(a, A) for each Q vertex a ∈ A, −1 where A is a representative set of char (t). Compute α A, t) = χ(H , k )/ A t ( a∈A ma ! using Qr Lemma 4. Set χD (Gt , kt ) = α(A, t) i=1 χD (Gti , kti ). Next, determine if t is reversible or not. If t is not reversible, continue the post-order traversal of TGL . If t is reversible and there is an a ∈ A0 with span(a) = [ia , ja ] such that ia + ja 6= r + 1 and ja ≥ (r + 1)/2, divide χD (Gt , kt ) by 2. Otherwise, obtain ma , and O(a, A0 ) for each vertex a ∈ A0 , where A0 is a subrepresentative set of A. Compute α(A0 , t) using Lemma 4. Qdr/2e Subtract α(A0 , t) i=1 χD (Gti , kti ) from χD (Gt , k) and divide the result by 2. 5. Return χD (Gr∗ , kr∗ ). Theorem 13 Let G be an interval graph with n vertices. For any positive integer k, χD (G, k) can be computed in O(n3 log2 k) time. Hence, χD (G) can be determined in O(n3 log3 n) time. Proof Again, the correctness of CHI-DIST(G, k) follows from setting χD (Gt , kt ) to the correct value when t is a leaf, Theorems 9 and 11, and the fact that Gr∗ = G. Steps 1 and 2 of the algorithm runs in time linear in the size of G. To compute the ni values in step 3b, we scan the span of each vertex a ∈ char−1 (t). If i ∈ span(a) = [ia , ja ], increment ni by 1. Hence, the amount of work that can be attributed to a is ja − ia , which is bounded by the number of maximal cliques of G that contain a. Thus, the total amount of work performed at step 3b is O(n2 ) since an interval graph can have at most O(n) maximal cliques. It is now straightforward to verify that step 3 can be accomplished in O(n2 ) time. Like DIST(G, k), computing χD (Gt , kt ) at each node t of TGL is the bottleneck of the algorithm. It is easy to see that when t is a leaf node or a P-node, the time spent is the same as that in DIST(G, k). When t is a Q-node, we have to additionally compute O(a, A) for each a ∈ A and O(a, A0 ) for each a ∈ A0 , but this will not dominate the time spent by the algorithm at t. Hence, the run-time of CHI-DIST(G, k) is the same as that of DIST(G, k). 2
6
Final Comments
In this paper, we have shown that the approach of counting the number of inequivalent distinguishing colorings and the number of inequivalent proper-distinguishing colorings of a graph is a fruitful one for the family of interval graphs. When G is an interval graph with n vertices, the approach yields O(n3 log3 n)-time algorithms that compute D(G) and χD (G). A very important ingredient in our algorithms is the labeled PQ-tree for G which captured the automorphisms of G and enabled us to view G as a tree-like structure. In contrast, we proved that the problem of determining a graph’s distinguishing chromatic number is NP-hard even when the graph is planar. We end with the same kind of question that motivated this paper – can our results be generalized to other graph families, particularly those slightly larger than interval graphs? Two such families come to mind – chordal graphs and circular-arc graphs. A graph is chordal if each of its cycles with four or more vertices contains a chord. It is a circular-arc graph if its vertices can be represented as arcs on a circle, and two vertices are adjacent if and only if their corresponding intervals have non-empty intersections. A chordal graph need not be a circular-arc graph and vice versa, but an interval graph is both a chordal graph and a circular-arc graph. Unlike interval graphs, testing the isomorphism of two chordal graphs is graph isomorphism complete [16]; that is, it is as hard as testing the isomorphism of two arbitrary graphs. Since this is an important subtask in our algorithms, our approach will likely not work for chordal graphs. On the other hand, there is an efficient graph isomorphism testing algorithm for circular-arc
16
graphs [15], but it is NP-hard to determine their chromatic numbers [13]. Thus, we make the following conjecture: Conjecture: Let G be a circular-arc graph. The problem of determining D(G) belongs to P, but the problem of computing χD (G) is NP-hard.
Acknowledgments I would like to thank the anonymous referees whose comments helped improve the presentation of the paper.
References [1] A. Aho, J. Hopcroft, and J. Ullman. The Design and Analysis of Algorithms. AddisonWesley, 1974. [2] M. Albertson and K. Collins. Symmetry breaking in graphs. Electronic Journal of Combinatorics, 3:R18, 1996. [3] V. Arvind, C. Cheng, and N. Devanur. On computing the distinguishing numbers of planar graphs and beyond: a counting approach. SIAM Journal on Discrete Mathematics. Accepted for publication. [4] V. Arvind and N. Devanur. Symmetry breaking in trees and planar graphs by vertex coloring. In Proceedings of the Nordic Combinatorial Conference, 2004. [5] W. Bogstad and L. Cowen. The distinguishing number of the hypercube. Discrete Mathematics, 283:29–35, 2004. [6] K. Booth and G. Lueker. Testing for the consecutive ones property, interval graphs, and graph planarity using PQ-tree algorithms. Journal of Computing and System Sciences, 13:335–379, 1976. [7] M. Chan. The distinguishing number of the augmented cube and hypercube powers. Discrete Mathematics, 308:2339–2336, 2008. [8] R. Chaudhuri. Teaching bit-level algorithm analysis to the undergraduates in computer science. The SIGCSE Bulletin, 36:62–63, 2004. [9] C. Cheng. On computing the distinguishing numbers of trees and forests. Electronic Journal of Combinatorics, 13:R11, 2006. [10] C. Colbourn and K. Booth. Linear time automorphism algorithms for trees, interval graphs, and planar graphs. SIAM Journal on Computing, 10:203–225, 1981. [11] K. Collins and A. Trenk. The distinguishing chromatic number. Electronic Journal of Combinatorics, 13:R16, 2006. [12] D. Fulkerson and O. Gross. Incidence matrices and interval graphs. Pacific Journal of Mathematics, 15:835–855, 1965. [13] M. Garey and D. Johnson. Computers and Intractability: a Guide to the Theory of NPCompleteness. W.H. Freeman and Company, 1979. [14] M. Golumbic. Algorithmic Graph Theory and Perfect Graphs. Academic Press, 1980. [15] W.-L. Hsu. O(mn) algorithms for the recognition and isomorphism problems on circular-arc graphs. SIAM Journal on Computing, 24:411–439, 1995. [16] G. Lueker and K. Booth. A linear time algorithm for deciding interval graph isomorphism. Journal of the Association for Computing Machineries, 26:183–195, 1979. [17] A. Russell and R. Sundaram. A note on the asymptotics and computational complexity of graph distinguishability. Electronic Journal of Combinatorics, 5:R23, 1998. [18] D. West. Introduction to Graph Theory. Prentice Hall, 2nd edition, 2000.
17
Appendix Claim 1 Let G be an interval graph and TG be its PQ-tree. Let t be an internal node of TG . Denote by cliques(t) the set containing the maximal cliques of G that correspond to the leaves of Tt . Let v be a vertex of G such that char(v) does not belong to Tt . Then either v is part of all the cliques in cliques(t), or v is not included in any of them. Proof By invoking the definitions of a characteristic node and the spans of a P- or Q-node, the following are obvious: (i) if char(v) is not an ancestor of t, none of the cliques in clique(t) contain v; (ii) if char(v) is an ancestor of t and is a P-node, v is part of all the cliques in clique(t); (iii) otherwise, char(v) is an ancestor of t and is a Q-node. Let its children be a1 , . . . , ar ordered from left to right, and span(v) = [i, j]. If one of the nodes ai , ai+1 , . . . , aj is t or is an ancestor of t, v is part of all the cliques in clique(t); otherwise, v is not in any of the cliques in clique(t). 2 Lemma 5 Let G be an interval graph and TGL be its labeled PQ-tree. Let t be an internal node of TGL . Then TtL is the labeled PQ-tree for Gt . Proof Again, let cliques(t) consist of the cliques of G that correspond to the leaves of Tt . Denote by Vt the vertex set of Gt . Notice that every maximal clique of G containing vertices from Vt must be part of cliques(t). For each C ∈ clique(t), let C 0 = C ∩ Vt . Let clique0 (t) = {C 0 : C ∈ clique(t)}. First, we note that clique0 (t) consists of cliques of Gt . Furthermore, from the claim above, for any two cliques C1 and C2 in clique(t), C1 − C10 = C2 − C20 ; let us denote this set as V 0 . Now, it must be the case that clique0 (t) is made up of distinct maximal cliques of Gt since clique(t) consists of distinct maximal cliques of G. Additionally, no maximal clique of Gt is missing from clique0 (t); otherwise, if say C 0 is missing, then C 0 ∪ V 0 is a maximal clique of G that is missing from clique(t) as well. Thus, clique0 (t) consists precisely of the maximal cliques of Gt . And since clique0 (t) was obtained from clique(t), it follows that the leaves of Tt also correspond to the maximal cliques of Gt . Suppose that O0 is an ordering of the cliques in clique0 (t) that satisfy the consecutiveness property. Let O denote the ordering of the cliques in clique(t) that is derived from O0 by replacing each C 0 ∈ clique0 (t) with C 0 ∪ V 0 . It is easy to check that if we replace the frontier of Tt in the frontier of T with O, the resulting ordering still satisfies the consecutiveness property since every clique containing a vertex from Vt belongs to clique(t), and every vertex not in Vt is either part of all the cliques in clique(t) or not part of any of the cliques in clique(t). Thus, if the consistent set of Tt does not contain all the orderings of the maximal cliques of Gt that satisfies the consecutiveness property, then the consistent set of T does not contain all the orderings of the maximal cliques of G as well. Since this is impossible, we have shown that Tt is the PQ-tree for Gt . Finally, since the labels of the nodes in Tt is based on the vertices in Vt only, and there is a one-to-one correspondence between the cliques in clique(t) and clique0 (t), TtL is the labeled PQ-tree for Gt . 2
18