Twin-Width III: Max Independent Set, Min Dominating Set, and Coloring
Édouard Bonnet, Colin Geniet, Eun Jung Kim, Stéphan Thomassé, Rémi Watrigant · SIAM Journal on Computing · 2024
Abstract. We recently introduced the notion of twin-width, a novel graph invariant, and showed that first-order model checking can be solved in time [Formula: see text] for [Formula: see text]-vertex graphs given with a witness that the twin-width is at most [Formula: see text], called [Formula: see text]-contraction sequence or [Formula: see text]-sequence, and formulas of size [Formula: see text] [Bonnet et al., JACM ’22]. The inevitable price to pay for such a general result is that [Formula: see text] is a tower of exponentials of height roughly [Formula: see text]. In this paper, we show that algorithms based on twin-width need not be impractical. We present [Formula: see text]-time algorithms for [Formula: see text]-independent set, [Formula: see text]-scattered set, [Formula: see text]-clique, and [Formula: see text]-dominating set when an [Formula: see text]-sequence of the graph is given in input. We further show how to solve the weighted version of [Formula: see text]-independent set, subgraph isomorphism, and induced subgraph isomorphism in the slightly worse running time [Formula: see text]. Up to logarithmic factors in the exponent, all these running times are optimal unless the exponential time hypothesis fails. Like our first-order model checking algorithm, these new algorithms are based on a dynamic programming scheme following the sequence of contractions forward. We then show a second algorithmic use of the contraction sequence by starting at its end and rewinding it. As an example of such a reverse scheme, we present a polynomial-time algorithm that properly colors the vertices of a graph with relatively few colors, thereby establishing that bounded twin-width classes are [Formula: see text]-bounded. This significantly extends the [Formula: see text]-boundedness of bounded rank-width classes and does so with a very concise proof. It readily yields a constant approximation for max independent set on [Formula: see text]-free graphs of bounded twin-width and a [Formula: see text]-approximation for min coloring on bounded twin-width graphs. We further observe that a constant approximation for max independent set on bounded twin-width graphs (but arbitrarily large clique number) would actually imply a polynomial-time approximation scheme. The third algorithmic use of twin-width builds on the second one. Playing the contraction sequence backward, we show that bounded twin-width graphs can be edge-partitioned into a linear number of bicliques such that both sides of the bicliques are on consecutive vertices in a fixed vertex ordering. This property is trivially shared with graphs of bounded average degree. Given that biclique edge-partition, we show how to solve the unweighted single-source shortest paths, and hence all-pairs shortest paths, in time [Formula: see text] and time [Formula: see text], respectively. In sharp contrast, even diameter does not admit a truly subquadratic algorithm on bounded twin-width graphs unless the strong exponential time hypothesis fails. The fourth algorithmic use of twin-width builds on the so-called versatile tree of contractions [Bonnet et al., Comb. Theory ’22], a branching and more robust witness of low twin-width. We present constant-approximation algorithms for min dominating set and related problems on bounded twin-width graphs by showing that the integrality gap is constant. This is done by going down the versatile tree and stopping according to a problem-dependent criterion. At the reached node, a greedy approach yields the desired approximation.