Approximating pathwidth for graphs of small treewidth
Carla Groenland, Gwenaël Joret, Wojciech Nadara, Bartosz Walczak
AApproximating Pathwidth for Graphs of Small Treewidth
Carla Groenland ∗ Gwenaël Joret † Wojciech Nadara ‡ Bartosz Walczak § Abstract
We describe a polynomial-time algorithm which, given a graph G with treewidth t , approxi-mates the pathwidth of G to within a ratio of O ( t √ log t ). This is the first algorithm to achievean f ( t )-approximation for some function f .Our approach builds on the following key insight: every graph with large pathwidth has largetreewidth or contains a subdivision of a large complete binary tree. Specifically, we show thatevery graph with pathwidth at least th + 2 has treewidth at least t or contains a subdivision of acomplete binary tree of height h + 1. The bound th + 2 is best possible up to a multiplicativeconstant. This result was motivated by, and implies (with c = 2), the following conjecture ofKawarabayashi and Rossman (SODA’18): there exists a universal constant c such that everygraph with pathwidth Ω( k c ) has treewidth at least k or contains a subdivision of a completebinary tree of height k .Our main technical algorithm takes a graph G and some (not necessarily optimal) treedecomposition of G of width t in the input, and it computes in polynomial time an integer h , acertificate that G has pathwidth at least h , and a path decomposition of G of width at most( t + 1) h + 1. The certificate is closely related to (and implies) the existence of a subdivision of acomplete binary tree of height h . The approximation algorithm for pathwidth is then obtainedby combining this algorithm with the approximation algorithm of Feige, Hajiaghayi, and Lee(STOC’05) for treewidth. Tree decompositions and path decompositions are fundamental objects in graph theory. Foralgorithmic purposes, it would be highly useful to be able to compute such decompositions ofminimum width, that is, achieving the treewidth and the pathwidth of the graph, respectively.However, both these problems are NP-hard, and remain so even when restricted to very specificgraph classes [1, 3, 15, 16, 18, 19, 20].For treewidth, a relatively good approximation can be found in polynomial time thanks to aclassic algorithm of Feige, Hajiaghayi, and Lee [13]. Their algorithm computes a tree decompositionof an input graph G whose width is within a ratio of O ( p log tw( G )) of the treewidth tw( G ) of G .For pathwidth, however, not much seems to be known. The treewidth algorithm of Feige et al. can ∗ Mathematical Institute, University of Oxford, United Kingdom ( [email protected] ). † Département d’Informatique, Université Libre de Bruxelles, Brussels, Belgium ( [email protected] ). Researchsupported by an ARC grant from the Wallonia-Brussels Federation of Belgium, by a CDR grant from the NationalFund for Scientific Research (FNRS), and by the Wallonia Brussels International (WBI) agency. ‡ Institute of Informatics, University of Warsaw, Poland ( [email protected] ). This research is part of a projectthat has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020research and innovation programme Grant Agreement 714704. § Department of Theoretical Computer Science, Faculty of Mathematics and Computer Science, JagiellonianUniversity, Kraków, Poland ( [email protected] ). Research partially supported by the Polish National Agencyfor Academic Exchange (NAWA). a r X i v : . [ c s . D S ] A ug e modified to output a path decomposition with width within a ratio of O (log n p log tw( G )) ofthe pathwidth pw( G ) of G , using the fact that tw( G ) (cid:54) pw( G ) (cid:54) (tw( G ) + 1) log n when G has n vertices [13]. This seems to be the best known approximation algorithm for pathwidth.In this paper we describe a polynomial-time algorithm approximating pathwidth to within aratio of O (tw( G ) p log tw( G )), thus replacing the log n factor in the previous approximation ratiowith a tw( G ) factor. To our knowledge, this is the first approximation algorithm achieving anapproximation factor of f (tw( G )) or f (pw( G )) for some function f with no dependence on n .Our approach builds on the following key insight: every graph with large pathwidth has largetreewidth or contains a subdivision of a large complete binary tree. Theorem 1.1.
Every graph G with treewidth t − has pathwidth at most th + 1 or contains asubdivision of a complete binary tree of height h + 1 . The bound th + 1 is best possible up to a multiplicative constant (see Section 5). We note thatTheorem 1.1 was originally motivated by the following result of Kawarabayashi and Rossman [17]about treedepth, which is an upper bound on pathwidth: every graph with treedepth Ω( k log k )has treewidth at least k , or contains a subdivision of a complete binary tree of height k , or contains apath of order 2 k . The bound Ω( k log k ) was recently lowered to Ω( k ) by Czerwiński, Nadara, andPilipczuk [10], who also devised an O (tw( G ) log / tw( G ))-approximation algorithm for treedepth.Kawarabayashi and Rossman [17] conjectured that the third outcome of their theorem, the path oforder 2 k , could be avoided if one considered pathwidth instead of treedepth: they conjectured theexistence of a universal constant c such that every graph with pathwidth Ω( k c ) has treewidth atleast k or contains a subdivision of a complete binary tree of height k . Theorem 1.1 implies theirconjecture with c = 2, which is best possible (see Section 5). Both Theorem 1.1 and the treedepthresults [17, 10] are a continuation of a line of research on excluded minor characterizations of graphswith small values of their corresponding width parameters (pathwidth/treedepth/treewidth), whichwas started by the seminal Grid Minor Theorem [21] and its improved polynomial versions [8, 9].Every subdivision of a complete binary tree of height h has pathwidth d h/ e [22]. Hence, such asubgraph can be used to certify that the pathwidth of a given graph is large. The following keyconcept provides a stronger certificate of large pathwidth, more suitable for our purposes. Let( T h ) ∞ h =0 be a sequence of classes of graphs defined inductively as follows: T is the class of allconnected graphs, and T h +1 is the class of connected graphs G that contain three pairwise disjointsets of vertices V , V , and V such that G [ V ] , G [ V ] , G [ V ] ∈ T h and any two of V , V , and V canbe connected in G by a path avoiding the third one. Every graph in T h has the following properties: • it has pathwidth at least h (see Lemma 2.1), and • it contains a subdivision of a complete binary tree of height h (see Lemma 2.2).Theorem 1.1 has a short and simple proof (see Section 3). It proceeds by showing that everygraph with treewidth t − th + 1 or belongs to T h +1 . The stronger assertionallows us to apply induction on h . Unfortunately, this proof is not algorithmic.To obtain the aforementioned approximation algorithm, we prove the following algorithmicversion of Theorem 1.1. Its proof is significantly more involved (see Section 4). Theorem 1.2.
For every connected graph G with treewidth at most t − , there is an integer h (cid:62) such that G ∈ T h and G has pathwidth at most th +1 . Moreover, there is a polynomial-time algorithmto compute such an integer h , a path decomposition of G of width at most th + 1 , and a subdivisionof a complete binary tree of height h in G given a tree decomposition of G of width at most t − . Since every graph in T h has pathwidth at least h , combining Theorem 1.2 with the aforementionedapproximation algorithm for treewidth of Feige et al. [13], we obtain the following approximationalgorithm for pathwidth. 2 orollary 1.3. There is a polynomial-time algorithm which, given a graph G of treewidth t andpathwidth p , computes a path decomposition of G of width O ( t √ log t · p ) . Moreover, if a treedecomposition of G of width t is also given in the input, the resulting path decomposition has widthat most ( t + 1) p + 1 . We remark that if we consider graphs G coming from a fixed class of graphs with boundedtreewidth, then we can first use an algorithm of Bodlaender [4] to compute an optimal treedecomposition of G in linear time, and then use the above algorithm to approximate pathwidthto within a ratio of roughly tw( G ) + 1. We note the following two precursors of this result inthe literature (with slightly better approximation ratios): Bodlaender and Fomin [6] gave a 2-approximation algorithm for computing the pathwidth of outerplanar graphs (a subclass of graphs oftreewidth at most 2), and Fomin and Thilikos [14] gave a 3-approximation algorithm for computingthe pathwidth on Halin graphs (a subclass of graphs of treewidth at most 3).We conclude this introduction with a remark about parameterized algorithms, even though ourfocus in this paper is approximation algorithms with running time polynomial in the size of the inputgraph. Bodlaender [4] (see also [5]) designed a linear-time FPT algorithm for computing pathwidthwhen parameterized by the pathwidth. That is, for an n -vertex input graph G , his algorithmcomputes the pathwidth pw( G ) and an optimal path decomposition of G in f (pw( G )) · n time forsome computable function f . Bodlaender and Kloks [7] considered the problem of computing thepathwidth when the input graph has small treewidth. They devised an XP algorithm for computingpathwidth when parameterized by the treewidth: given an n -vertex graph G , the algorithm computespw( G ) and an optimal path decomposition of G in n f (tw( G )) time for some computable function f .It is an old open problem whether pathwidth is fixed-parameter tractable when parameterized bythe treewidth, that is, whether there exists an algorithm to compute the pathwidth of an n -vertexinput graph G in f (tw( G )) · n O (1) time for some computable function f . This question was firstraised by Dean [11]. Fomin and Thilikos [14] pointed out that even obtaining an approximation ofpathwidth when parameterized by treewidth is open. Our approximation algorithm is a solutionto the latter problem (in a strong sense—with polynomial dependence of the running time in theparameter) and can be seen as a step in the direction of Dean’s question. Graphs considered in this paper are finite, simple, and undirected. We use standard graph-theoreticterminology and notation. We allow a graph to have no vertices; by convention, such a graph is notconnected and has no connected components. The vertex set of a graph G is denoted by V ( G ). Avertex v of a graph G is considered a neighbor of a set X ⊆ V ( G ) if v / ∈ X and v is connected by anedge to some vertex in X . The neighborhood (thus defined) of a set X in G is denoted by N G ( X ).A tree decomposition of a graph G is a pair ( T, { B x } x ∈ V ( T ) ) where T is a tree and { B x } x ∈ V ( T ) is a family of subsets of V ( G ) called bags , satisfying the following two conditions: • for each vertex v of G , the set of nodes { x ∈ V ( T ) : v ∈ B x } induces a non-empty subtree of T ; • for each edge uv of G , there is a node x in T such that both u and v belong to B x .The width of a tree decomposition ( T, { B x } x ∈ V ( T ) ) is max x ∈ V ( T ) | B x | −
1. The treewidth of a graph G is the minimum width of a tree decomposition of G . A path decomposition and pathwidth aredefined analogously with the extra requirement that the tree T is a path. The treewidth and thepathwidth of a graph G are denoted by tw( G ) and pw( G ), respectively. We refer the reader to [12]for background on tree decompositions. 3 complete binary tree of height h is a rooted tree in which every non-leaf node has two childrenand every path from the root to a leaf has h edges. Such a tree has 2 h +1 − completeternary tree of height h is defined analogously but with the requirement that every non-leaf nodehas three children. A subdivision of a tree T is a tree obtained from T by replacing each edge uv with some path connecting u and v whose internal nodes are new nodes private to that path. Recall that ( T h ) ∞ h =0 is the sequence of classes of graphs defined inductively as follows: T is the classof all connected graphs, and T h +1 is the class of connected graphs G that contain three pairwisedisjoint sets of vertices V , V , and V such that G [ V ] , G [ V ] , G [ V ] ∈ T h and any two of V , V , and V can be connected in G by a path avoiding the third one.A T h -witness for a graph G ∈ T h is a complete ternary tree of height h of subsets of V ( G ) definedinductively following the definition of T h . The T -witness for a connected graph G is the tree withthe single node V ( G ), denoted by h V ( G ) i . A T h +1 -witness for a graph G ∈ T h +1 is a tree with root V ( G ) and with three subtrees W , W , W of the root that are T h -witnesses of G [ V ] , G [ V ] , G [ V ]for some sets V , V , V as in the definition of T h +1 ; it is denoted by h V ( G ); W , W , W i .It clearly follows from these definitions that every graph in T h has at least 3 h vertices and every T h -witness of an n -vertex graph has O ( n ) nodes. The next two lemmas explain the connection of T h to pathwidth and to subdivisions of complete binary trees. Lemma 2.1. If G ∈ T h , then pw( G ) (cid:62) h .Proof. The proof goes by induction on h . The case h = 0 is trivial. Now, assume that h (cid:62) h −
1. Since G ∈ T h , there are sets V , V , V ⊆ V ( G ) interconnected as inthe definition of T h , such that G [ V i ] ∈ T h − and thus pw( G [ V i ]) (cid:62) h − i = 1 , ,
3. Let P be apath decomposition of G . With bags restricted to V i , it becomes a path decomposition of G [ V i ]. Itfollows that for i = 1 , ,
3, there is a bag B i in P such that | B i ∩ V i | (cid:62) h . Assume without loss ofgenerality that B , B , B occur in this order in P . Since G [ V ] and G [ V ] are connected, there is apath that connects B ∩ V and B ∩ V in G avoiding V . This path must have a vertex in B , so | B (cid:114) V | (cid:62) | B | (cid:62) h + 1. This proves that pw( G ) (cid:62) h .The proof of Lemma 2.1 generalizes the well-known proof of the fact that (a subdivision of) acomplete binary tree of height h has pathwidth at least d h/ e . Actually, it is straightforward toshow that such a tree belongs to T d h/ e . Lemma 2.2. If G ∈ T h , then G contains a subdivision of a complete binary tree of height h as asubgraph. Moreover, it can be computed in polynomial time from a T h -witness for G .Proof. We prove, by induction on h , that every graph G ∈ T h contains the following structure: asubdivision S of a complete binary tree of height h with some root r and a path P from v to r suchthat V ( P ) ∩ V ( S ) = { r } . This is trivial for h = 0. For the induction step, assume that h (cid:62) h −
1. Let G ∈ T h and v ∈ V ( G ). Let V , V , V ⊆ V ( G ) be as in the definitionof T h . Assume without loss of generality that v ∈ V or v can be connected with V by a path in G avoiding V ∪ V . For i = 1 ,
2, since G [ V ] is connected and G has a path connecting V i with V and avoiding V − i , there is also a path in G from v to some vertex v i ∈ V i avoiding V ∪ V (cid:114) { v i } .These paths can be chosen so that they first follow a common path P from v to some vertex r in G − ( V ∪ V ) and then they split into a path Q from r to v and a path Q from r to v so that r is the only common vertex of any two of P, Q , Q . For i = 1 ,
2, the induction hypothesis providesan appropriate structure in G [ V i ]: a subdivision S i of a complete binary tree of height h − r i and a path P i from v i to r i such that V ( P i ) ∩ V ( S i ) = { r i } . Connecting r with S and S by the combined paths Q P and Q P , respectively, yields a subdivision S of a complete binarytree of height h with root r in G . The construction guarantees that V ( P ) ∩ V ( S ) = { r } .Clearly, given a T h -witness for G , the induction step described above can be performed inpolynomial time, and therefore the full recursive procedure of computing a subdivision of a completebinary tree of height h in G works in polynomial time. The following lemma will be used several times in the paper to combine path decompositions.
Lemma 2.3.
Let G be a graph and ( T, { B x } x ∈ V ( T ) ) be a tree decomposition of G of width t − . (1) If q ∈ V ( T ) and every connected component of G − B q has pathwidth at most ‘ , then there is apath decomposition of G of width at most ‘ + t which contains B q in every bag. (2) If Q is the path connecting x and y in T and every connected component of G − S q ∈ V ( Q ) B q has pathwidth at most ‘ , then there is a path decomposition of G of width at most ‘ + t whichcontains B x in the first bag and B y in the last bag.In either case, there is a polynomial-time algorithm to construct such a path decomposition of G from the path decompositions of the respective components C of width at most ‘ .Proof. In case (1), the path decomposition of G is obtained by concatenating the path decompositionsof the connected components of G − B q (which have width at most ‘ ) and adding B q to every bag.Now, consider case (2). For every node q of Q , let T q be the subtree of T induced on the nodes z such that the path from q to z in T contains no other nodes of Q , and let V q = S z ∈ T q B z . Applycase (1) to the graph G [ V q ], the tree decomposition ( T q , { B z } z ∈ T q ) of G [ V q ], and the node q ∈ V ( T q )to obtain a path decomposition of G [ V q ] of width at most ‘ + t containing B q in every bag. Then,concatenate the path decompositions thus obtained for all nodes q of Q (in the order they occur on Q ) to obtain a requested path decomposition of G . By Lemma 2.2, every graph in T h contains a subdivision of a complete binary tree of height h , soTheorem 1.1 is a direct corollary to the following statement. Theorem 3.1.
For every h ∈ N , every connected graph with treewidth at most t − has pathwidthat most th + 1 or belongs to T h +1 .Proof. The proof goes by induction on h . The statement is true for h = 0: if a connected graph G has a cycle or a vertex of degree at least 3, then G ∈ T , and otherwise G is a path, so pw( G ) (cid:54) h (cid:62) h − G be a connected graph and ( T, { B x } x ∈ V ( T ) ) be a tree decomposition of G of width at most t −
1. Thus | B x | (cid:54) t for every node x of T . Every edge xy of T splits T into two subtrees: T x | y containing x and T y | x containing y . For every oriented edge xy of T , let V x | y be the set of vertices of G contained only in bags of T x | y (i.e., vertices belonging to no bag of T y | x ), and let G x | y = G [ V x | y ]. Aslong as T has and edge xz such that G x | z is disconnected, we modify ( T, { B x } x ∈ V ( T ) ) by replicatingthe subtree T x | z into one distinct copy (connected to z ) for each connected component C of G x | z with bags restricted to V ( C ) ∪ B z . This makes ( T, { B x } x ∈ V ( T ) ) satisfy the following:for every node z of T and every connected component C of G − B z ,the node z has a distinct neighbor x in T such that G x | z = C . ( ∗ )5f T has a node z such that G x | z / ∈ T h for every neighbor x of z in T , then the induction hypothesisgives pw( G x | z ) (cid:54) t ( h −
1) + 1 for every such x , and Lemma 2.3 (1) applied with q = z yieldspw( G ) (cid:54) th + 1. For the rest of the proof, assume that no such node z exists.Let D be the set of oriented edges zx of T such that G x | z ∈ T h . By the assumption above, atleast one oriented edge zx going out of every node z of T belongs to D . Therefore, | D | (cid:62) | V ( T ) | , so T has at least one edge xy such that xy, yx ∈ D . Since supergraphs of graphs in T h also belong to T h , zx ∈ D implies yz ∈ D for every neighbor y of z other than x . Therefore, the edges xy of T with xy, yx ∈ D form a subtree K in T , while the other edges in D “point towards K ” in T . Let Z be the set of leaves of K . Since K has at least one edge, | Z | (cid:62) | Z | (cid:62)
3. Choose any distinct z , z , z ∈ Z . For i ∈ { , , } , let V i = V z i | x i , where x i isthe unique neighbor of z i in K . It follows that G [ V ] , G [ V ] , G [ V ] ∈ T h and, by the property ( ∗ ),the subgraphs G x | z , G x | z , and G x | z are connected, which implies that any two of V , V , and V can be connected by a path avoiding the third one. Thus G ∈ T h +1 .Now, suppose | Z | = 2. It follows that K is a path x . . . x m , where Z = { x , x m } . For every node x i of K and every neighbor y of x i in T − K , the induction hypothesis gives a path decomposition of G y | x i of width at most t ( h −
1) + 1. Lemma 2.3 (2) applied with Q = K yields pw( G ) (cid:54) th + 1. By Lemma 2.2, every graph in T h contains a subdivision of a complete binary tree of height h , whichcan be computed in polynomial time from a T h -witness of G . Therefore, Theorem 1.2 is a directcorollary to the following statement, the proof of which is presented in this section. Theorem 4.1.
There is a polynomial-time algorithm which, given a connected graph G and a treedecomposition of G of width at most t − , computes • a number h ∈ N such that G ∈ T h and pw( G ) (cid:54) th + 1 , • a T h -witness for G , • a path decomposition of G of width at most th + 1 . Let G be a graph with a fixed rooted tree decomposition ( T , { B x } x ∈ V ( T ) ) of width at most t − initial tree decomposition of G . For a node x of T , let T x be the subtree of T consisting of x and all nodes of T lying below x , and let V x be the set of vertices of G containedonly in bags of T x (i.e., in no bags of T − T x ). We show how to use ( T , { B x } x ∈ V ( T ) ) to define a normalized tree decomposition of G , which will have some additional desired properties.For an induced subgraph H of G , let CC( H ) denote the family of connected components of H (which is empty when H is the empty graph). LetSub( G ) = [ x ∈ V ( T ) CC( G [ V x ]) . For a connected graph G , the set Sub( G ) will be the node set of the normalized tree decomposition of G , which we are to define shortly. We will use Greek letters α , β , etc. to denote members ofSub( G ) (nodes of the normalized tree decomposition of G ). Here are some easy consequences ofthese definitions and the assumption that ( T , { B x } x ∈ V ( T ) ) is a tree decomposition of G . Lemma 4.2.
The following holds for every graph G and for Sub( G ) defined as above. (1) If G is connected, then G ∈ Sub( G ) . If α, β ∈ Sub( G ) , then V ( α ) ⊆ V ( β ) , or V ( β ) ⊆ V ( α ) , or V ( α ) ∩ V ( β ) = ∅ . (3) If α, β ∈ Sub( G ) and V ( α ) ∩ V ( β ) = ∅ , then no edge of G connects V ( α ) and V ( β ) . Now, assume that G is a connected graph. By Lemma 4.2, the members of Sub( G ) are organizedin a tree T with root G and with the following properties for any α, β ∈ Sub( G ): • if β is a descendant of α (i.e., α lies on the path from the root to β ), then V ( β ) ⊆ V ( α ); • if neither of α and β is a descendant of the other, then V ( α ) and V ( β ) are disjoint and non-adjacent in G .For each α ∈ Sub( G ), let A α be the set of vertices v for which α is the minimum member of Sub( G )such that v ∈ V ( α ), and let B α = A α ∪ N G ( V ( α )). Recall that N G ( V ( α )) ⊆ V ( G ) (cid:114) V ( α ). Lemma 4.3.
The following holds for every connected graph G . (1) { A α } α ∈ Sub( G ) is a partition of V ( G ) into non-empty sets. (2) ( T, { B α } α ∈ Sub( G ) ) is a tree decomposition of G . (3) | B α | (cid:54) t for every α ∈ Sub( G ) .Proof. It is clear from the definition that S α ∈ Sub( G ) A α = V ( G ). Let α ∈ Sub( G ). Since α isconnected and the vertex sets of the children of α in T are pairwise disjoint and non-adjacent, atleast one vertex of α is not a vertex of any child of α and thus belongs to A α . This shows (1).For the proof of (2), let α ∈ Sub( G ) and v ∈ A α . Then v ∈ B α . If v ∈ B β for some other β ∈ Sub( G ), then v must be a neighbor of V ( β ) in G , which implies that β is a descendant of α in T . In that case, v is also a neighbor of V ( γ ) (and thus v ∈ B γ ) for every internal node γ onthe path from α to β in T . This shows that the nodes β of T such that v ∈ B β form a non-emptyconnected subtree of T . It remains to show that any two adjacent vertices u and v of G belong to acommon bag B α . Let α be a minimal member of Sub( G ) containing at least one of u and v ; say, itcontains v . Then v ∈ A α . If u / ∈ A α , then u / ∈ V ( α ), by minimality of α , so u is a neighbor of V ( α )in G . In either case, u, v ∈ B α .For the proof of (3), let α ∈ Sub( G ), and let x be the lowest node of T such that α ∈ CC( G [ V x ]).Every vertex v ∈ A α belongs to B x ; otherwise it would belong to V y for some child y of x in T ,and the connected component of G [ V y ] containing v would be a proper induced subgraph of α ,contradicting v ∈ A α . Now, let v be a neighbor of V ( α ) in G . Thus v is a neighbor of some vertex u ∈ V ( α ) while v / ∈ V ( α ). It follows that u ∈ V x while v / ∈ V x , which implies that v belongs to somebag of T − T x as well as some bag of T x (as uv is an edge of G ), so it belongs to B x . This showsthat B α ⊆ B x , so | B α | (cid:54) | B x | (cid:54) t .We call ( T, { B α } α ∈ Sub( G ) ) the normalized tree decomposition of G . By Lemma 4.3, it has atmost | V ( G ) | nodes and its width is at most t −
1. It depends on the choice of the initial treedecomposition for G . In the algorithm, the graphs G considered above are induced subgraphs of acommon input graph G in given with an input tree decomposition ( T in , { B in x } x ∈ V ( T in ) ), and the initialtree decomposition ( T , { B x } x ∈ V ( T ) ) of G considered above in the definition of Sub( G ) is the inputtree decomposition of G in with appropriately restricted bags (some of which may become empty):( T , { B x } x ∈ V ( T ) ) = ( T in , { B in x ∩ V ( G ) } x ∈ V ( T in ) ) . The fact that the normalized tree decompositions for all induced subgraphs G of G in consideredin the algorithm come from a common input tree decomposition of G in has the following easyconsequences, which will be used in the complexity analysis of the algorithm in Subsection 4.3. Lemma 4.4.
The following holds for every induced subgraph G of the input graph G in . If α ∈ Sub( G ) and V ( α ) ⊆ X ⊆ V ( G ) , then α ∈ Sub( G [ X ]) . (2) If α, β ∈ Sub( G ) , then α ∈ Sub( β ) , or β ∈ Sub( α ) , or V ( α ) ∩ V ( β ) = ∅ . (3) If α ∈ Sub( G ) , then Sub( α ) = { β ∈ Sub( G ) : V ( β ) ⊆ V ( α ) } . (4) If α ∈ Sub( G ) , X ⊆ V ( G ) , and γ ∈ CC( α [ X ]) , then γ ∈ Sub( G [ X ]) .Proof. Let T in x and V in x be defined like T x and V x but for the tree decomposition ( T in , { B in x } x ∈ V ( T in ) )of G in . For every induced subgraph G of G in , we haveSub( G ) = [ x ∈ V ( T in ) CC (cid:0) G in [ V in x ∩ V ( G )] (cid:1) . If α ∈ Sub( G ) and V ( α ) ⊆ X ⊆ V ( G ), then the fact that α is a connected component of G in [ V in x ∩ V ( G )] for some node x of T in implies that it is also a connected component of G in [ V in x ∩ X ],which in turn implies α ∈ Sub( G [ X ]). This shows (1).If α, β ∈ Sub( G ) and V ( α ) ⊆ V ( β ), then property (1) with X := V ( β ) yields α ∈ Sub( β ). Thisimplies (2) by Lemma 4.2 (2), and it also implies the “ ⊇ ” inclusion in (3) (with α and β interchanged).For the converse inclusion in (3), let α ∈ Sub( G ) and β ∈ Sub( α ). Thus V ( β ) ⊆ V ( α ). Let x andbe a node of T in such that α is a connected component of G in [ V in x ∩ V ( G )]. Since V ( α ) ⊆ V in x , thereis a node y in T in x (implying V in y ⊆ V in x ) such that β is a connected component of G in [ V in y ∩ V ( α )].It follows that β is a connected component of G in [ V in y ∩ V ( G )], so β ∈ Sub( G ).Finally, if α ∈ Sub( G ), X ⊆ V ( G ), and γ ∈ CC( α [ X ]), then α is a connected component of G in [ V in x ∩ V ( G )] for some node x of T in , whence it follows that γ is a connected component of G in [ V in x ∩ X ] and thus γ ∈ Sub( G [ X ]). This shows (4). The core of the algorithm is a recursive procedure solve ( G, b ), where G is a connected graph withtw( G ) (cid:54) t − b ∈ N ∪ {∞} is an upper bound request . It computes the following data: • a number h = h ( G, b ) ∈ N such that h (cid:54) b , • a T h -witness W ( G, b ) of G , • only when h < b : a path decomposition P ( G, b ) of G of width at most th + 1.The algorithm uses memoization to compute these data only once for each pair ( G, b ). A run of solve ( G, ∞ ) produces the outcome requested in Theorem 4.1.The purpose of the upper bound request is optimization—we tell the procedure that if it canprovide a T b -witness for G , then we no longer need any path decomposition for G . This allows theprocedure to save some computation, perhaps preventing many unnecessary recursive calls. Ourcomplexity analysis of the algorithm will heavily rely on this optimization.Below, we present the procedure solve ( G, b ) for a fixed connected graph G and a fixed upperbound request b ∈ N ∪ {∞} . The procedure assumes access to the normalized tree decomposition( T, { B α } α ∈ Sub( G ) ) of G of width at most t −
1, obtained from some initial tree decomposition of G in the way described in Subsection 4.1. In the next subsection, we show that if the normalizedtree decompositions for all graphs G considered in the algorithm come from a common input treedecomposition of an input graph G in as described in Subsection 4.1, then a full run of solve ( G in , ∞ )makes recursive calls to solve ( G, b ) for only polynomially many distinct pairs (
G, b ).If b = 0, then we just set h ( G,
0) = 0 and W ( G,
0) = h V ( G ) i . Assume henceforth that b (cid:62) T has only one node, that is, Sub( G ) = { G } . Since V ( G ) is the bag of that node, | V ( G ) | (cid:54) t . If G has a cycle or a vertex of degree at least 3, then it has three vertices v , v , v suchthat any two of them can be connected by a path in G avoiding the third one. In that case, weset h ( G, b ) = 1 and W ( G, b ) = h V ( G ); h{ v }i , h{ v }i , h{ v }ii , and (if b >
1) we let P ( G, b ) be the8ath decomposition of G consisting of the single bag V ( G ), which has width at most t −
1. If G has no cycle or vertex of degree at least 3, then it is a path. In that case, we set h ( G, b ) = 0 and W ( G, b ) = h V ( G ) i , and we let P ( G, b ) be any path decomposition of G of width 1.Assume henceforth that T has more than one node. For each node α ∈ Sub( G ) (cid:114) { G } , we run solve ( α, b ) to compute h ( α, b ), W ( α, b ), and P ( α, b ) when h ( α, b ) < b . We call these recursive callsto solve primary . If any of them leads to h ( α, b ) = b , we just set h ( G, b ) = b and W ( G, b ) = W ( α, b ),and we terminate the procedure. Assume henceforth that h ( α, b ) < b for every α ∈ Sub( G ) (cid:114) { G } .Let k be the maximum value of h ( α, b ) for α ∈ Sub( G ) (cid:114) { G } . Thus k < b . We will considerseveral further cases, each leading to one of the following two outcomes:(A) We set h ( G, b ) = k . In that case, we let W ( G, b ) be W ( α, b ) for any node α ∈ Sub( G ) (cid:114) { G } such that h ( α, b ) = k , and we only need to provide an appropriate path decomposition P ( G, b ).(B) We set h ( G, b ) = k + 1. In that case, if k + 1 < b , we let P ( G, b ) be the path decomposition of G of width t ( k + 1) + 1 obtained by applying Lemma 2.3 (1) with q the root of T , and we onlyneed to provide an appropriate T k +1 -witness W ( G, b ).Let K be the subtree of T consisting of the root G and those nodes ξ ∈ Sub( G ) (cid:114) { G } for which h ( ξ, b ) = k . Let Z be the set of minimal nodes in K . Suppose | Z | = 1, say, Z = { ζ } . Let Q bethe path from the root to ζ in T , and let B Q = S ξ ∈ V ( Q ) B ξ . Every connected component γ of G − B Q is a node in T − Q ; in particular, γ ∈ Sub( G ) (cid:114) { G } and h ( γ, b ) < k , so P ( γ, b ) is a pathdecomposition of γ of width at most t ( k −
1) + 1. We set h ( G, b ) = k and apply Lemma 2.3 (2) toobtain a path decomposition P ( G, b ) of G of width at most tk + 1.Assume henceforth that | Z | (cid:62)
2. Let U = V ( G ) (cid:114) S ζ ∈ Z V ( ζ ). The definition of Z and propertiesof the normalized tree decomposition ( T, { B α } α ∈ Sub( G ) ) of G imply the following.(1) The sets V ( ζ ) with ζ ∈ Z are pairwise disjoint and non-adjacent in G . For each ζ ∈ Z , allnodes α of T such that B α ∩ V ( ζ ) = ∅ are descendants of ζ in T .(2) For each ζ ∈ Z , the neighborhood of V ( ζ ) in G is B ζ ∩ U .Let any path in G with all internal vertices in U be called a U -path . Consider an auxiliary graph H with vertex set Z where ζξ is an edge if and only if there is a U -path connecting V ( ζ ) and V ( ξ ).The graph H is connected, because so is G . Suppose that H has a cycle or a vertex of degree atleast 3. Then there are ζ , ζ , ζ ∈ Z such that any two of them can be connected by a path in H avoiding the third one. This and connectedness of the induced subgraphs ζ ∈ Z (cid:114) { ζ , ζ , ζ } implythat any two of the sets V ( ζ ) , V ( ζ ) , V ( ζ ) can be connected by a path in G avoiding the third one.We set h ( G, b ) = k + 1 and W ( G, b ) = h V ( G ); W ( ζ , b ) , W ( ζ , b ) , W ( ζ , b ) i .Assume henceforth that H has no cycle or vertex of degree at least 3, that is, H is a path ζ . . . ζ m with m = | Z | (cid:62)
2. We call this the key case of the procedure solve ( G, b ). For convenience ofnotation, let ζ = ζ m +1 = G . Every vertex in U is connected by a U -path to one or two consecutivesets among V ( ζ ) , . . . , V ( ζ m ). Define subsets U , , U , , . . . , U m,m +1 of U as follows: • U , is the set of vertices in U connected by a U -path to V ( ζ ) but not to V ( ζ ); • for 1 (cid:54) i < m , U i,i +1 is the set of vertices in U connected by a U -path to V ( ζ i ) and V ( ζ i +1 ); • U m,m +1 is the set of vertices in U connected by a U -path to V ( ζ m ) but not to V ( ζ m − ).For 1 (cid:54) i (cid:54) m , let B i = B ζ i , let U i be the set of vertices in U (cid:114) S mj =0 U j,j +1 connected by a U -path to V ( ζ i ), and let V i = V ( ζ i ) ∪ B i ∪ U i . In particular, U = U m = ∅ , so V = V ( ζ ) ∪ B and V m = V ( ζ m ) ∪ B m . The sets U i (1 < i < m ) and U i,i +1 (0 (cid:54) i (cid:54) m ) form a partition of U , and thesets V i (1 (cid:54) i (cid:54) m ) and U i,i +1 (0 (cid:54) i (cid:54) m ) cover V ( G ). These definitions imply the following.(3) For 1 (cid:54) i (cid:54) m , the following sets are subsets of B i : U i − ,i ∩ V i , the neighbors of U i − ,i in V i , V i ∩ U i,i +1 , and the neighbors of U i,i +1 in V i . Any two non-consecutive sets in the sequence U , , V , U , , . . . , V m , U m,m +1 are disjoint and non-adjacent.9or 0 (cid:54) i (cid:54) m , let Q i,i +1 be the path from ζ i to ζ i +1 in T , and let B i,i +1 = U i,i +1 ∩ S ξ ∈ V ( Q i,i +1 ) B ξ .Let Γ be the family of connected components of G [ V i ] − B i for 1 (cid:54) i (cid:54) m and of connectedcomponents of G [ U i,i +1 ] − B i,i +1 for 0 (cid:54) i (cid:54) m . Suppose that for each γ ∈ Γ, we have a pathdecomposition P γ of γ of width at most t ( k −
1) + 1. Then we apply • Lemma 2.3 (1) to G [ V i ], the tree decomposition ( T, { V i ∩ B α } α ∈ Sub( G ) ) of G [ V i ] and the node ζ i to obtain a path decomposition P i of G [ V i ] of width at most tk + 1 containing the set B i inevery bag, for 1 (cid:54) i (cid:54) m ; • Lemma 2.3 (2) to G [ U i,i +1 ], the tree decomposition ( T, { U i,i +1 ∩ B α } α ∈ Sub( G ) ) of G [ U i,i +1 ] andthe path Q i,i +1 to obtain a path decomposition P i,i +1 of G [ U i,i +1 ] of width at most tk + 1containing U i,i +1 ∩ B i in the first bag and U i,i +1 ∩ B i +1 in the last bag, for 0 (cid:54) i (cid:54) m .We set h ( G, b ) = k , and we concatenate these path decompositions P , , P , P , , . . . , P m , P m,m +1 toobtain a path decomposition P ( G, b ) of G of width at most tk + 1, as shown by the following claim. Claim 4.5.
The concatenation of P , , P , P , , . . . , P m , P m,m +1 is a path decomposition of G .Proof. If v ∈ V ( G ) (cid:114) S mi =1 B i , then v belongs to exactly one set among U , , V , U , , . . . , V m , U m,m +1 ,so it belongs to the bags in exactly one of P , , P , P , , . . . , P m , P m,m +1 , where the correspondingnodes form a non-empty subpath. Now, suppose v ∈ B i where 1 (cid:54) i (cid:54) m . Thus v ∈ V i , possibly v ∈ U i − ,i or v ∈ U i,i +1 , and v belongs to no other sets among U , , V , U , , . . . , V m , U m,m +1 . Since U i − ,i ∩ B i is contained in the last bag of P i − ,i , B i is contained in every bag of P i , and U i,i +1 ∩ B i is contained in the first bag of P i,i +1 , the nodes whose bags contain v form a non-empty subpath inthe concatenation. Now, consider an edge uv of G . If u, v ∈ V i where 1 (cid:54) i (cid:54) m , then both u and v belong to a common bag of P i . Similarly, if u, v ∈ U i,i +1 where 0 (cid:54) i (cid:54) m , then both u and v belong to a common bag of P i,i +1 . By (3) and the fact that B i ⊆ V i for 1 (cid:54) i (cid:54) m , these two casesexhaust all the edges of G , showing that every edge is realized in some bag of the concatenation.It remains to provide the path decompositions P γ for all γ ∈ Γ or to deal with the cases wherewe cannot provide them. Recall that K is the subtree of T consisting of the root G and those nodes ξ ∈ Sub( G ) (cid:114) { G } for which h ( ξ, b ) = k . Claim 4.6. If γ is a connected component of G [ V i ] − B i where (cid:54) i (cid:54) m , then either (a) γ is a node in T − K that is a child of ζ i in T , or (b) V ( γ ) ∩ V ( ζ i ) = ∅ and N G ( V ( γ )) ⊆ U i ∩ B i , which is possible only when < i < m .If γ is a connected component of G [ U i,i +1 ] − B i,i +1 where (cid:54) i (cid:54) m , then either (a) γ is a node in T − K that is a child in T of a node from Q i,i +1 , or (b) V ( γ ) ∩ V ( ξ ) = ∅ for every node ξ of Q i,i +1 and N G ( V ( γ )) ⊆ U i,i +1 ∩ B i,i +1 , which is possibleonly when < i < m .Proof. For the proof of the first statement, let γ be a connected component of G [ V i ] − B i where1 (cid:54) i (cid:54) m . Since ( T, { V i ∩ B α } α ∈ Sub( G ) ) is a tree decomposition of G [ V i ], there is a unique component T of T − ζ i whose bags contain vertices of γ . Let ν be the node in T that is a neighbor of ζ i in T .Suppose that ν is a child of ζ i in T . Then ν is a node in T − K (because ζ i is a minimal node in K ). The definition of the bags yields B α (cid:114) B i ⊆ V ( ν ) for α ∈ V ( T ) and ( B α (cid:114) B i ) ∩ V ( ν ) = ∅ for α ∈ V ( T − T ). Therefore, we have V ( γ ) ⊆ V ( ν ) ⊆ V ( ζ i ) (cid:114) B i ⊆ V i (cid:114) B i . Since γ is a connectedcomponent of G [ V i (cid:114) B i ] and V ( γ ) ⊆ V ( ν ) ⊆ V i (cid:114) B i , we have γ = ν (as ν is connected). Thisshows (a). Now, suppose that ν is the parent of ζ i in T . Since every vertex in V ( ζ i ) belongs to B α for some descendant α of ζ i in T , we have V ( γ ) ∩ V ( ζ i ) = ∅ , so V ( γ ) ⊆ U i . This is possible onlywhen 1 < i < m , because U = U m = ∅ . The definition of V i and the fact that N G ( V ( ζ i )) ⊆ B i imply N G ( U i (cid:114) B i ) ⊆ U i ∩ B i and thus N G ( V ( γ )) ⊆ U i ∩ B i . This shows (b).10or the proof of the second statement, let γ be a connected component of G [ U i,i +1 ] − B i,i +1 where 0 (cid:54) i (cid:54) m . Since ( T, { U i,i +1 ∩ B α } α ∈ Sub( G ) ) is a tree decomposition of G [ U i,i +1 ], there is aunique component T of T − Q i,i +1 whose bags contain vertices of γ . Let ξ be the node in Q i,i +1 and ν be the node in T such that ξν is an edge of T . Suppose that ν is a child of ξ in T . We have V ( γ ) ⊆ V ( ν ) ⊆ V ( ξ ) (cid:114) B ξ just like before. Since neither ζ i nor ζ i +1 is in an ancestor-descendantrelation with ν in T , the set V ( ν ) is disjoint from and non-adjacent with both V ( ζ i ) and V ( ζ i +1 ).This, connectedness of ν , and the fact that U i,i +1 ∩ V ( ν ) ⊇ V ( γ ) = ∅ imply V ( ν ) ⊆ U i,i +1 (by thedefinition of U i,i +1 ). This implies that no node from Z lies in T , as U i,i +1 ∩ V ( ζ ) = ∅ for every ζ ∈ Z . Thus ν is a node in T − K . Since γ is a connected component of G [ U i,i +1 (cid:114) B i,i +1 ] and V ( γ ) ⊆ V ( ν ) ⊆ U i,i +1 (cid:114) B i,i +1 , we have γ = ν (as ν is connected). This shows (a). Now, supposethat ν is the parent of ξ (in particular, ξ is the highest node of Q i,i +1 in T ). Thus V ( γ ) ∩ V ( ξ ) = ∅ just like before; this is possible only when 0 < i < m , because ξ = G (the root of T ) when i ∈ { , m } .The fact that V ( γ ) ⊆ U i,i +1 , N G ( V ( ζ i )) ⊆ B i , N G ( V ( ζ i +1 )) ⊆ B i +1 , and U i,i +1 ∩ ( B i ∪ B i +1 ) ⊆ B i,i +1 implies N G ( U i,i +1 (cid:114) B i,i +1 ) ⊆ U i,i +1 ∩ B i,i +1 and thus N G ( V ( γ )) ⊆ U i,i +1 ∩ B i,i +1 . This shows (b).Let a component γ ∈ Γ be called a child component when case (a) of Claim 4.6 holds for γ anda parent component when case (b) of Claim 4.6 holds for γ . Case (a) of Claim 4.6 implies that forevery child component γ , there has been a primary recursive call to solve ( γ, b ) and h ( γ, b ) < k , so P γ = P ( γ, b ) is a path decomposition of γ of width at most t ( k − − γ , we run solve ( γ, k ) to compute h ( γ, k ), W ( γ, k ), and P ( γ, k ) when h ( γ, k ) < k . We call these recursive calls secondary . If every secondary call leads to h ( γ, k ) < k ,then P ( γ, k ) is a requested path decomposition of γ of width at most t ( k −
1) + 1 for every parentcomponent γ . If some secondary call leads to h ( γ, k ) = k , then we set h ( G, b ) = k + 1 and let W ( G, b )be the T k +1 -witness provided by the following claim, while P ( G, b ) is constructed in the default wayfor the case h ( G, b ) = k + 1; in particular, we do not need any explicit path decomposition of γ . Claim 4.7. If γ is a parent component and h ( γ, k ) = k , then the following is a T k +1 -witness for G : • h V ( G ); W ( ζ i − , b ) , W ( γ, k ) , W ( ζ i +1 , b ) i when γ ∈ CC( G [ V i ] − B i ) with < i < m ; • h V ( G ); W ( ζ i , b ) , W ( γ, k ) , W ( ζ i +1 , b ) i when γ ∈ CC( G [ U i,i +1 ] − B i,i +1 ) with (cid:54) i < m .Proof. If γ ∈ CC( G [ V i ] − B i ) with 1 < i < m , then there is a path in G connecting • V ( ζ i − ) with V ( γ ) via U i − ,i ∪ V i , thus avoiding V ( ζ i +1 ), • V ( γ ) with V ( ζ i +1 ) via V i ∪ U i,i +1 , thus avoiding V ( ζ i − ), • V ( ζ i − ) with V ( ζ i +1 ) via U i − ,i ∪ V ( ζ i ) ∪ U i,i +1 , thus avoiding V ( γ ), because V ( γ ) ∩ V ( ζ i ) = ∅ by case (b) of Claim 4.6.If γ ∈ CC( G [ U i,i +1 ] − B i,i +1 ) with 1 (cid:54) i < m , then there is a path in G connecting • V ( ζ i ) with V ( γ ) via U i,i +1 , thus avoiding V ( ζ i +1 ), • V ( γ ) with V ( ζ i +1 ) via U i,i +1 , thus avoiding V ( ζ i ), • V ( ζ i ) with V ( ζ i +1 ) via V ( ξ ) avoiding V ( γ ), where ξ is the highest node of Q i,i +1 in T ; this isbecause ξ is connected, V ( ζ i ) ∪ V ( ζ i +1 ) ⊆ V ( ξ ), and V ( γ ) ∩ V ( ξ ) = ∅ by case (b) of Claim 4.6.This completes the description of the procedure solve ( G, b ). Since all recursive calls of the form solve ( γ, c ) that it makes are for proper connected induced subgraphs γ of G (and for c (cid:54) b ), theprocedure terminates and correctly computes the requested outcome. In this subsection, we let G denote the input graph previously denoted by G in . The algorithmconsists in running solve ( G, ∞ ) on the input graph G . It makes further recursive calls to solve ( β, b )11or various connected induced subgraphs β of G and upper bound requests b . Let every pair ( β, b )such that solve ( β, b ) is run by the algorithm (somewhere in the recursion tree) be called a subproblem .We show that if G has n vertices, then there are only O ( n log n ) subproblems.A key subproblem is a subproblem ( β, b ) for which the procedure solve ( β, b ) enters the key case,that is, | Z | (cid:62) H is a path. For a key subproblem ( β, b ), we let B ( β, b ) = B , ∪ B ∪ B , ∪ · · · ∪ B m ∪ B m,m +1 ,M ( β, b ) = ( B , ∪ B ∪ B , ∪ · · · ∪ B m − ∪ B m − ,m ) ∩ U, where the sets B i , B i,i +1 , and U are as defined in the description of solve ( β, b ). For every subproblem( β, b ), we let level( β, b ) be the maximum of 0 and the values h ( γ, b ) over all γ ∈ Sub( β ) (cid:114) { β } .In particular, level( β, b ) = k for the cases where k is defined in the description of solve ( β, b ). Itfollows that level( β, b ) (cid:54) b for every subproblem ( β, b ) and level( β, b ) < b for every key subproblem( β, b ). For every k ∈ N , let M k be the union of the sets M ( β, b ) over all key subproblems ( β, b ) withlevel( β, b ) = k . Lemma 4.8.
The following holds for any key subproblems ( α, a ) and ( β, b ) such that α ∈ Sub( β ) and max { level( α, a ) , level( β, b ) } < min { a, b } . (1) level( α, a ) (cid:54) level( β, b ) . (2) If level( α, a ) < level( β, b ) , then V ( α ) ∩ M ( β, b ) = ∅ . (3) If level( α, a ) = level( β, b ) , then M ( α, a ) ⊆ V ( α ) ∩ M ( β, b ) ⊆ B ( α, a ) .Proof. First, observe that if level( α, a ) = k < a , then level( α, c ) = k for every c greater than k ,because the runs of solve ( α, a ) and solve ( α, c ) perform identical operations. In particular, under theassumptions of the lemma, we have level( α, a ) = level( α, b ) and level( β, a ) = level( β, b ).Statement (1) now follows directly from the definition of level and from Lemma 4.4 (3). State-ment (2) follows from the fact that when level( α, b ) < level( β, b ), then none of the nodes from theset Z considered by solve ( β, b ) lie below α in T (by the definition of level), so there is a node ζ ∈ Z such that V ( α ) ⊆ V ( ζ ), while M ( β, b ) ⊆ V ( β ) (cid:114) S ζ ∈ Z V ( ζ ).For the proof of (3), assume level( α, b ) = level( β, b ), and let Z , m , ζ i , B i , U , U i,i +1 , and B i,i +1 bedefined with as in solve ( α, b ) or solve ( β, b ) with a respective superscript α or β . We have Z α ⊆ Z β and V ( ζ ) ∩ V ( α ) = ∅ for ζ ∈ Z β (cid:114) Z α by Lemma 4.4 (2), and thus U α = U β ∩ V ( α ). For each ζ ∈ Z α ,since α is connected, there is a U α -path connecting a vertex v ∈ V ( α ) with V ( ζ ) in α if and only ifthere is a U β -path connecting v with V ( ζ ) in β . Therefore, there is s ∈ { , . . . , m β − } such that • for 1 (cid:54) i (cid:54) m α , we have ζ αi = ζ βs + i and B αi = B βs + i ∩ V ( α ); • for 0 (cid:54) i (cid:54) m α , we have U αi,i +1 ⊇ U βs + i,s + i +1 ∩ V ( α ) and B αi,i +1 ⊇ B βs + i,s + i +1 ∩ V ( α ); • for 0 < i < m α , we have U αi,i +1 = U βs + i,s + i +1 ∩ V ( α ) and B αi,i +1 = B βs + i,s + i +1 ∩ V ( α ).This yields M ( α, a ) = M ( α, b ) ⊆ M ( β, b ) ∩ V ( α ) ⊆ B ( α, b ) = B ( α, a ). Lemma 4.9.
For every k ∈ N ∪ {∞} , every subproblem ( γ, k ) satisfies γ ∈ Sub( G − S i (cid:62) k M i ) .Proof. First, we prove the lemma for k = ∞ , that is, we prove that every subproblem ( γ, ∞ ) satisfies γ ∈ Sub( G ). Consider a subproblem ( γ, ∞ ), and assume without loss of generality that the claimholds for all proper supergraphs of γ . We have G ∈ Sub( G ), and if γ = G , then every call to solve ( γ, ∞ ) is a primary call from solve ( β, ∞ ) where γ ∈ Sub( β ) (cid:114) { β } , and since β is a propersupergraph of γ , the assumption yields β ∈ Sub( G ), which implies γ ∈ Sub( G ) by Lemma 4.4 (3).For k finite, we prove the following two statements by a common downward induction on k :(1) Every subproblem ( γ, k ) satisfies γ ∈ Sub( G − S i (cid:62) k M i ).(2) Every subproblem ( α, a ) with a (cid:62) k > level( α, a ) satisfies α ∈ Sub( G − S i (cid:62) k M i ).12or k greater than the maximum finite upper bound request used by the algorithm, both statementscome down to the claim that every subproblem ( γ, ∞ ) satisfies γ ∈ Sub( G ) proved above. For theinduction step, assume that both statements hold for numbers greater than k .For statement (1), consider a subproblem ( γ, k ), and assume without loss of generality that (1)holds for all subproblems ( β, k ) with V ( γ ) ⊂ V ( β ). As before, if a call to solve ( γ, k ) is a primary callfrom solve ( β, k ) where γ ∈ Sub( β ) (cid:114) { β } , then β ∈ Sub( G − S i (cid:62) k M i ) implies γ ∈ Sub( G − S i (cid:62) k M i )by Lemma 4.4 (3). The remaining case is that the algorithm makes a secondary call to solve ( γ, k )from solve ( α, a ) where a > k = level( α, a ). By the induction hypothesis, α ∈ Sub( G − S i>k M i ).We claim that V ( α ) ∩ M k ⊆ B ( α, a ). To prove this claim, let v ∈ V ( α ) ∩ M k . Let ( β, b )be a subproblem with b > k = level( β, b ) such that v ∈ M ( β, b ) (which exists by the definitionof M k ). By the induction hypothesis, β ∈ Sub( G − S i>k M i ). The fact that v ∈ V ( α ) ∩ V ( β )and Lemma 4.4 (2) yield α ∈ Sub( β ) or β ∈ Sub( α ). If α ∈ Sub( β ), then Lemma 4.8 (3) yields v ∈ V ( α ) ∩ M ( β, b ) ⊆ B ( α, a ). If β ∈ Sub( α ), then Lemma 4.8 (3) (with α and β interchanged)yields v ∈ M ( β, b ) ⊆ M ( α, a ) ⊆ B ( α, a ). This completes the proof of the claim.Since γ is a parent component in solve ( α, a ), it follows from cases (b) of Claim 4.6 and the defini-tions of B ( α, a ) and M ( α, a ) that γ is a connected component of α − B ( α, a ) and the neighborhoodof V ( γ ) in α is contained in M ( α, a ). This and the fact that M ( α, a ) ⊆ V ( α ) ∩ M k ⊆ B ( α, a ) yield γ ∈ CC( α − M k ). Since α ∈ Sub( G − S i>k M i ), Lemma 4.4 (4) applied to G := G − S i>k M i and X := V ( G ) (cid:114) S i (cid:62) k M i yields γ ∈ Sub( G − S i (cid:62) k M i ).For statement (2), let ( α, a ) be a subproblem with a (cid:62) k > level( α, a ). If a = k , then α ∈ Sub( G − S i (cid:62) k M i ) by (1), so assume a > k . The induction hypothesis yields α ∈ Sub( G − S i>k M i ).Suppose there is a vertex v ∈ V ( α ) ∩ M k . As before, let ( β, b ) be a subproblem with b > k = level( β, b )such that v ∈ M ( β, b ). By the induction hypothesis, β ∈ Sub( G − S i>k M i ). The fact that v ∈ V ( α ) ∩ V ( β ) and Lemma 4.4 (2) yield α ∈ Sub( β ) or β ∈ Sub( α ). If α ∈ Sub( β ), thenLemma 4.8 (2) (with α and β interchanged) yields V ( α ) ∩ M ( β, b ) = ∅ , which is a contradiction.If β ∈ Sub( α ), then Lemma 4.8 (1) yields level( β, b ) (cid:54) level( α, a ), which is again a contradiction.Thus V ( α ) ∩ M k = ∅ , which implies α ∈ Sub( G − S i (cid:62) k M i ) by Lemma 4.4 (1).Let n = | V ( G ) | . Lemma 4.3 (1) implies that | Sub( G [ X ]) | (cid:54) | X | (cid:54) n for every X ⊆ V ( G ). Thisand Lemma 4.9 imply that there are at most n subproblems of the form ( γ, k ) for every k ∈ N ∪ {∞} .Every finite upper bound request k used in the algorithm is O (log n ), because it occurs on somesecondary call to solve ( γ, k ) from solve ( α, a ) where α has a T k -witness, so | V ( α ) | (cid:62) k . Therefore,the total number of subproblems is O ( n log n ). Since the operations performed in a single run of solve (excluding the recursive calls) clearly take polynomial time, we conclude that the full run of solve ( G, ∞ ) takes polynomial time. This completes the proof of Theorem 4.1. Theorem 1.1 asserts that every graph with pathwidth at least th + 2 has treewidth at least t orcontains a subdivision of a complete binary tree of height h + 1. While this statement is true forall positive integers t and h , we remark that the interesting case is when h > log t −
2. Indeed,if h (cid:54) log t −
2, then the second outcome is known to always hold; this follows from a result ofBienstock, Robertson, Seymour, and Thomas [2]. We now show that Theorem 1.1 is tight up to amultiplicative factor when h > log t − In [2], it is proved that for every forest F , graphs with no F minors have pathwidth at most | V ( F ) | −
2. Inparticular, if G contains no subdivision of a complete binary tree of height h + 1, then pw( G ) (cid:54) h +2 (cid:54) t < th + 2. heorem 5.1. For any positive integers t and h , there is a graph with treewidth t and pathwidth atleast t ( h + 1) − that contains no subdivision of a complete binary tree of height h + 1 , d log t e ) . Fix a positive integer t . For a tree T , let T ( t ) be a graph obtained from T by replacing everynode of T with a clique on t vertices and replacing every edge of T with an arbitrary perfectmatching between the corresponding cliques. For h ∈ N , let T h be a complete ternary tree of height h . The following three claims show that the graph T ( t ) h satisfies the three conditions requested inTheorem 5.1, thus proving that Theorem 5.1 holds for T ( t ) h . Claim 5.2. If T is a tree on at least two vertices, then tw( T ( t ) ) = t .Proof. For each node x of T , let B x be the clique of t vertices in T ( t ) corresponding to x . A treedecomposition of T ( t ) of width t is obtained from T by taking B x as the bag of every node x of T and by subdividing every edge xy of T into a path of length t + 1 with the following sequence ofbags, assuming that the vertices u , . . . , u t in B x are matched to v , . . . , v t in B y , respectively: { u , . . . , u t } , { u , . . . , u t } ∪ { v } , { u , . . . , u t } ∪ { v , v } , . . . , { u t } ∪ { v , . . . , v t } , { v , . . . , v t } . This way, for every matching edge u i v i with 1 (cid:54) i (cid:54) t , there is a bag containing its two endpoints.Consequently, this is a valid tree decomposition of T ( t ) with bags of size at most t + 1.For the proof that tw( T ( t ) ) (cid:62) t , let xy be an edge of T , and assume that the vertices u , . . . , u t of B x are matched to v , . . . , v t in B y , respectively, as before. In any tree decomposition of T ( t ) ,there is a node x whose bag contains the clique B x and a node y whose bag contains the clique B y .Walk on the path from x to y and stop at the first node whose bag contains some vertex in B y .This bag must also contain all of B x , so it has size at least t + 1. Claim 5.3.
For every h ∈ N , we have pw( T ( t ) h ) (cid:62) t ( h + 1) − .Proof. We define the root clique of T ( t ) h as the clique in T ( t ) h corresponding to the root of T h . Weprove the following slightly stronger statement, by induction on h : in every path decomposition of T ( t ) h , there are a bag B of size at least t ( h + 1) and t vertex-disjoint paths in T ( t ) h each having oneendpoint in the root clique and the other endpoint in B .For the base case h = 0, the graph T ( t )0 is simply a complete graph on t vertices, and thestatement is trivial. For the induction step, assume that h (cid:62) h − R be the root clique of T ( t ) h . Let ( P, { B x } x ∈ V ( P ) ) be a path decomposition of T ( t ) h of minimumwidth. The graph T ( t ) h − R has three connected components C , C , and C that are copies of T ( t ) h − with root cliques R , R , and R , respectively. For each i ∈ { , , } , the induction hypothesisapplied to the path decomposition ( P, { B x ∩ V ( C i ) } x ∈ V ( P ) ) of C i provides a node x i of P such that • | B x i ∩ V ( C i ) | (cid:62) th , and • there are t vertex-disjoint paths in C i between B x i ∩ V ( C i ) and the root clique R i of C i .Assume without a loss of generality that the node x occurs between x and x on P . We prove theinduction statement for B := B x .For each i ∈ { , , } , we take the t vertex-disjoint paths from B x i to R i in C i and extend themby the matching between R i and R to obtain t vertex-disjoint paths from B x i to R in T ( t ) h [ R ∪ V ( C i )].In particular, there are t vertex-disjoint paths from B x to R in T ( t ) h , as required in the inductionstatement. Since | R | = t , the t paths from B x to R and the t paths from B x to R togetherform t vertex-disjoint paths from B x to B x in T ( t ) h [ V ( C ) ∪ R ∪ V ( C )], which therefore avoid V ( C ). Since x lies between x and x on P , the set B x (cid:114) V ( C ) must contain at least one vertexfrom each of these t paths. Thus | B x (cid:114) V ( C ) | (cid:62) t . Since | B x ∩ V ( C ) | (cid:62) th , we conclude that | B x | (cid:62) t ( h + 1), as required in the induction statement.14 laim 5.4. For any h ∈ N , the graph T ( t ) h contains no subdivision of a complete binary tree ofheight h + 1 , d log t e ) .Proof. A simple calculation shows that T h has h +1 − nodes. Thus | V ( T ( t ) h ) | + 1 (cid:54) h +1 t and solog (cid:0) | V ( T ( t ) h ) | + 1 (cid:1) (cid:54) log (3 h +1 t ) (cid:54) h + 1 , d log t e ) . If a graph G contains a subdivision of a complete binary tree of height c , then | V ( G ) | (cid:62) c +1 − ( | V ( G ) | + 1) (cid:62) c + 1. Therefore, T ( t ) h cannot contain a subdivision of a complete binarytree of height 3 max( h + 1 , d log t e ). Acknowledgment
This research was started at the Structural Graph Theory workshop in Gułtowy, Poland, in June 2019.We are grateful to the organizers and to the other workshop participants for creating a productiveworking atmosphere.
References [1] Stefan Arnborg, Derek G. Corneil, and Andrzej Proskurowski. Complexity of finding embeddingsin a k -tree. SIAM Journal on Algebraic and Discrete Methods , 8(2):277–284, 1987.[2] Dan Bienstock, Neil Robertson, Paul Seymour, and Robin Thomas. Quickly excluding a forest.
Journal of Combinatorial Theory, Series B , 52(2):274–283, 1991.[3] Hans L. Bodlaender. A tourist guide through treewidth.
Acta Cybernetica , 11(1–2):1–21, 1992.[4] Hans L. Bodlaender. A linear-time algorithm for finding tree-decompositions of small treewidth.
SIAM Journal on Computing , 25(6):1305–1317, 1996.[5] Hans L. Bodlaender. Fixed-parameter tractability of treewidth and pathwidth. In
TheMultivariate Algorithmic Revolution and Beyond: Essays Dedicated to Michael R. Fellows onthe Occasion of His 60th Birthday , pages 196–227. Springer, Berlin, Heidelberg, 2012.[6] Hans L. Bodlaender and Fedor V. Fomin. Approximation of pathwidth of outerplanar graphs.
Journal of Algorithms , 43(2):190–200, 2002.[7] Hans L. Bodlaender and Ton Kloks. Efficient and constructive algorithms for the pathwidthand treewidth of graphs.
Journal of Algorithms , 21(2):358–402, 1996.[8] Chandra Chekuri and Julia Chuzhoy. Polynomial bounds for the grid-minor theorem.
Journalof the ACM , 63(5):Article No. 40, 2016.[9] Julia Chuzhoy and Zihan Tan. Towards tight(er) bounds for the excluded grid theorem. In
Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms , pages1445–1464. Society for Industrial and Applied Mathematics, Philadelphia, 2019.[10] Wojciech Czerwiński, Wojciech Nadara, and Marcin Pilipczuk. Improved bounds for theexcluded-minor approximation of treedepth. In Michael A. Bender, Ola Svensson, and GrzegorzHerman, editors, , volume 144 of
Leibniz International Proceedings in Informatics (LIPIcs) , pages 34:1–34:13. Schloss Dagstuhl,Wadern, 2019. arXiv:1904.13077. 1511] Nathaniel Dean. Open problems. In Neil Robertson and Paul Seymour, editors,
Graph StructureTheory: Proceedings of a Joint Summer Research Conference on Graph Minors , volume 147 of
Contemporary Mathematics , pages 677–688. American Mathematical Society, Providence, 1993.[12] Reinhard Diestel.
Graph Theory , volume 173 of
Graduate Texts in Mathematics . Springer,Berlin, Heidelberg, fourth edition, 2010.[13] Uriel Feige, MohammadTaghi Hajiaghayi, and James R. Lee. Improved approximation algo-rithms for minimum weight vertex separators.
SIAM Journal on Computing , 38(2):629–657,2008.[14] Fedor V. Fomin and Dimitrios M. Thilikos. A 3-approximation for the pathwidth of Halingraphs.
Journal of Discrete Algorithms , 4(4):499–510, 2006.[15] Jens Gusted. On the pathwidth of chordal graphs.
Discrete Applied Mathematics , 45(3):233–248, 1993.[16] Michel Habib and Rolf H. Möhring. Treewidth of cocomparability graphs and a new order-theoretic parameter.
Order , 11(1):47–60, 1994.[17] Ken-ichi Kawarabayashi and Benjamin Rossman. A polynomial excluded-minor approximationof treedepth. In
Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on DiscreteAlgorithms , pages 234–246. Society for Industrial and Applied Mathematics, Philadelphia, 2018.[18] Ton Kloks, Hans L. Bodlaender, Haiko Müller, and Dieter Kratsch. Computing treewidthand minimum fill-in: all you need are the minimal separators. In Thomas Lengauer, editor,
Algorithms—ESA ’93 , volume 726 of
Lecture Notes in Computer Science , pages 260–271.Springer, Berlin, Heidelberg, 1993.[19] Ton Kloks, Dieter Kratsch, and Haiko Müller. Dominoes. In Ernst W. Mayr, Gunther Schmidt,and Gottfried Tinhofer, editors,
Graph-Theoretic Concepts in Computer Science , volume 903 of
Lecture Notes in Computer Science , pages 106–120. Springer, Berlin, Heidelberg, 1995.[20] Burkhard Monien and Ivan Hal Sudborough. Min Cut is NP-complete for edge weighted trees.
Theoretical Computer Science , 58(1):209–229, 1988.[21] Neil Robertson and Paul Seymour. Graph minors. V. Excluding a planar graph.
Journal ofCombinatorial Theory, Series B , 41(1):92–114, 1986.[22] Petra Scheffler.