Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 Commons Attribution-Share Alike 3.0 Unported License.Creative Commons Attribution-Share Alike 3.0 Unported License Slides by: Eric Ringger, with contributions from Mike Jones, Eric Mercer, and Sean Warnick

2 Announcements  Homework #24 due now  Project #7: TSP  ASAP: Read the helpful “B&B for TSP Notes” linked from the schedule  Read Project Instructions  Today: We continue discussing design options

3 Objectives  Review the Traveling Salesman Problem (TSP)  Develop a good bounding function for the TSP  Reason about Tight Bounds  Augment general B&B algorithm

4 Traveling Salesman (Optimization) Problem  Rudrata or Hamiltonian Cycle  Cycle in the graph that passes through each vertex exactly once +  Find the least cost or “shortest” cycle  It’s NP Hard 1 2 34 5 8 6 7 4 4 3 2 19 10 12 Distinguish TSP-Opt from the TSP search problem and the TSP decision problem (The TSP decision problem is NP-Complete.)

5 How to solve?

6 If with B&B, what do we need?

7

8 Initial BSSF 1 2 34 5 8 6 7 4 4 3 2 19 10 12 How to compute? Should be quick. What if you have a complete graph? What if you don’t?

9 Simple-Minded Initial BSSF 1 2 34 5 8 6 7 4 4 3 2 19 10 12 Cost of BSSF = 9+4+4+12+1 = 30

10 A Bound on Possible TSP Tours We need a bound function. Lower or Upper? How to compute? 1 2 34 5 8 6 7 4 4 3 2 19 10 12

11 A Bound on Possible TSP Tours We need a bound function. Lower or Upper? How to compute? 1 2 34 5 8 6 7 4 4 3 2 19 10 12

12 A Bound on Possible TSP Tours We need a bound function. Lower or Upper? How to compute? 1 2 34 5 8 6 7 4 4 3 2 19 10 12

13 A Bound on Possible TSP Tours We need a bound function. Lower or Upper? How to compute? 1 2 34 5 8 6 7 4 4 3 2 19 10 12

14 A Bound on Possible TSP Tours We need a bound function. Lower or Upper? How to compute? 1 2 34 5 8 6 7 4 4 3 2 19 10 12

15 A Bound on Possible TSP Tours 1 2 34 5 8 6 7 4 4 3 2 19 10 12 What’s the cheapest way to leave each vertex?

16 Bound on Possible TSP Tours 1 2 34 5 8 6 7 4 4 3 2 19 10 12 Save the sum of those costs in the bound (as a rough draft). Rough draft bound = 8+6+3+2+1 = 20

17 Bound on Possible TSP Tours 1 2 34 5 8-8=0 6 7 4 4 3 2 19-8=1 10 12 For a given vertex, subtract the least cost departure from each edge leaving that vertex. Rough draft bound = 20

18 Bound on Possible TSP Tours 1 2 34 5 0 0 1 2 1 0 0 01 9 6 Repeat for the other vertices. What do the numbers on the edges mean now? Rough draft bound = 20

19 Bound on Possible TSP Tours 1 2 34 5 0 0 1 2 1 0 0 01 9 6 Now, can we find a tighter lower bound? Rough draft bound = 20

20 Bound on Possible TSP Tours 1 2 34 5 0 0 1 2 1 0 0 01 9 6 Does that set of edges now having 0 residual cost arrive at every vertex? Rough draft bound = 20

21 Bound on Possible TSP Tours 1 2 3 4 5 0 0 1 2 1 0 0 01 9 6 In this case, those edges never arrive at vertex #3. Rough draft bound = 20

22 Bound on Possible TSP Tours 1 2 34 5 0 0 1 2 1 0 0 01 9 6 We have to take an edge to vertex 3 from somewhere. Assume we take the cheapest. Rough draft bound = 20

23 Bound on Possible TSP Tours 1 2 34 5 0 0 0 1 1 0 0 01 9 6 Subtract its cost from other edges entering vertex 3 and add the cost to the bound. We have just tightened the bound. Bound = 21

24 This Bound  It will cost at least this much to visit all the vertices in the graph.  There’s no cheaper way to get in and out of each vertex.  Each edge is now labeled with the extra cost of choosing that edge.  The bound is not a solution; it’s a bound!  Why are tight bounds desirable?

25 Bound on Possible TSP Tours 1 2 34 5 8 6 7 4 4 3 2 19 10 12 Our algorithm can do this reasoning using a cost matrix. To: 1 2 3 4 5 From: 1 2 3 4 5

26 Bound on Possible TSP Tours 1 2 34 5 0 0 1 2 1 0 0 01 9 6 Reduce all rows. To: 1 2 3 4 5 From: 1 2 3 4 5

27 Bound on Possible TSP Tours 1 2 34 5 0 0 1 2 1 0 0 01 9 6 Then reduce column #3. Now we have a tighter bound. To: 1 2 3 4 5 From: 1 2 3 4 5

28 Search  Let’s start the search  Arbitrarily start at vertex 1  Why is this OK?  Focus on:  the bound function and  the reduced cost matrix representation of states

29 Using this bound for TSP in B&B bound = 21 BSSF=30 Start at vertex 1 in graph (arbitrary) What should our state expansion strategy be?

30 Using this bound for TSP in B&B bound = 21 1-2 1-31-4 1-5 bound = 21+1 Start at vertex 1 in graph (arbitrary) bound = 21 BSSF=30

31 Focus: going from 1 to 2 bound = 21 1-2 bound = 22 1 2 34 5 0 0 0 1 1 0 0 01 9 6 1 2 34 5 0 1 1 0 01 9 6 Add extra cost from 1 to 2, exclude edges from 1 or into 2. BeforeAfter BSSF=30

32 bound = 21 bound = 22+1 1 2 34 5 0 0 0 1 1 0 0 01 9 6 1 2 34 5 0 1 1 0 01 9 6 No edges out of vertex 3 w/ 0 reduced cost. Focus: going from 1 to 2 BeforeAfter 1-2 BSSF=30

33 bound = 21 bound = 22+1 1 2 34 5 0 1 0 0 01 9 6 Add cost of reducing edges out of vertex 3. Focus: going from 1 to 2 1-2 BSSF=30

34 Two Possibilities on the Agenda 1 2 34 5 0 1 0 0 01 9 6 1 2 34 5 0 0 0 10 0 0 6 bound = 23bound = 21

35 Bounds for other choices bound = 21 bound = 23bound = 21 1-2(23),1-4(21) 1-2 1-31-4 1-5 Agenda: BSSF=30

36 Leaving Vertex 4 bound = 21 1 2 34 5 0 0 0 10 0 0 6 1-4-21-4-31-4-5 bound = 22bound = 21bound = 28 BSSF=30 1-4

37 Leaving Vertex 4 bound = 21 1 2 34 5 0 0 0 10 0 0 6 bound = 22bound = 21bound = 28 1-4-2(22), 1-4-3(21) 1-4-5(28),1-2(23) BSSF=30 1-4 1-4-21-4-31-4-5 Agenda:

38 Leaving Vertex 3 bound = 21 1 2 34 5 0 0 0 0 0 1-4-3-2 bound = 21 BSSF=30 1-4-3

39 Leaving Vertex 3 bound = 21 4-2(22), 3-2(21) 4-5(28), 1-2(23), BSSF=30 1-4-3-2 Agenda: 1-4-3 1 2 34 5 0 0 0 0 0

40 Search Tree for This Problem b=21 b=23b=21 b=22b=21b=28 b=21 1-to-2 1-to-4 4-to-24-to-34-to-5 3-to-2 2-to-5

41 Termination Criteria for a B&B Algorithm  Repeat until  Agenda is empty  Or time is up  Or BSSF cost is equal to original LB

42 Assignment  HW #25:  Compute bound for TSP instance using today’s method  Reason about search for TSP solution  Due Wednesday!


Download ppt "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."

Similar presentations


Ads by Google