CS 312: Algorithm Design & Analysis Lecture #35: Branch and Bound Design Options: State Spaces Slides by: Eric Ringger, with contributions from Mike Jones,

Slides:



Advertisements
Similar presentations
Traveling Salesperson Problem
Advertisements

Techniques for Dealing with Hard Problems Backtrack: –Systematically enumerates all potential solutions by continually trying to extend a partial solution.
Branch & Bound Algorithms
Graphs By JJ Shepherd. Introduction Graphs are simply trees with looser restrictions – You can have cycles Historically hard to deal with in computers.
Search in AI.
Lecture 11 CSS314 Parallel Computing
Slide 1 Search: Advanced Topics Jim Little UBC CS 322 – Search 5 September 22, 2014 Textbook § 3.6.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
Branch and Bound Searching Strategies
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.
CS 410 Applied Algorithms Applied Algorithms Lecture #3 Data Structures.
MAE 552 – Heuristic Optimization Lecture 26 April 1, 2002 Topic:Branch and Bound.
CS 206 Introduction to Computer Science II 11 / 05 / 2008 Instructor: Michael Eckmann.
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
Jin Zheng, Central South University1 Branch-and-bound.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Backtracking.
CS 312: Algorithm Analysis Lecture #16: Strongly Connected Components This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported.
CS 312: Algorithm Analysis Lecture #3: Algorithms for Modular Arithmetic, Modular Exponentiation This work is licensed under a Creative Commons Attribution-Share.
CS 312: Algorithm Analysis
Branch & Bound UPPER =  LOWER = 0.
CS 312: Algorithm Design & Analysis Lecture #34: Branch and Bound Design Options for Solving the TSP: Tight Bounds This work is licensed under a Creative.
MA/CSSE 473 Day 12 Insertion Sort quick review DFS, BFS Topological Sort.
CS 312: Algorithm Analysis Lecture #4: Primality Testing, GCD This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
CS 312: Algorithm Design & Analysis Lecture #17: Connectedness in Graphs This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported.
Backtracking. N-Queens The object is to place queens on a chess board in such a way as no queen can capture another one in a single move –Recall that.
Lecture 5: Backtracking Depth-First Search N-Queens Problem Hamiltonian Circuits.
CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0.
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.
CS 312: Algorithm Analysis Lecture #32: Intro. to State-Space Search This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported.
CS 312: Algorithm Design & Analysis Lecture #23: Making Optimal Change with Dynamic Programming Slides by: Eric Ringger, with contributions from Mike Jones,
CS 312: Algorithm Design & Analysis Lecture #12: Average Case Analysis of Quicksort This work is licensed under a Creative Commons Attribution-Share Alike.
Computer Science CPSC 322 Lecture 9 (Ch , 3.7.6) Slide 1.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
CS 312: Algorithm Design & Analysis Lecture #24: Optimality, Gene Sequence Alignment This work is licensed under a Creative Commons Attribution-Share Alike.
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.
CS 312: Algorithm Design & Analysis Lecture #2: Asymptotic Notation This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported.
CS 312: Algorithm Analysis Lecture #4: Primality Testing, GCD This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
Lecture 3: Uninformed Search
1 Branch and Bound Searching Strategies Updated: 12/27/2010.
COPING WITH THE LIMITATIONS OF ALGORITHM POWER
CS 312: Algorithm Design & Analysis Lecture #37: A* (cont.); Admissible Heuristics Credit: adapted from slides by Stuart Russell of UC Berkeley. This work.
Slides by: Eric Ringger, adapted from slides by Stuart Russell of UC Berkeley. CS 312: Algorithm Design & Analysis Lecture #36: Best-first State- space.
CS 312: Algorithm Analysis Lecture #7: Recurrence Relations a.k.a. Difference Equations Slides by: Eric Ringger, with contributions from Mike Jones, Eric.
CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0.
CS 312: Algorithm Analysis Lecture #33: Branch and Bound, Job Assignment This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported.
CS 312: Algorithm Analysis
CS 312: Algorithm Analysis Lecture #31: Linear Programming: the Simplex Algorithm, part 2 This work is licensed under a Creative Commons Attribution-Share.
CS 312: Algorithm Analysis Lecture #35: Branch and Bound Design Options - State Spaces Slides by: Eric Ringger, with contributions from Mike Jones, Eric.
CSCE350 Algorithms and Data Structure Lecture 21 Jianjun Hu Department of Computer Science and Engineering University of South Carolina
CS 312: Algorithm Analysis Lecture #31: Linear Programming: the Simplex Algorithm, part 2 This work is licensed under a Creative Commons Attribution-Share.
CS 312: Algorithm Analysis Lecture #4: Primality Testing, GCD This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
Branch and Bound Searching Strategies
Adversarial Search 2 (Game Playing)
Optimization Problems The previous examples simply find a single solution What if we have a cost associated with each solution and we want to find the.
CS 312: Algorithm Analysis Lecture #9: Recurrence Relations - Change of Variable Slides by: Eric Ringger, with contributions from Mike Jones, Eric Mercer,
CS 312: Algorithm Design & Analysis Lecture #26: 0/1 Knapsack This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
CS 312: Algorithm Design & Analysis Lecture #29: Network Flow and Cuts This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported.
CS 312: Algorithm Analysis Lecture #30: Linear Programming: Intro. to the Simplex Algorithm This work is licensed under a Creative Commons Attribution-Share.
CS 721 Project Implementation of Hypergraph Edge Covering Algorithms By David Leung ( )
Brian Williams, Fall 041 Analysis of Uninformed Search Methods Brian C. Williams Sep 21 st, 2004 Slides adapted from: Tomas Lozano Perez,
CS 312: Algorithm Analysis Lecture #27: Network Flow This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
EMIS 8373: Integer Programming Combinatorial Optimization Problems updated 27 January 2005.
BackTracking CS255.
Graphs Part 2 Adjacency Matrix
Branch and Bound Searching Strategies
Discrete Math 2 Shortest Path Using Matrix
Backtracking and Branch-and-Bound
Lecture 4: Tree Search Strategies
Presentation transcript:

CS 312: Algorithm Design & Analysis Lecture #35: Branch and Bound Design Options: State Spaces Slides by: Eric Ringger, with contributions from Mike Jones, Eric Mercer, and Sean Warnick This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative Commons Attribution-Share Alike 3.0 Unported License

Announcements  Homework #25 due now  Questions about bounding functions?  Screencast and Quiz  Due: end of day Thursday  Project #7: TSP  We continue discussing design options today  Help sessions: Thursday (3/26)  Whiteboard experience: Monday (3/30)  Early: Wednesday 4/8  Due: Friday 4/10

Objectives  Consider an alternate way to structure the state space.  i.e., an alternate method for state expansion  Provide more design options to complete the project.

Review the Ingredients of B&B

Review: A Bound on TSP Tour

1.Reduce Rows

2. Reduce Columns

Review: Feasibility  Part of our state expansion function  The feasibility test may include any condition you might think of:  Vertex doubly entered  Vertex doubly exited  Cycle among sub-set of cities  No options remaining – dead end.

Review: Pruning  Under what conditions can a search state be pruned?  Just one condition:  the (lower) bound for state  BSSF (current upper bound)  When?  Right after the state is created  Don’t even add it to the agenda  Either / or:  Eager pruning: When the BSSF is updated  Lazy pruning: When the state comes off the agenda

B&B Pseudo-Code: Eager Pruning function BandB() s  init_state() BSSF  quick-solution(s) // BSSF.cost holds cost Agenda.clear() Agenda.add(s, s.bound) while !Agenda.empty() and time remains and BSSF.cost != Agenda.first().bound do u  Agenda.first() Agenda.remove_first() children = successors(u) for each w in children do if ! time remains then break if (w.bound is better than BSSF.cost) then if criterion(w) then BSSF  w Agenda.prune(BSSF.cost) else Agenda.add(w, w.bound) return BSSF Proj. #7 option: Use this pseudo-code for eager B&B.

B&B Pseudo-Code: Lazy Pruning function BandB() s  init_state() BSSF  quick-solution(s) // BSSF.cost holds cost Agenda.clear() Agenda.add(s, s.bound) while !Agenda.empty() and time remains and BSSF.cost != Agenda.first().bound do u  Agenda.first() Agenda.remove_first() if (u.bound is better than BSSF.cost) then children = successors(u) for each w in children do if ! time remains then break if (w.bound is better than BSSF.cost) then if criterion(w) then BSSF  w else Agenda.add(w, w.bound) return BSSF Proj. #7 option: Use this pseudo-code for lazy B&B.

Structure of State Space  Recall the structure of the state space from last time.

Review: State Space #1  Generate all children one step away  each child state is generated by including an edge from city j, to a previously unvisited city (where j is the destination of the last edge in the parent state)  Pro: Does not include premature cycles. Why not?  Pro: Simple algorithm: pick all neighbors that remain from vertex j, (leave the starting vertex for the end)  Con: On many instances, while searching with B&B, will result in excessively deep (possibly exponential) agendas. Why?  Is B&B in this state space optimal, given enough time and space? Include edge (j,1) (j,2)(j,3) … (j,N) (i,j)

Structure of State Space  Could we structure the space another way?  How else could we generate children states?

Good Idea  Generate states of interest  Postpone expanding states of lesser interest  A lazy approach

State Space #2 Include edge (i,j)Exclude edge (i,j) Use same representation for states & same bounding function. New method for generating children: Why is branch and bound in this state space optimal, given enough time?

How: Excluding an Edge What happens to a state’s cost matrix when an edge is excluded? Exclude 4  2

Size of the State Space  Start with Complete Graph

State Space: Strategy #2

Which edge to select?  What strategies for edge selection can you think of?  Idea: try to reduce the size of the part of the state-space you actually need to explore!  Avoid going into the deep (exclude) side, if possible.

0 Try #1: Consider edge (3,2) include (3,2)exclude (3,2) bound = 22bound = 21 Parent: bound = 21 Both children similarly competetive.

Try #2: Consider edge (2,3) include (2,3)exclude (2,3) bound = 21bound = 28 bound = Parent: Left child more likely to be pruned.

Try #3: Consider edge (5,1) include (5,1)exclude (5,1) bound = 30bound = Parent: Right child more likely to be pruned. Let’s use this approach for our example.

State Space so far include (5,1)exclude (5,1) bound = 30bound = 21

Consider edge (2,5) include (2,5)exclude (2,5) bound = 28bound = Parent: Again, right child more likely to be pruned.

Search Space so far include (5,1)exclude (5,1) 3021 include (2,5)exclude (2,5) 2821

Consider edge (3,2) include (3,2)exclude (3,2) bound = 22bound = Parent:

Search Space so far include (5,1)exclude (5,1) 3021 include (2,5)exclude (2,5) 2821 include (3,2) 21 exclude (3,2) 22

Search Space so far include (5,1)exclude (5,1) 3021 include (2,5)exclude (2,5) 2821 include (3,2) 21 exclude (3,2) include (4,3),(1,4)

Summarize: State Space #2  Pick an edge e = (i,j) and generate two children: 1.Include edge e 2.Exclude edge e  One might pick an edge by:  maximizing the difference between the included edge child and the excluded edge child  maximizing the bound on the excluded edge child  minimizing the bound on the included edge child  One must be careful not to create a cycle prematurely  How to prevent? Include edge (i,j) Exclude edge (i,j)

Sizes of State Spaces  Strategy #1  Strategy #2  See ch. 6: DP strategy  n 2 2 n

Conclusions  You have options!  Having some control without sacrificing optimality is important.  You may be able to prune more aggressively without sacrificing optimality.

Assignment  HW #26  Due Friday  Read the project instructions and lecture notes  Have your “whiteboard experience” for Project #7  Consider your options  Make your choice  Design your algorithm  Work and talk through an example