Branch and Bound Searching Strategies

Slides:



Advertisements
Similar presentations
Section 3.4 The Traveling Salesperson Problem Tucker Applied Combinatorics By Aaron Desrochers and Ben Epstein.
Advertisements

Traveling Salesperson Problem
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
ICS-171:Notes 4: 1 Notes 4: Optimal Search ICS 171 Summer 1999.
5-1 Chapter 5 Tree Searching Strategies. 5-2 Satisfiability problem Tree representation of 8 assignments. If there are n variables x 1, x 2, …,x n, then.
Branch & Bound Algorithms
CSC 423 ARTIFICIAL INTELLIGENCE
S. J. Shyu Chap. 1 Introduction 1 The Design and Analysis of Algorithms Chapter 1 Introduction S. J. Shyu.
Search by partial solutions. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Random restart General.
Chapter 3 The Greedy Method 3.
Sum of Subsets and Knapsack
Review: Search problem formulation
Chapter 7 Dynamic Programming 7.
Branch and Bound Searching Strategies
6 - 1 § 6 The Searching Strategies e.g. satisfiability problem x1x1 x2x2 x3x3 FFF FFT FTF FTT TFF TFT TTF TTT.
Branch and Bound Similar to backtracking in generating a search tree and looking for one or more solutions Different in that the “objective” is constrained.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
Dealing with NP-Complete Problems
1 Tree Searching Strategies. 2 The procedure of solving many problems may be represented by trees. Therefore the solving of these problems becomes a tree.
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
MAE 552 – Heuristic Optimization Lecture 26 April 1, 2002 Topic:Branch and Bound.
Problem Solving and Search in AI Heuristic Search
1 Branch and Bound Searching Strategies 2 Branch-and-bound strategy 2 mechanisms: A mechanism to generate branches A mechanism to generate a bound so.
Ch 13 – Backtracking + Branch-and-Bound
1 Tree Searching Strategies. 2 The procedure of solving many problems may be represented by trees. Therefore the solving of these problems becomes a tree.
9-1 Chapter 9 Approximation Algorithms. 9-2 Approximation algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
5-1 Chapter 5 Tree Searching Strategies. 5-2 Breadth-first search (BFS) 8-puzzle problem The breadth-first search uses a queue to hold all expanded nodes.
Jin Zheng, Central South University1 Branch-and-bound.
Backtracking.
Approximation Algorithms
1 Lecture 4 Maximal Flow Problems Set Covering Problems.
1.1 Chapter 1: Introduction What is the course all about? Problems, instances and algorithms Running time v.s. computational complexity General description.
Busby, Dodge, Fleming, and Negrusa. Backtracking Algorithm Is used to solve problems for which a sequence of objects is to be selected from a set such.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1.3 Modeling with exponentially many constr.  Some strong formulations (or even formulation itself) may involve exponentially many constraints (cutting.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
MODELING AND ANALYSIS OF MANUFACTURING SYSTEMS Session 12 MACHINE SETUP AND OPERATION SEQUENCING E. Gutierrez-Miravete Spring 2001.
Design and Analysis of Algorithms - Chapter 111 How to tackle those difficult problems... There are two principal approaches to tackling NP-hard problems.
BackTracking CS335. N-Queens The object is to place queens on a chess board in such as way as no queen can capture another one in a single move –Recall.
Search by partial solutions.  nodes are partial or complete states  graphs are DAGs (may be trees) source (root) is empty state sinks (leaves) are complete.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed Search Methods. Informed Search  Uninformed searches  easy  but very inefficient in most cases of huge search tree  Informed searches  uses.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
1 Branch and Bound Searching Strategies Updated: 12/27/2010.
Algorithm Design Methods (II) Fall 2003 CSE, POSTECH.
COPING WITH THE LIMITATIONS OF ALGORITHM POWER
State space representations and search strategies - 2 Spring 2007, Juris Vīksna.
Chapter 13 Backtracking Introduction The 3-coloring problem
CSCE350 Algorithms and Data Structure Lecture 21 Jianjun Hu Department of Computer Science and Engineering University of South Carolina
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
For Monday Read chapter 4 exercise 1 No homework.
The Theory of NP-Completeness
Integer Programming An integer linear program (ILP) is defined exactly as a linear program except that values of variables in a feasible solution have.
BackTracking CS255.
The minimum cost flow problem
Design and Analysis of Algorithm
Analysis and design of algorithm
1.3 Modeling with exponentially many constr.
Integer Programming (정수계획법)
Applied Combinatorics, 4th Ed. Alan Tucker
1.3 Modeling with exponentially many constr.
Branch and Bound Searching Strategies
Integer Programming (정수계획법)
Major Design Strategies
Major Design Strategies
Lecture 4: Tree Search Strategies
Presentation transcript:

Branch and Bound Searching Strategies

Feasible Solution vs. Optimal Solution DFS, BFS, hill climbing and best-first search can not be used to solve optimization problems. They only point out a feasible solution.

The branch-and-bound strategy This strategy can be used to solve optimization problems without an exhaustive search (in the average case).

A Multi-Stage Graph Searching Problem.

E.G.:A Multi-Stage Graph Searching Problem

Solved by branch-and-bound (hill-climbing with bounds)

Solved by branch-and-bound (hill-climbing with bounds)

Branch-and-bound strategy 2 mechanisms: A mechanism to generate branches A mechanism to generate a bound so that many braches can be terminated.

Branch-and-bound strategy It is efficient in the average case because many branches can be terminated very early. Although it is usually very efficient, a very large tree may be generated in the worst case. Recall the NPC problem. (Many NPC problem can be solved by B&B efficiently in the average case; however, the worst case time complexity is still exponential.)

Personnel Assignment Problem A linearly ordered set of persons P={P1, P2, …, Pn} where P1<P2<…<Pn A partially ordered set of jobs J={J1, J2, …, Jn} Suppose that Pi and Pj are assigned to jobs f(Pi) and f(Pj) respectively. If f(Pi)  f(Pj), then Pi  Pj. Cost Cij is the cost of assigning Pi to Jj. We want to find a feasible assignment with the minimum cost. i.e. Xij = 1 if Pi is assigned to Jj Xij = 0 otherwise. Minimize i,j CijXij

e.g. A partial ordering of jobs After topological sorting, one of the following topologically sorted sequences will be generated: One of feasible assignments: P1→J1, P2→J2, P3→J3, P4→J4 J1   J2 ↓ ↘ J3 J4 J1, J2, J3, J4 J4, J3

A Solution Tree All possible solutions can be represented by a solution tree. J1   J2 ↓ ↘ J3 J4

Cost Matrix Apply the best-first search scheme: Cost matrix Jobs Persons 1 2 3 4 29 19 17 12 32 30 26 28 21 7 9 18 13 10 15

Reduced Cost Matrix Cost matrix Reduced cost matrix Jobs Persons 1 2 3 4 29 19 17 12 32 30 26 28 21 7 9 18 13 10 15 Jobs Persons 1 2 3 4   17 5 (-12) 6 (-26) 15 (-3) 8 (-10)

A reduced cost matrix can be obtained: subtract a constant from each row and each column respectively such that each row and each column contains at least one zero. Total cost subtracted: 12+26+3+10+3 = 54 This is a lower bound of our solution.

Branch-and-Bound for the Personnel Assignment Problem Bounding of subsolutions: Jobs Persons 1 2 3 4   17 5 6 15 8

The traveling salesperson optimization problem Given a graph, the TSP Optimization problem is to find a tour, starting from any vertex, visiting every other vertex and returning to the starting vertex, with minimal cost. It is NP-complete We try to avoid n! exhaustive search by the branch-and-bound technique. (Recall that O(n!)>O(2n).)

The traveling salesperson optimization problem E.g. A Cost Matrix for a Traveling Salesperson Problem. j i 1 2 3 4 5 6 7 ∞ 93 13 33 9 57 77 42 21 16 34 45 17 36 28 25 39 90 80 56 91 46 88 18 92 44 26 27 84

The basic idea There is a way to split the solution space (branch) There is a way to predict a lower bound for a class of solutions. There is also a way to find a upper bound of an optimal solution. If the lower bound of a solution exceeds the upper bound, this solution cannot be optimal and thus we should terminate the branching associated with this solution.

Splitting We split a solution into two groups: One group including a particular arc The other excluding the arc Each splitting incurs a lower bound and we shall traverse the searching tree with the “lower” lower bound.

The traveling salesperson optimization problem Reduced cost matrix: A Reduced Cost Matrix. j i 1 2 3 4 5 6 7   ∞ 90 10 30 54 (-3) 73 38 17 12 (-4) 29 20 9 (-16) 32 83 49 84 (-7) 21 63 8 (-25) 85 15 43 89 18 58 13 (-26) reduced:84

The traveling salesperson optimization problem j i 1 2 3 4 5 6 7 ∞ 83 9 30 50 66 37 17 12 26 29 19 32 49 80 21 56 28 85 8 42 89 18 58 13   (-7) (-1) (-4) Table 6-5 Another Reduced Cost Matrix.  

Lower bound The total cost of 84+12=96 is subtracted. Thus, we know the lower bound of this TSP problem is 96.

The traveling salesperson optimization problem Total cost reduced: 84+7+1+4 = 96 (lower bound)  decision tree: The Highest Level of a Decision Tree. If we use arc 3-5 to split, the difference on the lower bounds is 17+1 = 18.

A Reduced Cost Matrix if Arc 4-6 is Included. For the right subtree A Reduced Cost Matrix if Arc 4-6 is Included. (We must set c6-4 to be )

A Reduced Cost Matrix for that in Table 6-6. For the left subtree The cost matrix for all solution with arc 4-6: A Reduced Cost Matrix for that in Table 6-6. Total cost reduced: 96+3 = 99 (new lower bound) j i 1 2 3 4 5 7   ∞ 83 9 30 50 66 37 17 26 29 19 18 53 25 (-3) 6 85 8 89 58

Upper bound We follow the best-first search scheme and can obtain a feasible solution with cost C. C serves as an upper bound and many branchings may be terminated if their lower bounds exceed C.

Fig 6-26 A Branch-and-Bound Solution of a Traveling Salesperson Problem.

Preventing an arc In general, if paths i1-i2-…-im and j1-j2-…-jn have already been included and a path from im to j1 is to be added, then path from jn to i1 must be prevented (by assigning the cost of jn to i1 to be )

The 0/1 knapsack problem Positive integer P1, P2, …, Pn (profit) W1, W2, …, Wn (weight) M (capacity)

The 0/1 knapsack problem Fig. 6-27 The Branching Mechanism in the Branch-and-Bound Strategy to Solve 0/1 Knapsack Problem.

How to find the upper bound? Ans: by quickly finding a feasible solution: starting from the smallest available i, scanning towards the largest i’s until M is exceeded. The upper bound can be calculated.

The 0/1 knapsack problem E.g. n = 6, M = 34 A feasible solution: X1 = 1, X2 = 1, X3 = 0, X4 = 0, X5 = 0, X6 = 0 -(P1+P2) = -16 (upper bound) Any solution higher than -16 can not be an optimal solution. i 1 2 3 4 5 6 Pi 10 Wi 19 8 12 (Pi/Wi  Pi+1/Wi+1)

How to find the lower bound? Ans: by relaxing our restriction from Xi = 0 or 1 to 0  Xi  1 (knapsack problem)

The knapsack problem We can use the greedy method to find an optimal solution for knapsack problem. For example, for the state of X1=1 and X2=1, we have  X1 = 1, X2 =1, X3 = (34-6-10)/8=5/8, X4 = 0, X5 = 0, X6 =0 -(P1+P2+5/8P3) = -18.5 (lower bound) -18 is our lower bound. (only consider integers)  

How to expand the tree? By the best-first search scheme That is, by expanding the node with the best lower bound. If two nodes have the same lower bounds, expand the node with the lower upper bound.

0/1 Knapsack Problem Solved by Branch-and-Bound Strategy

Node 2 is terminated because its lower bound is equal to the upper bound of node 14. Nodes 16, 18 and others are terminated because the local lower bound is equal to the local upper bound. (lower bound  optimal solution  upper bound)

The A* algorithm Used to solve optimization problems. Using the best-first strategy. If a feasible solution (goal node) is obtained, then it is optimal and we can stop. Estimated cost function of node n : f(n) f(n) = g(n) + h(n) g(n): cost from root to node n. h(n): estimated cost from node n to a goal node. h*(n): “real” cost from node n to a goal node. f*(n): “real” cost of node n  h(n)  h*(n)    f(n) = g(n) + h(n)  g(n)+h*(n) = f*(n)

Reasoning Let t be the selected goal node. Let n denote a node already expanded. f(t)f(n) f(t) f(n) f*(n) But one of f*(n)’s must be the optimal value (cost). Let f*(s) denote the value. We have f(t) f*(s) …………(a)

Reasoning Since t is a goal node, we have h(t)=0. Thus, f(t)=g(t)+h(t)=g(t). By Eq. (a), we have f(t)=g(t)f*(s) Yet, f(t)=g(t) is the value of a feasible solution. Consequently, g(t) cannot be smaller than f*(s) by definition. This means that g(t)=f*(s).

Fig. 6-36 A Graph to Illustrate A* Algorithm. The A* algorithm Stop iff the selected node is also a goal node E.g. Fig. 6-36 A Graph to Illustrate A* Algorithm.

The A* algorithm Step 1.

The A* algorithm Step 2. Expand A

The A* algorithm Step 3. Expand C

The A* algorithm Step 4. Expand D

The A* algorithm Step 5. Expand B

The A* algorithm Step 6. Expand F

The A* Algorithm Can be considered as a special type of branch-and-bound algorithm.