Branching Algorithms
Dieter Kratsch
Laboratoire d’Informatique Th´ eorique et Appliqu´ ee Universit´ e Paul Verlaine - Metz 57000 Metz Cedex 01 France
AGAPE 09, Corsica, France May 24 - 29, 2009
1/122
Branching Algorithms Dieter Kratsch Laboratoire dInformatique Th - - PowerPoint PPT Presentation
Branching Algorithms Dieter Kratsch Laboratoire dInformatique Th eorique et Appliqu ee Universit e Paul Verlaine - Metz 57000 Metz Cedex 01 France AGAPE 09, Corsica, France May 24 - 29, 2009 1/122 I. Our First Independent Set
Laboratoire d’Informatique Th´ eorique et Appliqu´ ee Universit´ e Paul Verlaine - Metz 57000 Metz Cedex 01 France
1/122
2/122
3/122
◮ For every vertex v: ”there is a maximum independent set
◮ Branching into two smaller subproblems: ”select v” and
◮ ”discard v”: remove v ◮ ”select v”: remove N[v] ◮ branching rule:
4/122
5/122
6/122
◮ standard branching rule correct; hence branching does not
◮ graphs of maximum degree two are disjoint union of paths
◮ α(G) easy to compute if ∆(G) ≤ 2 [exercice] ◮ mis1 outputs α(G) for input graph G ◮ mis1 can be modified s.t. it outputs a maximum independent
7/122
◮ Running time of mis1 is O∗(T(n)), where ◮ T(n) is largest number of base cases for any input graph G on
◮ Base case = graph of maximum degree two for which α is
◮ branching rule implies recurrence:
8/122
◮ Solutions of recurrence of form cn ◮ Basic solutions root of characteristic polynomial
◮ largest root of characteristic polynomial is its unique positive
◮ Maple, Mathematica, Matlab etc.
9/122
10/122
11/122
◮ branch & bound algorithms ◮ backtracking algorithms ◮ search tree algorithms ◮ branch & reduce algorithms ◮ splitting algorithms
12/122
◮ Branching rules: solve a problem instance by recursively
◮ Reduction rules:
13/122
◮ Search Tree:
◮ root: assign the input to the root ◮ node: assign to each node a solved problem instance ◮ child: each instance reached by a branching rule is assigned to
14/122
15/122
◮ Correctness:
◮ Running Time:
i ) for each).
16/122
◮ Correctness:
◮ Running Time:
i ) for each).
16/122
◮ Correctness:
◮ Running Time:
i ) for each).
16/122
◮ Correctness:
◮ Running Time:
i ) for each).
16/122
◮ Correctness:
◮ Running Time:
i ) for each).
16/122
◮ Correctness:
◮ Running Time:
i ) for each).
16/122
◮ Assumption: for any node of search tree polynomial running
◮ Time analysis of branching algorithms means to upper bound
◮ Let T(n) be (an upper bound of) the maximum number of
◮ Running time of corresponding branching algorithm:
◮ Branching rules to be analysed separately
17/122
◮ Application of branching rule b to any instance of size n ◮ Problem branches into r ≥ 2 subproblems of size at most
◮
18/122
◮ Linear recurrence for the maximum number of leaves of a
◮ Largest solution of any such linear recurrence (obtained by a
◮ This root c > 1 is called branching factor of
19/122
1, t2, . . . , tr)
1.
20/122
2 ).
◮ τ(3, 3) =
3
◮ τ(2, 4) = τ(4, 2) = 1.2721 ◮ τ(1, 5) = τ(5, 1) = 1.3248
21/122
22/122
◮ ”Sum up” consecutive branchings ◮ ”sum” (overall branching vector) easy to find via search tree ◮ useful technique to deal with tight branching vector (i, j)
◮ whenever algorithm (i, j)-branches it immediately
◮ overall branching vector (i + k, i + l, j)
23/122
24/122
25/122
◮ one of the major techniques to construct FPT and ModEx
◮ need only polynomial space ◮ major progress due to new methods of running time analysis ◮ many best known ModEx algorithms are branching algorithms
26/122
◮ Davis, Putnam (1960): SAT ◮ Davis, Logemann, Loveland (1962): SAT ◮ Tarjan, Trojanowski (1977): Independent Set ◮ Robson (1986): Independent Set ◮ Monien, Speckenmeyer (1985): 3-SAT
27/122
◮ Beigel, Eppstein (2005): 3-Coloring ◮ Fomin, Grandoni, Kratsch (2005): Dominating Set ◮ Fomin, Grandoni, Kratsch (2006): Independent Set ◮ Razgon; Fomin, Gaspers, Pyatkin (2006): FVS
28/122
29/122
◮ For every vertex v:
◮ ”either there is a maximum independent set containing v, ◮ or there is a maximum independent set containing a neighbour
◮ Branching into d(v) + 1 smaller subproblems: ”select v” and
◮ Branching rule:
30/122
31/122
◮ Input Size number n of vertices of input graph ◮ Recurrence:
◮ Solution of recurrence:
◮ Running time of mis2: O∗(3n/3).
32/122
◮ to any leaf of the search tree a maximal independent set of G
◮ each maximal independent set corresponds to a leaf of the
33/122
34/122
35/122
◮ History of branching algorithms to compute a maximum
◮ Branching and reduction rules for Independent Set algorithms ◮ Algorithm mis3 ◮ Running time analysis of algorithm mis3
36/122
◮ O(1.2600n)
◮ O(1.2346n)
◮ O(1.2278n)
◮ O(1.2202n)
37/122
38/122
39/122
◮ If I is a mis containing no vertex of N[v] then I + v is a mis,
◮ If I is a mis such that v /
40/122
41/122
41/122
41/122
41/122
◮ By the lemma, every mis of G contains two vertices of N(v). ◮ If u is a mirror then N(v) \ N(u) is a clique; thus at least one
◮ Consequently, no mis contains u.
42/122
43/122
44/122
A∈I(S) |A| + α(G − (S ∪ N[A])).
45/122
46/122
◮ separator S small, and ◮ easy to find.
◮ S ⊆ N2(v), and ◮ |S| ≤ 2
47/122
◮ minimum degree of instance graph G at most 3 ◮ v vertex of minimum degree ◮ if d(v) is equal to 0 or 1 then apply simplicial rule
48/122
◮ d(v) = 2: u1 and u2 neighbors of v
49/122
◮ d(v) = 2: u1 and u2 neighbors of v
49/122
50/122
51/122
◮ each vertex of N2(v) has precisely one neighbor in N(v) ◮ minimum degree of G at least 3, hence every ui has at least
52/122
53/122
◮ select v ◮ discard v, select u1, select u2 ◮ discard v, select u1, discard u2, select u3 ◮ discard v, discard u1, select u2, select u3
54/122
55/122
55/122
56/122
56/122
57/122
58/122
58/122
59/122
60/122
61/122
◮ A CNF-formula, i.e. a boolean formula in conjunctive normal
◮ A clause
◮ A k-CNF formula is a CNF-formula in which each clause
62/122
◮ A truth assignment assigns boolean values (false, true) to the
◮ A CNF-formula F is satisfiable if there is a truth assignment
◮ A CNF-formula is satisfiable if each clause contains at least
63/122
64/122
◮ Davis, Putnam 1960 ◮ Davis, Logemann, Loveland (1962)
◮ [UnitPropagate] If all literals of a clause c except literal ℓ are
◮ [PureLiteral] If a literal ℓ occurs pure in F, i.e. ℓ occurs in F
◮ [Branching] For any variable xi, branch into ”xi true” and ”xi
65/122
66/122
◮ Recursively compute partial assignment(s) of given k-CNF
◮ Given a partial truth assignment of F the corresponding
◮ Subproblem generated by the branching algorithm is a k-CNF
◮ Size of a k-CNF formula is its number of variables
67/122
◮ Branching on clause c = (ℓ1 ∨ ℓ2 ∨ · · · ∨ ℓt) of k-CNF formula
◮ into t subproblems by fixing some truth values:
◮ F1 :
◮ F2 :
◮ F3 :
◮ Ft :
68/122
◮ Assuming F consists of n variables then Fi, i = 1, 2, . . . , t,
◮ Branching vector is (1, 2, . . . , t), where t = |c|. ◮ Solve linear recurrence
◮ Compute the unique positive real root of
69/122
70/122
◮ If |c| = 0 return ”unsatisfiable”. ◮ If |c| = 1 reduce by setting the unique literal true. ◮ If F is empty then return ”satisfiable”.
71/122
72/122
◮ t autark: Any clause c for which a literal is set by t is true.
◮ t not autark: There is a clause c for which a literal is set by
73/122
74/122
◮ simple (or classical) time analysis ◮ Measure & Conquer, quasiconvex analysis, etc. ◮ based on recurrences
◮ establish upper bounds on the (worst-case) running time ◮ new methods achieve improved bounds for same algorithm ◮ no proof for tightness of bounds
75/122
◮ stated upper bounds of algorithms may (significantly)
◮ How to compare branching algorithms if their worst-case
76/122
◮ stated upper bounds of algorithms may (significantly)
◮ How to compare branching algorithms if their worst-case
76/122
◮ Upper bounds on worst case running time of a Branching
◮ Lower bounds on worst case running time of a particular
◮ Large gaps between lower and upper bounds for some
◮ Study of lower bounds leads to new insights on particular
77/122
78/122
79/122
80/122
◮ Branching vectors of standard branching: (1, d(v) + 1) ◮ Running time of algorithm mis1: O∗(1.3803n) ◮ Running time of modifications mis1a and mis1b:
81/122
◮ Branching vectors of standard branching: (1, d(v) + 1) ◮ Running time of algorithm mis1: O∗(1.3803n) ◮ Running time of modifications mis1a and mis1b:
81/122
◮ What is the worst-case running time of these three algorithms
◮ How much can we improve the upper bounds of the running
◮ (Again) what is the worst-case running time of algorithm
82/122
◮ Consider the graphs Gn = (Vn, E3) ◮ Vertex set: {1, 2, . . . , n} ◮ Edge set: {i, j} ∈ E3 ⇔ |i − j| ≤ 3
83/122
◮ Branch on smallest vertex of instance ◮ Always a vertex of degree three ◮ Every instance of form Gn[{i, i + 1, . . . , n}] ◮ Branching on instance Gn[{i, i + 1, . . . , n}] calls mis1 on
84/122
85/122
86/122
◮ Lower bound graph Gk: disjoint union of k triangles. ◮ Algorithm mis2 applied to Gk: chooses a vertex of any
◮ Search tree has 3k = 3n/3 leaves;
87/122
◮ Algorithm tt:
◮ Branching algorithm to compute a maximum independent set
◮ published in 1977 ◮ lengthy and tedious case analysis ◮ size of instance: number of vertices
◮ ”Simple running time analysis”: O∗(2n/3) = O∗(1.2600n) ◮ More precisely, author’s analysis establishes O∗(1.2561n).
88/122
89/122
89/122
◮ LB graphs: For all positive integers n,
◮ Tie break: For graphs of minimum degree 6, the algorithm
◮ Branching “select[i]” removes i, i + 1, . . . i + 6;
90/122
91/122
92/122
92/122
◮ Dynamic Programming ◮ Inclusion-Exclusion ◮ Treewidth Based ◮ Subset Convolution
93/122
◮ faster than claimed running time on all instances ◮ hard to construct instances that even need a close running
◮ ”much better on many instances”?
94/122
95/122
◮ GOAL: Reduction of running time of branching algorithms ◮ Use of exponential space instead of polynomial space ◮ Introduced by Robson (1986): Memorization for a MIS
◮ Theoretical Interest: allows to obtain branching algorithm of
◮ Practical Importance doubtful: high memory requirements
96/122
◮ Pruning the search tree: solve less subproblems ◮ Solutions of subproblems already solved to be stored in
◮ Solve subproblem once; when to be solved again, look up the
◮ query time in database logarithmic in number of stored
◮ cost of each look up is polynomial.
97/122
98/122
◮ Having solved an instance G ′, an induced subgraph of input
◮ Before solving any instance, check whether its solution is
◮ Input graph G has at most 2n induced subgraphs. ◮ Database can be implemented such that each query takes
99/122
◮ Search tree of mis1(G) on any graph of n vertices has T(n)
◮ Let Th(n), 0 ≤ h ≤ n, be the maximum number of
◮ Th(n) maximum number of nodes of the subtree
◮ Similar to analysis of T(n), one obtains:
100/122
◮ Th(n) ≤
h
h
◮ Th(n) ≤ 1.3803n−h
101/122
102/122
103/122
◮ Using weights within the algorithm; not ”only” as a tool in
◮ GOAL: Easy time analysis ◮ In the best case: a few simple recurrences to solve ◮ Sophisticated correctness proof ◮ Time analysis (still) ”recurrence based”
104/122
◮ First assign a weight of one to each vertex: w(v) = 1 ◮ weight (resp. size) of input graph
105/122
◮ Fix one branching rule: ”select v” and ”discard v” ◮ Fix a branching vector (1, 1 + ǫ), ǫ > 0 ◮ Make sure that for each branching
◮ ”discard v”: gain at least 1 ◮ ”select v”: gain at least 1 + ǫ
◮ running time of algorithm: O∗(cǫn) ◮ cǫ unique positive real root of
106/122
◮ When branching on a vertex v with w(v) = 1,
◮ ”select v”: Borrow a weight of ǫ from a neighbour of v ◮ When branching on a vertex v with w(v) < 1
107/122
◮ also called (σ, ̺)-Domination, where σ, ̺ ⊆ N ◮ generalizes many domination-type problems
◮ for all v ∈ S, |N(v) ∩ S| ∈ σ; ◮ for all v ∈ S, |N(v) ∩ S| ∈ ̺.
108/122
109/122
109/122
110/122
112/122
113/122
114/122
115/122
116/122
◮ Perfect Cover: Given a graph, decide whether it has a vertex
◮ Max 2-SAT: Given a 2-CNF formula F, compute a truth
◮ Weighted Independent Set: Given a graph G = (V , E)
117/122
118/122
119/122
120/122
121/122
122/122
123/122