Planar K-Path in Subexponential Time and Polynomial Space
Total Page:16
File Type:pdf, Size:1020Kb
Planar k-Path in Subexponential Time and Polynomial Space Daniel Lokshtanov1, Matthias Mnich2, and Saket Saurabh3 1 University of California, San Diego, USA, [email protected] 2 International Computer Science Institute, Berkeley, USA, [email protected] 3 The Institute of Mathematical Sciences, Chennai, India, [email protected] Abstract. In the k-Path problem we are given an n-vertex graph G to- gether with an integer k and asked whether G contains a path of length k as a subgraph. We give the first subexponential time, polynomial space parameterized algorithm for k-Path on planar graphs, and more gen- erally, on H-minor-free graphs. The running time of our algorithm is p 2 O(2O( k log k)nO(1)). 1 Introduction In the k-Path problem we are given a n-vertex graph G and integer k and asked whether G contains a path of length k as a subgraph. The problem is a gen- eralization of the classical Hamiltonian Path problem, which is known to be NP-complete [16] even when restricted to planar graphs [15]. On the other hand k-Path is known to admit a subexponential time parameterized algorithm when the input is restricted to planar, or more generally H-minor free graphs [4]. For the case of k-Path a subexponential time parameterized algorithm means an algorithm with running time 2o(k)nO(1). More generally, in parameterized com- plexity problem instances come equipped with a parameter k and a problem is said to be fixed parameter tractable (FPT) if there is an algorithm for the problem that runs in time f(k)nO(1). The algorithm is said to be a subexponential time parameterized algorithm if f(k) ≤ 2o(k). For an introduction to parameterized algorithms and complexity see the textbooks [10, 11, 22]. In this paper we pose the following question. Does k-Path on planar graphs admit a subexponential time parameterized algorithm which only uses space polynomial in n? Wep give a positive answer to this question by presenting a poly- 2 nomial space, 2O( k log k)nO(1) time algorithm for k-Path restricted to planar graphs. Our algorithm easily generalizes to any family of graphs which exclude a fixed graph H as a minor. pThe fastest parameterized algorithmp for k-Path on planar graphs runs in 2O( k)nO(1) time and uses 2O( k) log n + nO(1) space [9]. The algorithm we present uses polynomial space, but is slower by a factor of O(log2 k) in the exponent of 2. Is the trade-off worth it? In general, does it make sense to settle for slightly slower algorithms if used space is reduced drastically? We believe that such a trade-off is reasonable because algorithms that use exponential time and space tend to run out of space long before they run out of time. In the survey paper on exponential time algorithms, Woeginger [24] states that \algorithms with exponential space complexities are absolutely useless for real life applica- tions". This line of reasoning has opened up an interesting research direction; for which problems can we obtain space-efficient algorithms that are (almost) as time-efficient as the fastest ones? Some progress has been made { Fomin, Grandoni and Kratsch [12] gave a 6knO(log k) time, polynomial space algorithm for the Steiner Tree problem and showed how to use it to obtain a O(1:60n) time polynomial space algorithm. In a breakthrough paper, Nederlof [21] gave a 2knO(1) time polynomial space algorithm for Steiner Tree. Subsequently, Lokshtanov and Nederlof [20] devised general sufficient conditions for turning exponential space dynamic programming algorithms into polynomial space al- gorithms based on algebraic transforms. It is natural to ask which problems admit polynomial space FPT algorithms. While this might look like a whole new research program, the question has a surprising answer; any problem for which a polynomial space FPT algorithm is remotely feasible has one. In particular, a necessary condition for a problem to have a polynomial space FPT algorithm is to have an FPT algorithm. Another necessary condition is that the problem is solvable in polynomial space and time ng(k) for some function g (that is, a polynomial space XP algorithm for the problem). A well-known trick from parameterized complexity shows that these two conditions are not only necessary, but also sufficient. Theorem 1. If a parameterized problem Π has an algorithm A which uses f(k)nc time and space, and an algorithm B which uses ng(k) time and poly- nomial space, then Π can be solved in nc+1 + f(k)g(k) time and polynomial space. Proof. If n ≥ f(k) then run algorithm A, this takes polynomial time and space. If n ≤ f(k) then run algorithm B, this takes polynomial space and f(k)g(k) time. ut Because of Theorem 1 the right question to ask is not which problems ad- mit polynomial space FPT algorithms, but rather which problems admit fast polynomial space FPT algorithms. Obvious candidates for scrutiny are prob- lems for which the fastest parameterized algorithms require exponential space. Graph problems restricted to planar and H-minor free graphs havep this prop- erty { the Bidimensionality theory of Demaine et al. [4] gives 2O( k)nO(1) or p 2O( k log k)nO(1) time algorithms for a multitude of graph problems on H-minor free graphs. However, these algorithms crucially depend on exponential space dynamic programming algorithms on graphs of bounded treewidth. In partic- ular, the crux of all bidimiensionality basedp algorithms is to first bound the treewidth of the input graph by t = O( k), and then solve the problems in 2O(t)n (or tO(t)n) time and 2O(t) log n (or tO(t) log n) space. We refer to follow- ing surveys for further details on the the Bidimensionality theory and its several applications [5, 8]. 2 Interestingly, using another simple trick we can make most of the algorithms for bidimensional problems on H-minor free graphs run in polynomial space, at the cost of a O(log k) factor in the exponent of the running time. The trick has two components, the first is that (almost) all of the 2O(t)n time and 2O(t log t)n time dynamic programming algorithms on graphs of treewidth t can be turned into polynomial space divide and conquer algorithms with running time nO(t) and nO(t log t). The second component is that most problems for which the Bidi- mensionality theory of Demaine et al. [4] gives fast algorithms admit linear kernels on planar and H-minor-free graphs [3, 14]. A linear kernel for a parame- terized graph problem is a polynomial time pre-processing algorithm that takes instances (G; k) and transforms them into equivalent instances (G0; k0) of the same problem such that k0 = O(k) and V (G0) = O(k). Now the subexponential time algorithms of Demaine et al. [4] can be made to run in polynomial space as follows. Run the pre-processing algorithm first, to ensure that the numberp of ver- tices in the input graph is at most O(k). Bound the treewidth by t = O( k) as before, but replace the 2O(t)n (or tO(t)n) time algorithms by nO(t) (or nO(t log t)) time polynomial space algorithms. Since n = O(k) this second step uses only p p 2 2O( k log k) (or 2O( k log k)) time respectively. We remark that for many of these problems one can even remove the log k overhead in the exponent by using a Lipton-Tarjan separator approach [18, 19] instead of the polynomial space algo- rithms for graphs of bounded treewidth after obtaining the linear kernel for the problem, as done in [1]. In the above argument it was crucial that the problem considered admits a linear kernel. What about the problems that do not? Notably, the k-Path prob- lem does have a subexponential time parameterized algorithm on H-minor-free graphs. At the same time k-Path does not admit a linear (or polynomial size) kernel unless the polynomial hierarchy collapses to the third level [2], even when the input is restricted to planar graphs. Thus, with respect to parameterized polynomial space, subexponential time algorithms for planar graph problems, k-Path standsp out as a blank spot in an almost chartered map. Our polynomial 2 space, 2O( k log k)nO(1) time algorithm for k-Path on H-minor free graphs fills this gap. Our approach for obtaining polynomial space subexponential time al- gorithm for k-Path seems applicable to other problems also that do not admit polynomial kernels or not known to admit a polynomial kernel. 2 Definitions and Notations In this section we give various definitions which we make use of in the pa- per. Let G be a graph then we use V (G) and E(G) to denote its vertex set and the edge set respectively. A graph G0 is a subgraph of G if V (G0) ⊆ V (G) and E(G0) ⊆ E(G). The subgraph G0 is called an induced subgraph of G if E(G0) = fuv 2 E(G) j u; v 2 V (G0)g, in this case, G0 is also called the subgraph induced by V 0 and denoted with G[V 0]. By N(u) we denote the (open) neighborhood of u, that is, the set of all vertices adjacent to u. The closed neighbourhood of u is 3 S N[u] = N(u) [ fug.