René van Bevern Institut für Softwaretechnik und Theoretische Informatik, TU Berlin, Germany, {rene.vanbevern,manuel.sorge}@tu-berlin.de Andreas Emil Feldmann Combinatorics & Optimization, University of Waterloo, Canada, andreas.feldmann@uwaterloo.ca Manuel Sorge Institut für Softwaretechnik und Theoretische Informatik, TU Berlin, Germany, {rene.vanbevern,manuel.sorge}@tu-berlin.de Ondřej Suchý Faculty of Information Technology, Czech Technical University in Prague, Czech Republic, ondrej.suchy@fit.cvut.cz
###### Abstract

A balanced partition is a clustering of a graph into a given number of equal-sized parts. For instance, the Bisection problem asks to remove at most edges in order to partition the vertices into two equal-sized parts. We prove that Bisection is FPT for the distance to constant cliquewidth if we are given the deletion set. This implies FPT algorithms for some well-studied parameters such as cluster vertex deletion number and feedback vertex set. However, we show that Bisection does not admit polynomial-size kernels for these parameters.

For the Vertex Bisection problem, vertices need to be removed in order to obtain two equal-sized parts. We show that this problem is FPT for the number of removed vertices if the solution cuts the graph into a constant number of connected components. The latter condition is unavoidable, since we also prove that Vertex Bisection is W[1]-hard w.r.t. .

Our algorithms for finding bisections can easily be adapted to finding partitions into  equal-sized parts, which entails additional running time factors of . We show that a substantial speed-up is unlikely since the corresponding task is W[1]-hard w.r.t. , even on forests of maximum degree two. We can, however, show that it is FPT for the vertex cover number.

## 1 Introduction

In this article we consider partitioning problems on graphs. These are clustering-type problems in which the clusters need to be equal-sized, and the number of edges connecting the clusters needs to be minimized. At the same time the desired number of clusters is given. We begin with the setting in which only two clusters need to be found, and later generalize to more clusters. In particular we consider the Bisection, Vertex Bisection, and Balanced Partitioning problems, which are defined below. We study these problems from a parameterized complexity point of view and consider several parameters that naturally arise from the known results (see Table 1). That is, we consider a given parameter of an input instance and ask whether an algorithm with running time exists that optimally solves the problem. Here  is the instance size and  is a function that only depends on . If there is such an algorithm, then the problem is called fixed-parameter tractable (or FPT for short) with respect to . For in-depth introductions to parameterized complexity we refer to the literature [46, 26, 19]. Throughout this article we use standard terminology of graph theory [17].

### 1.1 The Bisection problem

The first problem we consider is the NP-hard [32] Bisection problem for which the  vertices of a graph  need to be partitioned into two parts and of size at most  each, while minimizing the number of edges connecting and . The partition  is called a bisection of , and the number of edges connecting vertices in with vertices in  is called the cut size. Throughout this article it will be convenient to consider Bisection as a decision problem, which is defined as follows.

Bisection

Input:

A graph  and a positive integer .

Question:

Does  have a bisection with cut size at most ?

The Bisection problem is of importance both in theory and practice, and for instance has applications in divide-and-conquer algorithms [41], computer vision [40], and route planning [15]. As a consequence, the problem has been thoroughly studied in the past. It is known that it is NP-hard in general [32] and that the minimum cut size can be approximated within a factor of  [48]. Assuming the Unique Games Conjecture, no constant factor approximations exist [37]. For special graph classes such as trees [42] and solid grids [24] the optimum cut size can be computed in polynomial time. For planar graphs it is still open whether Bisection is NP-hard, but it is known to be FPT with respect to the cut size [9].

It was recently shown by Cygan et al. [14] that Bisection is FPT with respect to the cut size on general graphs. We complement this result by showing that Bisection does not allow for polynomial-size problem kernels for this parameter unless coNPNP/poly. Hence, presumably there is no polynomial-time algorithm that reduces an instance of Bisection to an equivalent one that has size polynomial in the desired cut size. We prove this by giving a corresponding result for all parameters that are polynomial in the input size and that do not increase when taking the disjoint union of graphs. We call such parameters union-oblivious. This includes parameters such as treewidth, cliquewidth, bandwidth, and others.

Some of these parameters have been considered for the Bisection problem before. For instance, we already mentioned the cut size, and it was shown that the problem is FPT with respect to treewidth [49, 52]. Even though treewidth is probably the most widely used graph parameter for sparse graphs, it is not suitable for dense graphs, although they can also have simple structure. For that purpose, Courcelle and Olariu [13] introduced the parameter cliquewidth [21]. Fomin et al. [27] showed that Bisection is W[1]-hard with respect to cliquewidth, that is, an FPT-algorithm is unlikely. On the positive side, they give an -time algorithm if a cliquewidth- expression is given. Generalizing the latter result we show that Bisection is FPT with respect to the cliquewidth- vertex deletion number: the number of vertices that have to be deleted in order to obtain a graph of constant cliquewidth .111To be precise, we need the vertex deletion set to be given to obtain an FPT algorithm for this parameter. To the best of our knowledge this parameter has not been considered in the past. The cliquewidth- deletion number is a generalization of several well-studied graph parameters like vertex cover number ([12], cluster vertex deletion number and cograph vertex deletion number ([13], feedback vertex set number ([39], and treewidth- vertex deletion number ([13, 28].

### 1.2 The Vertex Bisection problem

The next problem we consider is the Vertex Bisection problem, for which vertices instead of edges need to be removed in order to bisect the graph. More formally, let  be a graph and be a subset of the vertices of . We call  an --separator for  if there are vertex sets  such that  forms a partition of , and there are no edges between  and  in . Moreover, we call  balanced if . The problem then is the following.

Vertex Bisection

Input:

A graph  and a positive integer .

Question:

Does  contain a balanced separator of size at most ?

We show that this problem is more general than Bisection in the sense that any solution to Vertex Bisection can be transformed into a solution to Bisection having (almost) the same cut size and (almost) the same number of cut out connected components, in polynomial time. In contrast to Bisection however, we prove that Vertex Bisection is W[1]-hard with respect to the cut size. In fact this still holds true when combining the cut size and the number of cut out connected components as a parameter. This means that to obtain a fixed-parameter algorithm it is unavoidable to impose some additional constraint.

We show that the Vertex Bisection problem is FPT with respect to the cut size, if an optimal solution cuts the graph into a given constant number of connected components. We chose this condition as a natural candidate: First, in practice optimal bisections often cut into very few connected components, typically only into two or three [2, 36, 51, 16]. Second, also for random regular graphs the sets  and  of the optimum bisection are connected with high probability [10]. And third, Vertex Bisection remains NP-hard even if all optimum bisections cut into exactly two connected components (this follows easily by combining the NP-hardness proof for Bisection of Garey et al. [32] with our techniques from Section 2.2; see also [8] for a related problem). To achieve our FPT result for Vertex Bisection, we generalize the treewidth reduction technique for separation problems that has been recently introduced by Marx et al. [45]. By adapting it to the global balancedness constraint of our problem, we address an open question by Marx et al. [45] of whether this is possible.

### 1.3 The Balanced Partitioning problem

Apart from Bisection and Vertex Bisection we also study the Balanced Partitioning problem. This is a natural generalization of the Bisection problem, in which the vertices of a graph need to be partitioned into  equal-sized parts, for some arbitrary given number (instead of only two). More formally the problem is defined as follows, where the cut size of a partition is the number of edges incident to vertices of different parts.

Balanced Partitioning

Input:

A graph and two positive integers and .

Question:

Is there a partition of the vertices of into sets of size at most each and with cut size at most ?

Note that there is no explicit lower bound on the part sizes. This means that they can technically speaking be unbalanced. However the definition above is the most commonly used one in the literature. Also, for numerous applications such as parallel computing [3] or VLSI circuit design [4], only an upper bound is needed.

Our algorithms for the special case Bisection can easily be extended to algorithms for Balanced Partitioning, as we will describe in Section 5. However the algorithms have additional running time factors in the order of . We observe that Balanced Partitioning is W[1]-hard for the number  of cut out parts even on forests of maximum degree two and hence it is unlikely that running time factors of  can be avoided. Furthermore, we show that the problem remains W[1]-hard on more general graphs for the larger number  of cut out connected components.

Regarding structural graph parameters, many of the known hardness results for Balanced Partitioning already rule out FPT algorithms for parameters such as treewidth or cluster vertex deletion number (Balanced Partitioning is NP-hard for trees [23] and graphs formed by a disjoint union of cliques [1]). On the positive side we can show that Balanced Partitioning is FPT with respect to the vertex cover number . Recently Ganian and Obdržálek [30] developed an algorithmic framework with which they were able to show that Balanced Partitioning is FPT with respect to the combined parameters and . Hence we improve on this result by removing the dependence on .

### 1.4 Organization of the article

We begin with presenting our results for Vertex Bisection in Section 2. These include the hardness of Vertex Bisection, the FPT algorithm in case the number of cut out components is constant, and the reduction from Bisection showing that Vertex Bisection is more general. Section 3 contains incompressibility results for Bisection. In Section 4 we give our FPT algorithm for the cliquewidth- deletion number. Hardness results for Balanced Partitioning are given in Section 5, and Section 6 contains the FPT algorithm w.r.t. the vertex cover number.

## 2 Vertex Bisection and the Cut Size Parameter

In this section we show how to compute optimal bisections that cut into some constant number of connected components in FPT-time with respect to the cut size. As mentioned in the introduction, for Vertex Bisection one searches for a small set of vertices in order to bisect a given graph. We note below that Vertex Bisection generalizes Bisection and hence, there is also a corresponding algorithm for Bisection.

The outline of this section is as follows. First, we note that Vertex Bisection is W[1]-hard with respect to  and the number  of cut out components (Section 2.1). Hence, an additional constraint like  being constant is unavoidable to get an FPT-algorithm. We then proceed to show that Vertex Bisection indeed generalizes Bisection (Section 2.2). The FPT algorithm with respect to  and constant number of cut out components for Vertex Bisection is given in Section 2.3.

### 2.1 Hardness of Vertex Bisection

In this section we prove that Vertex Bisection is W[1]-hard with respect to the combination of the desired separator size and the number of cut out components. It follows, that it is in particular W[1]-hard for the parameter separator size.

###### Theorem 1.

Vertex Bisection is W[1]-hard with respect to the combined parameter , where  is the desired separator size and  is the maximum number of components after removing any set of at most  vertices from the input graph.

We reduce from the W[1]-hard Clique problem [19]. The reduction is an adaption of the one Marx [43] used to show W[1]-hardness for the Cutting Vertices problem. The construction we use is as follows.

###### Construction 1.

Suppose we want to construct an instance  of Vertex Bisection from an instance  of Clique. Without loss of generality, assume that  is even. The graph  is obtained by first copying  and then subdividing every edge, meaning to replace each  by a new edge vertex  and the edges . Next, we make  into a clique in  and we furthermore add to  a disjoint clique  with  vertices, where  and . Note that the overall number of vertices in  is .

Let us prove that Construction 1 is a parameterized reduction.

###### Proof of Theorem 1.

Assume that  contains a clique  of size . We claim that  also induces a balanced separator in . Let  be the set of edge vertices in  corresponding to the edges of . Consider the sets  and . Clearly, form a partition of , and since  is exactly the neighborhood of  in , there are no edges between  and . Moreover,

 |A| =(2n+2m−k−2(k2))−k−(k2)−(n+m−k−2(k2)) =n+m−k−(k2)=n+m−k−2(k2)+(k2)=|B|.

Thus, indeed  is a balanced separator for .

For the reverse direction first consider any vertex set  with . The graph  consists of two cliques that, without loss of generality, contain more than  vertices, in addition to degree-two vertices attached to the clique on . Furthermore, any pair of vertices in  has at most one common degree-two neighbor. Hence, the number of connected components of  is at most , which means that .

Now assume additionally that  is a balanced --separator for  and, without loss of generality, assume that . We may furthermore assume that . Otherwise we may successively replace all vertices in  with arbitrary vertices from , which is always non-empty since

 |D∖S| ≤|D|=n+m−k−2(k2) <(2n+2m−k−2(k2)−k)/2≤(|V(G′)|−|S|)/2.

Note that, without loss of generality, we may assume further that  is even. Otherwise, because  is even by assumption and we may simply add an arbitrary vertex from  or  to . Hence, since  is also even and , we have . Thus, in addition to the vertices in  the set  needs to get at least

 |V(G′)∖S|/2−|D|≥(2n+2m−2k−2(k2))/2−(n+m−k−2(k2))=(k2)

more vertices. Hence, needs to separate  edge vertices from . This can only be achieved if , and hence  induces a clique of size  in . ∎

### 2.2 Reducing Bisection to Vertex Bisection

Before turning to our algorithm for Vertex Bisection we show that it indeed transfers also to Bisection. That is, Vertex Bisection is more general than Bisection in our setting. We say that  is a -component separator for  if there are exactly  connected components in . A -component bisection is defined analogously.

###### Theorem 2.

There is a polynomial-time many-one reduction from Bisection to Vertex Bisection such that the desired separator size is one larger than the desired cut size. Furthermore, each -component bisection for the Bisection instance yields a -component balanced separator for the Vertex Bisection instance and vice versa.

The basic idea to prove Theorem 2 is to subdivide each edge and replace each vertex by a large clique in a given instance of Bisection. As deleting edge vertices corresponding to cut edges in a bisection then yields imbalanced parts, we use a gadget consisting of two very large cliques connected by a path to rebalance the parts.

###### Construction 2.

Let  be an instance of Bisection and without loss of generality, assume that  and denote . Construct a graph  as follows. For each vertex , introduce a clique  with  vertices. Next, for every edge  introduce a vertex  and make  adjacent to all vertices in both  and . Call the set of such “edge vertices” . Finally, add two cliques  and  with  vertices each and connect two arbitrary vertices of  and  by a path  with  inner vertices. Set the desired separator size to . This finishes the construction of a Vertex Bisection instance .

We claim that Construction 2 yields a proof for Theorem 2.

###### Proof of Theorem 2.

First, Construction 2 can easily be seen to be doable in polynomial time. Let us prove that it is a many-one reduction.

Let  be a bisection of , that is such that  and there are at most  edges between  and  in ; call the set of these edges . Let , , and . Note that  is an --separator of . Furthermore . Observe also that for any  there is a vertex  on  such that  is a --separator of  and . Hence, choosing  on  appropriately yields a balanced separator  for  that has size . Further, if  is a -component bisection, then  is a -component balanced separator.

For the converse direction, let  be a balanced --separator for . Observe that, for the cliques  and for each of the cliques , , removing  from their vertex set yields a set which is completely contained either in  or in . Furthermore, not both  and  are contained in  or in  since, otherwise, this would contradict the balancedness of . Let us assume without loss of generality, that  and . We claim that the number  of cliques , , that intersect  is the same as the number  of cliques , , that intersect . By the above observation, all vertices of a clique  not contained in  are either completely contained in  or . Hence, as  consists of , its intersection with the cliques , at most  edge-vertices , and at most  vertices from , we have

 5nm+(3m+2)⋅a+2m≥|A|≥5nm+(3m+2)⋅a−k≥5nm+(3m+2)⋅a−m

and analogously for . Without loss of generality, we may assume . Using the above size bounds for  and , we thus obtain that  is at least

 5nm+(3m+2)⋅a−m−(5nm+(3m+2)⋅b+2m)=(3m+2)⋅(a−b)−3m,

and, thus,  (recall that  is a balanced separator, and hence ). Since  and  we have at least one vertex in , and thus the number of edge vertices  in the balanced separator  is at most . We conclude that cutting the edges according to the edge vertices in  yields a bisection for  of cut size at most . Here, too, the bound on the number of connected components is easy to see. ∎

### 2.3 An FPT Algorithm for Cut Size and Constant Number of Cut Out Components

We now outline an FPT algorithm for Vertex Bisection. We say that  is an --separator for vertices  if there are vertex sets  such that  is an --separator and  and . We say that an --separator  is inclusion-wise minimal, or just minimal, if there is no --separator . We first observe that a balanced separator consists of inclusion-wise minimal --separators between a collection of “terminal” vertices . The terminal vertices are chosen one from each of the connected components of the graph without the separator. Guessing the terminals, we can reduce Vertex Bisection to finding an “almost balanced” separator consisting of vertices contained in inclusion-wise minimal separators of pairs of terminals. To find such an almost balanced separator, we generalize the “treewidth reduction” technique introduced by Marx et al. [45]. We obtain an algorithm that constructs a graph  that preserves all inclusion-wise minimal separators of size at most  between some given terminals and has treewidth bounded by some function , where  is the number of terminals. Moreover, the algorithm runs in time  and also derives a mapping of the vertices between the input graph  and the constructed graph  which allows to transfer balanced separators of  to balanced separators of . Using this algorithm it then only remains to show that weighted Vertex Bisection is fixed-parameter tractable with respect to the treewidth. Overall, the algorithm solving Vertex Bisection guesses the terminals, reduces the treewidth and then solves the bounded-treewidth problem.

The main ingredient in our FPT algorithm for Vertex Bisection is a generalization of the treewidth reduction technique of Marx et al. [45] to graphs with vertex weights. We aim to construct a graph of bounded treewidth that preserves all inclusion-wise minimal --separators of a given size. To this end, we define trimmers.

###### Definition 1.

Let  be a graph, an integer and . A tuple  of a graph  and a total, surjective, but not necessarily injective mapping  is called a -trimmer of  if the following holds. (Here, we let , for , and define  analogously.)

1. For any , the mapping  is a one-to-one mapping between the connected components of  and .

2. If  is an inclusion-wise minimal --separator for  with  and , then  and  is an inclusion-wise minimal --separator for .

We refer to the above as trimmer properties (i) and (ii).

An example for a trimmer is given in Figure 1: one can verify by inspecting the graph  depicted there, that only vertices 1, 2, 11, 12, 13, 14, and 15 are contained in any inclusion-wise minimal --separator of size at most 3. For example, vertex 3 is not contained in any such separator because removing it from the graph leaves two vertex-disjoint --paths and all pairs of such paths can only be destroyed by removing two further vertices if we delete either vertex 1 and 2, or vertex 11 and 12. However, both  and  are themselves --separators and hence adding 3 does not yield an inclusion-wise minimal separator. Thus contracting every edge in  we can derive a mapping  that fulfills trimmer property (ii). Basically, trimmer property (i) is obtained by observing that contracting edges keeps intact all important paths.

A more precise description of computing a trimmer, a formal proof of the properties, and an upper bound on the treewidth of the trimmer is given in Section 2.3.1: as we show in Theorem 3, if  and  are small, then there are trimmers of small treewidth that can be computed efficiently.

###### Theorem 3.

Let  be a graph. For every constant and constant-size , we can compute a -trimmer  for  in  time such that the treewidth of  is at most  for some function  depending only on  and .

The final ingredient for our FPT algorithm for Vertex Bisection is an efficient algorithm for small treewidth and vertex weights.

###### Theorem 4.

Let  be a graph with treewidth and integer vertex-weights . Let  be the sum of all vertex weights and let  be an integer. We can find in  time, for all integers , a partition  of  such that and  is a minimum-weight -component --separator, or reveal that no such partition exists.

We defer also this proof until later in Section 2.3.2. If we suppose for the moment that the above Theorem 3 and Theorem 4 hold, then we arrive at the main theorem of this section.

###### Theorem 5.

Let  be a graph. Given non-negative integers  and , in  time we can find a -component balanced separator for  of size at most  if it exists. Here,  is a function depending only on  and .

###### Proof.

The algorithm proceeds as follows. For each of size exactly  we compute a -trimmer  using Theorem 3. We create a vertex weight function  for  by letting . Then, for each , we compute a minimum-weight -component --separator for  and the corresponding sets  with  using Theorem 4. If among the separators there is an --separator  with , then we compute , and . Note that, by trimmer property (i),  is a -component --separator for . Moreover, since  is a total mapping, . We move  vertices from  or  to  in such a way that  is a -component balanced separator for  and we output . If no suitable separator is found, we output that there is no -component balanced separator of size at most  for . Note that, unless  is bounded by a function of  (i.e. the problem is trivially FPT), moving the vertices from  or  to  without changing the number of components of  is always possible. This is because not every vertex of a connected component can separate it into multiple ones and there is always a component of size at least two.

Let  be a -component balanced separator of size at most  for  and pick vertices , one from each connected component of . Let us observe that the above algorithm finds a -component balanced separator of size at most . Note that  is a --separator for each . Hence, contains inclusion-wise minimal --separators  of size at most . Let , call a connected component in  odd if it does not contain any , and let be the union of and all odd components. Note that odd components are contained in . Hence, is a -component --separator for  with  and . Clearly, at some point in the algorithm  and the -trimmer  of  is computed. It remains to show that separator  induces a separator in  that is found by the algorithm. By trimmer property (ii) we have that  is contained in . Trimmer property (i) gives that is a one-to-one mapping of connected components  in  and their counterparts  in . In particular, there is a corresponding mapping for all odd connected components. Thus, is a -component --separator for  and we have , and . Hence, an --separator  for  with  and is enumerated by the algorithm of Theorem 4. Applying the size bounds of  we have and . Thus, the algorithm described above finds a -component balanced separator of size at most  for .

Concerning the running time, there are at most  computations of the trimmer, each of which can be done in  time (Theorem 3), where . Then we compute the separators for  and since the treewidth of  is bounded by some function  (Theorem 3), this can be done in time  using Theorem 4. Next, the parts  can be computed in linear time from the parts  and we can modify the algorithm for Theorem 4 to also output  without increasing the running time bound (see Section 2.3.2). Finally, moving the vertices from the parts  or  to  can be done in  time because we move at most  vertices and a vertex that does not change the number of components can be found in  time by taking a leaf of a BFS tree of a component that contains at least two vertices. Hence, the overall running time is bounded by  which in turn is bounded by  for a suitable function . ∎

We remark that an upper bound on the treewidth of the trimmer is  (see Remark 2 below), yielding a -time algorithm. This bound can most certainly be improved, and it would be interesting to know what kinds of lower bounds exist. Applying Theorem 2 we can derive the following.

###### Corollary 1.

Let  be a graph. Given non-negative integers  and , in  time we can find a -component bisection for  of size at most  if it exists. Here,  is a function depending only on  and .

Note that a direct application of Theorem 2 yields only a factor of  in the running time. The trick is, however, that two of the terminals in instances created by the corresponding Construction 2 do not need to be guessed, while for the others we only have to guess in which vertex clique they appear. They can be assumed to be arbitrary vertices in the appropriate cliques. We omit the straightforward details. We remark that the FPT algorithm given by Cygan et al. [14] has a much better singly exponential runtime, even if is constant. However, as said above, we believe that the runtime of our algorithm can be significantly improved. Hence our observations might still yield faster FPT algorithms for constant  in instances from practice. As described in the introduction, this would have implications for applications, as there often is a small constant.

Let us now deliver the proofs of Theorem 3 and Theorem 4.

#### 2.3.1 Treewidth Reduction

In order to prove Theorem 3, we need to generalize the results of Marx et al. [45], which we do using the following definition.

###### Definition 2.

Let be a graph. The annotated torso , for a set , is a tuple  of a graph  and a total, surjective, but not necessarily injective mapping  defined as follows. The graph  is obtained from  by contracting all edges that have empty intersection with  and removing all loops and parallel edges created in the process. Hence, each connected component of  has a corresponding vertex in  which we call component vertex. The mapping  is defined as the identity when restricted to , that is, for all  we have . For all remaining vertices , maps to the component vertex of the connected component of  which contains .

The torso  is obtained from  in  as follows. First, make the neighborhood of each component vertex into a clique, creating shortcut edges. Then remove all component vertices.222This definition of torso is equivalent to the one used by Marx et al. [45].

Some graphs and their (annotated) torso graphs are depicted in Figure 2.

We begin with an observation about annotated torsos and their connected components if some set of vertices is removed.

###### Lemma 1.

Let be a graph, , and . For any , the mapping  is a one-to-one mapping between the connected components of  and .

###### Proof.

We prove that  maps connected components of to connected components of  and then prove that it is indeed a one-to-one mapping. Before proving the first part, we note that --paths in  translate to --paths in  for all  and vice versa.

1. If  is a path  in , then  is a walk  in  where multiple consecutive occurrences of a vertex in the second sequence are omitted. Hence there is a --path in .

It is enough to show that  maps each pair of adjacent vertices either to the same vertex or to adjacent vertices. This is clear if both are in . If both and are in then they are mapped to the same component vertex of , as they are in the same connected component of . Finally, if in and or vice versa, then and are adjacent by the definition of annotated torso.

1. If  is a path  in , then there is an --path  in  for every .

Construct  as follows. First, consider a component vertex  with , if there is any. Note that  and  are not component vertices, because component vertices are not adjacent with each other. We know that  is a connected component in  and, since , also . Since is a component vertex adjacent to  and , there are  and  in  adjacent to  and , respectively. Modify  by replacing  with a --path in  formed by the edges , and a --path inside the component .

Next, if  is a component vertex, choose an arbitrary --path  in . Such a path exists by a similar argument as above. Replace  with  in . Proceed analogously if  is a component vertex. Since, in this way, we replaced all vertices in  with paths that exist in , we have obtained an --walk in . Hence also (ii) is proved.

For a graph  and a set , let us call a set of vertices -unbroken if there is a path in  between any two vertices in . Note that a connected component of  is an inclusion-wise maximal -unbroken set. Claims (i) and (ii) show that if  is -unbroken in , then  is -unbroken in  and if  is -unbroken in , then  is -unbroken in .

Now let us prove that indeed provides a mapping between the connected components.

1. If a set  is a connected component in  then  is a connected component in .

If  is a connected component in  then  is -unbroken in . Now for the sake of contradiction assume that there is a connected component  in . Then  is -unbroken in  and  as is surjective. This contradicts  being a connected component. Hence  is a connected component of .

Finally, let us prove that the mapping is one-to-one.

1. If a set  is a connected component in  then  is a connected component in .

If  is a connected component in  then  is -unbroken in . Now for the sake of contradiction assume that there is a connected component  in . Then  is -unbroken in  and  by the definition of  as . This contradicts  being a connected component. Hence  is a connected component of . ∎

We now show that the treewidth of an annotated torso is at most one larger than the treewidth of the corresponding torso. For this we need to formally introduce the treewidth first. A tree decomposition of a graph  is a pair , where is a rooted tree and is a mapping  such that

• for every , there is an with , and

• for every the set induces a non-empty subtree of .

The sets  are sometimes called bags. The width of a tree decomposition  is and the treewidth  of a graph  is the minimum width of a tree decomposition for .

###### Lemma 2.

Let  be a graph, let  and let  be of treewidth . Then, the graph in  has treewidth at most .

###### Proof.

Let  be a tree-decomposition for . Note that, to obtain a tree-decomposition for  we only need to incorporate the component vertices and their incident edges. For this, successively consider each component vertex  and let  be its neighborhood in . Due to the shortcut edges between neighbors of induces a clique in . Hence there is a bag , that contains  [38, Lemma 2.2.2.]. Add a new vertex  to  adjacent only to  and define . Hence, the bags containing  or , respectively, (still) induce a subtree in . Furthermore, each edge incident to  is contained in . Note that we never need to introduce a copy of a bag that does not occur in the tree-decomposition of  because component vertices are not adjacent with each other. Thus, introducing a new bag for all component vertices in the above-described way yields a tree-decomposition for  and increases the maximum bag size by at most one. ∎

###### Remark 1.

We mention in passing that the notion of annotated torso is more robust with respect to the treewidth than the notion of torso introduced by Marx et al. [45] in the following sense. Adding vertices to the set  increases the treewidth of both and the graph in by at most one, as Corollary 2 (below) shows. However, removing a vertex from  may increase the treewidth of arbitrarily. This is witnessed by a star where  contains all vertices; removing the center of the star from  yields a clique in the torso (see Figure 2). In contrast, the treewidth of annotated torsos cannot increase when removing a vertex  from . This is because, either the graph in the annotated torso stays the same, or removing  is equivalent to contracting an edge between  and a component vertex. That is, the resulting graph is a minor of the original annotated torso graph.

As we observe next, annotated torsos can be computed in linear time.

###### Lemma 3.

Let  be a graph and let . Then, and  can be computed in  time.

###### Proof.

To compute the annotated torso, color the connected components of  with distinct colors . Next, create a copy  of  and modify  by contracting all edges that have empty intersection with  and removing all self-loops and parallel edges. In order to achieve a linear time bound for this, we proceed as follows (we assume  to be represented as an adjacency list structure).

We start with vertices in having their adjacency lists as in and introduce new vertices  (the component vertices) with empty lists. For each in we process its adjacency list and for each vertex on the list we distinguish the following cases:

• the vertex  is in . We make no changes to the adjacency lists and proceed with the next vertex in the adjacency list.

• the vertex  is in , in the component of color  and  is the last entry in the adjacency list of vertex . Then we delete  from the adjacency list of vertex .

• the vertex  is in , in the component of color  and  is not the last entry in the adjacency list of vertex . Then we add  to the end of adjacency list of  and replace  by  in the adjacency list of vertex .

Note that if appears on the list of , it must be at the end, since we only process another vertex in after we finish processing . Hence, this procedure indeed computes  according to the definition of . This proves the running time bound of computing the graph .

Using the colors of the vertices in  we can create an array to compute  efficiently. To compute  we use an array indexed by the colors which at index  contains a list of all vertices with color  in . Filling the array can be done in linear time. ∎

To prove Theorem 3 we reuse some results by Marx et al. [45]. To state them we need to define the excess of a cut.

###### Definition 3.

Let  be a graph and . Let  be the minimum size of an --separator in . The excess of an --separator  is .

The following three statements have been proved by Marx et al. [45]; they correspond to Lemma 2.11, Lemma 2.8, and Corollary 2.10, respectively.

###### Lemma 4 (Marx et al. [45]).

Let  be two vertices of a graph  and let be the minimum size of an --separator. For some  let  be the union of all inclusion-wise minimal --separators having excess at most  (that is, having size at most ). Then, there is an -time algorithm that returns a set  disjoint from  such that , for some functions  and  depending only on  and .

###### Lemma 5 (Marx et al. [45]).

Let  be a graph and  and let . We have .

###### Corollary 2 (Marx et al. [45]).

For every graph  and sets , we have .

Finally we put all the above results together in order to prove Theorem 3. We have to only slightly adapt the proof of the treewidth-reduction theorem by Marx et al. [45].

###### Proof of Theorem 3.

We first use Lemma 4 to compute a set  for each pair  such that  contains each inclusion-wise minimal --separator of size at most . Let  be the union of all the  sets . Using the upper bound on the treewidth of Lemma 4 and combining it with the bound of Lemma 5, we obtain that  has treewidth bounded by some function  depending only on  and . Hence, by Corollary 2 also  has treewidth bounded by such a function. Using Lemma 2 we have a similar bound on the graph  in . We claim that