0% found this document useful (0 votes)
32 views10 pages

An Output Sensitive Algorithm For Computing A Maximum Independent Set of A Circle Graph

The document presents an output sensitive algorithm for computing a maximum independent set of an unweighted circle graph. The algorithm improves on previous algorithms that required Θ(nd) time by requiring only O(n min{d, α}) time, where α is the independence number of the circle graph and d is its density. It does this by only updating the values in the dynamic programming table for positions where the maximum independent set size increases when a new interval endpoint is considered, rather than recomputing the whole table. Pseudocode is provided for the update procedure.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views10 pages

An Output Sensitive Algorithm For Computing A Maximum Independent Set of A Circle Graph

The document presents an output sensitive algorithm for computing a maximum independent set of an unweighted circle graph. The algorithm improves on previous algorithms that required Θ(nd) time by requiring only O(n min{d, α}) time, where α is the independence number of the circle graph and d is its density. It does this by only updating the values in the dynamic programming table for positions where the maximum independent set size increases when a new interval endpoint is considered, rather than recomputing the whole table. Pseudocode is provided for the update procedure.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

An Output Sensitive Algorithm for Computing a Maximum Independent Set of a Circle Graph

Nicholas Nash
Abstract We present an output sensitive algorithm for computing a maximum independent set of an unweighted circle graph. Our algorithm requires O(n min{d, }) time at worst, for an n vertex circle graph where is the independence number of the circle graph and d is its density. Previous algorithms for this problem required (nd) time at worst.

David Gregg

Introduction

The intersection graph of a nite family of sets X1 , . . . , Xn , is an undirected graph of n vertices v1 , . . . , vn with an edge connecting vi and vj if and only if Xi Xj = . A circle graph is an undirected graph isomorphic to the intersection graph of a nite set of chords in a circle. Finding a maximum independent set of a circle graph can be solved in time polynomial in the number of vertices of the graph, Gavril [4] presented a (n3 ) algorithm while others developed (n2 ) algorithms [3, 5, 9]. Apostolico et al [1, 2] solve the problem in (nd) time and space, where d is a parameter known as the density of the circle graph. Valiente [11] solved the problem in (nd) time and only (n) space. Nash et al [8] experimentally studied the relative performance of optimized implementations of both of the preceding algorithms, showing that when suitably implemented, Valientes algorithm performs better. As we note in Section 6 a variation of the algorithm described in this paper has been experimentally observed to signicantly out-perform the best performing previous algorithm. Other problems that are N P -complete for general graphs can also be solved in polynomial time for circle graphs, for example Tiskin [10] has shown an O(n log2 d) time algorithm for the maximum clique problem. There are also problems that are N P -complete for both circle graphs and general graphs, such as minimum dominating set [7].
Dept. of Computer Science, Trinity College Dublin, Ireland. Work supported by the Irish Research Council for Science, Engineering and Technology (IRCSET), [email protected]. Lero, Trinity College Dublin, [email protected].

Figure 1: The chords in the circle of (a) give rise to the circle graph in (c). The intervals in (b) also give rise to the circle graph of (c). The interval representation in (b) has density 4.
The contribution of this paper is an algorithm for computing a maximum independent set of an unweighted circle graph in O(n min{d, }) time, where is the independence number of the circle graph.

Background

A circle graph can be represented either by chords in a circle or intervals on the real line, and the two representations may easily be obtained from one another [4]. Figure 1 shows an example of these representations together with the circle graph they give rise to. We can assume without loss of generality that no two chords (or intervals) share an end-point, since if two chords share an end-point we can slightly move the end-point of one of the chords without changing the circle graph [4]. An interval representation of an n vertex circle graph can be encoded as a permutation of {1, ..., 2n} where the end-points of the intervals are formed by pairs (2k1 , 2k ), for 1 k n. We refer to this as a -representation of the circle graph. Note that this makes use of the assumption that no intervals share an end-point. An arbitrary set of intervals can be transformed into this form in O(n log n) time. In this paper we make use solely of this interval representation. The density of an interval representation is the maximum number of intervals crossing any point on the real line. Two intervals are said to overlap if neither contains the other and they are not disjoint. If two intervals overlap then their corresponding chords in the circle intersect. A maximum independent set is then a set of mutually non-overlapping intervals with cardinality at least as large as any other mutually non-overlapping set of intervals. Further background on circle graphs and related graph families is provided by Golumbic [6].

A Naive Algorithm

In this section we informally describe a naive algorithm for computing a maximum independent set of a circle graph, as well as introducing some preliminary notation and denitions. This naive algorithm forms the base for the output sensitive algorithm we introduce in Section 4. We shall nd it convenient to use the standard notation [a, b] = {x R | a x b} (for a < b) below and to speak of one interval containing another when this is true set-wise in R. Given a set of intervals I we dene Iq,m to be the subset of those intervals which are contained in [q, m]. Throughout this paper, this set I should be regarded as having the form
n k=1 {[2k1 , 2k ]}

for some given -representation of

an n vertex circle graph. We denote the set of maximum independent sets of Iq,m by M ISq,m , and we denote their cardinality by M IS[q, m]. Finally, for an interval i = [a, b] we dene CM ISi = M ISa+1,b1

Input: A -representation of an n vertex unweighted circle graph. Output: The cardinality of the circle graphs maximum independent sets. M [1 . . . 2n] 0 C[1 . . . n] 0 for m 1 to 2n do if m is the right end-point of an interval i = [l, m] then C[i] M [l + 1] endif for q m 1 downto 1 do M [q] M [q + 1] if q is the left end-point of an interval j = [q, r] and r m then M [q] max{M [q + 1], 1 + C[j] + M [r + 1]} endif endfor endfor

Figure 2: Pseudo-code for a simple (n2 ) time and (n) space algorithm for computing the cardinality of a circle graphs maximum independent sets.
and CM IS[i] = M IS[a + 1, b 1]. Although M IS and CM IS depend on the choice of a set of intervals I, we choose to suppress this dependence in the notation because it shall never lead to ambiguity. We now note some simple properties of M IS[q, m]. Property 3.1 If q is the right end-point of an interval, then M IS[q, m] = M IS[q + 1, m]. This property follows since, if q is the right end-point of an interval, then Iq,m = Iq+1,m . Property 3.2 If q is the left end-point of an interval i = [q, r] then M IS[q + 1, m] if r > m M IS[q, m] = max {M IS[q + 1, m], 1 + CM IS[i] + M IS[r + 1, m]} otherwise Proof If r > m then Iq,m = Iq+1,m and so M IS[q, m] = M IS[q +1, m]. Assume r m. Since Iq,m \{i} = Iq+1,m it follows that the cardinality of a maximum independent set of Iq,m \ {i} is M IS[q + 1, m]. Let V be a maximum cardinality independent set of Iq,m that includes i. Clearly for any other interval j Iq,m that does not overlap with i then either j Iq+1,r1 or j Ir+1,m . Thus |V | = 1 + CM IS[i] + M IS[r + 1, m]. Since when r m any x M ISq,m can either include or exclude i, it follows that M IS[q, m] = max{M IS[q + 1, m], 1 + CM IS[i] + M IS[r + 1, m]} in this case. Property 3.1 and 3.2 can be used to construct a simple dynamic programming algorithm for computing a maximum independent set of a circle graph. Figure 2 shows pseudo-code for this algorithm, which operates in (n2 ) time while using (n) space. This algorithm evaluates M IS[q, m] in an array M [1 . . . 2n] by increasing m from 1 to 2n, and then evaluating the entries of the recurrence for this value of m by

Input: The -representation of an n vertex circle graph together with an integer m and the arrays M and C as dened in Denition 4.3. Output: M such that M [q] = M IS[q, m] for 1 q m. if m is the right end-point of an interval i = [l, m] then M [l] 1 + C[i] push(T, l) while top(T ) = nil x pop(T ) if x > 1 and M [x] > M [x 1] then M [x 1] M [x] push(T, x 1) endif if there is an interval j = [p, x 1] and 1 + C[j] + M [x] > M [p] then M [p] 1 + C[j] + M [x] push(T, p) endif endwhile endif

Figure 3: Pseudo-code for the update algorithm of Denition 4.3.


decreasing q from m 1 down to 1. When the algorithm terminates, M [1] = M IS[1, 2n]. We note that a maximum independent set itself, and not just its weight, can easily be maintained while evaluating this recurrence. The algorithm of Figure 2 is less ecient than Valientes [11] (nd) time algorithm, however, we include it because it motivates the output sensitive algorithm we introduce in the next section. The basic observation motivating the output sensitive algorithm is that, each time m is incremented in the naive algorithm, the number of cells in the array M [1 . . . 2n] whose value changes (in fact, increases) may be substantially smaller than the number of cells examined in the right-to-left scan of q from m 1 down to 1. Thus, if the set of cells that change can be determined eciently, the resulting algorithm may be more ecient too. We formalize this intuition in the remainder of this paper.

An Output Sensitive Algorithm

Denition 4.1 Given the -representation of an n vertex circle graph, the update set at m, 1 m 2n, is Sm = {q | M IS[q, m] > M IS[q, m 1] for 1 q m} Proposition 4.2 If q Sm then M IS[q, m] = 1 + M IS[q, m 1]. Proof By assumption M IS[q, m] = k + M IS[q, m 1], k 1, and thus there must be an interval i = [l, m] included in all x M ISq,m but not in any y M ISq,m1 . For all x M ISq,m clearly x \ {i}

is an independent set of of Iq,m1 and if k > 1 then its cardinality would exceed M IS[q, m 1], which is a contradiction and thus k = 1. Denition 4.3 ( update algorithm) Given the -representation of an n vertex circle graph, an integer 1 m 2n and an array M [1 . . . 2n] such that M [q] = M IS[q, m 1] for 1 q m 1, and M [q] = 0 otherwise, and an array C[1 . . . n] such that for each interval i = [l, r] with r m C[i] = CM IS[i] (here C[i] should be regarded as being indexed by the rank of i in the -representation of the circle graph) then we dene the update algorithm as follows: If m is the left end-point of an interval, the algorithm terminates. Otherwise, there is an interval i = [l, m] and the algorithm performs the assignment M [l] 1 + C[i], and l is pushed onto a stack T . The following procedure is then iterated until the stack T contains no entries. The top of the stack is popped into x. If x > 1 and M [x] > M [x 1] then the update M [x 1] M [x] is performed (we refer to this as a Type-1 update) and x 1 is pushed onto T . If there is an interval j = [p, x 1] and 1 + C[j] + M [x] > M [p] then the assignment M [p] 1 + C[j] + M [x] is performed (we refer to this as a Type-2 update) and p is pushed onto T , and the process iterates. Pseudo-code for this algorithm is provided in Figure 3. Lemma 4.4 If any cell M [q], 1 q m is modied by the update algorithm, then M [q] = M IS[q, m] when the algorithm terminates. Proof Assume the algorithm iterates at least once until the stack T is empty, possibly modifying cells of M . If, for all indices x on the stack T we have M [x] = M IS[x, m] we say T is valid. Assume that T is valid at the beginning of each loop iteration where any cell of M is modied. Assume that value of M [p] has been modied by the algorithm on some iteration. If p is a right end-point, then it must have been modied by a Type-1 update via an assignment of the form M [p] M [p + 1], where p + 1 was popped from T and since T is valid M [p] = M IS[p + 1, m]. Moreover, by Property 3.1 M IS[p, m] = M IS[p + 1, m], and thus M [p] = M IS[p, m], as required. The algorithm then pushes p onto T , and so T is still valid after p is pushed onto it. Otherwise, if M [p] was modied and p is a left end-point of an interval j = [p, x 1], then M [p] may have been modied by either a Type-1 or a Type-2 update (but not both, see Proposition 4.2). If M [p] was modied only by a Type-1 update, then M [p] = M [p + 1] and M [p + 1] 1 + C[j] + M [x]. If M [p] was modied by a Type-2 update, then M [p] = 1 + C[j] + M [x] and 1 + C[j] + M [x] M [p + 1]. Thus, in the case of either update, M [p] = max{M [p + 1], 1 + C[j] + M [x]}. Since T is valid M [p + 1] = M IS[p + 1, m] and M [x] = M IS[x, m]. Thus M [p] = max{M IS[p+1, m], 1+CM IS[j]+M IS[x, m]}, and so by Property 3.2 M [p] = M IS[p, m] as required. The algorithm then pushes p onto T , and so T is still valid after p is pushed onto it.

It follows immediately from the above that if T is valid at the beginning of some iteration of the loop, then T is valid at the beginning of the next iteration of the loop, and thus on every iteration of the loop. To complete the proof, we show T is valid before the rst iteration of the loop. If m is the right end-point of an interval i = [l, m], then the rst index pushed onto the stack is l. Preceding this, the algorithm performs the assignment M [l] 1 + C[i]. Note that M IS[m + 1, m] = 0, and that M IS[p+1, m] = M IS[p+1, m1] = C[i], and thus by Property 3.2, M [l] = M IS[p, m] following the assignment. As a result T is valid after l is pushed onto it. Denition 4.5 If at some point during the execution of the update algorithm we have M [q] = M IS[q, m] for all q p, we say that M is fully updated at p. Property 4.6 If M [p] is not modied by the update algorithm and M is fully updated at p + 1 then M IS[p, m] = M IS[p, m 1]. Proof If p is a right end-point and M [p + 1] was not modied by the algorithm then, since M is fully updated, M IS[p + 1, m 1] = M IS[p + 1, m] but by Property 3.1 M IS[p, m 1] = M IS[p + 1, m 1] and M IS[p, m] = M IS[p + 1, m] and hence M IS[p, m] = M IS[p, m 1], as required. If p is a right end-point and M [p + 1] was modied by the algorithm, then since no Type-1 update of M [p] occured, we have M [p] M [p + 1], implying M IS[p, m 1] M IS[p + 1, m], but by Property 3.1 M IS[p, m] = M IS[p + 1, m], and hence M IS[p, m 1] M IS[p, m] but clearly M IS[p, m 1] M IS[p, m] since Ip,m1 Ip,m , and hence M IS[p, m] = M IS[p, m 1], as required. Otherwise, if p is a left end-point of an interval j = [p, x 1] and neither M [p + 1] nor M [x] has been updated then M IS[p + 1, m] = M IS[p + 1, m 1] and M [x] = M IS[x, m 1], thus, by Property 3.2 M IS[p, m] = max{M IS[p + 1, m 1], 1 + CM IS[j] + M IS[x, m 1]} showing that at M IS[p, m] = M IS[p, m 1] as required. Otherwise, if both of M [p + 1] and M [x] have been updated then we have M [p] max{M IS[p + 1, m], 1 + CM IS[j] + M IS[x, m]}, since M is fully updated and neither a Type-1 or a Type-2 update occured. That is, M IS[p, m 1] M IS[p, m], implying as above that M IS[p, m] = M IS[p, m 1], as is required. Lastly, we consider the cases where exactly one of M [p + 1] and M [x] has been updated. By Property 3.2 M IS[p, m 1] = max{M IS[p + 1, m 1], 1 + CM IS[j] + M IS[x, m 1]}. Assume that only M [p + 1] was updated, and since M is fully updated at p + 1, M IS[p + 1, m] > M IS[p + 1, m 1]. But since M [p] was not updated, and in particular there was no Type-1 update, we have M IS[p, m 1] M IS[p + 1, m], implying that M IS[p, m 1] > M IS[p + 1, m 1] and in turn that M IS[p, m 1] = 1 + CM IS[j] + M IS[x, m 1], and once more since M [p] was not updated 1 + CM IS[j] + M IS[x, m 1] M IS[p + 1, m], and hence M IS[p, m] = 1 + CM IS[j] + M IS[x, m 1], and M IS[p, m] = M IS[p, m 1], as required. The other case, where only M [x] is updated is analogous.

Lemma 4.7 When the update algorithm terminates M [q] = M IS[q, m] for 1 q m. Proof If m is the left end-point of some interval then the algorithm can terminate without modifying M because Iq,m = Iq,m1 for 1 q m. Assume the algorithm iterates z 1 times. On the k th iteration of the algorithm, we denote the contents of the stack T at the beginning of that iteration as Tk . Moreover we denote the largest index on some Tk as F (Tk ). Note that the algorithm modies only the cells M [F (T1 )], . . . , M [F (Tz )]. Note also that for each 1 k < z the algorithm modies none of the cells M [F (Tk+1 ) + 1], . . . , M [F (Tk ) 1]. Consider any iteration, 1 k < z, and assume M is fully updated at F (Tk ). It follows by F (Tk ) F (Tk+1 ) 1 applications of Property 4.6 that M is fully updated at F (Tk+1 ) + 1. Moreover, when the algorithm modies M [F (Tk+1 )], by Lemma 4.4, M will be fully updated at F (Tk+1 ). Thus if M is fully updated at F (Tk ) at the beginning of k th iteration of the algorithm, it is fully updated at F (Tk+1 ) on the (k + 1)th iteration. Note that at the beginning of the rst iteration of the algorithm, M is fully updated at F (T1 ) = l noting that Ir,m = Ir,m1 for l < r m and that M [l] = M IS[l, m] by the same argument given at the end of in Lemma 4.4. Finally, after the nal, z th iteration, a further F (Tz ) 1 applications of Property 4.6 show that M is fully updated at 1 when the algorithm terminates. Lemma 4.8 The update algorithm terminates in O(1+|Sm |) time and uses O(1+|Sm |) space in addition to the space used by its input. Proof The algorithm only pushes an index q onto the stack T if q Sm . Moreover, by Proposition 4.2 such an index q can be pushed onto T at most once by the algorithm. Thus T can contain at most |Sm | indices and since the algorithm uses at most constant space in addition to T the total space is O(1 + |Sm |) space (allowing for Sm = ). Since the main loop of the algorithm iterates until T contains no entries, this loop can iterate at most |Sm | times, with each iteration incurring constant time. Thus, the total time is O(1 + |Sm |). Lemma 4.9 Given an n vertex circle graph with independence number then
2n q=1

|Sq | 2n. Clearly

Proof Let f (q) be the number of the update sets {S1 , . . . , S2n } that q is an element of.
2n q=1

f (q) =

2n q=1 2n q=1

|Sq |. Also note that f (1) f (2) f (2n), and in particular that = f (1). It
2n q=1

follows that

f (q) 2n and thus that

|Sq | 2n.

Lemma 4.10 Given the -representation of a circle graph, the cardinality of its maximum independent sets can be computed in O(n) time and O(n) space

Input: A -representation of an n vertex unweighted circle graph. Output: The cardinality of the circle graphs maximum independent sets. M [1 . . . 2n] 0 C[1 . . . n] 0 for m 1 to 2n do if m is the right end-point of an interval i = [l, m] then C[i] M [l + 1] endif update(M, C, m) endfor

Figure 4: Pseudo-code for a O(n) time and O(n) space algorithm for computing the cardinality of a circle graphs maximum independent sets. update(M, C, m) denotes an invocation of the update algorithm of Denition 4.3, Figure 3 and Lemma 4.7.
Proof We refer to the algorithm in Figure 4, here, update(M, C, m) denotes an invocation of the update algorithm of Denition 4.3, Figure 3 and Lemma 4.7. On the mth iteration of the loop, given M [q] = M IS[q, m 1] for 1 q < m and C[i] = CM IS[i] for all interval i Iq,m1 with r < m, by Lemma 4.7, update will modify M such that M [q] = M IS[q, m] for 1 q m. Examining Figure 3, C will be modied giving C[i] = CM IS[i] for all i I1,m . Thus, after the mth iteration of the loop, the inputs C and M required by update in the next iteration are available. Since on the rst iteration the inputs required by update are trivially available, it follows that when the for loop terminates M [1] holds the cardinality of the maximum independent sets of the circle graph. For the time complexity, note that there are 2n calls to the update algorithm, requiring by Lemma 4.8, in total time
2n m=1

O(1 + |Sm |) which is O(n) by Lemma 4.9.

For the space complexity, note that in addition to the O(n) space required by the input, the only space used O(n) for the array C and, by Lemma 4.8, at most O(n) for the stack T .

A Combined Algorithm

Having established the O(n) time and O(n) space algorithm of Lemma 4.10, we can combine it with Valientes [11] O(nd) time and O(n) space algorithm giving a O(n min{d, }) time algorithm. The following is the main result of this paper. Theorem 5.1 Given the -representation of a circle graph, the cardinality of its maximum independent sets can be computed in O(n min{d, }) time and O(n) space. Proof In O(n) time and O(1) space the parameter d can be computed by a simple iteration over the -representation. Now, the update algorithm of Figure 3 is modied such that if an update to a cell M [q] gives M [q] > d, then the update algorithm simply sets a ag F and terminates.

To compute the cardinality of the maximum independent sets, the algorithm of Figure 4 is used with this modied update algorithm. When the algorithm terminates, if the ag F is not set, then it must be the case that < d and hence the cardinality of the maximum independent sets has been determined in O(n) time using at most O(n) space, by Lemma 4.10. On the other hand, if the ag F is set, it must be the case that d < . In this case, at most O(nd) time has been incurred using O(n) space. To complete the computation, Valientes algorithm [11] is invoked on the -representation, requiring an additional O(nd) time and O(n) space. Thus, the modied algorithm requires O(n min{d, }) time. We note that a maximum independent set itself, and not just its cardinality, can easily be maintained by this algorithm within the same time and space bounds. Referring to Figure 4, a cell C[i] of C[1 . . . 2n] can be thought of as representing an element of CM ISi rather than CM IS[i], and C[i] can then be represented by a linked list of all the intervals directly contained in an element of CM ISi (an interval j is directly contained in x CM ISi if j x and there is no k x such that j is contained in the element of CM ISk represented by C[k]). The same linked list representation can be used in place of M [1 . . . 2n]. This simple representation of a maximum independent set is illustrated by Valiente [11].

Conclusion

This paper has described a O(n min{d, }) time and O(n) space algorithm for computing a maximum independent set of an unweighted circle graph. Future work could attempt to extend coverage to weighted circle graphs. In addition, we note that in experiments we have observed an algorithm based on the output sensitive approach described in this paper to perform excellently in practice. In these experiments, a variation of the algorithm described in this paper was used. This variation appears to have favourable constant factors and operates in time O(n min{d, log n}), it was compared to an optimized implementation of the previous best algorithm, whose experimental performance was documented in [8]. The output sensitive algorithm was observed to oer much improved performance (by a factor of between 3 and 7). Moreover, in these experiments we have observed a class of circle graphs with d = (n) and = ( n). We leave a full description of these experimental results to future work.

References
[1] A. Apostolico, M. J. Atallah, and S. E. Hambrusch. New clique and independent set algorithms for circle graphs. Discrete Applied Mathematics, 36(1):124, 1992.

[2] A. Apostolico, M. J. Atallah, and S. E. Hambrusch. Erratum: New clique and independent set algorithms for circle graphs (discrete applied mathematics 36 (1992) 124). Discrete Applied Mathematics, 41(2):179180, 1993. [3] T. Asano, H. Imai, and A. Mukaiyama. Finding a maximum weight independent set of a circle graph. IEICE Transactions, E74(4):681683, 1991. [4] F. Gavril. Algorithms for a maximum clique and a maximum independent set of a circle graph. Networks, 3(3):261273, 1973. [5] O. Goldschmidt and A. Takvorian. An ecient algorithm for nding a maximum weight independent set of a circle graph. IEICE Transactions, E77-A(10):16721674, 1994. [6] M. C. Golumbic. Algorithmic Graph Theory and Perfect Graphs (Annals of Discrete Mathematics, Vol 57). North-Holland Publishing Co., Amsterdam, The Netherlands, The Netherlands, 2004. [7] J. M. Keil. The complexity of domination problems in circle graphs. Discrete Applied Mathematics, 42(1):5163, 1993. [8] N. Nash, S. Lelait, and D. Gregg. Eciently implementing maximum independent set algorithms on circle graphs. J. Exp. Algorithmics, 13(1.9):134, 2009. [9] K. J. Supowit. Finding a maximum planar subset of a set of nets in a channel. IEEE Trans. on CAD of Integrated Circuits and Systems, 6(1):9394, 1987. [10] A. Tiskin. Semi-local string comparison: abs/0707.3619, 2009. [11] G. Valiente. A new simple algorithm for the maximum-weight independent set problem on circle graphs. In T. Ibaraki, N. Katoh, and H. Ono, editors, ISAAC, volume 2906 of Lecture Notes in Computer Science, pages 129137. Springer, 2003 algorithmic techniques and applications. CoRR,

10

You might also like