Download Lecture Notes on Branch and Bound in Algorithms and more Slides Design and Analysis of Algorithms in PDF only on Docsity!
Branch and Bound Paradigm
- Aims at exploring the Tree corresponding to the
problem statement
- Recall : In backtracking feasible function was used
for pruning the search !!
- In addition to pruning following are additional
requirement:
1. For each node a bound (lower or upper ) is
determined on the best possible value of objective
function that can be obtained by exploring the node
further
2. Keep track of a value of best possible solution
obtained so far
Example: Job Assignment Problem
• N people and N Jobs are available
• People are associated with jobs and cost of
association is given (Matrix)
• Aim: To find an assignment which will minimize
the cost.
A
B
C
D
J1 J2 J3 J
Consider the
Assignment Matrix:
- The problem is that of minimization of cost hence, the
lowest bound for the cost can be found by considering
lowest value in each row and adding them i.e. 4 + 3 + 2 + 7
= 16. Optimal solution without solving the problem !!!
- This bound itself may not give the desired solution as
the problem constraints may be violated!!
- However, it is a lower bound on any legitimate solution
- The same process is applied to partially constructed
solutions
- Lower bound obtained when A is assigned
jobs 2 and B is assigned jobs 1,3 and 4
A→ 2
Lb= 4+3+2+9=
B→ 4
Lb= 4+3+2+9=
B→ 3
Lb= 4+6+5+9=
B→ 1
Lb= 4+7+2+14=
Note: Node 8 has a lower bound of 18 (obtained after
assignment of job 2 to A and job 4 to B) which is minimum
among all assignments and hence node 8 is further
expanded.
- Lower bound obtained when A is assigned
jobs 2, B is assigned job 4 and C is assigned
jobs 1and 3:
B→ 4
Lb= 4+3+2+9=
C→ 3
D→ 1
C→ 1
D→ 3
Lb= 4+3+8+10=25 Lb= 4+3+2+9=
//Implied
Note: Value of Lower bound at node 10 is less than that at
node 9. Moreover Lower bounds at nodes 2 , 4 , 5 , 6 and 7
are all greater than 18. Hence, Lower bound is 18 and
assignments are: A→ 2 ; B→ 4 ; C→ 3 and D→ 1
0/1 Knapsack problem
• N objects with profit are given
• Aim: To select subset of objects such that the
total wieght does not exceed M, the capacity
of knapsack, and profit earned is maximum
• Objects are considered according to
decreasing P/W ratios to maximize profit
• Strategy: Construct a binary tree
corresponding to selection and non selection
of objects one by one
- The upper bound, ub, is obtained by adding the
product of remaining capacity of knapsack and
best p/w value among the remaining objects to p,
i.e
ub = p + (M-w)*(best P/W ratio among the
remaining objects)
(p1,p2,p3,p4) = (50,49,36,20);
(w1,w2,w3,w4) = (5,7,6,4)
Solve the 0/1 knapsack problem using
Branch and Bound
- N=4; M=10; (p1,p2,p3,p4)=(40,49,25,9)
(w1,w2,w3,w4)=(4,7,5,3)
Traveling Salesman Problem
• Well known problem that has been solved using
dynamic Programming
• If B&B is to be used, all possibilities have to be
investigated using State Space Tree
• Given a Weighted Graph, starting at vertex 1, we
have to investigate all possible paths to find the
least cost path starting at vertex 1 and ending at
it
• More importantly, we need to compute a lower
bound for each node!!
Example: Solve TSP for the given
Graph using Branch and Bound
- Root of Tree corresponds to vertex 1 and the lower bound
is:
- Lb = ½[(1+4)+(1+3)+(4+2)+(3+2)+(4+6)]
= ½[5+4+6+5+10] = ciel (15) = 15
Lb = ceil{1/2[(1+4)+(1+3)+(2+4)+(2+3)+(4+6)]}
= ceil{ 1/2[5+4+6+5+10]}= 15
- Lb for node 3 of the tree:
Lb = ceil{1/2[(1+5)+(1+3)+(2+4)+(2+5)+(4+6)]}
= ceil {1/2[6+4+6+7+10]} = ceil {16.5} = 17
- Similarly, Lb for node 4 = 15
V
Lb = 15
V1, V
Lb = ??
V1, V
Lb = ??
V1, V
Lb = ??
Solve the TSP using B&B