Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jin Zheng, Central South University1 Branch-and-bound.

Similar presentations


Presentation on theme: "Jin Zheng, Central South University1 Branch-and-bound."— Presentation transcript:

1 Jin Zheng, Central South University1 Branch-and-bound

2 Jin Zheng, Central South University2 Branch and Bound  An enhancement of backtracking Similarity  A state space tree is used to solve a problem. Difference  The branch-and-bound algorithm does not limit us to any particular way of traversing the tree and is used only for optimization problems  The backtracking algorithm requires the using of DFS traversal and is used for nonoptimization problems.

3 Jin Zheng, Central South University3 Branch and Bound  Compared to backtracking,branch-and-bound requires two additional items.  A way to provide,for every node of a state-space-tree,a bound on the best value of the objective function on any solution that can be obtained by adding further components to the partial solution represented by the node.  The value of the best solution seen so far.

4 Jin Zheng, Central South University4 The main idea  Set up a bounding function, which is used to compute a bound (for the value of the objective function) at a node on a state-space tree and determine if it is promising  Promising (if the bound is better than the value of the best soluton so far:expand beyond the node.  Nonpromising (if the bound is no better than the value of the best solution so far--:not smaller for a minimization problem and not larger for a maxmization problem ): not expand beyond the node (pruning the state- space tree).

5 Jin Zheng, Central South University5 Terminate a search path at the current node in a state- space tree for any one of the following three reasons:  The value of the node’s bound is not better than the value of the best solution seen so far.  The node reprsents no feasible solutions because the constraints of the problem are already violated.  The subset of feasible solutions reprsented by the node consists of a single point(and hence no further choices can be made)-in this case we compare the value of the objective function for this feasible solution with that of the best solution seen so far and update the latter with the former if the new solution is better.

6 Jin Zheng, Central South University6 Assignment problem Job1 Job2 Job3 Job4 C= 9 2 7 8 6 4 3 7 5 8 1 8 7 6 9 4

7 Jin Zheng, Central South University7 Start Ib=10 a → 1 Ib=17 a → 2 Ib=10 a → 3 Ib=20 a → 4 Ib=18 b → 1 Ib=13 b → 3 Ib=14 b → 4 Ib=17 c → 3 Ib=13 c → 4 Ib=20 d → 4 Cost=13 0 1 2 34 56 7 89 10 complete state-space tree for the instance of the assignment problem solved with the best-first branch-and- bound algorithm

8 Jin Zheng, Central South University8 Traveling Salesman Problem — Bounding Function 1  Because a tour must leave every vertex exactly once, a lower bound on the length of a tour is the sum of the minimum (lower bound)cost of leaving every vertex. The lower bound on the cost of leaving vertex v 1 is given by the minimum of all the nonzero entries in row 1 of the adjacency matrix. … The lower bound on the cost of leaving vertex v n is given by the minimum of all the nonzero entries in row n of the adjacency matrix.  Note: This is not to say that there is a tour with this length. Rather, it says that there can be no shorter tour.Assume that the tour starts with v1.

9 Jin Zheng, Central South University9 Traveling Salesman Problem — Bounding Function 2  Because every vertex must be entered and exited exactly once, a lower bound on the length of a tour is the sum of the minimum cost of entering and leaving every vertex. For a given edge (u, v), think of half of its weight as the the exiting cost of u, and half of its weight as the entering cost of v. The total length of a tour = the total cost of visiting( entering and exiting) every vertex exactly once. The lower bound of the length of a tour = the lower bound of the total cost of visiting (entering and exiting ) every vertex exactly once.  Calculation: for each vertex, pick top two shortest adjacent edges (their sum divided by 2 is the lower bound of the total cost of entering and exiting the vertex); add up these summations for all the vertices.  Assume that the tour starts with vertex a and that b is visited before c.

10 Jin Zheng, Central South University10 Traveling salesman a Ib=14 a, b Ib=14 a,ca,d Ib=16 a,e Ib=19 0 1 2 3 4 5 6 7 9 a,b,c Ib=16 a,b,e Ib=19 a,b,d Ib=16 8 a,b,c,d,e,a l=24 10 11 b is not before c a,b,c,d,e,a l=19 a,b,c,d,e,a I=24 a,b,c,d,e,a I=16

11 Jin Zheng, Central South University11 Notes Finding a good bounding is not a simple task. On the one hand.we want this function to be easy to compute. On the other hand,it cann’t bt too simplistic.— otherwise,it would fail in its principal task to prune as many branches of a state-space tree as soon as possible.

12 Jin Zheng, Central South University12 9 palace problem 23 164 7 5 813 84 765 2

13 Jin Zheng, Central South University13 23 14 765 8 23 164 75 8 23 164 7 5 8 283 14 7 65 23 184 765 23 14 765 8 83 214 765 283 714 65 3 184 765 2 2 184 765 3 13 84 765 2 13 84 765 2 283 164 75 1 234 567 891011 12 4 6 4 6 556 6 65 6 5 5 13 A solution

14 Jin Zheng, Central South University14 Knapsack problem (1) v 1 /w 1 ≥v 2 /w 2 ≥… ≥v n /w n (2) bound function: ub=v+(W-w)(v i+1 /w i+1 )

15 Jin Zheng, Central South University15 Example Item weight value value/weight 1 4 40 10 2 7 42 6 3 5 25 5 4 3 12 4  W=10

16 Jin Zheng, Central South University16 w=0,v=0 Ub=100 w=4,v=40 Ub=76 w=0,v=0 Ub=60 w=11w=4,v=40 Ub=70 w=9,v=65 Ub=69 w=4,v=40 Ub=64 w=12w=9,v=65 Ub=65 With 1 W/o 1


Download ppt "Jin Zheng, Central South University1 Branch-and-bound."

Similar presentations


Ads by Google