Composing dynamic programming tree-decomposition-based algorithms
aa r X i v : . [ c s . D S ] A p r Composing dynamic programmingtree-decomposition-based algorithms
Julien Baste ∗ Abstract
Given two integers ℓ and p as well as ℓ graph classes H , . . . , H ℓ , the problems GraphPart ( H , . . . , H ℓ , p ), VertPart ( H , . . . , H ℓ ), and EdgePart ( H , . . . , H ℓ ) ask, given graph G as input, whether V ( G ), V ( G ), E ( G ) respectively can be partitioned into ℓ sets S , . . . , S ℓ such that, for each i between 1 and ℓ , G [ V i ] ∈ H i , G [ V i ] ∈ H i , ( V ( G ) , S i ) ∈ H i respectively.Moreover in GraphPart ( H , . . . , H ℓ , p ), we request that the number of edges with endpointsin different sets of the partition is bounded by p . We show that if there exist dynamicprogramming tree-decomposition-based algorithms for recognizing the graph classes H i , foreach i , then we can constructively create a dynamic programming tree-decomposition-basedalgorithms for GraphPart ( H , . . . , H ℓ , p ), VertPart ( H , . . . , H ℓ ), and EdgePart ( H , . . . , H ℓ ).We show that, in some known cases, the obtained running times are comparable to those ofthe best know algorithms. Keywords : graph partition; treewidth; parameterized complexity; dynamic programming;dynamic programming core model. ∗ Institute of Optimization and Operations Research, Ulm University, Ulm, Germany. Introduction
In one well-known graph partition problem, one is asked, given a graph G and an integer k ,whether V ( G ) can be partitioned into ℓ sets V , . . . , V ℓ such that the number of edges betweentwo different sets is small. These problems have many applications starting from clusteringgenes, through optimizing financial problems, parallel scientific computing to image segmenta-tion, and analysis of social networks. The above specified graph partitioning problem favorscutting small sets of isolated vertices in the input graph [17, 18]. In order to avoid this kindof solutions which is often undesirable for many practical applications, restrictions are oftenimposed on the sets V i , i ∈ [1 , ℓ ]. The most natural restriction is to require the partition tobe balanced [1]. Another one, used in image segmentation, is to consider normalized cuts [17],that is, cuts that maximize the similarity within the sets while minimizing the dissimilar-ity between the sets. In social networks, the graph clustering problem is a graph partitionproblem where the graphs G [ V i ], i ∈ [1 , ℓ ], are required to be dense [15]. In this paper, weconsider the graph partition problem in a general form defined in the following way. Given ℓ graph classes H , . . . , H ℓ and an integer p , the GraphPart ( H , . . . , H ℓ , p ) problem consists in,given a graph G , determining whether V ( G ) can be partitioned into ℓ sets V , . . . , V ℓ such that {{ u, v } ∈ E ( G ) | u ∈ V i , v ∈ V j , i = j } , i.e., the set of transversal edges, is of size at most p and G [ V i ] ∈ H i for each i ∈ [1 , ℓ ].Coloring problems are special kinds of graph partition problems where the number oftransversal edges is not relevant anymore. So, in the VertPart ( H , . . . , H ℓ ) problem, the taskis to determine whether the vertex set of the input graph G can be partitioned into ℓ sets V , . . . , V ℓ such that G [ V i ] ∈ H i for each i ∈ [1 , ℓ ]. The most famous coloring problem is the Graph -Colorability problem corresponding to VertPart ( I , I , I ) where I is the class ofedgeless graphs. This problem is one of the first problems proved by Karp to be NP -hard [11]and has attracted a lot of attention. If Graph -Colorability is the best known, severalother graph classes are also under study. For instance, in [19, 13, 21], the authors considerthe induced matching partition where each vertex set of the partition should induce a graphof maximum degree 1. In [6], the authors focus on VertPart ( H , . . . , H ℓ ) where ℓ is a fixedinteger, H = . . . = H ℓ = R , and R is either the class of every tree or the class of every forest.These problems are called Tree Arboricity when R is the class of every tree and VertexArboricity when R is the class of every forest. They provide polynomial time algorithms forblock-cactus graph, series-parallel graphs, and cographs. In [20], the authors focus on planargraph of diameter two. These problems have in particular applications in bioinformatics forconstructing phylogenetic trees [10].The treewidth of a graph is a structural parameter that measures the similarity of the graphto a forest. Courcelle [7] shows that every problem that can be expressed in monadic second-order logic can be solved in FPT -time parameterized by treewidth, i.e., in time f ( tw ) · n O (1) forsome function f where n (resp. tw ) denotes the size (resp. treewidth) of the input graph. In [14],the author shows that if there is a monadic second-order logic formula that recognizes a graphclass H , then for any fixed integer ℓ , VertPart ( H , . . . , H ℓ ), with H i = H for all i ∈ [1 , ℓ ], canbe solved in polynomial time on graphs of bounded treewidth. If [7] and [14] provide powerfulmeta-algorithms, the claimed running times may be far from being optimal. For instance, theCourcelle theorem [7] provides an 2 O ( tw ) · n O (1) algorithm for Graph -Coloring when it iswell known that an 2 O ( tw ) · n O (1) algorithm exists [8].Recently, treewidth has found several applications in bioinformatics when dealing with theso-called display graphs [5, 16, 3]. In a recent paper [10], the authors are interested in determin-ing whether a given graph of bounded treewidth is a positive instance of VertPart ( T , T ) where T is the class of all trees, and they provide an algorithm using Courcelle’s theorem.2he dynamic programming core model, introduced in [2], is a new formalism that describeswhat is a dynamic programming algorithm that process a tree decomposition, once, in a bottom-up approach. The authors use this model in order to construct meta-algorithms for what theycalled diverse problems.In the present paper, we use the expressive power of this formalism and show that, with somesmall refinements, it can be used to provide algorithms, with good running times, that solve thegraph partition problems parameterized by treewidth. Roughly speaking, given ℓ graph classes H , . . . , H ℓ , we show that solving GraphPart ( H , . . . , H ℓ , p ) or VertPart ( H , . . . , H ℓ ) is not muchharder than recognizing each H i , using a dynamic programming tree-decomposition-based algo-rithm. Moreover, we provide the explicit running time needed for solving GraphPart ( H , . . . , H ℓ , p )and VertPart ( H , . . . , H ℓ ) using the running time needed for recognizing each H i . We providesimilar result for the case where we want to partition the edge set of the graph, that is, for thegraph problem EdgePart ( H , . . . , H ℓ ) that, given a graph G , consists in determining whether E ( G ) can be partitioned into ℓ sets S , . . . , S ℓ such that ( V ( G ) , S i ) ∈ H i for each i ∈ [1 , ℓ ].The main feature of our contribution is to describe a meta-approach that leads to algorithmswhose running times are comparable to the best-known algorithms specifically designed for theindividual problems.In Section 2, we introduce the notations and useful definitions. Section 3 is devoted to thedefinition of the dynamic programming core model together with some examples of dynamiccores. The main results are given in Section 4. In Section 5, we show how theses results canbe applied to reproduce known results and to provide unknown algorithms. We provide a shortconclusion in Section 6. We denote by N the set of integers. Given two integers a and b we define [ a, b ] the set of everyinteger c such that a ≤ c ≤ b . Let G be a graph. Let ℓ be an integer and A = ( m , . . . , m ℓ ) bea ℓ -uplet. For each i ∈ [1 , ℓ ], we use the notation A. ( i ) to refer to the i -th coordinate of A , i.e.,in this case to m i . Note that the coordinates are numbered from 1 to ℓ . Given an alphabet Σ,we denote by W Σ the set of every finite set of finite words over Σ. We denote by Γ the set ofthree special letters denoted “(”, “)”, and “,”.We use V ( G ) and E ( G ) to denote the vertex and edge sets, respectively, of the graph G .Through this paper, we assume that vertices are represented as elements of N . Given a set S ⊆ V ( G ), we denote by G [ S ] the subgraph of G induced by S . Given a set S ⊆ E ( G ), wedenote by G [ S ] the graph ( V ( G ) , S ). Given two sets S , S ⊆ V ( G ), we denote by edge G ( S , S )the set of every edge of G with one endpoint in S and the other endpoint in S . We also denoteby G the set of every graph. Given an integer p , we denote by B p the class of every graph of sizeat most p . We also denote by T the set of every tree and by F the set of every forest. Given atree T rooted at r , for each t ∈ V ( T ), we denote by child ( t ) the set of every child of t in T andby desc ( t ) the set of every descendent of t in T .A rooted tree decomposition of a graph G is a tuple D = ( T, r, X ), where T is a tree rootedat r ∈ V ( T ) and X = { X t | t ∈ V ( T ) } is a collection of subsets of V ( G ) such that: • S t ∈ V ( T ) X t = V ( G ), • for every edge { u, v } ∈ E , there is a t ∈ V ( T ) such that { u, v } ⊆ X t , and • for each { x, y, z } ⊆ V ( T ) such that z lies on the unique path between x and y in T , X x ∩ X y ⊆ X z . 3he width of a tree decomposition D = ( T, r, X ), denoted by w ( D ), is defined as max t ∈ V ( T ) | X t |− . The treewidth of a graph G , denoted by tw ( G ), is the smallest integer w such that there existsa tree decomposition of G of width at most w . We also define Y t = X t ∪ S t ′ ∈ child ( t ) X t ′ and Z t = X t ∪ S t ′ ∈ desc ( t ) X t ′ .It is well known, see for instance [12], that given a rooted tree decomposition D = ( T, r, X ),we can, without loss of generality, assume that X r = ∅ , that, for each t ∈ V ( T ), t has at most2 children and that | Y t | ≤ | X t | + 1. In the following we always assume that the rooted treedecompositions have these properties.Given a graph G , a rooted tree decomposition D = ( T, r, X ) of G , and a set S ⊆ V ( G ), wedefine D [ S ] to be ( T, r, { X t ∩ S | t ∈ V ( T ) } ). Note that D [ S ] is a rooted tree decomposition of G [ S ]. In this section we use a small variation of the dynamic programming core model introducedin [2]. The main idea of this model is to formalize what is a dynamic programming algorithmbased on a tree decomposition. This will allows us to manipulate these algorithms in theregeneric form in order to construct meta-algorithms.
Definition 1 (Dynamic Core) . A dynamic core C over an alphabet Σ is a set of four functions: • Accept C : G → W Σ , • Process C , : G → W Σ , • Process C , : G × G → W , and • Process C , : G × G × G → W . In the following, we always assume that the associated alphabet is implicitly given when adynamic core is mentioned and we denote by Σ C the alphabet associated to a dynamic core C .Given a dynamic core C , a graph G and a rooted tree decomposition D = ( T, r, X ) of G , the data of C associated to ( G, D ) are, for each t ∈ V ( T ): Accept C ,G, D = Accept ( G [ X r ]) Process C ,G, D ( t ) = Process C , ( G [ X t ]) if child ( t ) = ∅ , Process C , ( G [ X t ] , G [ X t ′ ]) if child ( t ) = { t ′ } , and Process C , ( G [ X t ] , G [ X t ′ ] , G [ X t ′′ ]) if child ( t ) = { t ′ , t ′′ } . Given a function f : K → J and an input I ∈ K , we denote by τ ( f, I ) the time needed tocompute f ( I ). Given a dynamic core C , a graph G and a rooted tree decomposition D = ( T, r, X )we let: τ ( C , G, D , t ) = max A ⊆ Y t τ ( Process C , ( G [ A ∩ X t ])) if child ( t ) = ∅ ,max A ⊆ Y t τ ( Process C , ( G [ A ∩ X t ] , G [ A ∩ X t ′ ])) if child ( t ) = { t ′ } , andmax A ⊆ Y t τ ( Process C , ( G [ A ∩ X t ] , G [ A ∩ X t ′ ] , G [ A ∩ X t ′′ ])) if child ( t ) = { t ′ , t ′′ } . We also define τ ( C , G, D ) = P t ∈ V ( T ) τ ( C , G, D , t ) and size ( C , G, D , t ) = max A ⊆ Y t | Process C ,G [ A ] , D [ A ] ( t ) | .Note that, for each t ∈ V ( T ), Process C ,G [ Y t ] , D [ Y t ] ( t ) = Process C ,G, D ( t ). We say that a dynamiccore C is polynomial , if for each graph G , each rooted tree decomposition D = ( T, r, X ) of G ,and each t ∈ V ( T ), size ( C , G, D , t ) and τ ( C , G, D , t ) are polynomial.4 efinition 2. Let C be a dynamic core, G be a graph in G , and D = ( T, r, X ) be a rootedtree decomposition of G . A ( C , G, D )-witness is a function α : V ( T ) → Σ ∗ C such that α ( r ) ∈ Accept C ,G, D and for each t ∈ V ( T ) ,if t has no child, α ( t ) if t has a unique child t ′ , and ( α ( t ) , α ( t ′ )) if t has exactly two children t ′ and t ′′ . ( α ( t ) , α ( t ′ ) , α ( t ′′ )) ∈ Process C ,G, D ( t )The witness provided in Definition 2 can be seen as a proof of correction of the algorithmswe can produce using a given dynamic core. Definition 3.
Let H be a class of graphs. We say that a dynamic core C solves H if for eachgraph G ∈ G , and each rooted tree decomposition D of G , G ∈ H if and only if a ( C , G, D ) -witnessexists. As explained in [2] and summarized in Theorem 4, a dynamic core can be seen as analgorithm producer. Moreover the running time of the produced algorithms is directly connectedto the definition of the associated dynamic core.
Theorem 4 ([2]) . Let H be a class of graphs and C be a dynamic core that solves H . Given agraph G ∈ G and a rooted tree decomposition D = ( T, r, X ) of G , one can decide whether G ∈ H in time O (cid:16)P t ∈ V ( T ) | Process C ,G, D ( t ) | + τ ( C , G, D ) (cid:17) . In this section we provide few examples of dynamic cores. We start by a dynamic core thatsolves I , the class of graphs with no edges. Observation 5. I can be solved by a polynomial dynamic core C .Proof. We define C such that for each G, G ′ , G ′′ ∈ G , Accept C ( G ) = {⊤} Process C , ( G ) = {⊤ | E ( G ) = ∅} Process C , ( G, G ′ ) = { ( ⊤ , ⊤ ) | E ( G ) = ∅} Process C , ( G, G ′ , G ′′ ) = { ( ⊤ , ⊤ , ⊤ ) | E ( G ) = ∅} In this case, Σ C = {⊤} where ⊤ represents the fact that the already explored part does notcontain any edge. For the running time, note that given a graph G and a rooted tree decom-position D = ( T, r, X ) of G , then for each t ∈ V ( T ), | Process C ,G, D ( t ) | ≤ τ ( C , G, D , t ) = O ( | X t | ).We also provide a bit more involved dynamic core that solves B p for some integer p , i.e, theclass of graph with at most p vertices. Observation 6.
Let p be an integer. B p can be solved by a polynomial dynamic core C . roof. We define C such that for each G, G ′ , G ′′ ∈ G , Accept C ( G ) = { q | q ∈ [0 , p ] } Process C , ( G ) = { } Process C , ( G, G ′ ) = { ( q, q ′ ) | q ′ ≥ , q ≤ p, and q = q ′ + | V ( G ′ ) \ V ( G ) |} Process C , ( G, G ′ , G ′′ ) = { ( q, q ′ , q ′′ ) | q ′ , q ′′ ≥ , q ≤ p, and q = q ′ + q ′′ + | ( V ( G ′ ) ∪ V ( G ′′ )) \ V ( G ) |} It is now an easy task to show that C solves B p . Simply note that we only count the number ofvertices in the part that has already been completely explored and forgotten and that X r = ∅ .For the running time, note that given a graph G and a rooted tree decomposition D =( T, r, X ) of G , then, for each t ∈ V ( T ), | Process C ,G, D ( t ) | ≤ ( p + 1) and τ ( C , G, D , t ) = O ( | Process C ,G, D ( t ) | ). The lemma follows.The rank-based approach [4] provides, in particular, a deterministic algorithm that solves Feedback Vertex Set in time 2 O ( tw ) · n O (1) , where n (resp. tw ) stands for the size (resp.treewidth) of the input graph. From this algorithm, one can easily decline a dynamic core forrecognizing if a graph is a tree. We omit the proof of it as it implies to reintroduce several toolspresented in [4] that are out of the scope of this paper. Observation 7.
The class T of trees can be solved by a dynamic core C such that, for eachgraph G , each rooted tree decomposition D = ( T, r, X ) of G , and each t ∈ V ( T ) : • | Process C ,G, D ( t ) | = 2 O ( w ( D )) · n O (1) • τ ( C , G, D ) = 2 O ( w ( D )) · | V ( T ) | · n O (1) Note in particular that the dynamic core provided in Observation 7 is not polynomial.
In this section we provide some simple combinations of dynamic cores. More precisely, we showhow to do the union and the intersection of two dynamic cores. Let H and H be two graphclasses and let C (resp. C ) be a dynamic core that solves H (resp. H ). We would like tostress that, in order to solve H ∩ H or H ∪ H , the naive procedure, consisting in using C and then using C , would be more efficient with regard to the running time but will not producea dynamic core. As the main theorems of the paper, namely Theorems 10, 11, and 12, rely onthe knowledge of a dynamic core, this naive procedure will not suit. Lemma 8.
Let ℓ be an integer, let H , . . . , H ℓ be graph classes and let, for each i ∈ [1 , ℓ ] , C i bea dynamic core that solves H i . There exists a dynamic core C that solves H = T i ∈ [1 ,ℓ ] H i suchthat, for each graph G , each rooted tree decomposition D = ( T, r, X ) of G , and each t ∈ V ( T ) : • Process C ,G, D ( t ) = Q i ∈ [1 ,ℓ ] | Process C i ,G, D ( t ) |• τ ( C , G, D ) = P i ∈ [1 ,ℓ ] τ ( C i , G, D ) + O (cid:16)P t ∈ V ( T ) | Process C ,G, D ( t ) | (cid:17) roof. We define C such that for each G, G ′ , G ′′ ∈ G , Accept C ( G ) = { ( m , . . . , m ℓ ) | ∀ i ∈ [1 , ℓ ] , m i ∈ Accept C i ( G ) } , Process C , ( G ) = { ( m , . . . , m ℓ ) | ∀ i ∈ [1 , ℓ ] , m i ∈ Process C i , ( G ) } , Process C , ( G, G ′ ) = { (( m , . . . , m ℓ ) , ( m ′ , . . . , m ′ ℓ )) |∀ i ∈ [1 , ℓ ] , ( m i , m ′ i ) ∈ Process C i , ( G, G ′ ) } , Process C , ( G, G ′ , G ′′ ) = { (( m , . . . , m ℓ ) , ( m ′ , . . . , m ′ ℓ ) , ( m ′′ , . . . , m ′′ ℓ )) |∀ i ∈ [1 , ℓ ] , ( m i , m ′ i , m ′′ i ) ∈ Process C i , ( G, G ′ , G ′′ ) } . We now prove that C solves H . First note that Σ C = Γ ∪ S i ∈ [1 ,ℓ ] Σ C i . Let G be a graph and D = ( T, r, X ) be a rooted tree decomposition of G .Assume first that G ∈ H , then by definition of H , for each i ∈ [1 , ℓ ], G ∈ H i . Let, for each i ∈ [1 , ℓ ], α i : V ( T ) → Σ ∗ C i be a ( C i , G, D )-witness. Note that it exists as C i solves H i and G ∈ H i . We define α : V ( T ) → Σ ∗ C such that for each t ∈ V ( T ), α ( t ) = ( α ( t ) , . . . , α ℓ ( t )). Byconstruction of C , α is a ( C , G, D )-witness.Assume now that there exists a ( C , G, D )-witness α : V ( T ) → Σ ∗ C . Then by definition of C ,for each t ∈ V ( T ), α ( t ) is a ℓ -uplet. Let define ℓ functions α i : V ( T ) → Σ ∗ C , i ∈ [1 , ℓ ], suchthat for each i ∈ [1 , ℓ ] and each t ∈ V ( T ), α i ( t ) = α ( t ) . ( i ). Then, by definition of C , for each i ∈ [1 , ℓ ], α i is a ( C i , G, D )-witness and so G ∈ H i . Thus G ∈ H .Let now analyze the needed running time for this algorithm. Let G be a graph and D =( T, r, X ) be a rooted tree decomposition of G . For each t ∈ V ( T ), we have, by definition, | Process C ,G, D ( t ) | = Q i ∈ [1 ,ℓ ] | Process C i ,G, D ( t ) | . In order to construct the data of C associated to( G, D ), we need first to construct the data of C i associated to ( G, D ) for each i ∈ [1 , ℓ ] and thento combine them. Thus, we have τ ( C , G, D ) = X i ∈ [1 ,ℓ ] τ ( C i , G, D ) + O X t ∈ V ( T ) | Process C ,G, D ( t ) | . Lemma 9.
Let ℓ be an integer, let H , . . . , H ℓ be graph classes and let, for each i ∈ [1 , ℓ ] , C i bea dynamic core that solves H i . There exists a dynamic core C that solves H = S i ∈ [1 ,ℓ ] H i suchthat, for each graph G , each rooted tree decomposition D = ( T, r, X ) of G , and each t ∈ V ( T ) : • Process C ,G, D ( t ) = Q i ∈ [1 ,ℓ ] | Process C i ,G, D ( t ) |• τ ( C , G, D ) = P i ∈ [1 ,ℓ ] τ ( C i , G, D ) + O (cid:16)P t ∈ V ( T ) | Process C ,G, D ( t ) | (cid:17) Proof.
Let ⊥ be an unused letter. We define C such that for each G, G ′ , G ′′ ∈ G , Accept C ( G ) = { ( m , . . . , m ℓ ) | ∃ i ∈ [1 , ℓ ] , m i ∈ Accept C i ( G ) } , Process C , ( G ) = { ( m , . . . , m ℓ ) | ∀ i ∈ [1 , ℓ ] , m i ∈ Process C i , ( G ) ∪ {⊥} } , Process C , ( G, G ′ ) = { (( m , . . . , m ℓ ) , ( m ′ , . . . , m ′ ℓ )) |∀ i ∈ [1 , ℓ ] , ( m i , m ′ i ) ∈ Process C i , ( G, G ′ ) ∪ { ( ⊥ , ⊥ ) } } , Process C , ( G, G ′ , G ′′ ) = { (( m , . . . , m ℓ ) , ( m ′ , . . . , m ′ ℓ ) , ( m ′′ , . . . , m ′′ ℓ )) |∀ i ∈ [1 , ℓ ] , ( m i , m ′ i , m ′′ i ) ∈ Process C i , ( G, G ′ , G ′′ ) ∪ { ( ⊥ , ⊥ , ⊥ ) } } . We prove, using the same kind of argumentation as for Theorem 8, that C solves H . Note thatin this case, the letter ⊥ is used for each coordinate i such that G
6∈ H i .7 Main theorem
In this section we show, given two integers ℓ and p , ℓ graph classes H , . . . , H ℓ and ℓ dynamiccores C , . . . , C ℓ such that, for each i ∈ [1 , ℓ ], C i solves H i , how to construct dynamic cores thatsolve GraphPart ( H , . . . , H ℓ , p ), VertPart ( H , . . . , H ℓ ), and EdgePart ( H , . . . , H ℓ ).We start by the graph partition problem, that is the most involved case. Theorem 10.
Let ℓ and p be two integers, let H , . . . , H ℓ be graph classes and let, for each i ∈ [1 , ℓ ] , C i be a dynamic core that solves H i . There exists a dynamic core C that solves H = GraphPart ( H , . . . , H ℓ , p ) such that, for each graph G , each rooted tree decomposition D =( T, r, X ) of G , and each t ∈ V ( T ) : • | Process C ,G, D ( t ) | ≤ ℓ | Y t | · ( p + 1) · Q i ∈ [1 ,ℓ ] size ( C i , G, D , t ) • τ ( C , G, D ) = P t ∈ V ( T ) (cid:16) O ( | Process C ,G, D ( t ) | ) + 2 | Y t | · P i ∈ [1 ,ℓ ] τ ( C i , G, D , t ) (cid:17) Proof.
We define C such that for each G, G ′ , G ′′ ∈ G , Accept C ( G ) = { (( m , V ) , . . . , ( m ℓ , V ℓ ) , q ) | q ≤ p,V , . . . , V ℓ is a partition of V ( G ), and ∀ i ∈ [1 , ℓ ] , m i ∈ Accept C i ( G [ V i ]) } , Process C , ( G ) = { (( m , V ) , . . . , ( m ℓ , V ℓ ) , | V , . . . , V ℓ is a partition of V ( G ) and ∀ i ∈ [1 , ℓ ] , m i ∈ Process C i , ( G [ V i ]) } , Process C , ( G, G ′ ) = { ((( m , V ) , . . . , ( m ℓ , V ℓ ) , q ) , (( m ′ , V ′ ) , . . . , ( m ′ ℓ , V ′ ℓ ) , q ′ )) | U , . . . , U ℓ is a partition of V ( G ) ∪ V ( G ′ ), ∀ i ∈ [1 , ℓ ] , V i = U i ∩ V ( G ) , ∀ i ∈ [1 , ℓ ] , V ′ i = U i ∩ V ( G ′ ) , ∀ i ∈ [1 , ℓ ] , ( m i , m ′ i ) ∈ Process C i , ( G [ V i ] , G ′ [ V ′ i ]) ,q ≤ p, and q = q ′ + X i ∈ [1 ,ℓ ] | edge G ( U i \ V ( G ) , ( V ( G ) ∪ V ( G ′ )) \ U i ) | } , Process C , ( G, G ′ , G ′′ ) = { ((( m , V ) , . . . , ( m ℓ , V ℓ ) , q ) , (( m ′ , V ′ ) , . . . , ( m ′ ℓ , V ′ ℓ ) , q ′ ) , (( m ′′ , V ′′ ) , . . . , ( m ′′ ℓ , V ′′ ℓ ) , q ′′ )) | U , . . . , U ℓ is a partition of V ( G ) ∪ V ( G ′ ) ∪ V ( G ′′ ), ∀ i ∈ [1 , ℓ ] , V i = U i ∩ V ( G ) , ∀ i ∈ [1 , ℓ ] , V ′ i = U i ∩ V ( G ′ ) , ∀ i ∈ [1 , ℓ ] , V ′′ i = U i ∩ V ( G ′′ ) , ∀ i ∈ [1 , ℓ ] , ( m i , m ′ i , m ′′ i ) ∈ Process C i , ( G [ V i ] , G ′ [ V ′ i ] , G ′′ [ V ′′ i ]) ,q ≤ p, and q = q ′ + q ′′ + X i ∈ [1 ,ℓ ] | edge G ( U i \ V ( G ) , ( V ( G ) ∪ V ( G ′ ) ∪ V ( G ′′ )) \ U i ) | } .
8e now prove that C solves H = GraphPart ( H , . . . , H ℓ , p ). First note that Σ C = Γ ∪ N ∪ S i ∈ [1 ,ℓ ] Σ C i . Let G be a graph and D = ( T, r, X ) be a rooted tree decomposition of G .Assume first that G ∈ H . Then, by definition, there exists V , . . . , V ℓ , partition of V ( G )such that for each i ∈ [1 , ℓ ], G [ V i ] ∈ H i and P ≤ i Theorem 11. Let ℓ be an integer, let H , . . . , H ℓ be graph classes and let, for each i ∈ [1 , ℓ ] , C i be a dynamic core that solves H i . There exists a dynamic core C that solves H = VertPart ( H , . . . , H ℓ ) such that, for each graph G , each rooted tree decomposition D = ( T, r, X ) of G , and each t ∈ V ( T ) : • | Process C ,G, D ( t ) | ≤ ℓ | Y t | · Q i ∈ [1 ,ℓ ] size ( C i , G, D , t ) • τ ( C , G, D ) = P t ∈ V ( T ) (cid:16) O ( | Process C ,G, D ( t ) | ) + 2 | Y t | · P i ∈ [1 ,ℓ ] τ ( C i , G, D , t ) (cid:17) roof. Using the same base than for Theorem 10, we define C such that for each G, G ′ , G ′′ ∈ G , Accept C ( G ) = { (( m , V ) , . . . , ( m ℓ , V ℓ )) | V , . . . , V ℓ is a partition of V ( G ) and ∀ i ∈ [1 , ℓ ] , m i ∈ Accept C i ( G [ V i ]) } , Process C , ( G ) = { (( m , V ) , . . . , ( m ℓ , V ℓ )) | V , . . . , V ℓ is a partition of V ( G ) and ∀ i ∈ [1 , ℓ ] , m i ∈ Process C i , ( G [ V i ]) } , Process C , ( G, G ′ ) = { ((( m , V ) , . . . , ( m ℓ , V ℓ )) , (( m ′ , V ′ ) , . . . , ( m ′ ℓ , V ′ ℓ ))) | U , . . . , U ℓ is a partition of V ( G ) ∪ V ( G ′ ), ∀ i ∈ [1 , ℓ ] , V i = U i ∩ V ( G ) , ∀ i ∈ [1 , ℓ ] , V ′ i = U i ∩ V ( G ′ ) , and ∀ i ∈ [1 , ℓ ] , ( m i , m ′ i ) ∈ Process C i , ( G [ V i ] , G ′ [ V ′ i ]) } , Process C , ( G, G ′ , G ′′ ) = { ((( m , V ) , . . . , ( m ℓ , V ℓ )) , (( m ′ , V ′ ) , . . . , ( m ′ ℓ , V ′ ℓ )) , (( m ′′ , V ′′ ) , . . . , ( m ′′ ℓ , V ′′ ℓ ))) | U , . . . , U ℓ is a partition of V ( G ) ∪ V ( G ′ ) ∪ V ( G ′′ ), ∀ i ∈ [1 , ℓ ] , V i = U i ∩ V ( G ) , ∀ i ∈ [1 , ℓ ] , V ′ i = U i ∩ V ( G ′ ) , ∀ i ∈ [1 , ℓ ] , V ′′ i = U i ∩ V ( G ′′ ) , and ∀ i ∈ [1 , ℓ ] , ( m i , m ′ i , m ′′ i ) ∈ Process C i , ( G [ V i ] , G ′ [ V ′ i ] , G ′′ [ V ′′ i ]) } . The proof that C solves H = VertPart ( H , . . . , H ℓ ) is omitted as it is similar to the oneprovided for Theorem 10 at the difference that this time we do not keep track of the transversaledges.Edge partitioning problems are really similar to coloring problem at the difference that thesubgraph we consider are induced by a set of edges instead of a set of vertices. Theorem 12. Let ℓ be an integer, let H , . . . , H ℓ be graph classes and let, for each i ∈ [1 , ℓ ] , C i be a dynamic core that solves H i . There exists a dynamic core C that solves H = EdgePart ( H , . . . , H ℓ ) such that, for each graph G , each rooted tree decomposition D = ( T, r, X ) of G , and each t ∈ V ( T ) : • | Process C ,G, D ( t ) | ≤ ℓ | E ( G [ Y t ]) | · Q i ∈ [1 ,ℓ ] size ( C i , G, D , t ) • τ ( C , G, D ) = P t ∈ V ( T ) (cid:16) O ( | Process C ,G, D ( t ) | ) + 2 | E ( G [ Y t ]) | · P i ∈ [1 ,ℓ ] τ ( C i , G, D , t ) (cid:17) roof. We define C such that for each G, G ′ , G ′′ ∈ G , Accept C ( G ) = { (( m , E ) , . . . , ( m ℓ , E ℓ )) | E , . . . , E ℓ is a partition of E ( G ) and ∀ i ∈ [1 , ℓ ] , m i ∈ Accept C i ( G [ E i ]) } , Process C , ( G ) = { (( m , E ) , . . . , ( m ℓ , E ℓ )) | E , . . . , E ℓ is a partition of E ( G ) and ∀ i ∈ [1 , ℓ ] , m i ∈ Process C i , ( G [ E i ]) } , Process C , ( G, G ′ ) = { ((( m , E ) , . . . , ( m ℓ , E ℓ )) , (( m ′ , E ′ ) , . . . , ( m ′ ℓ , E ′ ℓ ))) | U , . . . , U ℓ is a partition of E ( G ) ∪ E ( G ′ ), ∀ i ∈ [1 , ℓ ] , E i = U i ∩ E ( G ) , ∀ i ∈ [1 , ℓ ] , E ′ i = U i ∩ E ( G ′ ) , and ∀ i ∈ [1 , ℓ ] , ( m i , m ′ i ) ∈ Process C i , ( G [ E i ] , G ′ [ E ′ i ]) } , Process C , ( G, G ′ , G ′′ ) = { ((( m , E ) , . . . , ( m ℓ , E ℓ )) , (( m ′ , E ′ ) , . . . , ( m ′ ℓ , E ′ ℓ )) , (( m ′′ , E ′′ ) , . . . , ( m ′′ ℓ , E ′′ ℓ ))) | U , . . . , U ℓ is a partition of E ( G ) ∪ E ( G ′ ) ∪ E ( G ′′ ), ∀ i ∈ [1 , ℓ ] , E i = U i ∩ E ( G ) , ∀ i ∈ [1 , ℓ ] , E ′ i = U i ∩ E ( G ′ ) , ∀ i ∈ [1 , ℓ ] , E ′′ i = U i ∩ E ( G ′′ ) , and ∀ i ∈ [1 , ℓ ] , ( m i , m ′ i , m ′′ i ) ∈ Process C i , ( G [ E i ] , G ′ [ E ′ i ] , G ′′ [ E ′′ i ]) } . The proof that C solves H = EdgePart ( H , . . . , H ℓ ) is omitted as it is, again, similar to the oneprovided for Theorem 10 at the difference that this time we partition over the edges instead ofthe vertices and there is no transversal edges to consider. In this section we show how our results may lead to significant simplification when looking foralgorithms parameterized by treewidth.The first application of these results can be applied to Vertex Cover corresponding to VertPart ( B k , I ), for some integer k . Combining Observation 5, Observation 6, and Theorem 11,we obtain a dynamic core that solves Vertex Cover . Moreover, combined with Theorem 4,we obtain an algorithm solving Vertex Cover in time 2 tw · n O (1) , while it is known that noalgorithm running in time 2 o ( tw ) · n O (1) can solve Vertex Cover unless ETH fails [9].More generally, deletion problems are problems that attract a lot of attention and that canbe considered as coloring problems. Indeed, given a graph class H , the H -deletion correspondsto the problem VertPart ( B k , H ), for some integer k . Moreover, we show, in Observation 6 that B p -recognition , for some integer p , has a polynomial dynamic core. Combining Observation 6with Theorem 11, we obtain that if there exists a dynamic core such that recognizing H canbe done in time 2 f ( tw ) · n O (1) for some function f , then H -deletion can be solved in time2 O ( tw + f ( tw )) · n O (1) .The most basic and well-known coloring problem is Graph q -Coloring . Again we obtainan asymptotically optimal [8] algorithm by combining Observation 5 and Theorem 11. Corollary 13. Graph q -Coloring can be solved in time q tw · n O (1) . roof. Given a fixed integer q , the Graph q -Coloring problem correspond to VertPart ( H , . . . , H q )where for each i ∈ [1 , q ], H i = I . The result follows from the combination of Observation 5 andTheorem 11.As discussed in the introduction, finding an algorithm for VertPart ( T , T ) parameterized bythe treewidth of the input graph is a question of interest in bioinformatics. By combining Obser-vation 7, Theorem 11, and Theorem 4, we obtain an efficient algorithm solving VertPart ( T , T ). Corollary 14. There exists an algorithm that solves VertPart ( T , T ) in time O ( tw ) · n O (1) . In this paper, we provide a generic tool for solving graph partition problems, coloring problems,and edge partition problems parameterized by the treewidth of the input graph.In this conclusion we want to stress that when solving graph partition problems, we countthe number of transversal edges. The illustrated technique allows, for instance, with somesmall modifications, to count separately transversal edges between different vertex sets of thepartition. One can ask for instance for a partition of the vertex set of the input graph intothree sets V , V , V such that there are k , edges between V and V , at most k , edges edgesbetween V and V , and no edge between V and V for some integers k , and k , .More generally, we believe that using the dynamic programming core model, one can easilycompose dynamic programming tree-decomposition-based algorithms with several added con-straints. References [1] K. Andreev and H. Racke. Balanced Graph Partitioning. Theory of Computing Systems ,39:929–939, 2006.[2] J. Baste, M. Fellows, L. Jaffke, T. Masarik, M. de Oliveira Oliveira, G. Philip, and F. Rosa-mond. Diversity in Combinatorial Optimization. CoRR , abs/1903.07410, 2019.[3] J. Baste, C. Paul, I. Sau, and C. Scornavacca. Efficient FPT algorithms for (strict) com-patibility of unrooted phylogenetic trees. Bulletin of Mathematical Biology , 79(4):920–938,2017.[4] H. Bodlaender, M. Cygan, S. Kratsch, and J. Nederlof. Deterministic single exponentialtime algorithms for connectivity problems parameterized by treewidth. Information andComputation , 243(C):86–111, 2015.[5] D. Bryant and J. Lagergren. Compatibility of unrooted phylogenetic trees is FPT. Theo-retical Computer Science , 351:296–302, 2006.[6] G. Chang, C. Chen, and Y. Chen. Vertex and Tree Arboricities of Graphs. Journal ofCombinatorial Optimization , 8(3):295–306, 2004.[7] B. Courcelle. The monadic second-order logic of graphs. I. Recognizable sets of finitegraphs. Information and Computation , 85(1):12–75, 1990.[8] M. Cygan, F. Fomin, L. Kowalik, D. Lokshtanov, D. Marx, M. Pilipczuk, M. Pilipczuk,and S. Saurabh. Parameterized Algorithms . Springer, 2015.129] R. Impagliazzo, R. Paturi, and F. Zane. Which Problems Have Strongly ExponentialComplexity? Journal of Computer and System Sciences , 63(4):512–530, 2001.[10] R. Janssen, M. Jones, S. Kelk, G. Stamoulis, and T. Wu. Treewidth of display graphs:bounds, brambles and applications. CoRR , abs/1809.00907, 2018.[11] R. Karp. Reducibility Among Combinatorial Problems. Complexity of Computer Compu-tations , pages 85–103, 1972.[12] T. Kloks. Treewidth, Computations and Approximations . Springer, 1994.[13] I. Rajasingh and A. Shanthi. Induced Matching Partition of Petersen and Circulant Graphs. Procedia Engineering , 64:395–400, 2013.[14] M. Rao. MSOL partitioning problems on graphs of bounded treewidth and clique-width. Theoretical Computer Science , 377(1):260–267, 2007.[15] S. Schaeffer. Graph clustering. Computer Science Review , 1:27–64, 2007.[16] C. Scornavacca, L. van Iersel, S. Kelk, and D. Bryant. The agreement problem for unrootedphylogenetic trees is FPT. Journal of Graph Algorithms and Applications , 18:385–392,2014.[17] J. Shi and J. Malik. Normalized cuts and image segmentation. IEEE Transactions onPattern Analysis and Machine Intelligence , 22:888–905, 2000.[18] Z. Wu and R. Leahy. An optimal graph theoretic approach to data clustering: theoryand its application to image segmentation. IEEE Transactions on Pattern Analysis andMachine Intelligence , 15:1101–1113, 1993.[19] A. Yang and J. Yuan. Partition a graph with small diameter into two induced matchings. Applied Mathematics-A Journal of Chinese Universities , 19(3):245–251, 2004.[20] A. Yang and J. Yuan. On the vertex arboricity of planar graphs of diameter two. DiscreteMathematics , 307(19):2438–2447, 2007.[21] J. Yuan and Q. Wang. Partition the vertices of a graph into induced matchings.