A Measure & Conquer Approach for the Analysis of Exact Algorithms Fabrizio Grandoni
Tor Vergata Rome
grandoni@disp.uniroma2.it
– p. 1/69
A Measure & Conquer Approach for the Analysis of Exact - - PowerPoint PPT Presentation
A Measure & Conquer Approach for the Analysis of Exact Algorithms Fabrizio Grandoni Tor Vergata Rome grandoni@disp.uniroma2.it p. 1/69 The Importance of Being Tight (Accurately) measuring the size of relevant quantities is a
grandoni@disp.uniroma2.it
– p. 1/69
crucial step in science and engineering
exception
approximation ratios etc. are crucial to understand how good an algorithm is, and whether there is room for improvement
– p. 2/69
algorithm
tight running time bounds EG: The worst-case running time of MergeSort is Θ(n log n)
approximation algorithms EG: The approximation ratio of the classical primal-dual algorithm for Steiner forest is exactly 2
– p. 3/69
NP-hard problems is much worse
almost trivial (enumerative) algorithms
the design of better algorithms, not of better analytical tools ⇒ The aim of this talk is introducing a non-standard analytical tool, sometimes named Measure & Conquer, which leads to much tighter (though possibly non-tight) running time bounds for branch & reduce exact algorithms
– p. 4/69
– p. 5/69
exactly with the smallest possible (exponential) running time
⋄ Need for exact solutions (e.g. decision problems) ⋄ Reducing the running time from, say, O(2n) to O(1.41n) roughly doubles the size of the instances solvable within a given (large) time bound. This can’t be achieved using faster computers!! ⋄ Classical approaches (heuristics, approximation algorithms, parameterized algorithms...) have limits and drawbacks (no guaranty, hardness of approximation, W[1]-completeness...) ⋄ New combinatorial and algorithmic challenges
– p. 6/69
reduce paradigm
the problem, and then branch on two or more subproblems which are solved recursively according to some branching rules
the bounded search tree technique: a measure of the size of the subproblems is defined. This measure is used to lower bound the progress made by the algorithm at each branching step.
used in their analysis are usually trivial (e.g., number of nodes or edges in the graph).
– p. 7/69
problem of size n ≥ 0
and branching rules takes polynomial time (in n). Assume also that the branching depth is bounded by a polynomial
O(P(n)nO(1)) = O∗(P(n)) ⋄ O∗() suppresses polynomial factors
constant λ > 1
– p. 8/69
h(b) ≥ 1 subproblems. Let n − δb
j be the size of the j-th
subproblem ⋄ It must be δb
j ≥ 0 (indeed δb j > 0 for h(b) > 1)
⋄ (δb
1, . . . , δb h(b)) is the branching vector
P(n) ≤
h(b)
P(n − δb
j) ≤ h(b)
λn−δb
j ≤ λn ⇒ f b(λ) := 1 −
h(b)
λ−δb
j ≤ 0
positive root of f b(·) (branching factor).
– p. 9/69
– p. 10/69
Def: Given G = (V, E), the maximum independent set problem (MIS) is to determine the maximum cardinality α(G) of a subset
a b c d e α(G) = 2
– p. 11/69
[Zucherman’06]
[Impagliazzo,Paturi,Zane’01] ⇒ The best we can hope for is a O(λn) exact algorithm for some small constant λ ∈ (1, 2].
– p. 12/69
algorithm (≃ 10 lines of pseudo-code against ≃ 100 lines in [Robson’86]) is shown to have time complexity O(1.221n) [Fomin, Grandoni, Kratsch’06] ⇒ We will consider a similar algorithm, and analyze it in a similar (but simplified) way
– p. 13/69
⋄ connected components ⋄ domination ⋄ folding ⋄ mirroring ⋄ ...
might turn to be useful
– p. 14/69
Lem 1: Given a graph G with connected components G1, . . . , Gh, α(G) =
α(Gi) Rem: One can solve the problems induced by the Gi’s independently
– p. 15/69
Lem 2: If there are two nodes v and w such that N[v] ⊆ N[w], there is a maximum independent set which does not contain w ⋄ N[x]=N(x)∪{x}
v w
v w
– p. 16/69
Lem 3: For every node v, there is a maximum independent set which either contains v or at least two nodes in N(v).
v w
v w
Exr 1: Prove Lemmas 1, 2, and 3
– p. 17/69
Def: A mirror of a node v is a node u ∈ N 2(v) such that N(v)−N(u) is a (possibly empty) clique ⋄ N 2(v) are the nodes at distance 2 from v ⋄ mirrors of v are denoted by M(v)
v u v u v u v u
– p. 18/69
Lem 4: For any node v, α(G) = max{α(G − v − M(v)), α(G − N[v])} Exr: Prove Lem 4 (Hint: use Lem 3)
– p. 19/69
Def: Given a node v with no anti-triangle in N(v), folding v means
each anti-edge uw of N(v);
⋄ we use Gv to denote the graph after folding
v u w a b c
uw a b c v u w z a b c d
uz wz a b c d
– p. 20/69
Def: Given a node v with no anti-triangle in N(v), folding v means
each anti-edge uw of N(v);
⋄ we use Gv to denote the graph after folding
v u w a b c
uw a b c v u w z a b c d
uz wz a b c d
Rem 1: Folding can increase the number of nodes!
– p. 20/69
Def: Given a node v with no anti-triangle in N(v), folding v means
each anti-edge uw of N(v);
⋄ we use Gv to denote the graph after folding
v u w a b c
uw a b c v u w z a b c d
uz wz a b c d
Rem 2: Nodes of degree ≤ 2 are always foldable
– p. 20/69
Lem 5: For a foldable node v, α(G) = 1 + α(Gv)
v u w z a b c d
uz wz a b c d v u w z a b c d
uz wz a b c d
Exr 3: Prove Lem 5 (Hint: use Lem 3)
– p. 21/69
Rem: Lem 5 includes a few standard reductions as special cases
v u w a b c
a b c v u w a b c
u w a b c v u w a b c
w a b c
– p. 22/69
int mis(G) { if (G = ∅) return 0; //Base case //Folding Take v of minimum degree; if (d(v) ≤ 2) return 1 + mis(Gv); //“Greedy” branching Take v of maximum degree; return max{ mis(G − v), 1 + mis(G − N[v]) }; }
– p. 23/69
Thr: Algorithm mis solves MIS in O∗(1.33n) time
– p. 24/69
Thr: Algorithm mis solves MIS in O∗(1.33n) time Prf:
λ < 1.33
decreases by at least one P(n) ≤ P(n − 1) ≤ λn−1 ≤ λn
– p. 24/69
Thr: Algorithm mis solves MIS in O∗(1.33n) time Prf:
subproblem it removes 1 node (i.e. v), and in the other it removes 1 + d(v) ≥ 5 nodes (i.e. N[v]): P(n) ≤ P(n − 1) + P(n − 5) ≤ λn−1 + λn−5 ≤ λn (λ ≥ 1.32 . . .)
– p. 24/69
Thr: Algorithm mis solves MIS in O∗(1.33n) time Prf:
exactly 3, hence removing either 1 or 4 nodes. However, in the first case a node of degree 2 is folded afterwards, with the removal of at least 2 more nodes P(n) ≤ P(n − 3) + P(n − 4) ≤ λn−3 + λn−4 ≤ λn (λ ≥ 1.22 . . .)
– p. 24/69
Thr: Algorithm mis solves MIS in O∗(1.33n) time Prf:
exactly 3, hence removing either 1 or 4 nodes. However, in the first case a node of degree 2 is folded afterwards, with the removal of at least 2 more nodes P(n) ≤ P(n − 3) + P(n − 4) ≤ λn−3 + λn−4 ≤ λn (λ ≥ 1.22 . . .) Rem: This is the best one can get with a standard analysis
– p. 24/69
– p. 25/69
refined branching and reduction rules. In particular, one tries to improve on the tight recurrences. The analysis is then performed in a similar fashion
analysis and the quantity in terms of which the final time bound is expressed
measure m in the analysis, provided that m ≤ f(n) for some known function f
O∗(λm) = O∗(λf(n)), which is in the desired form
– p. 26/69
which standard measures are not able to exploit, and hence lead to a tighter analysis of a given algorithm
thanks to a better measure of subproblems size (without changing the algorithm!)
This measure does not immediately give a better time bound, but it will be a good starting point to define a really better measure
– p. 27/69
problem in polynomial time! Idea: define the size of the problem to be the number of nodes of degree at least 3
– p. 28/69
Def: Let ni be the number of nodes of degree i, and n≥i =
j≥i nj
m = n) Rem: m = n≥3 ≤ n. Hence, if we prove a running time bound in O∗(λm), we immediately get a O∗(λn) time bound
– p. 29/69
Thr: Algorithm mis solves MIS in O∗(1.33n) time
– p. 30/69
Thr: Algorithm mis solves MIS in O∗(1.33n) time (Alternative) Prf:
2 (which implies m = n≥3 = 0)
by the algorithm to solve an instance of size m
prove by induction that P(m) ≤ λm for λ < 1.33
– p. 30/69
Thr: Algorithm mis solves MIS in O∗(1.33n) time (Alternative) Prf:
P(0) = 1 ≤ λ0
sufficient to show that m′ ≤ m, from which P(m) ≤ P(m′) ≤ λm′ ≤ λm
– p. 30/69
Thr: Algorithm mis solves MIS in O∗(1.33n) time (Alternative) Prf:
∈ E. In this case we remove {v, u, w} and add a node uw with d(uw) ≤ d(u) + d(w) − 2. By case analysis m′ ≤ m also in this case
d(u) d(w) d(uw) m′ 2 2 2 m 2 ≥ 3 ≥ 3 m − 1 + 1 ≥ 3 ≥ 3 ≥ 4 m − 2 + 1
– p. 30/69
Thr: Algorithm mis solves MIS in O∗(1.33n) time (Alternative) Prf:
that all the nodes of the graph have degree ≥ 3 (since we do not fold). For t3 = |{u ∈ N(v) : d(u) = 3}|,
P(m) ≤ P(m − 1 − t3) + P(m − 1 − d(v)) ≤ P(m − 1) + P(m − 5) ≤ λm−1 + λm−5 ≤ λm (λ ≥ 1.32 . . .)
remove either 1 or 4 nodes of degree 3. However, in the first case the degree of the 3 neighbors of v drops from 3 to 2, with a consequent further reduction of the size by 3
P(m) ≤ P(m − 4) + P(m − 4) ≤ λm−4 + λm−4 ≤ λm (λ ≥ 1.18 . . .)
– p. 30/69
the degree of many other nodes
degree ≤ 2 without branching
Idea: assign a larger weight ωi ≤ 1 to nodes of larger degree i, and let the size of the problem be the sum of node weights. This way, when the degree of a node decreases, the size of the problem decreases as well
– p. 31/69
Def:
ωi = if i ≤ 2; ω if i = 3; 1
m =
ω(v) = ω · n3 + n≥4
– p. 32/69
Thr: Algorithm mis solves MIS in O∗(1.29n) time Prf:
λ < 1.29
sufficient to show that m′ ≤ m. Then P(m) ≤ P(m′) ≤ λm′ ≤ λm
the weight increasing with the degree)
– p. 33/69
Thr: Algorithm mis solves MIS in O∗(1.29n) time Prf:
w not adjacent. In this case we remove {v, u, w}, and add a node uw with d(uw) ≤ d(u) + d(w) − 2. Hence it is sufficient to show that ω(v) + ω(u) + ω(w) − ω(sw) = ω(u) + ω(w) − ω(uw) ≥ 0
– p. 33/69
Thr: Algorithm mis solves MIS in O∗(1.29n) time Prf:
d(u) d(w) d(uw) ω(u) + ω(w) − ω(uw) ≥ 0 2 2 2 0 + 0 − 0 ≥ 0 2 3 3 0 + ω − ω ≥ 0 2 ≥ 4 ≥ 4 0 + 1 − 1 ≥ 0 3 3 4 ω + ω − 1 ≥ 0 3 ≥ 4 ≥ 4 ω + 1 − 1 ≥ 0 ≥ 4 ≥ 4 ≥ 4 1 + 1 − 1 ≥ 0
2 (new constraint on the weights!)
– p. 33/69
Thr: Algorithm mis solves MIS in O∗(1.29n) time Prf:
degree of the ith neighbor of v (which thus has weight ωdi). Then
P(m) ≤ P(m − ωd(v) −
(ωdi − ωdi−1)) + P(m − ωd(v) −
ωdi) ≤ P(m − 1 −
5
(ωdi − ωdi−1)) + P(s − 1 −
5
ωdi)
cases ωdi = 1 and ωdi − ωdi−1 = 0. Hence we can assume di ∈ {3, 4, 5} (finite number of recurrences!!!)
– p. 33/69
Thr: Algorithm mis solves MIS in O∗(1.29n) time Prf:
P(m) ≤ P(m - 1 - 5·ω - 0·(1-ω) - 0·0) + P(m - 1 - 5·ω - 0·1 - 0·1) P(m - 1 - 4·ω - 1·(1-ω) - 0·0) + P(m - 1 - 4·ω - 1·1 - 0·1) P(m - 1 - 4·ω - 0·(1-ω) - 1·0) + P(m - 1 - 4·ω - 0·1 - 1·1) P(m - 1 - 3·ω - 2·(1-ω) - 0·0) + P(m - 1 - 3·ω - 2·1 - 0·1) . . . P(m - 1 - 0·ω - 0·(1-ω) - 5·0) + P(m - 1 - 0·ω - 0·1 - 5·1)
– p. 33/69
Thr: Algorithm mis solves MIS in O∗(1.29n) time Prf:
argument (but with di ∈ {3, 4}) P(m) ≤ P(m - 1 - 4·ω - 0·(1-ω)) + P(m - 1 - 4·ω - 0·1) P(m - 1 - 3·ω - 1·(1-ω)) + P(m - 1 - 3·ω - 1·1) P(m - 1 - 2·ω - 2·(1-ω)) + P(m - 1 - 2·ω - 2·1) P(m - 1 - 1·ω - 3·(1-ω)) + P(m - 1 - 1·ω - 3·1) P(m - 1 - 0·ω - 4·(1-ω)) + P(m - 1 - 0·ω - 4·1)
– p. 33/69
Thr: Algorithm mis solves MIS in O∗(1.29n) time Prf:
analogous argument (but with ω(v) = ω3 = ω and di = 3) P(m) ≤ P(m − ω − 3 ω) + P(m − ω − 3 ω)
upper bound λ(ω) on λ. Our goal is minimizing λ(ω) (hence getting a better time bound)
gives λ(ω) < 1.29
– p. 33/69
ωi = if i ≤ 2; ω if i = 3; ω′ if i = 4; 1
where 0 < ω ≤ ω′ ≤ 1 Thr 3: Algorithm mis solves MIS in O∗(1.26n) time
– p. 34/69
Exr 5: Prove Thr 3 (Hint: ω = 0.750, ω′ = 0.951) Exr 6: What do you expect that would happen if we added one extra weight ω5 = ω′′? Can you guess any pattern? Exr 7*: Design a better algorithm for MIS, using possibly the
standard way and via Measure & Conquer Exr 8*: Can you imagine an alternative, promising measure for MIS?
– p. 35/69
– p. 36/69
exploration might be too slow
an (exponentially) faster way
– p. 37/69
describing different aspects of the size of the problem considered EG: In the analysis of mis we used m1 = n3 and m2 = n≥4
P(m1, . . . , md) ≤ P(m1 − δb
1,1, . . . , md − δb d,1) + . . .
+ P(m1 − δb
1,h(b), . . . , md − δb d,h(b))
Rem: some of the δb
i,j might be negative. For example, deleting
increase n3
– p. 38/69
recurrences by considering a linear combination of the measures (aggregated measure) m(α) = α1 m1 + . . . + αd md
j := i αi δb i,j > 0,
i.e. m(α) decreases in each subproblem (we allow ≥ 0 for h = 1) EG: In the analysis of mis we used α1 = ω and α2 = 1. The condition is satisfied for every ω ∈ [0.5, 1]
– p. 39/69
standard way (for fixed weights)
positive root λb(α) of f b(λ, α) := 1 −
λ− P
i αiδb i,j
P
i αi mi)
where λ(α) := max
b
λb(α)
– p. 40/69
Def: A function f : D → R, with D ⊆ Rd convex, is quasiconvex if the set f ≤a := {x ∈ D : f(x) ≤ a} is convex for any a ∈ R
f(x) x a f ≤a
– p. 41/69
Thr [Eppstein’01]: Function λ(α), α ∈ Rd, is quasiconvex Prf:
quasiconvex, it is sufficient to show that each λb(α) is quasiconvex
j λ− P
i αiδb i,j
λb,≤a = {α ∈ Rd : λb(α) ≤ a} = {α ∈ Rd :
j a− P
i αiδb i,j ≤ 1}
j a− P
i αiδb i,j is convex as sum of convex functions,
and trivially its level sets are convex, including gb,≤1 Cor: Function λ(α) is quasiconvex over any convex D ⊆ Rd
– p. 42/69
the Measure & Conquer framework
such that (a) the size of each subproblem does not increase (b) the initial measure m = m(α) is upper bounded by n, where n is a standard measure for the problem
can compute the minimum value λ(˜ α) of the quasiconvex function λ(α)
α)m(˜
α)) = O∗(λ(˜
α)n)
– p. 43/69
a quasi-convex functions (see e.g. [Eppstein’01,Gaspers])
implement, approach based on randomized local search (in simulated annealing style) ⋄ We start from any feasible initial value α ⋄ We add to it a random vector in a given range [−∆, ∆]d ⋄ If the resulting α′ is feasible and gives λ(α′) ≤ λ(α), we set α = α′ ⋄ We iterate the process, reducing the value of ∆ if no improvement is achieved for a large number of steps ⋄ The process halts when ∆ drops below a given value ∆′
– p. 44/69
f(x) x D
– p. 45/69
f(x) x D
– p. 45/69
f(x) x D
– p. 45/69
f(x) x D
– p. 45/69
f(x) x D
– p. 45/69
f(x) x D
– p. 45/69
f(x) x D
– p. 45/69
f(x) x D
– p. 45/69
f(x) x D
– p. 45/69
f(x) x D
– p. 45/69
f(x) x D
– p. 45/69
f(x) x D
Rem: This algorithm does not guarantee closeness to the optimal λ(˜ α). However it is accurate in practice. More important, it provides feasible upper bounds
– p. 45/69
– p. 46/69
time bounds
problem!)
being tight
– p. 47/69
Thr 4: The running time of mis is Ω(2n/4) Prf:
a1 b1 c1 d1 a2 b2 c2 d2 a3 b3 c3 d3
{a1, b1, c1, d1} is removed, either immediately or later on by
number of subproblems, which gives P(n) ≥ 2n/4
– p. 48/69
Thr 4: The running time of mis is Ω(2n/4) Exr 8: Find a larger lower bound on the running time of mis (Hint: Ω(3n/6) = Ω(1.20n), maybe better) Exr 9*: Consider the variant of mis where the algorithm, after the base case, branches on connected components when possible. Can you find a good lower bound on the running time of this modified algorithm? Rem: Typically finding lower bounds on connected graphs is much more complicated
– p. 49/69
– p. 50/69
Def: Given G = (V, E), the independent set problem (MIS) is to determine the maximum cardinality α(G) of a subset of pairwise non-adjacent nodes (independent set) a b c d e α(G) = 2
– p. 51/69
Thr [Fomin,Grandoni,Kratsch’06-’09]: MIS can be solved in O∗(1.221n) time and polynomial space Prf:
int mis(G) { if(|V (G)| ≤ 1) return |V (G)|; if(∃ component C ⊂ G) return mis(C)+mis(G − C); if(∃ vertices v and w: N[w] ⊆ N[v]) return mis(G − {v}); if(∃ a vertex v, with d(v) = 2) return 1+mis(Gv); select a vertex v of maximum degree, which minimizes |E(N(v))|; return max{mis(G − {v} − M(v)), 1+mis(G − N[v])}; }
– p. 52/69
Def: Given a weighted G = (V, E), the traveling salesman problem problem (TSP) is to compute a minimum weight cycle spanning V (TSP tour) a b c d e
2 2 2 1 2 2 4 5
– p. 53/69
Thr [Eppstein’03-’07]: TSP can be solved in O∗(1.260n) time in cubic graphs Prf:
which induce connected components in G − F
– p. 54/69
Def: Given G = (V, E) and a set of 3 colors, the 3-coloring problem (3-COL) is to find an assignment of colors to nodes such that adjacent nodes are colored differently a b c d e
– p. 55/69
Def: Given a set of variables on domains of size ≤ a and a set of constraints each one involving at most b variables, the (a, b)-constraint satisfaction problem (CSP) is to find an assignment of the variables satisfying all the constraints Rem: 3-COL is a special case of (3, 2)-CSP
– p. 56/69
Thr [Beigel,Eppstein’00-’05]: 3-COL can be solved in O∗(1.329n) time Prf:
O∗(1.365n) time
the number of variables with domain of size 3 and 4 (variables with smaller domain can be filtered out)
– p. 57/69
Def: Given G = (V, E), the dominating set problem (MDS) is to determine the minimum cardinality δ(G) of a subset of nodes D such that any node in V − D is adjacent to some node in D (dominating set) a b c d e δ(G) = 2
– p. 58/69
Def: Given a universe U and a collection of subsets S ⊆ 2U, the set cover problem (MSC) is to determine a minimum cardinality subcollection C ⊆ S such that ∪S∈CS = U (set cover) Rem: MDS can reduced to MSC by letting U = V and S = {N[v] : v ∈ V }. This instance has n subsets and n elements a b c d e U = {a, b, c, d, e} Sa = {a, b, e} Sb = {a, b, c, e} Sc = {b, c, d} Sd = {c, d, e} Se = {a, b, d, e}
– p. 59/69
Thr [Grandoni’04-’06]: MDS can be solved in O∗(1.803n) time Proof: Design a simple algorithm solving MSC in O∗(1.381|U|+|S|) time ⇒ O∗(1.3812n) time algo for MDS
int msc(S) { if(|S| = 0) return 0; if(∃S, R ∈ S : S ⊆ R) return msc(S\{S}); if(∃u ∈ U(S)∃ a unique S ∈ S : u ∈ S) return 1+msc(del(S, S)); take S ∈ S of maximum cardinality; if(|S| = 2) return poly-msc(S) return min{msc(S\{S}), 1+msc(del(S, S))}; }
Exr 10: Prove the theorem above
– p. 60/69
Thr [Fomin,Grandoni,Kratsch’05-’09]: MDS can be solved in O∗(1.527n) time Proof:
as before
elements of different frequency Exr 11*: Prove the theorem above Thr [van Rooij,Bodlaender’08]: MDS can be solved in O∗(1.507n) time
– p. 61/69
Def: Given G = (V, E), the minimum independent dominating set problem (MIDS) is to determine the minimum cardinality of a dominating set of G which is also an independent set Thr [Gasper,Liedloff’06]: MIDS can be solved in O∗(1.358n) time Def: Given G = (V, E), the minimum dominating clique problem (MDC) is to determine the minimum cardinality of a dominating set of G which is also a clique Thr [Kratsch,Liedloff’07]: MDC can be solved in O∗(1.324n) time
– p. 62/69
Def: Given G = (V, E), the connected dominating set problem (ConDomS) is to determine the minimum cardinality δ′(G) of a dominating set of G which induces a connected graph (connected dominating set) a b c d e δ′(G) = 2
– p. 63/69
Thr [Fomin,Grandoni,Kratsch’06-’08]: Connected dominating set can be solved in O∗(1.941n) time Proof:
graph, until it becomes dominating
number of nodes not yet dominated
discarded, giving a smaller extra weight to nodes whose removal makes the problem infeasible Rem: without the refined measure one does not improve on trivial 2n!
– p. 64/69
Thr [Fomin,Grandoni,Pyatkin,Stepanov’05-’08]: An n-node graph has O∗(1.716n) minimal dominating sets Prf: Design a listing algorithm and analyze it via M&C
problems, where reduction rules are harder to get Thr [Fomin,Grandoni,Pyatkin,Stepanov’05]: The weighted minimum dominating set problem can be solved in O∗(1.578n) time Prf: Use a variant of the listing algorithm above, implementing a trivial weighted set cover reduction rule
– p. 65/69
Def: Given G = (V, E), the feedback vertex set problem (FVS) is to determine the minimum cardinality φ(G) of a subset of nodes whose removal makes G acyclic (feedback vertex set) a b c d e φ(G) = 1
– p. 66/69
Thr [Razgon+Fomin,Gaspers,Pyatkin’06-’08]: FVS can be solved in O∗(1.755n) time Prf:
independent sets computation to solve the equivalent maximum induced forest problem
0 · |F| + 1 · |N(t)| + (1 + α)|V − F − N(t)|
– p. 67/69
I apologize for related and improved results that I forgot to mention
– p. 68/69
– p. 69/69