Chapter 3 Branch and Bound PDF
Chapter 3 Branch and Bound PDF
CHAPTER 3:
INTRODUCTION
• If these values are integer valued, this must also be the solution to the
integer problem.
• If these variables are not integer valued, the feasible region is divided
by adding constraints restricting the value of one of the variables that
was not integer valued.
• The divided feasible region results in sub-problems that are then solved
- partitioned into smaller subsets of solutions.
• The branch and bound method uses a tree diagram of nodes and
branches to organize the solution partitioning.
• Bounds on the value of the objective function are found and used to
help determine which subproblems can be eliminated and when the
optimal solution has been found.
1. Solve the original problem using LP. If the answer satisfies the integer
constraints, we are done. If not, this value provides an initial upper
bound.
2. Find any feasible solution that meets the integer constraints for use as
a lower bound. Usually, rounding down each variable will accomplish
this.
3. Branch on one variable from step 1 that does not have an integer value.
Split the problem into two subproblems based on integer values that
are immediately above or below the noninteger value.
4. Create nodes at the top of these new branches by solving the new
problem.
6. Examine both branches again and set the upper bound equal to the
maximum value of the objective function at all final nodes. If the
upper bound equals the lower bound, stop. If not, go back to step 3.
Example 1:
Since X1 and X2 are not integers, this solution is not valid. The profit value
of $35.25 will provide the initial upper bound.
Subproblem A
Maximize profit = $7X1 + $6X2
subject to 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1 ≥4
Subproblem B
Maximize profit = $7X1 + $6X2
subject to 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1 ≤3
Subproblem A’s
optimal solution: [X1 = 4, X2 = 1.2, profit = $35.20]
Subproblem B’s
optimal solution: [X1 = 3, X2 = 2, profit = $33.00]
X1 = 3
X2 = 2
P = 33.00
Stop This Branch
Solution Is Integer, Feasible
Provides New Lower Bound of $33.00
Subproblem C
Maximize profit = $7X1 + $6X2
subject to 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1 ≥4
X2 ≥2
Subproblem D
Maximize profit = $7X1 + $6X2
subject to 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30
X1 ≥4
X2 ≤1
Subproblem E
Maximize profit = $7X1 + $6X2
subject to 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30 Optimal solution to E:
X1 ≥4 X1 = 4, X2 = 1, profit = $34
X1 ≤4
X2 ≤1
Subproblem D
Maximize profit = $7X1 + $6X2
subject to 2X1 + 3X2 ≤ 12
6X1 + 5X2 ≤ 30 Optimal solution to F:
X1 ≥4 X1 = 5, X2 = 0, profit = $35
X1 ≥5
X2 ≤1
• The stopping rule for the branching process is that we continue until
the new upper bound is less than or equal to the lower bound or no
further branching is possible.
• The later case applies here since both branches yielded feasible integer
solutions.
Subproblem C
No
Feasible
Solution
Region
Subproblem A Subproblem E
X1 = 4 X1 = 4
X2 = 1.2 X2 = 1 Feasible, Integer
P = 35.20 P = 34.00 Solution
Subproblem D
X1 = 3.75 X1 = 4.17
X2 = 1.5 X2 = 1
P = 35.25 P = 35.16
Subproblem B Subproblem F
X1 = 3 Upper Bound X1 = 5
X2 = 2 = $35.25 X2 = 0
P = 33.00 Lower Bound P = 35.00
= $27.00
Optimal
Solution
SQQP3043 – Heuristic Techniques 8
• In this chapter, we will solve three types of problems i.e. (1) Knapsack
problem, (2) machine scheduling problem and (3) traveling
salesperson problem (TSP) by the branch and bound method.
SQQP3043 – Heuristic Techniques 9
Knapsack Problem
o Put the best item in the knapsack, the second best item and so on
until the best remaining item will overfill the knapsack.
SQQP3043 – Heuristic Techniques 10
Example 2
Solution:
SQQP3043 – Heuristic Techniques 11
Example 3
Subproblem 1
z = 44
x1 = x2 = 1
x3 = 1/2
x3 = 0 x3 = 1
Subproblem 2 Subproblem 3
z = 43 5/7
x1 = x3 = 1
x2 = 5/7
x4 = 0
SQQP3043 – Heuristic Techniques 13
Remarks:
• Sub-problem 9 has a z-value of 42 6/7. Since the z-value for any all-
integer solution must also be an integer, this meant that branching on
sub-problem 9 could never yield a z-value larger than 42. Thus, further
branching on sub-problem 9 could not beat the current LB of 42, and
sub-problem 9 was eliminated from consideration.
SQQP3043 – Heuristic Techniques 14
Jobs: J1 , J2 , ..., Jn
• The objective of this problem is to find an ordering of the jobs that can
minimize the total delay of the jobs.
• Assumptions:
▪ The machine is always available throughout the scheduling period.
▪ The machine cannot process more than one job at a time.
▪ Each job must spend on the machine a prescribed length of time.
xi
4
3
2
1
*, *, *, *
2nd Level
1, 2, *, * 1, 3, *, * ………...
………...
• Branching rule:
▪ k-1 level, j1 , ... , jk-1 are scheduled,
▪ jk need to be considered if no job to be scheduled cannot be
processed before the release time of jk
SQQP3043 – Heuristic Techniques 16
Example 4:
Solution:
Suppose the jobs are processed in the following order: Job 1, 2, 3 and 4.
The delays occur is shown in the table below:
• Create four branches with nodes 1 – 4 and obtain a lower bound on the
total delay (D) associated with the node.
x14 = 1 x44 = 1
x24 = 1 x34 = 1
Node 1 Node 2 Node 3 Node 4
D ≥ 15 D ≥ 19 D ≥ 11 D≥7
• For example, at node 7, we know that job 4 will processed last and
delayed by 7 days and job 3 will be the third job processed. Thus, job
3 will be completed after 6 + 4 + 5 = 15 days and will be 15 – 12 = 3
days late. Any sequence associated with node 7 must have D ≥ 7 + 3 =
10 DAYS.
x14 = 1 x44 = 1
x24 = 1 x34 = 1
Node 1 Node 2 Node 3 Node 4
D ≥ 15 D ≥ 19 D ≥ 11 D≥7
x13 = 1 x33 = 1
x23 = 1
Node 5 Node 6 Node 7
D ≥ 14 D ≥ 18 D ≥ 10
SQQP3043 – Heuristic Techniques 18
x14 = 1 x44 = 1
x24 = 1 x34 = 1
Node 1 Node 2 Node 3 Node 4
D ≥ 15 D ≥ 19 D ≥ 11 D≥7
x13 = 1 x33 = 1
x23 = 1
Node 5 Node 6 Node 7
D ≥ 14 D ≥ 18 D ≥ 10
x12 = 1 x22 = 1
Node 8 Node 9
D = 12 D = 16
x14 = 1 x44 = 1
x24 = 1 x34 = 1
Node 1 Node 2 Node 3 Node 4
D ≥ 15 D ≥ 19 D ≥ 11 D≥7
x12 = 1 x22 = 1
Node 8 Node 9
D = 12 D = 16
• For node 10, D ≥ (delay from processing job 3 last) + (delay from
processing job 1 third) = 11 + (6 + 4 + 8 – 8) = 21. Since any sequence
associated with node 10 must have D ≥ 21 and we have a candidate
with D = 12, node 10 is eliminated.
• For node 11, D ≥ (delay from processing job 3 last) + (delay from
processing job 2 third) = 11 + (6 + 4 + 8 – 4) = 25. Any sequence
associated with node 11 must have D ≥ 25, node 11 is eliminated.
• Finally, for node 12, D ≥ (delay from processing job 3 last) + (delay
from processing job 4 third) = 11 + (6 + 4 + 8 – 16) = 13. Any
sequence associated with node 12 must have D ≥ 13, node 12 is
eliminated.
SQQP3043 – Heuristic Techniques 20
• With the exception of node 8, every node has been eliminated from
consideration. Node 8 yields the delay-minimizing sequence x14 = x24
= x34 = x44 = 1.
• Thus, the jobs should be processed in the order 2-1-3-4 with a total
delay of 12 days resulting.
SQQP3043 – Heuristic Techniques 21
• Starting from his home, a salesman wishes to visit each of (n −1) other
cities and return home at minimal cost. He must visit each city exactly
once and it costs cij to travel from city i to city j. What route should he
select?
• Let
xij 1 if he goes from city i to city j,
0 otherwise
N N
Minimize c
i 1 j 1
ij xij
subject to: x
i 1
ij 1, (j = 1, 2, ..., N)
N
x
j 1
ij 1, (i = 1, 2, ..., N)
u i u j Nx ij N 1 (for i ≠ j; i = 2, 3, .., N; j = 2, ..., N)
xij 0 or 1, x j 0
• The constraints require that the salesman must enter and leave each
city exactly once.
Example 5:
14 5 8 7
2 12 6 5
7 8 3 9
2 4 6 10
Solution:
9 0 3 2
0 10 4 3
4 5 0 6
0 2 4 8
Column
0 0 0 2
minimum
SQQP3043 – Heuristic Techniques 23
9 0 3 0
0 10 4 1
4 5 0 4
0 2 4 6
Since fewer than four lines are required to cover all the zeros, proceed to
Step 3. The smallest uncovered element is 1, so subtract 1 from each
uncovered element and add 1 to each twice-covered element.
10 0 3 0
0 9 3 0
5 5 0 4
0 1 3 5
SQQP3043 – Heuristic Techniques 24
Example 6:
Joe State lives in Gary, Indiana. He owns insurance agencies in Gary, Fort
Wayne, Evansville, Terre Haute and South Bend. Each December, he
visits each of his insurance agencies. The distance between each if his
agencies (in miles) is shown in the table below. What order of visiting his
agencies will minimize the total distance traveled?
Solution:
• Define
For i ≠ j,
cij distance between cities i and j
cii M, where M is a large positive number
• Supposed this assignment problem is solved with the solution x14 = x24
= x45 = x53 = x31 = 1. This solution can be written 1-2-4-5-3-1. An
itinerary that begins and ends at the same city and visits each city once
is called a tour.
3 4
2 5
• A subtour is a round trip that does not pass through all cities. The two
subtours are 1-5-2-1 and 3-4-3.
• Branch and bound approach is the most efficient approach for solving
a TSP.
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 79
3 217 290 M 113 303
4 164 201 113 M 196
5 58 79 303 196 M
Cost matrix of subproblem 1
Subproblem 1
z = 495
x15 = x21 = x34 =
x43 = x52 = 1
x34 = 0 x43 = 0
Subproblem 2 Subproblem 3
z = 652 z = 652
x14 = x25 = x31 = x13 = x25 = x34 =
x43 = x52 = 1 x41 = x52 = 1
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 79
3 217 290 M M 303
4 164 201 113 M 196
5 58 79 303 196 M
Cost matrix of subproblem 2
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 M
3 217 290 M M 303
4 164 201 113 M 196
5 58 79 303 196 M
Cost matrix of subproblem 4
Subproblem 1
z = 495
x15 = x21 = x34 =
x43 = x52 = 1
x34 = 0 x43 = 0
Subproblem 2 Subproblem 3
z = 652 z = 652
x14 = x25 = x31 = x13 = x25 = x34 =
x43 = x52 = 1 x41 = x52 = 1
Subproblem 4 Subproblem 5
z = 668 z = 704
x15 = x24 = x31 = x14 = x43 = x32 =
x43 = x52 = 1 x25 = x51 = 1
candidate sol. UB = 668
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 79
3 217 290 M M 303
4 164 201 113 M 196
5 58 M 303 196 M
Cost matrix of subproblem 5
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 79
3 217 290 M 113 303
4 164 201 M M 196
5 58 79 303 196 M
Cost matrix of subproblem 3
• Since 652 < 668, it is still possible for subproblem 3 to yield a solution
with no subtours that beats z = 668. Thus, branch on subproblem 3
(subproblem 6 and 7) in an effort to exclude the subtours with x25 = 0
or x52 = 0.
City 1 2 3 4 5
1 M 132 217 164 58
2 132 M 290 201 M
3 217 290 M 113 303
4 164 201 M M 196
5 58 79 303 196 M
Cost matrix of subproblem 6
SQQP3043 – Heuristic Techniques 29
Subproblem 1
z = 495
x15 = x21 = x34 =
x43 = x52 = 1
x34 = 0 x43 = 0
Subproblem 2 Subproblem 3
z = 652 z = 652
x14 = x25 = x31 = x13 = x25 = x34 =
x43 = x52 = 1 x41 = x52 = 1
x25 = 0 x52 = 0 UB = 668
x25 = 0 x52 = 0
Subproblem 4 Subproblem 5
z = 668 z = 704
x15 = x24 = x31 = x14 = x43 = x32 =
x43 = x52 = 1 x25 = x51 = 1
candidate sol. UB = 668
Subproblem 6 Subproblem 7
z = 704 z = 910
x15 = x34 = x23 = x13 = x25 = x31 =
x42 = x52 = 1 x42 = x54 = 1
UB = 668 UB = 668
City 1 2 4 3 5
1 M 132 217 164 58
2 132 M 290 201 79
3 217 290 M 113 303
4 164 201 M M 196
5 58 M 303 196 M
Cost matrix of subproblem 7