Fixed-Parameter Algorithms for Cochromatic Number and Disjoint Rectangle Stabbing∗
Total Page:16
File Type:pdf, Size:1020Kb
Fixed-parameter algorithms for Cochromatic Number and Disjoint Rectangle Stabbing∗ Pinar Heggernesy Dieter Kratschz Daniel Lokshtanovy Venkatesh Ramanx Saket Saurabhx Abstract Given a permutation π of f1; : : : ; ng and a positive integer k, we give an algorithm with 2 running time 2O(k log k)nO(1) that decides whether π can be partitioned into at most k increasing or decreasing subsequences. Thus we resolve affirmatively the open question of whether the problem is fixed parameter tractable. This NP-complete problem is equivalent to deciding whether the cochromatic number, partitioning into the minimum number of cliques or independent sets, of a given permutation graph on n vertices is at most k. In fact, we give a more general result: within the mentioned running time, one can decide whether the cochromatic number of a given perfect graph on n vertices is at most k. To obtain our result we use a combination of two well-known techniques within pa- rameterized algorithms, namely greedy localization and iterative compression. We further 2 demonstrate the power of this combination by giving a 2O(k log k)n log n time algorithm for deciding whether a given set of n non-overlapping axis-parallel rectangles can be stabbed by at most k of a given set of horizontal and vertical lines. Whether such an algorithm exists was mentioned as an open question in several papers. 1 Introduction Given a permutation π on [n] = f1; : : : ; ng and a positive integer k, a well known partitioning problem asks whether we can partition π into at most k monotone (increasing or decreasing) subsequences. This seemingly easy partition problem is indeed NP-complete [32], though it can be solved in time nO(k) [3]. Using the famous Erd}os-Szekeres theorem [16] which states that every sequence of p · q + 1 real numbers has a monotone subsequence of length either p + 1 O(k) or q + 1, an algorithmp with running time n implies a subexponential-time algorithm with running time nO( 2n) for partitioning π into the minimum number of monotone subsequences [3]. A natural question which has been left open, and most recently stated at the 2008 Dagstuhl Seminar on Moderately Exponential Time Algorithms (Seminar 08431) [19], is whether the problem is fixed parameter tractable (FPT) when parameterized by the number of monotone subsequences. That is, do we have an algorithm with running time f(k) · nO(1) for partitioning a permutation π into at most k monotone subsequences? In this paper, we answer this question in the affirmative by giving an algorithm for it with running time 2O(k2 log k)nO(1). We solve the problem of partitioning the given permutation into at most k monotone subse- quences by giving an algorithm for an equivalent problem on graphs. Every permutation π on [n] corresponds to a permutation graph G(π) on n vertices. This graph has a vertex for each num- ber 1; 2; : : : ; n and there is an edge between any two numbers that are in reversed order in the ∗This work is supported by the Research Council of Norway. yDepartment of Informatics, University of Bergen, Norway. fpinar|[email protected] zUniversit´ede Metz, France. [email protected] xThe Institute of Mathematical Sciences, Chennai, India. fvraman|[email protected] 1 permutation, that is, we have an edge between i < j if π(i) > π(j). Hence, the above mentioned partitioning problem is equivalent to deciding whether the vertices of G(π) can be partitioned into at most k independent sets or cliques. This brings us to the notion of cochromatic number of a graph. The cochromatic number of a graph G = (V; E) is the minimum number of sets the vertex set V can be partitioned into, such that each set is either an independent set or a clique. Formally, the Cochromatic Number problem is defined as follows. Cochromatic Number Input: A graph G on n vertices, and an integer k ≥ 1. Parameter: k. Question: Is the cochromatic number of G at most k? Thus, the problem of partitioning the given permutation into at most k monotone subsequences is equivalent to Cochromatic Number of permutation graphs. Cochromatic Number attracted the attention of Erd}os[14, 15] and many others, after being introduced in the 70's as a natural extension of chromatic number and graph colorings. The Cochromatic Number problem is NP-complete by the result of Wagner [32] who proved it to be NP-complete even on permutation graphs. Brandst¨adt[2] showed that we can recognize in polynomial time whether the vertex set of a given undirected graph can be partitioned into one or two independent sets and one or two cliques. However, it remains NP-complete to check whether we can partition the given graph into κ independent sets or ` cliques if either κ ≥ 3 or ` ≥ 3. In fact it is easy to show that testing whether the cochromatic number of a given graph is at most 3 is NP-complete. Thus, we can not hope to solve Cochromatic Number on general graphs even in time nf(k) for any arbitrary function of k unless P=NP. In this paper, we show that Cochromatic Number is fixed parameter tractable on perfect graphs; a graph class that subsumes bipartite graphs, chordal graphs and permutation graphs, to name a few. A graph is perfect if the chromatic number is equal to the clique number for each of its induced subgraphs. Perfect graphs were introduced by Berge in the early 60's, and the number of books (e.g., [4, 17, 23, 29]) and papers written on perfect graphs and subclasses are now in the thousands. The proof of Berge's famous strong perfect graph conjecture [1] by Chudnovsky et al. [8] after being open for 40 years, is one of the important highlights in the area, establishing finally that a graph is perfect if and only if neither the graph nor its complement contains an induced cycle of odd length at least 5 as an induced subgraph. Perfect graphs also have many nice algorithmic properties. They can be recognized in polynomial time [7] and one can find a maximum independent set, minimum coloring, maximum clique in polynomial time using the classical algorithm of Gr¨otschel, Lov´aszand Schrijver [24]. Our algorithm solves 2 Cochromatic Number in 2O(k log k)nO(1) time on perfect graphs and crucially uses several algorithmic properties of perfect graphs. To the best of our knowledge even an nO(k) algorithm solving this problem on perfect graphs was not known before. The only known algorithmic results for the Cochromatic Number problem are by Fomin et al. [20] who gave a factor 1:71 approximation algorithm for Cochromatic Number on comparability (or cocomparability) graphs, and a factor log n approximation algorithm on perfect graphs. To show our result we use a combination of two well-known techniques within parameterized algorithms, namely, greedy localization and iterative compression. This combination follows the well known iterative compression paradigm in parameterized complexity, but finds a small witness to branch and move towards an optimal solution \for the compressed instance" at the compression step. Using this new combination, we are also able to resolve another open question [11, 12], namely whether Disjoint Rectangle Stabbing is fixed parameter tractable. Disjoint Rectangle Stabbing Input: A set R of n axis-parallel non-overlapping rectangles embedded in a plane, 2 a set L of vertical and horizontal lines embedded in the plane, and an integer k ≥ 1. Parameter: k. Question: Is there a set L0 ⊆ L with jL0j ≤ k such that every rectangle from R is stabbed by at least one line from L0? Here we say that a rectangle is stabbed by a line if their intersection is nonempty. Also two rectangles are said to be overlapping if there exists a vertical line v and a horizontal line h such that both rectangles are stabbed by the lines v and h. For example, non intersecting rectangles are always non overlapping independent of L. The Rectangle Stabbing problem, the more general version of the Disjoint Rect- angle Stabbing problem, where the rectangles can overlap is a generic geometric covering problem having wide applicability [25]. A number of polynomial-time approximation results for Rectangle Stabbing and its variants are known [9, 33, 27, 25]. In [12], the authors prove a W[1]-hardness result for a higher dimensional version of the Rectangle Stabbing problem and show several restrictions of this two dimensional version fixed-parameter tractable. Re- cently, Dom et al. [11] and Giannopoulos et al. [22] independently considered the general two dimensional version, the Rectangle Stabbing problem, and showed it to be complete for the parameterized complexity class W[1]. Dom et al. [11] also showed that the restriction of Disjoint Rectangle Stabbing to b-Disjoint Square Stabbing, when all the rectangles are squares of the size b × b, is NP-complete for any fixed b ≥ 2. Furthermore, both Dom et al. [11] and Giannopoulos et al. [22] considered the b-Disjoint Square Stabbing problem for a fixed b and show it to be fixed parameter tractable. All these papers leave the parameterized complexity of the Disjoint Rectangle Stabbing problem open. Our paper is organized as follows. In Section 2 we give necessary definitions and set up our notations. Section 3 gives an overview of the method we use to solve Cochromatic Number on perfect graphs and Disjoint Rectangle Stabbing. We give a fixed parameter tractable algorithm for Cochromatic Number on perfect graphs in Section 4 and for Disjoint Rectangle Stabbing in Section 5.