Branching. Teppo Niinimäki. Helsinki October 14, 2011 Seminar: Exact Exponential Algorithms UNIVERSITY OF HELSINKI Department of Computer Science

Similar documents
Comp487/587 - Boolean Formulas

Conjunctive Normal Form and SAT

More on NP and Reductions

Exact Exponential Algorithms

Conjunctive Normal Form and SAT

A Collection of Problems in Propositional Logic

Computational Complexity and Intractability: An Introduction to the Theory of NP. Chapter 9

Lecture 9: The Splitting Method for SAT

P, NP, NP-Complete, and NPhard

The Complexity of Maximum. Matroid-Greedoid Intersection and. Weighted Greedoid Maximization

NP-completeness. Chapter 34. Sergey Bereg

Conjunctive Normal Form and SAT

Propositional Logic: Models and Proofs

NP-Completeness and Boolean Satisfiability

NP and Computational Intractability

Automata Theory CS Complexity Theory I: Polynomial Time

Solving Connected Dominating Set Faster than 2 n

A brief introduction to Logic. (slides from

NP Completeness. CS 374: Algorithms & Models of Computation, Spring Lecture 23. November 19, 2015

Exact Algorithms for Dominating Induced Matching Based on Graph Partition

P P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions

A An Overview of Complexity Theory for the Algorithm Designer

Introduction to Solving Combinatorial Problems with SAT

Lecture 15 - NP Completeness 1

CSE 135: Introduction to Theory of Computation NP-completeness

A New Approach to Proving Upper Bounds for MAX-2-SAT

Polynomial-Time Reductions

Chapter 3 Deterministic planning

Essential facts about NP-completeness:

Formal Verification Methods 1: Propositional Logic

Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011

CSE 3500 Algorithms and Complexity Fall 2016 Lecture 25: November 29, 2016

Theory of Computation Time Complexity

1 Non-deterministic Turing Machine

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

NP Complete Problems. COMP 215 Lecture 20

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

Intro to Theory of Computation

Tecniche di Verifica. Introduction to Propositional Logic

NP-Complete Problems. More reductions

Advanced Topics in Theoretical Computer Science

CSI 4105 MIDTERM SOLUTION

Limitations of Algorithm Power

Design and Analysis of Algorithms

Polynomial time reduction and NP-completeness. Exploring some time complexity limits of polynomial time algorithmic solutions

Lecture 14 - P v.s. NP 1

Algorithms. NP -Complete Problems. Dong Kyue Kim Hanyang University

CSE 421 NP-Completeness

arxiv: v1 [cs.dm] 29 Oct 2012

Part V. Intractable Problems

Lecture #14: NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition.

1. Introduction Recap

ENEE 459E/CMSC 498R In-class exercise February 10, 2015

1.1 P, NP, and NP-complete

CS 583: Algorithms. NP Completeness Ch 34. Intractability

Clause/Term Resolution and Learning in the Evaluation of Quantified Boolean Formulas

NP-Completeness Review

Summer School on Introduction to Algorithms and Optimization Techniques July 4-12, 2017 Organized by ACMU, ISI and IEEE CEDA.

NP Completeness and Approximation Algorithms

A New Upper Bound for Max-2-SAT: A Graph-Theoretic Approach

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Lecture 18: P & NP. Revised, May 1, CLRS, pp

Geometric Steiner Trees

1 More finite deterministic automata

Introduction. Pvs.NPExample

Critical Reading of Optimization Methods for Logical Inference [1]

Lecture 9: Search 8. Victor R. Lesser. CMPSCI 683 Fall 2010

Cardinality Networks: a Theoretical and Empirical Study

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

On the hardness of losing width

SAT, Coloring, Hamiltonian Cycle, TSP

NP-Completeness Part II

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

On the hardness of losing width

NP-Hardness reductions

COMP Analysis of Algorithms & Data Structures

NP-Completeness Part II

CSCI 1590 Intro to Computational Complexity

CISC 4090 Theory of Computation

Worst-Case Upper Bound for (1, 2)-QSAT

Solving Connected Dominating Set Faster than 2 n

3. Branching Algorithms

NP-Complete Reductions 2

Recap from Last Time

NP-Completeness. Algorithmique Fall semester 2011/12

Admin NP-COMPLETE PROBLEMS. Run-time analysis. Tractable vs. intractable problems 5/2/13. What is a tractable problem?

Improved Exact Algorithms for Max-Sat

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

CS Introduction to Complexity Theory. Lecture #11: Dec 8th, 2015

Instructor N.Sadagopan Scribe: P.Renjith. Lecture- Complexity Class- P and NP

COS597D: Information Theory in Computer Science October 5, Lecture 6

Maximum 3-SAT as QUBO

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30)

CSCI3390-Lecture 17: A sampler of NP-complete problems

NP and NP-Completeness

1a. Introduction COMP6741: Parameterized and Exact Computation

CS311 Computational Structures. NP-completeness. Lecture 18. Andrew P. Black Andrew Tolmach. Thursday, 2 December 2010

Transcription:

Branching Teppo Niinimäki Helsinki October 14, 2011 Seminar: Exact Exponential Algorithms UNIVERSITY OF HELSINKI Department of Computer Science

1 For a large number of important computational problems no polynomial-time algorithm is known. The family of NP-complete problems is the best known family of such problems. Every combinatorial problem can be solved by using a brute force search that explicitly tests all possible solutions, but often better alternatives are available. Branching is one of the basic techniques for designing faster exponential algorithms for such problems. It is based on dividing the problem recursively into smaller subproblems. This strategy has led to significant improvements over trivial brute force algorithms in computational complexity for problems such as k-satisfiability or Maximum Independent Set. The ideal behind branching is simple and intuitive and has been invented multiple times under alternative names such as branch and reduce, splitting, backtracking or pruning search tree. The rest of this paper is organized as follows: In section 1 the general structure and principles of branching algorithms are described. In section 2 a branching algorithm for the k-satisfiability problem is presented and analysed. Finally in section 3 we look very briefly into how branching can be used to build fast algorithms for the Maximum Independent Set problem. The material in this paper is based on the Chapter 2 of the book Exact Exponential Algorithms by Fomin and Kratsch (2010). 1 General Framework Let n be the size of the problem such as the number of nodes in a graph. Note, that n does not need to be the size of the actual input, but instead it can be chosen quite freely. In general, any branching algorithm consists of two kinds of rules: Branching rules convert the problem to two or more smaller problems which are then solved recursively, and reduction rules simplify the problem or halt the algorithm. Recursive application of branching rules results in a tree structure which is called search tree. The root of the search tree represents the original problem and other nodes represent smaller instances obtained by the use of branching rules. The time spend in one node is assumed to be polynomial in the size of the problem, which also includes the time spent in applying possible reduction rules. Thus the running time of the algorithm is a polynomial times the number of nodes of the search tree, which is normally O (α n ) for some constant α > 1. Since we are not interested in polynomial factors, we only need to concentrate on branching rules when analysing the running time and reduction rules can generally be ignored.

2 1 2 3 4 5 6 1 2.0000 1.6181 1.4656 1.3803 1.3248 1.2852 2 1.6181 1.4143 1.3248 1.2721 1.2366 1.2107 3 1.4656 1.3248 1.2560 1.2208 1.1939 1.1740 4 1.3803 1.2721 1.2208 1.1893 1.1674 1.1510 5 1.3248 1.2366 1.1939 1.1674 1.1487 1.1348 6 1.2852 1.2107 1.1740 1.1510 1.1348 1.1225 Table 1: Branching factors for binary branching vectors, rounded up. As no general method for determining the worst-case running time of branching algorithm is known, an upper bound for α is normally searched. Since the number of leaves in any search tree is always at least half of the number of all nodes we can concentrate on finding an upper bound for the number of leafs. Let b be a branching rule that divides a problem of size n into r 2 smaller problems of sizes n t 1, n t 2,..., n t r, where t i > 0 for all i = 1, 2,..., r. Then b = (t 1, t 2,..., t r ) is called the branching vector of branching rule b. Let T (n) be the maximum number of leaves in a search tree of an input problem of size n. We get the following linear recurrence: T (n) T (n t 1 ) + T (n t 2 ) + + T (n t r ). It is known that the solution of this linear recurrence is of the form T (n) = α n where α can be obtained by finding the unique positive real root of the corresponding equation x n x n t 1 x n t 2 x n tr = 0. This constant, denoted by α = τ(t 1, t 2,..., t r ), is called the branching factor of branching vector b. As a result the running time of an algorithm which uses only branching rule b is O (α n ). Branching vectors with two elements are called binary. Table 1 contains the branching factors for some common binary branching vectors. There are some important properties concerning branching factors. First, it is easy to see that the order of elements in branching vector does not affect the branching factor. In addition the following two properties hold: If t 1 > t 1, then τ(t 1, t 2,..., t r ) < τ(t 1, t 2,..., t r ). In this case it is said that the latter branching vector dominates the former. If 0 < a < b, then τ(a+ɛ, b ɛ) < τ(a, b) for all 0 < ɛ < (b a)/2. So intuitively it is beneficial to make the branching vector as balanced as possible.

3 Above we saw how to analyse an algorithm with only one branching rule. Typically a branching algorithm consists of multiple branching rules and in each node of the search tree one of these rules is selected to be applied based on various criteria. In the case of multiple branching rules the upper bound for the running time is O (α n ) where α is the maximum of the branching factors of individual branching rules. While in a general case the rule with the highest branching factor determines the worst case running time, it is not unusual that the analysis can be tightened. If it is known that a branching rule with a high branching factor is always followed by another rule with a low branching factor, an analysis technique called the addition of branching vectors can be used. For example, suppose that after branching with branching vector (i, j) in the left branch (corresponding to i) a branching rule with a branching vector (k, l) is always immediately applied. In this case we can treat these two branching rules as one with a combined branching vector (i + k, i + l, j). 2 k-satisfiability This section describes a classical branching algorithm by Monien and Speckenmeyer for the k-satisfiability problem. The algorithm is best known for the fact that it solves the 3-Satisfiability problem in time O (1.6181 n ). Let {x 1, x 2,..., x n } be a set Boolean variables. A clause c = (l 1 l 2 l t ) is a disjunction of literals where each literal l is a Boolean variable x or its negation x. A Boolean formula F = (c 1 c 2 c r ) which is a conjunction of clauses is said to be in conjunctive normal form (CNF). If every cause contains at most k literals the formula is a k-cnf formula. We represent a clause c by the set of its literals {l 1, l 2,..., l t } and a formula F by the set of its clauses {c 1, c 2,..., c m }. F is said to be satisfiable if there is a truth assignment of variables such that F evaluates to true. For a CNF formula this means that every clause must contain at least one true literal. An empty formula is always true and thus satisfiable. On the other hand, empty clause is always false and makes the formula unsatisfiable. The problem of deciding whether a given formula is satisfiable is called the Satisfiability problem (SAT). If the input is in k-cnf form the problem is called k-satisfiability (k-sat). From now on we only handle k-sat and thus any formula F is assumed to be in k-cnf form. Let now k be fixed and n be the number of variable. The size of the formula is

denoted by n. Because there are at most 2n different literals, the number of different clauses in F is at most m k ( 2n ) i=0 i and is thus upper bounded by a polynomial. It is known that 2-SAT is solvable in linear time but for k 3 the k-sat problem is NP-complete. Any k-sat can be solved by a trivial brute force algorithm that separately examines every possible truth assignment. Since there are 2 n different truth assignments and evaluating for one truth assignment takes polynomial number of steps, the brute force algorithm requires O (2 n ) time. We now describe a branching algorithm, that solves the k-sat problem by recursively making partial truth assignments. In a partial truth assignment the truth values of some of the variables are fixed. When a partial truth assignment is applied to formula F, a new simplified formula F is obtained by removing all clauses that contain a true literal and removing all false literals from the remaining clauses. The algorithm now works as follows: Let F be the input formula. If F is empty, it is satisfiable and the algorithm returns true. If F contains an empty clause, the algorithm returns false. Otherwise, one clause is selected and a branching rule is applied. Let (l 1 l 2 l q ) be the selected clause. The algorithm branches into q simplified cases F 1, F 2,..., F q corresponding the following partial truth assignment: F 1 : l 1 = true F 2 : l 1 = false, l 2 = true. F q : l 1 = false, l 2 = false,..., l q 1 = false, l q = true It is obvious that F is satisfiable if and only if at least one of the resulting simplified formulas is satisfiable. If the selected clause contains only one literal this is actually a reduction rule. Otherwise, we get a branching vector (1, 2,..., q). For the given branching rules the branching factors β q = τ(1, 2,..., q) for first few clause sizes are β 2 < 1.6181, β 3 < 1.8393 and β 4 < 1.9276 (rounded up). Because for a k-cnf formula the results of the branching and reduction rules are also k-cnf formulas, the branching factor is always at most β k and the running time of the algorithm is O (β n k ). For the 3-SAT problem this is O (1.8393 n ). There is relatively simple way to improve the above algorithm. It is based on the observation, that if we were able to guarantee that the branching always (except possibly the very first branching) happens on a clause of size at most k 1, the worst case branching factor would be β k 1. Let again F be the input formula. In partial truth assignment all clauses contain- 4

ing fixed true literals and the remaining fixed false literals are removed from the resulting formula F. If any of the remaining clauses contains a fixed literal then the literal must be false and the size of that clause is dropped by at least one and thus on the next branching step we can choose a clause of size at most k 1 from F. Unfortunately this is not always the case. However, if none of the remaining clauses contains a fixed literal, then we know how to satisfy the removed clauses independently of the remaining clauses and thus F is satisfiable if and only if F is satisfiable. This latter kind of partial truth assignment for F is called autark. Based on the above observations we make the following modification the the previous algorithm. Instead of any clause, a clause of minimum size is always selected for branching. Before actually performing the branching the algorithm checks whether any of the partial truth assignments is an autark. If this is the case, no branching is done and instead a reduction to the corresponding simplified formula F is performed. This is a reduction rule. algorithm branches normally. If none of the partial truth assignments is autark, the In the case of normal branching every subformula F 1, F 2,..., F q contains a clause of size at most k 1 and thus the branching factors of the subsequent branchings are at most β k 1. On the other hand, after the autark reduction it is possible that the resulting formula F contains only clauses of size k leading to branching vector (1, 2,..., k). But because the size of the formula is decreased by at least one in the reduction step, the branching vector actually becomes at least (2, 3,..., k + 1) if we consider F as an input instead of F. It can be shown that τ(2, 3..., k + 1) < τ(1, 2,..., k 1) and thus β k 1 = τ(1, 2,..., k 1) is the dominating branching factor. We conclude that the modified algorithm solves k-sat in time O (βk 1 n ). In particular, for 3-SAT the running time is O (1.6181 n ). 5 3 Maximum Independent Set In this section we make a short look on how to use branching to develop a reasonably fast exponential algorithm for the Maximum Independent Set problem. We do not describe the whole algorithm in detail, but just the general reduction and branching rules behind the algorithm. Let G = (V, E) be an undirected graph. A set I V of vertices is an independent set if none of the pairs of vertices from I is adjacent in G. We denote by α(g) the maximum size of an independent set of G. In the Maximum Independent Set

6 problem (MIS) the task is to find an independent set of maximum size. We use the following notations: Let v V be a vertex. The neighborhood of v is N(v) = {u V : (v, u) E} and the open neighborhood of v is N[v] = N(v) {v}. Respectively, the set of vertices at distance 2 from v, that is, the set the set of neighbors of the neighbors of v, is denoted by N 2 (v). For a subset S V of vertices G[S] is a subgraph of G that has S as a vertex set and those edges from E that have both endpoints in S. The subgraph G[V \ S] is denoted by G \ S and G \ {v} for a vertex v can be shortened to G \ v. The closed neigborhood of S is denoted by N[S] = v S N[v]. Let G be an input graph. For the MIS problem the following reduction rules can be applied: 1. (domination rule) If v and w are adjacent vertices and N[v] N[w], then α(g) = α(g \ w). 2. (simplicial rule) If v is a vertex and N[v] is a clique, then α(g) = 1 + α(g \ N[v]). In addition to the two reduction rules above the following branching rules can be derived: 3. (standard branching) If v is a vertex, then α(g) = max(1 + α(g \ N[v]), α(g \ v)). 4. (mirror branching) If v is a vertex, then α(g) = max(1 + α(g \ N[v]), α(g \ (M(v) {v})), where M(v) = {w N 2 (v) : N(v) \ N(w) is a clique}. 5. (separator branching) If S V and G \ S is disconnected, then α(g) = max A + α(g \ (S N[A])), A I(S) where I(S) contains the subsets of S which are independent sets of G. 6. If G is disconnected and C V is a connected component of G, then α(g) = α(g[c]) + α(g \ C).

7 Using the above reduction and branching rules it is possible to construct a relatively fast exponential algorithm for the Maximum Independent Set problem. The basic idea is to select on each step a rule from above based on the minimum and maximum degree of the input graph. Such algorithm with running time O (1.2786 n ) as well as the proofs of the above rules are described in more detail in (Fomin and Kratsch, 2010). References Fedor V. Fomin and Dieter Kratsch. Exact Exponential Algorithms, chapter 2. Branching, pages 13 30. Springer, 2010.