SMS is an exact algorithm implementation for computing treedepth, available in  and in https://github.com/Laakeri/pace2020-treedepth-exact. SMS was developed for the fifth PACE challenge (PACE 2020). The main algorithm implemented in SMS is a recursive procedure that branches on minimal separators 
. Two variants of the branching algorithm are implemented, one with a heuristic algorithm for enumerating minimal separators and one with an exact algorithm. Several lower bound techniques are implemented within the branching algorithm. Before applying the branching algorithm, preprocessing techniques are applied and a heuristic upper bound for treedepth is computed.
This arXiv version contains an appendix containing proofs for novel techniques used.
Let be a graph with vertex set and edge set . The graph is the induced subgraph of with vertex set . The set is the neighborhood of a vertex and is the neighborhood of a vertex set . The treedepth of is denoted by . A minimal -separator of is a subset-minimal vertex set such that the vertices and are in different connected components of . The set of minimal separators of for all pairs is denoted by and the set of minimal separators with size at most by . The set of vertex sets of connected components of is denoted by .
3 The Algorithm
SMS is based on the following characterization of treedepth.
[] Let be a graph. If is a clique then . Otherwise
Proposition 3.1 is implemented as a recursive algorithm that takes a vertex set as input and computes by first enumerating the minimal separators of and then branching from each minimal separator to smaller induced subgraphs for each component . We make use of upper bounds by implementing Proposition 3.1 as a decision procedure which, given a vertex set and a number , decides if . Clearly, in this case we may consider only the minimal separators in . Moreover, we handle the minimal separators with sizes and as special cases and thus consider only the minimal separators in in the main recursion. A minimal separator with such that must be a vertex cover of and therefore is a neighborhood of a vertex. A minimal separator with such that has also a somewhat special structure, and we handle them with a modification of Berry’s algorithm  for enumerating minimal separators.
3.2 Enumerating Small Minimal Separators
SMS spends most of its runtime in a subroutine which given a number and a graph enumerates . To make use of the fact that heuristic enumeration of small minimal separators is more efficient than exact enumeration, two variants of the main branching algorithm are ran: first a variant using a heuristic minimal separator enumeration algorithm and then a variant using an exact minimal separator enumeration algorithm.
The heuristic enumeration algorithm is a simple modification of Berry’s algorithm . The modification prunes all minimal separators with more than vertices immediately during the execution, outputting a set in time. As observed in , there are cases in which . However, in practice the algorithm seems to often find all small minimal separators on the values of that are relevant.
As an exact small minimal separator enumeration algorithm we implement the algorithm of Tamaki , including also the optimizations discussed in the paper. To the best of our knowledge there are no better bounds than for the runtime of this algorithm. In practice it appears to usually have only a factor of 2-10 runtime overhead compared to the heuristic algorithm.
In cases when is a child of in the recursion, obtained by branching on a minimal separator , and we make use of the small minimal separators of to enumerate the small minimal separators of . In particular, for all minimal separators , there exists a minimal separator such that . Note that in this case is exactly the difference in the values of in recursive calls on and , and therefore is already enumerated.
3.3 Lower Bounds
To avoid unnecessary re-computation, the known upper and lower bounds for are stored for each handled induced subgraph . To this end, an open addressing hashtable with linear probing is implemented. Also, we implement an ad-hoc data structure so that given a vertex set , a vertex set with the highest known lower bound for can be found. This data structure uses the idea of computing subset-preserving hashes by using the intersection , where is a subset of vertices with size , where is the number of elements in the data structure. Other implemented algorithms for computing lower bounds on are the MMD+ algorithm  which finds large clique minors, a depth-first search algorithm which finds long paths and cycles, and a graph isomorphism hashtable which finds already processed induced subgraphs that are isomorphic to and applies the lower bounds of to .
3.4 Preprocessing Techniques
The preprocessing techniques implemented in SMS are tree elimination and the kernelization procedures described in . Tree elimination finds a subgraph such that is a tree and , i.e., the subgraph is attached to the rest of the graph only on a single vertex. Then it uses an exact algorithm to compute a list of length that characterizes the behavior of with respect to treedepth of , and replaces with a construction of vertices whose behavior is the same. The simplicial vertex kernelization rule from  is implemented as it is described there, but the shared neighborhood rule is generalized. In particular, if there are two non-adjacent vertices , and the minimum -vertex cut is at least , where is an upper bound for treedepth, then an edge can be added between and .
3.5 Upper Bounds
To compute upper bounds on treedepth we implement a novel heuristic algorithm. The algorithm first finds a triangulation (chordal completion) of using the LB-Triang algorithm  with a heuristic aiming to minimize the number of fill-edges in each step. Then it uses the branching algorithm, with some additional heuristics making it non-exact, to compute a treedepth decomposition of . Any treedepth decomposition of is also a treedepth decomposition of . The properties of chordal graphs interplay nicely with the branching algorithm: chordal graphs have a linear number of minimal separators and the treewidth of a chordal graph can be computed in linear time . Moreover, there exists a triangulation of with , because treedepth can be formulated as a completion problem to a graph class that is a subset of chordal graphs .
-  Anne Berry, Jean-Paul Bordat, and Olivier Cogis. Generating all the minimal separators of a graph. International Journal of Foundations of Computer Science, 11(3):397–403, 2000. doi:10.1142/S0129054100000211.
-  Anne Berry, Jean-Paul Bordat, Pinar Heggernes, Geneviève Simonet, and Yngve Villanger. A wide-range algorithm for minimal triangulation from an arbitrary ordering. Journal of Algorithms, 58(1):33–66, 2006. doi:10.1016/j.jalgor.2004.07.001.
-  Hans L. Bodlaender and Arie M. C. A. Koster. Treewidth computations II. Lower bounds. Information and Computation, 209(7):1103–1119, 2011. doi:10.1016/j.ic.2011.04.003.
-  Jitender S. Deogun, Ton Kloks, Dieter Kratsch, and Haiko Müller. On the vertex ranking problem for trapezoid, circular-arc and other graphs. Discrete Applied Mathematics, 98(1-2):39–63, 1999. doi:10.1016/S0166-218X(99)00179-1.
-  Philippe Galinier, Michel Habib, and Christophe Paul. Chordal graphs and their clique graphs. In WG 1995, volume 1017 of LNCS, pages 358–371. Springer, 1995. doi:10.1007/3-540-60618-1_88.
-  Yasuaki Kobayashi and Hisao Tamaki. Treedepth parameterized by vertex cover number. In IPEC 2016, volume 63 of LIPIcs, pages 18:1–18:11. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2016. doi:10.4230/LIPIcs.IPEC.2016.18.
-  Tuukka Korhonen. PACE 2020 exact treedepth submission: SMS, 2020. doi:10.5281/zenodo.3872898.
-  Alejandro A. Schäffer. Optimal node ranking of trees in linear time. Information Processing Letters, 33(2):91–96, 1989. doi:10.1016/0020-0190(89)90161-0.
-  Hisao Tamaki. Computing treewidth via exact and heuristic lists of minimal separators. In SEA 2019, volume 11544 of LNCS, pages 219–236. Springer, 2019. doi:10.1007/978-3-030-34029-2_15.
Appendix A Details and Proofs
For a vertex set let . For a vertex let .
[] A minimal separator has at least two full components, i.e., components with .
a.1 Minimal Separators with Vertices
In the branching algorithm, minimal separators with vertices are handled as special cases.
Let be a minimal separator of a graph such that . It holds that for a vertex .
The set is not empty, so . A graph with treedepth is an independent set, so the full components of are single vertices. ∎
By Proposition A.1, it can be decided in polynomial time if there is a minimal separator of size that can be used to obtain a treedepth decomposition of depth .
a.2 Minimal Separators with Vertices
Handling minimal separators with size is more complicated. A minimal separator with can be used to obtain a treedepth decomposition of depth if and only if each connected component of is a star. To find such minimal separators, we find for each vertex the minimal separators such that is in a full component of and is a star with . The following proposition can be adapted from .
[] Let be a minimal separator of a graph and a full component of containing . The separator is either a separator close to , obtained as for a component , or can generated from a separator with a full component with by where for a vertex .
By Proposition A.2, the minimal separators such that is a star can be generated from other minimal separators such that is a star. Thus we can modify Berry’s algorithm to prune the minimal separators for which is not a star. We also use an optimization that if has a component that is not a star, then there is no minimal separator such that is in a full component of and all components of are stars.
a.3 Inducing Small Minimal Separators
We use small minimal separators of to generate small minimal separators of .
Let be a graph, and . There exists a minimal separator such that .
Let be a minimal -separator in . Let . Now is a minimal -separator in . Let us add each vertex to one by one. If can be reached from both and in , then is a minimal -separator of , having the same full components in as has in . Otherwise is a minimal separator of . With this process we obtain a minimal separator with . ∎
a.4 Tree Elimination
We adapt the algorithm for computing the treedepth of a tree in linear time  to locally kernelize tree subgraphs of the input graph. Treedepth can be formulated as a problem of finding a vertex ranking such that if for distinct vertices , then all paths between and contain a vertex with . Now, for a vertex we can define the set of ranks that can be “seen” from as the ranks (including ) such that there is a path from to such that all vertices of the path have . Let us say that a set of ranks is smaller than a set of ranks if the maximum element of is smaller than the maximum element of .
[] Let be a tree and . A vertex ranking of such that is the smallest possible can be computed in linear time.
Our local kernelization algorithm finds a subset-maximal subgraph such that is a tree and is attached to the rest of the graph only on a single vertex , i.e., and then computes a vertex ranking of such that is the smallest possible. Then the subgraph is replaced with a subgraph determined by . This is done by first replacing with a path of length , attached to the rest of the graph only on . Then, a clique with vertices is attached to each vertex of the path, where is the -th smallest rank in . Now, has been replaced with a construction consisting of vertex-disjoint cliques whose sizes are the ranks in . The size of this construction is vertices.
Let be a graph and be a graph obtained from by applying the above described procedure. It holds that .
Assume that the procedure was applied on a single tree with . Let be the smallest possible set of ranks seen from in .
First, consider a vertex ranking of and let us construct a vertex ranking of . Let be the set of ranks on seen from in . If the maximum value of is the same as the maximum value of , then let be this value. The clique attached to can now be arbitrarily ranked with smaller values. Now we can remove the maximum value from both and and remove the vertex and the attached clique and continue by induction. If the maximum value of is different than the maximum value of , then it must be higher than the maximum value of because is the smallest. In that case, we can rank with the maximum value, and now clearly the rest of the structure of cliques can be ranked with smaller values.
Then, consider a vertex ranking of and let us construct a vertex ranking of . Let be the set of ranks on seen from in , where is the set of vertices which replaced . Our strategy is to show that (1) is not smaller than and (2) given any set of ranks not smaller than , we can construct a ranking of such that . In particular, we can construct a ranking for the induced subgraph which does not add any ranks to the set of seen ranks from , and thus this ranking can be plugged into the rest of the ranking for . To show (1), if the maximum value of is higher the maximum value of we are done. Otherwise, the maximum value must be taken by the clique attached to . Let us then remove the maximum value from both and and remove and the attached clique and proceed by induction. To show (2), let be a set of ranks not smaller than and let us construct a ranking of such that . If the maximum value of is higher than the maximum value of then let be the maximum value, now and the rest of the tree can be ranked with the optimal ranking. Otherwise find the subtree whose root in the optimal ranking of has the maximum value of , rank the subtree with the optimal ranking, remove the subtree, and remove the maximum value from both and and proceed by induction. ∎
The local kernelization and the reconstruction can be implemented in time.
a.5 Generalized Shared Neighborhood Rule
In  it was shown that if there are non-adjacent vertices with , where is an upper bound for treedepth, then an edge can be added between and . We generalize this rule.
Let and be non-adjacent vertices in a graph . If the minimum vertex cut between and is at least and , then , where is a graph obtained from by adding an edge between and .
Consider a treedepth decomposition of with depth at most such that is not an ancestor of and is not an ancestor of . Now, the ancestors of form a vertex cut between and with size at most . Therefore, in any treedepth decomposition of with depth at most either is an ancestor of or is an ancestor of . ∎