Positive-instance driven dynamic programming for treewidth

Consider a dynamic programming scheme for a decision problem in which all subproblems involved are also decision problems. An implementation of such a scheme is {\em positive-instance driven} (PID), if it generates positive subproblem instances, but not negative ones, building each on smaller positive instances. We take the dynamic programming scheme due to Bouchitt\'{e} and Todinca for treewidth computation, which is based on minimal separators and potential maximal cliques, and design a variant (for the decision version of the problem) with a natural PID implementation. The resulting implementation performs extremely well: it solves a number of standard benchmark instances for which the optimal solutions have not previously been known. Incorporating a new heuristic algorithm for detecting safe separators, it also solves all of the 100 public instances posed by the exact treewidth track in PACE 2017, a competition on algorithm implementation. We describe the algorithm and prove its correctness. We also perform an experimental analysis counting combinatorial structures involved, which gives insights into the advantage of our approach over more conventional approaches and points to the future direction of theoretical and engineering research on treewidth computation.


Introduction
Suppose we design a dynamic programming algorithm for some decision problem, formulating subproblems, which are decision problems as well, and recurrences among those subproblems. A standard approach is to list all subproblem instances from "small" ones to "large" and scan the list, deciding the answer, positive or negative, to each instance by means of these recurrences. When the number of positive subproblem instances are expected to be much smaller than the total number of subproblem instances, a natural alternative is to generate positive instances only, using recurrences to combine positive instance to generate a "larger" positive instance. We call such a mode of dynamic programming execution positive-instance driven or PID for short. One goal of this paper is to demonstrate that PID is not simply a low-level implementation strategy but can be a paradigm of algorithm design for some problems.
The decision problem we consider is that of deciding, given graph G and positive integer k, if the treewidth of G is at most k. This graph parameter was introduced by Robertson and Seymour [17] and has had a tremendous impact on graph theory and on the design of graph algorithms (see, for example, a survey [7]). The treewidth problem is NP-complete [1] but fixed-parameter tractable: it has an f (k)n O(1) time algorithm for some fixed function f (k) as implied by the graph minor theorem of Robertson and Seymour [18], and explicit O(f (k)n) time algorithm is given by Bodlaender [3]. A classical dynamic programming algorithm due to Arnborg, Corneil, and Proskurowsky (ACP algorithm) [1] runs in n k+O (1) time. Bouchitté and Todinca [9] developed a more refined dynamic programming algorithm (BT algorithm) based on the notions of minimal separators and potential maximal cliques, which lead to algorithms running in O(1.7549 n ) time or in O(n 5 ⌈(2n+k+8)/3⌉ k+2 ) time [11,12]. Another important approach to treewidth computation is based on the perfect elimination order (PEO) of minimal chordal completions of the given graph. PEO-based dynamic programming algorithms run in O(2 n ) time with exponential space and in (4 n ) time with polynomial space [4].
There has been a considerable amount of effort on implementing treewidth algorithms to be used in practice and, prior to this work, the most successful implementations for exact treewidth computation are all based on PEO. The authors of [4] implemented the O(2 n ) dynamic programming algorithm and experimented on its performance, showing that it works well for small instances. For larger instances, PEO-based branch-and-bound algorithms are known to work well in practice [13]. Recent proposals for reducing treewidth computation to SAT solving are also based on PEO [19,2]. From the PID perspective, this situation is somewhat surprising, since it can be shown that each positive subproblem instance in the PEO-based dynamic programming scheme corresponds to a combination of an indefinite number of positive subproblem instances in the ACP algorithm, and hence the number of positive subproblem instances can be exponentially larger than that in the ACP algorithm. Indeed, a PID variant of the ACP algorithm was implemented by the present author and has won the first place in the exact treewidth track of PACE 2016 [10], a competition on algorithm implementations, outperforming other submissions based on PEO. Given this success, a natural next step is to design a PID variant of the BT algorithm, which is tackled in this paper.
The resulting algorithm performs extremely well, as reported in Section 7. It is tested on DI-MACS graph-coloring instances [14], which have been used in the literature as standard benchmark instances [13,5,15,19,4,2]. Our implementation of the algorithm solves all the instances that have been previously solved (that is, with matching upper and lower bounds known) within 10 seconds per instance on a typical desktop computer and solves 13 out of the 42 previously unsolved instances. For nealy half of the instances which it leaves unsolved, it significantly reduces the gap between the lower and upper bounds. It is interesting to note that this is done by improving the lower bound. Since the number of positive subproblem instances are much smaller when k < tw(G) than when k = tw(G), the PID approach is particularly good at establishing strong lower bounds.
We also adopt the notion of safe separators due to Bodlaender and Koster [5] in our preprocessing and design a new heuristic algorithm for detecting safe separators. With this preprocessing, our implementation also solves all of the 100 public instances posed by PACE 2017 [16], the successor of PACE 2016. It should be noted that these test instances of PACE 2017 are much harder than those of PACE 2016: the winning implementation of PACE 2016 mentioned above, which solved 199 of the 200 instances therein, solves only 62 of these 100 instances of PACE 2017 in the given time of 30 minutes per instance.
Adapting the BT algorithm to work in PID mode has turned out non-trivial. It requires concepts and observations not present in [9]. We describe these concepts and observations, formulate our variant in full details, and prove its correctness.
We also perform an experimental analysis in which we count combinatorial structures involved in both PID and non-PID approaches, namely minimal separators, potential maximal cliques, and related objects. The analysis reveals that the practical bottleneck of the original BT algorithm lies in enumerating objects, called vertex representations, underlying the generation of potential maximal cliques, which our PID variant circumvent by a different method of generating potential maximal cliques. Unfortunately, we do not have any theoretical analysis that shows our method is superior to the theoretical algorithm. Development of an algorithm for generating potential maximal cliques that is practically fast and theoretically analyzable would be of utmost interest.

Preliminaries
In this paper, all graphs are simple, that is, without self loops or parallel edges. Let G be a graph. We denote by V (G) the vertex set of G and by E(G) the edge set of G.
, the open neighbor set of U in G, denoted by N G (U ), is the set of vertices adjacent to some vertex in U but not belonging to U itself: In the above notation, as well as in the notation further introduced below, we will often drop the subscript G when the graph is clear from the context. We say that vertex set C ⊆ V (G) is connected in G if, for every u, v ∈ C, there is a path in G[C] between u and v. It is a connected component of G if it is connected and is inclusion-wise maximal subject to this condition.
A separator S is a minimal separator if there are at least two full components associated with S. This term is justified by this fact: if S is a minimal separator and a, b vertices belonging to two distinct components in F (S), then for every proper subset S ′ of S, a and b belong to the same component associated with S ′ ; S is a minimal set of vertices that separates a from b.
Graph H is chordal if every induced cycle of H has length exactly three.
, and E(H) is minimal subject to these conditions. A vertex set Ω ⊆ V (G) is a potential maximal clique of G, if Ω is a clique in some minimal chordal completion of G.
A tree-decomposition of G is a pair (T, X ) where T is a tree and X is a family {X i } i∈V (T ) of vertex sets of G such that the following three conditions are satisfied. We call members of V (T ) nodes of T and each X i the bag at node i.
The width of this tree-decomposition is max i∈V (T ) |X i | − 1. The treewidth of G, denoted by tw(G) is the minimum width of all tree-decompositions of G. We may assume that the bags X i and X j are distinct from each other for i = j and, under this assumption, we will often regard a treedecomposition as a tree T in which each node is a bag.
We call a tree-decomposition T of G canonical if each bag of T is a potential maximal clique of G and, for every pair X, Y of adjacent bags in T , X ∩ Y is a minimal separator of G. The following fact is well-known. It easily follows, for example, from Proposition 2.4 in [8].
Lemma 1. Let G be an arbitrary graph. There is a tree-decomposition T of G of width tw(G) that is canonical.
The following local characterization of a potential maximal clique is crucial. We say that a vertex set S ⊆ V (G) is cliquish in G if, for every pair of distinct vertices u and v in S, either u and v are adjacent to each other or there is some C ∈ C(S) such that u, v ∈ N (C). In other words, S is cliquish if completing N (C) for every C ∈ C(S) into a clique makes S a clique. It is also shown in [8] that if Ω is a potential maximal clique of G and S is a minimal separator contained in Ω, then there is a unique component C S associated with S that contains Ω \ S. We need an explicit way of forming C S from Ω and S.
Let K ⊆ V (G) be an arbitrary vertex set and S an arbitrary proper subset of K. We say that a component C ∈ C(K) is confined to S if N (C) ⊆ S; otherwise it is unconfined to S. Let unconf(S, K) denote the set of components associated with K that are unconfined to S. Define crib(S, K) = (K \ S) ∪ C∈unconf(S,K) C. The following lemma relies only on the second property of potential maximal cliques, namely that they are cliquish, and will be applied not only to potential maximal cliques but also to separators with full components, which are trivially cliquish. Proof. Let C = crib(S, K). We first show that G[C] is connected. Suppose K \ S has two distinct vertices u and v. Since K is cliquish, either u and v are adjacent to each other or there is some component C ′ ∈ C(K) such that u, v ∈ N (C ′ ). In the latter case, as C ′ is unconfined to S, we have C ′ ⊆ C. Therefore, u and v belong to the same connected component of G [C]. As this applies to every pair of vertices in K \S, K \S is contained in a single connected component of G [C]. Moreover, each component C ′ ∈ C(K) contained in C is unconfined to S, by the definition of crib(S, K) and hence has a neighbor in K \ S. Therefore, we conclude that G[C] is connected. Each vertex v not in S ∪ C belongs to some component in C(K) that is confined to S and hence does not have a neighbor in C. Therefore, C is a component associated with S.
To see that C is a full component, let u ∈ S and v ∈ K \ S be arbitrary. Since K is cliquish, either u and v are adjacent to each other or there is some C ′ ∈ C(K) such that u, v ∈ N (C ′ ). As such C ′ is unconfined to S in the latter case, we conclude that u ∈ N (C) in either case. Since this holds for arbitrary u ∈ S, we conclude that C is a full component associated with S. ⊓ ⊔ Remark 1. As crib(S, K) contains K \ S, it is clear that it is the only component associated with S that intersects K. Therefore, the above mentioned assertion on potential maximal cliques is a corollary of this Lemma.

Recurrences on oriented minimal separators
In this section, we fix graph G and positive integer k that are given in the problem instance: we are to decide if the treewidth of G is at most k.
Let us first review the BT algorithm [8] adapting it to our decision problem. We first list all minimum separators of cardinality k or smaller and all potential maximal cliques of cardinality k + 1 or smaller. Then, for each pair of a potential maximal clique Ω and a minimal separator S such that S ⊂ Ω, place a link from S to Ω. To understand the difficulty of formulating a PID variant of the algorithm, it is important to note that the pair (Ω, S) to be linked is easy to find from the side of Ω, but not the other way round. Then, we scan the full blocks (N (C), C) of minimal separators in increasing order of |C| to decide if C is feasible, using the following recurrence: C is feasible if and only if there is some potential maximal clique Ω such that N (C) ⊂ Ω, C = crib(N (C), Ω), and every component D ∈ unconf(N (C), Ω) is feasible. Finally, we have tw(G) ≤ k if and only if there is a potential maximal clique Ω with |Ω| ≤ k + 1 such that every component associated with Ω is feasible.
To facilitate the PID construction, we orient minimal separators as follows. We assume a total order < on V (G). For each vertex set U ⊆ V (G), the minimum element of U , denoted by min(U ), is the smallest element of U under <. For vertex sets U and W , we say U precedes W and write U ≺ W if min(U ) < min(W ).
We say that a connected set C is inbound if there is some full block associated with N (C) that precedes C; otherwise, it is outbound. Observe that if C is inbound then N (C) is a minimal separator, since N (C) has another full component associated with it and, contrapositively, if N (C) is not a minimal separator then C is necessarily outbound. We say a full block (N (C), C) is inbound (outbound)) if C is inbound (outbound, respectively). Lemma 4. Let K be a cliquish vertex set and let A 1 , A 2 be two components associated with K. Suppose that A 1 and A 2 are outbound. Then, either N ( Proof. Let K, A 1 , and A 2 be as above and suppose neither of N (A 1 ) and N (A 2 ) is a subset of the other. For i = 1, 2, let Let K be a cliquish vertex set. Based on the above lemma, we define the outlet of K, denoted by outlet(K), as follows. If no non-full component associated with K is outbound, then we let outlet(K) = ∅. Otherwise, outlet(K) = N (A), where A is a non-full component associated with K that is outbound, chosen so that N (A) is maximal. We define support(K) = unconf(outlet(K), K), the set of components associated with K that are not confined to outlet(K). By Lemma 4, every member of support(K) is inbound.
We call a full block (N (C), We say that an I-block ( for some set C of feasible inbound components. Note that this definition of feasibility of an O-block is somewhat weak in the sense that we do not require every inbound component associated with N (A) to be feasible.
Let Ω be a potential maximal clique with |Ω| ≤ k + 1. For each C ∈ support(Ω), block (N (C), C) is an I-block, since C is inbound as observed above and we have |N (C)| ≤ k by our assumption that |Ω| ≤ k + 1. We say that Ω is feasible if |Ω| ≤ k + 1 and either We say that Ω is strongly feasible if |Ω| ≤ k + 1 and every C ∈ support(Ω) is feasible. It will turn out that every strongly feasible potential maximal clique is feasible (Lemma 9). This implication, however, is not immediate from the definitions. Proof. Suppose first that G has a strongly feasible potential maximal clique Ω with outlet(Ω) = ∅.
For each component C ∈ support(Ω), let T C be the tree-decomposition of G C of width k or smaller, which exists since C is feasible by the definition of a strongly feasible potential maximal clique. Let X C be a bag of T C such that N (C) ⊆ X C . Combine these tree-decompositions into a tree T by adding bag Ω and letting each X C in T C be adjacent to Ω. It is straightforward to verify that T is a tree-decomposition of G of width k or smaller.
For the converse, suppose the treewidth of G is k or smaller. Let T be a canonical treedecomposition of G of width k or smaller: each bag of T is a potential maximal clique and the intersection of each pair of adjacent bags of T is a minimal separator. Orient each edge of T as follows. Let X and Y be adjacent bags in T and let S = X ∩ Y . Let C be the outbound full component associated with minimal separator S. Then, C intersects exactly one of X and Y . If C intersects X then we orient the edge between X and Y from Y to X; otherwise from X to Y . Since T is a tree, the resulting directed tree has a sink X 0 . Then, each component C associated with X 0 is inbound and hence outlet(X 0 ) = ∅. We show that each such C is moreover feasible. Indeed, the required tree-decomposition of G C may be obtained from T by taking intersection of every bag with N [C]: the resulting tree is a tree-decomposition of G[N (C)] and contains the bag X 0 ∩ N [C] ⊇ N (C). The width of the tree-decomposition is not greater than that of T and hence is k or smaller. Therefore, I-block (N (C), C) for each C ∈ support(X 0 ) = C(X 0 ) is feasible and hence potential maximal clique X 0 is strongly feasible.
⊓ ⊔ Lemma 6. Let C be a connected set of G such that N (C) is a minimal separator. Let Ω be a potential maximal clique of G C . Then, Ω is a potential maximal clique of G.
Proof. For each component D associated with N (C), let H D be a minimal chordal completion of G C . In particular, choose H C so that Ω is a clique in H C . Let H be the union of these graphs: It is well-known that every minimal separator is a clique in every chordal completion and hence N (C) is a clique in H ′ . Therefore, the minimality of H D for each D implies that H ′ = H.
As Ω is a clique in H C , it is a clique in H and hence is a potential maximal clique of G. ⊓ ⊔ The following is our oriented version of the recurrence in the BT algorithm described in the beginning of this section. Proof. Suppose first that there is a strongly feasible potential maximal clique Ω as in the lemma. For each component D ∈ support(Ω), let T D be the tree-decomposition of G D of width k or smaller and X D be a bag in T D containing N (D). Combine these tree-decompositions T D , D ∈ support(Ω), into a tree T by adding bag Ω and let it be adjacent to X D for each D ∈ support(Ω). As we are assuming that N (C) = outlet(Ω), support(Ω) = unconf(N (C), Ω) and hence C = D∈support(Ω) D = crib(N (C), Ω). Therefore, it is straightforward to verify that T is a tree-decomposition of G C of width k or smaller.
For the converse, suppose that I-block (N (C), C) is feasible. Let T be a canonical tree-decomposition of G C of width k or smaller. Orient the edges of T as in the proof of Lemma 5: orient the edge from X to Y if and only if Y intersects the outbound full component associated with X ∩ Y . We need to stress here that the notion of outbound components used in this orientation is with respect to the entire graph G and not with respect to G C , the graph of which T is a tree-decomposition.
As N (C) is a clique in G C , T contains a bag that contains N (C). In the subtree of T induced by those bags containing N (C), let X 0 be a sink with respect to the above orientation. As T is canonical, X 0 is a potential maximal clique of G C and hence of G by Lemma 6. We show below that X 0 is strongly feasible.
Let A be the outbound full component associated with N (C). As N (C) ⊆ X 0 and A ∩ N [C] = ∅, A is a component associated with X 0 . We claim that N (C) = outlet(X 0 ). Suppose otherwise that there is some outbound component A ′ associated with X 0 such that N (A ′ ) is a proper superset of N (C). Then, as A ′ is not confined to N (C), A ′ is a subset of C = crib(N (C), X 0 ). Therefore, there is some bag X adjacent to X 0 in T such that X ∩ A ′ = ∅. Since N (C) is a minimal separator that separates A from A ′ , X must contain N (C). But, as the edge between X 0 and X is oriented from X 0 to X, this contradicts the choice of X 0 . We conclude that N (C) = outlet(X 0 ).
It remains to verify that each D ∈ support(X 0 ) is feasible. This is true since the tree of bags obtained from T by intersecting each bag with N [D] is a tree-decomposition of G D required for the feasibility of D.
⊓ ⊔ Lemma 8. Let K be a cliquish vertex set, C a non-empty subset of support(K), and S = C∈C N (C). If S is a proper subset of K then crib(S, K) is outbound.
Proof. Let K, C and S be as in the lemma. Since K is cliquish, crib(S, K) is a full component associated with S that contains K \ S, by Lemma 3. To show that it is outbound, it suffices to show that no other full component associated with S is outbound. Let A be an arbitrary full component associated with S that is distinct from crib(S, K). As A does not intersect K, it is a component associated with K. Let C be an arbitrary member of C. Then, C is confined to S by the definition of S. On the other hand C is not confined to outlet(K) since C ∈ support(K). Therefore, S is not a subset of outlet(K). A cannot be outbound, since it would imply that S = N (A) ⊆ outlet(K). Therefore, A is inbound and, since this holds for every full component associated with S other than crib(S, K), crib(S, K) is outbound.

⊓ ⊔
The following lemma is crucial for our PID result: the algorithm described in the next section generates all feasible potential maximal cliques and we need to guarantee all strongly feasible maximal cliques to be among them.

Lemma 9.
Let Ω be a strongly feasible potential maximal clique. Then, Ω is feasible.
Since Ω is cliquish and v is not in N (C) for any component C associated with Ω, v is adjacent to every other vertex in Ω. Therefore, . Thus, Ω is feasible, the first case of feasibility.
Suppose next that S ∪ outlet(Ω) = Ω. We have two cases to consider: S = Ω and S = Ω.
Consider the case where S = Ω. Let C 0 be an arbitrary minimal subset of support(Ω) such that Since Ω does not have a full component associated with it, C 0 has at least two members. Let C 0 be an arbitrary member of C 0 and let C 1 = C 0 \ {C 0 }. From the minimality of C 0 , S 1 = C∈C1 N (C) is a proper subset of Ω. By Lemmas 3 and 8, A 1 = crib(S 1 , Ω) is a full component associated with S 1 and is outbound. Therefore, (S 1 , A 1 ) is an O-block and is feasible since every member of C 1 ⊆ support(Ω) is feasible as potential maximal clique Ω is strongly feasible. Thus, the second case in the definition of feasible potential maximal cliques applies.
Finally, suppose that S = Ω. Let A = crib(S, Ω). Then, A is a full component associated with S and is outbound, by Lemmas 3 and 8. Since S = C∈support(Ω) N (C) and Ω is strongly feasible, the O-block (S, A) is feasible. Let x be an arbitrary vertex in Ω \ S. Since we are assuming that S ∪ outlet(Ω) = Ω we have x ∈ outlet(Ω) \ S. Let v be an arbitrary vertex in Ω \ outlet(Ω). Observe that there is no component C associated with Ω such that N (C) contains both x and v: x ∈ N (C) for every C ∈ support(Ω) and v ∈ N (C) for every C that is confined to outlet(Ω). Since Ω is cliquish, it follows that x and v are adjacent to each other. Therefore, we have Ω \ S ⊆ N (v). Moreover, A contains Ω \ S by Lemma 3. Finally, A\ Ω is disjoint from N (v), since every component D associated with Ω such that v ∈ N (D) is not confined to outlet(Ω) and hence contained in C. Therefore, we have Ω = S ∪ (N (v) ∩ A), and the third case in the definition of feasible potential maximal cliques applies.

Algorithm
Given graph G and positive integer k, our algorithm generates all I-blocks, O-blocks, and potential maximal cliques that are feasible. In the following algorithm, variable I is used for listing feasible Iblocks, O for feasible O-blocks, P for feasible potential maximal cliques, and SS for strongly feasible potential maximal cliques.
Algorithm PID-BT Input Graph G and positive integer k Output "YES" if tw(G) ≤ k; "NO" otherwise Procedure ) and, provided that C = C h for 1 ≤ h ≤ j, increment j and let C j = C. 5. Set i = 0. 6. Repeat the following and stop repetition when j is not incremented during the iteration step.
(a) While i < j, do the following. i. Increment i and let I i be and do the following.
A. If K is a potential maximal clique, then add K to P i . B. If |K| ≤ k and there is a full component A associated with K (which is unique), then and K is a potential maximal clique then add K to P i . vi. For each K ∈ P i \ SS i−1 , if support(K) ⊆ I i then add K to SS i and do the following: if outlet(K) = ∅ then let C = crib(outlet(K), K) and, provided that C = C h for 1 ≤ h ≤ j, increment j and let C j = C. 7. If there is some K ∈ SS j such that outlet(K) = ∅, then answer "YES"; otherwise, answer "NO". Proof. We show that SS J computed by the algorithm, where J denotes the final value of j, is exactly the set of strongly feasible potential maximal cliques for the given G and k. The theorem then follows by Lemma 5.
In the following proof, O i , P i , and SS i for each i stand for the final values of these program variables.
We first show by induction on i that the following conditions are satisfied.

For every
4. Every K ∈ P i is a feasible potential maximal clique. 5. Every K ∈ SS i is a strongly feasible potential maximal clique.
Consider the base case i = 0. Condition 1 vacantly holds. Conditions 2 and 3 also hold since I 0 = O 0 = ∅. Condition 4 holds: N [v] is confirmed to be a potential maximal clique before it is added to P 0 and is feasible by the definition of feasibility (case 1). Condition 5 holds since support(N [v]) = ∅ implies that the potential maximal clique N [v] is strongly feasible.
Suppose i > 0 and that the above conditions are satisfied for smaller values of i.
1. When C i is defined, there is some i ′ < i and K ∈ SS i ′ such that outlet(K) = ∅ and C i = crib(outlet(K), K). By the induction hypothesis, K is a strongly feasible potential maximal clique and hence, by Lemma 7, (N (C i ), C i ) is a feasible I-block.  A) is a feasible O-block, and the third case in the definition of feasible potential maximal cliques applies. 5. Let K ∈ SS i \ SS i−1 . Then, K ∈ P i and is a feasible potential maximal clique by 4 above. The confirmed condition support(K) ⊆ I i ensures that K is strongly feasible, since every member of I i is feasible by 1 and 2 above.

As
We conclude that every member of SS J is a strongly feasible potential maximal clique.
In showing the converse, the following observation is crucial. Let (N (A), A) be a feasible O-block such that N (A) = C∈C N (C) for some set C of feasible components and suppose C ⊆ I i . Then, A ∈ O i . The proof is a straightforward induction on i.
The proof of the converse consists in showing the following by induction on m.

For each feasible I-block
For each feasible potential maximal clique Ω such that | C∈support(Ω)C | = m, there is some i such that Ω ∈ P i . 4. For each strongly feasible potential maximal clique Ω such that such that | C∈support(Ω)C | = m, there is some i such that Ω ∈ SS i .
The base case m = 0 is vacantly true. Suppose m > 0 and the statements hold for smaller values of m.
1. Let (N (C), C) be a feasible I-block with |C| = m. Then, by Lemma 7, there is some strongly feasible potential maximal clique Ω such that N (C) = outlet(Ω) and C = crib(N (C), Ω). We have | C∈support(Ω) C| < m, since this union is a subset of C \ (Ω \ N (C)). Therefore, by the induction hypothesis, there is some i such that Ω ∈ SS i . Therefore, C is constructed as C j either at step 4-(b) or at step 6-(a)-vi. 2. Let (N (A), A) be a feasible O-block with |A| = |V (G)|− m. Let C be a set of feasible components such that N (A) = C∈C N (C) and let C be an arbitrary member of C. As C, A, and N (C) are pairwise disjoint, we have |C| < m. Therefore, there is some i C such that C iC = C. Set i = max{i C | C ∈ C}. Then, C ⊆ I i and hence A ∈ O i , by the observation above. 3. Let Ω be a feasible potential maximal clique with | C∈support(Ω) C| = m. In the first case of the definition of feasibility, Ω is added to P 0 at step 4. In the second case, we have Ω = C∈C N (C) for some C ⊆ support(Ω) such that every member of C is feasible. Choose C to be minimal subject to these conditions. Let C be an arbitrary member of C. As |C| ≤ m, by the induction hypothesis and 1 above, there is some i C such that C ⊆ I iC . Choose C ∈ C so that i C is the largest and let the chosen be D. Let C ′ = C \ {D} and let S = C∈C ′ N (C). By the minimality of C, S is a proper subset of Ω. Therefore, crib(S, Ω) is a full component associated with S and there is an outbound full component A associated with S. As all members of C ′ is feasible and |S| ≤ k, (S, A) is a feasible O-block. By the choice of D, we have C ′ ⊆ I iD −1 and hence A ∈ O iD −1 by the observation above. At step 6-(a)-iii-A in the iteration for i = i D , Ω is put into P iD . 4. Let Ω be a strongly feasible potential maximal clique with | C∈support(Ω) C| = m. Then, by 3 above, there is some i 1 such that Ω ∈ P i1 . Furthermore, as every member C of support(Ω) is feasible and |C| ≤ m, there is some i 2 such that support(Ω) ⊆ I i2 , by 1 above. At step 7 in the iteration for i = max{i 1 , i 2 }, Ω is put into SS i .
We conclude that every strongly feasible potential maximal clique is in SS J . This completes the proof. ⊓ ⊔

Experimental analysis
Our PID approach is motivated by an expectation that, for typical graph instances, the number of positive subproblem instances is drastically smaller than the number of all subproblems instances. An experimental analysis has revealed that this expectation is not fulfilled.
In this experiment, we first count the number of minimal separators and the number of potential maximal cliques of a given graph. We also count those that are relevant in deciding if the treewidth of the graph is at most k: minimal separators with cardinality k or smaller and potential maximal cliques with cardinality k + 1 or smaller. We then count the number of I-blocks, O-blocks, and potential maximal cliques that are feasible for this value of k. Table 1 shows the results on some random instances, with k set to the treewidth of the graph: we are not interested in larger k and, for smaller k, the numbers in the columns dependent on k are smaller. The total number of minimal separators and that of potential maximal cliques grow much faster than the number of feasible objects in our algorithm, as the size of the graph grows. However, the growth in the numbers of relevant minimal separators and relevant potential maximal cliques is similar to the growth in the number of feasible objects. For example, for all but two instances, the number of relevant potential maximal cliques is within twice the number of feasible potential maximal cliques. Based on these numbers in the table, one may suspect that a more conventional (non-PID) implementation of the Bouchitté-Todinca dynamic programming will perform equally well as, or even better than, our PID implementation. To judge the plausibility of this suspicion, we need to take a closer look into how those combinatorial objects in Table 1, in particular the potential maximal cliques, are generated. The theoretically best algorithm currently known for listing all potential maximal cliques of cardinality ≤ k or smaller is due to Fomin and Villanger [12] (using results from [9]), and runs in O(n 5 ⌈(2n+k+6)/3⌉ k+2 ) time, where n is the number of vertices of the graph. Their algorithm operates by listing pairs of the form (C, v), called vertex representations, and testing if each pair yields a potential maximal clique, where C is a connected set of vertices and v is a vertex in C such that |N (C)| ≤ k and |C| is roughly 2(n−k) 3 or smaller. In fact, we need to list vertex representations in n subgraphs of G, each induced by a set of i vertices, i = 1, . . . , n, with n in the bound on |C| replaced by i. Table 2 shows the number of vertex representations generated by their algorithm, alongside with the number of potential maximal cliques generated. It should be clear that we need a better algorithm for generating potential maximal cliques in order to make the non-PID approach effective.
On the other hand, to generate feasible potential maximal cliques in our PID algorithm, we need to consider pairings of I-blocks and O-blocks as follows. For each pair of a feasible I-block (N (C), C) and a feasible O-block (N (A), A) such that C ⊆ A and |N (C) ∪ N (A)| ≤ k + 1, we test if "plugging-in" this I-block into that O-block results in a potential maximal clique or a new O-block. Call such a pair of an I-block and an O-block satisfying the above condition a plug-in pair. Although a naive algorithm for finding all plug-in pairs would require a quadratic amount of time, the number of plug-in pairs itself is rather small. The "plug-in pairs" column in Table 2 shows this number for each examined instance. For most instances, the number of plug-in pairs is smaller than 10 times the number of I-blocks. Thus, the efficiency of our algorithm boils down to a data structure with which we can quickly retrieve, from the huge set of O-blocks, this small number of O-blocks that form plug-in pairs with a given particular I-block. The next section describes a data structure we call block sieves, which is fairly successful in practice but lacks any theoretical guarantee on its efficiency.

Implementation
In this section, we sketch two important ingredients of our implementation. Although both are crucial in obtaining the result reported in Section 7, our work on this part is preliminary and improvements are the subject of future research.

Data structures
The crucial elementary operation in our algorithm is the following. We have a set O of feasible O-blocks obtained so far and, given a new feasible I-block (N (C), C), need to find all members (N (A), A) of O such that C ⊆ A and |N (C) ∪ N (A)| ≤ k + 1. As the experimental analysis in the previous section shows, there is only a few such A on average for the tested instances even though O is usually huge. To support an efficient query processing, we introduce an abstract data structure we call block sieve. Let G be a graph and k a positive integer. A block sieve for graph G and width k is a data structure storing vertex sets of V (G) which supports the following operations. store(U ) : store vertex set U in in the block sieve. supersets(U ) : return the list of entries W stored in the block sieve such that U ⊆ W and |N (U ) ∪ N (W )| ≤ k + 1.
Data structures for superset query have been studied [20]. The second condition above on the retrieved sets, however, appears to make this data structure new. For each U ⊆ V (G), we define the margin of U to be k + 1 − |N (U )|. Our implementation of block sieves described below exploits an upper bound on the margins of vertex sets stored in the sieve. We first describe how such block sieves with upper bounds on margins are used in our algorithm. Let O be the current set of O-blocks. We use t block sieves B 1 , . . . , B t , each B i having a predetermined upper bound m i on the margins of the sets stored. We have 0 < m 1 < m 2 < . . . < m t = k. We set m 0 = 0 for notational ease below. In our implementation, we choose roughly t = log 2 k and m i = 2 i for 0 < i < t. For each (N (A), A) in O, A is stored in B i such that the margin k + 1 − |N (A)| is m i or smaller but larger than m i−1 . When we are given an I-block (N (C), C) and are to list relevant blocks in O, we query all of the t blocks with the operations supersets(C). These queries as a whole return the list of all vertex sets A such that (N (A), A) ∈ O, C ⊆ A, and |(N (A) ∪ N (C))| ≤ k + 1.
We implement a block sieve by a trie T . The upper bound m on margin is not used in the construction of the sieve; it is used in the query time. In the following, we assume V (G) = {1, . . . , n} and, by an interval [i, j], 1 ≤ i ≤ j ≤ n, we mean the set {v : i ≤ v ≤ j} of vertices. Each non-leaf node p of T is labelled with a non-empty interval [s p , f p ], such that s r = 0 for the root r, s p = f q + 1 if p is a child of q, and f p = n if p is a parent of a leaf. Each edge (p, q) which connects node p and a child q of p, is labelled with a subset S (p,q) of the interval [s p , f p ]. Thus, for each node p, the union of the labels of the edges along the path from the root to p is a subset of the interval [1, s p − 1], or [1, n] when p is a leaf, which we denote by S p . The choice of interval [s p , f p ] for each node p is heuristic. It is chosen so that the number of descendants of p is not too large or too small. In our implementation, the interval size is adaptively chosen from 8, 16, 32, and 64.
Each leaf q of trie T represents a single set stored at this leaf, namely S q as defined above. We denote by S(T ) the set of all sets stored in T . Then, for each node p of T , the set of sets stored We now describe how a query is processed against this data structure. Suppose query U is given. The goal is to visit all leaves q such that U ⊆ S q and |N (U ) ∪ N (S q )| ≤ k + 1. This is done by a depth-first traversal of the trie T . When we visit node p, we have the invariant that U ∩ [1, f p ] ⊆ S p , since otherwise no leaf in the subtree rooted at p stores a superset of U . Therefore, we descend from p to a child p ′ of p only if this invariant is maintained. Moreover, we keep track of the quantity i(p, U ) = |N (U ) ∩ S p |. Since, for each leaf q below p such that U ⊆ S q , we have i(q, U ) ≥ i(p, U ) and |N (U ) \ N (S q )| = i(q, U ) and hence |N (U ) ∪ N (S q )| ≥ |N (S q )| + i(p, U ). Since we know an upper bound m on the margin k + 1 − |N (S q )| of S q , we may prune the search under node p if i(p, U ) > m. When we reach a leaf q, we test if |N (U ) ∪ N (S q )| ≤ k + 1 indeed holds.

Safe separators
The notion of safe separators for tree width was introduced by Bodlaender and Koster [5]: a separator S of G is safe if completing S into a clique does not change the treewidth of G. If we find a safe separator S then the problem of deciding tree width of G reduces to that of deciding the treewidth of G C for each component C associated with S. Preprocessing G into such independent subproblems is highly desirable whenever possible.
The above authors observed that a powerful sufficient condition for safeness can be formulated based on graph minors. A labelled minor of G is a graph obtained from G by zero or more applications of the following operations. Call a separator minor-safe if it satisfies the sufficient condition for safeness stated in this lemma. Bodlaender and Koster [5] showed that if S is a minimal separator and is an almost clique (deleting some single vertex makes it a clique) then S is minor-safe and moreover that the set of all almost clique minimal separators can be found in O(n 2 m) time, where n is the number of vertices and m is the number of edges.
We aim at capturing as many minor-safe separators as possible, at the expense of theoretical running time bounds on the algorithm for finding them. Thus, in our approach, both the algorithm for generating candidate separators and the algorithm for deciding minor-safeness are heuristic. For candidate generation, we use greedy heuristic for treewidth such as min-fill and min-degree: the separators in the resulting tree-decomposition are all candidates for safe separators.
When we apply our heuristic decision algorithm for minor-safeness to candidate separator S, one of the following occurs.
1. The algorithm answers "YES". In this case, the required labelled clique minor has been found for every component associated S and hence S is minor-safe. 2. The algorithm answers "DON'T KNOW". In this case, the algorithm has failed to find a labelled clique minor for at least one component, and hence it is not known if S is minor-safe or not. 3. The algorithm aborts, after reaching the prescribed number of execution steps.
Our heuristic decision algorithm works in two phases. Let S be a separator, C a component associated with S, and R = V (G) \ (S ∪ C). In the first phase, we contract edges in R and obtain a graph B on vertex set S ∪ R ′ , where each vertex of R ′ is a contraction of some vertex set of R and B has no edge between vertices in R ′ . For each pair u, v of distinct vertices in S, let N (u, v) denote the common neighbors of u and v in graph B. The contractions are performed with the goal of making |N (u, v) ∩ R ′ | large for each missing edge {u, v} in S. In the second phase, for each missing edge {u, v}, we choose a common neighbor w ∈ N (u, v) ∩ R ′ and contract either {u, w} or {v, w}. The choice of the next missing edge to be processed and the choice of the common neighbor are done as follows. Suppose the contractions in the second phase are done for some missing edges in S. For each missing edge {u, v} not yet "processed", let N ′ (u, v) be the set of common neighbors of u and v that are not yet contracted with any vertex in S. We choose {u, v} with the smallest |N ′ (u, v) ∩ R ′ | to be processed next. Tie-breaking when necessary and the choice of the common neighbor w in N ′ (u, v) ∩ R ′ to be contracted with u or v is done in such a way that the minimum of |(N ′ (x, y) ∩ R ′ ) \ {w}| is maximized over all remaining missing edges {x, y} in S.
The performance of these heuristic strongly depends on the instances. For PACE 2017 public instances, they work quite well. Table 3 shows the preprocessing result on the last 10 of those instances. See Section 7 for the description of those instances and the computational environment for the experiment. For each instance, the number of safe separators found and the maximum subproblem size in terms of the number of vertices, after the graph is decomposed by the safe separators found, are listed. The results show that these instances, which are deemed the hardest among all the 100 public instances, are quickly decomposed into manageable subproblems by our preprocessing. On the other hand, these heuristics turned out useless for most of the DIMACS graph coloring instances: no safe separators are found for those instances. We suspect that this is not the limitation of the heuristics but is simply because those instances lack minor-safe separators. We need, however, further study to get a firm conclusion.

Performance results
We have tested our implementation on two sets of instances. The first set comes from the DIMACS graph coloring challenge [14] and has served as a standard benchmark suite for treewidth in the literature [13,5,15,19,4,2]. The other is the set of public instances posed by the exact treewidth track of PACE 2017 [16].
The computing environment for the experiment is as follows. CPU: Intel Core i7-7700K, 4.20GHz; RAM: 32GB; Operating system: Windows 10, 64bit; Programming language: Java 1.8; JVM: jre1.8.0 121. The maximum heap space size is 6GB by default and is 24GB where it is stated so. The implementation is single threaded, except that multiple threads may be invoked for garbage collection by JVM. The time measured is the CPU time, which includes the garbage collection time.
To determine the treewidth of a given instance we use our decision procedure with k being incremented one by one, starting from the obvious lower bound, namely the minimum degree of the graph. Binary search is not used because the cost of overshooting the exact treewidth is huge. We do not feel the need of using stronger lower bounds either, since the cost of executing the decision procedure for k below such lower bounds is usually quite small. Table 4 shows the results on DIMACS graph coloring instances. Each row shows the name of the instance, the number of vertices, the number of edges, the exact treewidth computed by our algorithm, CPU time in seconds, and the previously best known upper and lower bounds on the treewidth. Rows in bold face show the newly solved instances. For all but three of them, the previous best upper bound has turned out optimal: only the lower bound was weaker. In this experiment, however, no knowledge of previous bounds are used and our algorithm independently determines the exact treewidth.
The results on "queen" instances illustrate how far our algorithm has extended the practical limit of exact treewidth computation. Queen7 7 with 49 vertices is the largest instance previously solved, while queen10 10 with 100 vertices is now solved. Also note that all previously solved instances are fairly easy for our algorithm: all of them are solved within 10 seconds per instance and many of them within a second. Table 5 shows the lower bounds obtained by our algorithm on unsolved DIMACS graph coloring instances. Lower bound entries in bold face are improvements over the previously known lower bounds. Computation time of the previously best lower bounds ranges from a few minutes to a week [6]. Detailed comparison of lower bound methods, which requires the normalization of machine speeds, is not intended here. Rather, the table is meant to show the potential of our algorithm as a lower bound procedure.
For many of the instances the improvements are significant. It can also be seen from this table that our algorithm performs rather poorly on relatively sparse graphs with a large number of vertices. Table 6 shows the results on PACE 2017 instances. The prefix "ex" in the instance names means that they are for the exact treewidth track. Odd numbers mean that they are public instances disclosed prior to the competition for testing and experimenting. Even numbered instances, not in the list, are secret and to be used in evaluating submissions. The time allowed to be spent for each instance is 30 minutes. As can be seen from the table, our algorithm solves all of the instances with a large margin in time.  [15]; previous lower bounds from [6]. † out of memory before time out