Home

Enclsoing the horse in singly-exponential time

Consider the Steiner Tree problem:

Problem: Steiner Tree


Input: a graph 𝐺, a set of terminals π‘‡βŠ†π‘‰(𝐺), and an integer π‘˜.

Output: Does 𝐺 contain a connected subset of size β‰€π‘˜ that contains all of 𝑇?

Without the connectivity requirement, this problem can easily be solved by standard DP techniques (although it is also trivial: Just output yes if and only if |𝑇|β‰€π‘˜). When trying to formulate a treewidth-based DP for the full problem, however, we run into an issue: A naive formulation might look as follows:

𝐴(π‘₯,𝑓)=min. size of solution𝑆in𝑉π‘₯such that𝐡π‘₯βˆ©π‘†=𝑓

with 𝑛2tw many states. This does not quite work, however: consider a grid graph like the following:

Here, 𝐴(row3,{(3,1),(3,3)}) tells us nothing about whether (3,1) and (3,3) are connected somewhere within 𝑉row3 (ie. through (4,2)) or outside (through (2,2)). Subsequently we will not be able to ensure that (3,1) and (3,3) are connected at all!

The β€œsimple” way to work around this is to represent which subsets of 𝐡π‘₯ are connected in 𝑉π‘₯ directly in the DP state itself, ie.

𝐴:(π‘₯:tree decomposition bag)Γ—(𝑓:2𝐡π‘₯)Γ—equiv. rel. on𝑓→ℕ𝐴(π‘₯,𝑓,𝑐)=min. size of solution𝑆in𝑉π‘₯such that𝐡π‘₯βˆ©π‘†=𝑓and(𝑒,𝑣)βˆˆπ‘iff. there is a pathπ‘’βˆ’π‘£in𝑉π‘₯βˆ©π‘†

And while this works (and leads to a running time of the form 2𝑂(twlogtw)𝑛), the dependence on the treewidth is no longer singly exponential.

The Cut&Count technique [3] is a recent (2013) technique invented to solve problems with β€œconnectivity constraints” such as the above in singly-exponential time.

Cut&Count

It will turn out that, instead of finding an exact answer, it will be sufficient to count the number of solutions (of a slightly modified problem) modulo 2. (proof of this comes later). As is usual whenever a DP gets too complicated, we will also take the solution size as a parameter π‘˜ instead of computing the optimum directly.

Let 𝑅 be the set of all β€œsolutions” of the given size without the conΒ­nectivity constraint (we will call these β€œpotential solutions”), and 𝑆 be the subset of potential solutions which are actually connected.

𝑅={π‘‹βŠ†π‘‰(𝐺)|π‘‡βŠ†π‘‹,|𝑋|=π‘˜}𝑆={π‘‹βˆˆπ‘…|𝑋is connected}

We would like to compute |𝑆| mod 2, but this seems hard. Computing the parity of |𝑅| is easy (in fact computing the whole of |𝑅| is easy), but this will not be very useful as the parity of |𝑆| and |𝑅| may differ.1

The main idea of the Cut&Count technique is to replace the β€œglobal” connectivity constraint with a local constraint about graph cuts. More specifically, consider some potential solution 𝑋. Let a β€œconsistent cut” of 𝑋 be a cut (𝑋𝑙,π‘‹π‘Ÿ) such that no edge in 𝐺[𝑋] crosses the cut. EquiΒ­valently, a consistent cut consists of an assignment of a side (β€œleft” or β€œright”) to each connected component of 𝐺[𝑋], and thus the number of consistent cuts is exactly 2cc(𝐺[𝑋]), where cc(𝐻) is the number of conΒ­nected components in 𝐻.

This is almost what we want: if we somehow halved this number, we would get a number which is odd if 𝐺[𝑋] is connected and even otherwise. So let

𝐢={(𝑋,(𝑋𝑙,π‘‹π‘Ÿ))|π‘‹βˆˆπ‘…,(𝑋𝑙,π‘‹π‘Ÿ)consistent cut of𝑋}

Then |𝐢|≑|𝑆|mod2, since connected potential solutions2 contribute by exactly 1 to |𝐢| all other potential solutions contribute by 0mod2.

To halve this number, we may simply pick a vertex π‘Ÿ we know is in the solution (ie. any vertex in 𝑇) and require that it be put on the left side of the cut.

To compute |𝐢| we may use standard DP techniques: Given a bag 𝑑, a subset π‘‹βŠ‚π΅π‘‘ and an assignment 𝑠:𝐴→{L,R}, let 𝑐(𝑑,𝐴,𝑠) be the number of pairs (𝑋,(𝑋𝑙,π‘‹π‘Ÿ)) in 𝐢 except restricted to 𝐺[𝑉𝑑] such that π‘‹βˆ©π΅π‘‘=𝐴 and 𝑠 gives the side of each vertex in 𝐴 in the cut, requiring that 𝑠(π‘Ÿ)=L. Computing 𝑐 in time π‘‚βˆ—(2𝑂(π‘˜)) should then be relatively straightforward.

The promised proof of why parity is enough

The following definition and lemma are taken from [3]:

Definition. A function πœ”:π‘ˆβ†’β„€ isolates a set family β„±οΈ€βŠ†2π‘ˆ if there is a unique π‘†β€²βˆˆβ„±οΈ€ with πœ”(𝑆′)=minπ‘†βˆˆβ„±οΈ€πœ”(𝑆).

Lemma. (Isolation Lemma, [4]) Let β„±οΈ€βŠ†2π‘ˆ be a set family over a universe π‘ˆ with |β„±οΈ€|>0. For each π‘’βˆˆπ‘ˆ, choose a weight πœ”(𝑒)∈{1,2,…,𝑁} uniformly and independently at random. Then

β„™[πœ”isolatesβ„±οΈ€]β‰₯1βˆ’|π‘ˆ|𝑁

The relevance of the Isolation Lemma is as follows: Let π‘ˆ=𝑉 and β„±οΈ€ be the set of solutions. Then the isolation lemma implies that if we randomly weigh the vertices in the graph, whp. there will be some weight 𝑀 such that exactly one solution has weight 𝑀. In particular, 1 is odd, so if we only look for solutions of weight 𝑀, if πœ”isolatesβ„±οΈ€, we will detect that we have an odd number of solutions and thus that a solution exists.

We get the following algorithm: let 𝑁=2|𝑉|, and uniformly and independently at random assign a weight in {1,…,𝑁} to each vertex in the graph. Then, for each 𝑀 from 1 to 𝑁|𝑉|3, compute the number of solutions of total weight 𝑀mod2. If any of them is nonzero, return True, otherwise return False.

Obviously, if the algorithm returns True, there must be at least one solution. Otherwise, the probability that a solution exists is ≀|𝑉|/𝑁=1/2, by the Isolation Lemma, as outlined above.

Bibliography


  1. 1testing footnotes
  2. 2aka solutions
  3. 3Or any upper bound on the maximum solution weight, for Steiner Tree π‘˜|𝑉| suffices4
  4. 4testing nested footnotes