L3
L3
Algorithm
Lecture 3
Branch-and-Bound Algorithm Complete Enumeration
Branch-and-Bound
MATH3220 Operations Research and Logistics Algorithm
Pan Li
The Chinese University of Hong Kong
3.1
Branch-and-Bound
Agenda Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
1 Complete Enumeration
2 Branch-and-Bound Algorithm
3.2
Branch-and-Bound
Is IP easy to solve? Algorithm
Branch-and-Bound
solution is finite. But, the number is simply too large Algorithm
3.3
Branch-and-Bound
Overview Algorithm
Branch-and-Bound
Algorithm
Branch and bound is the starting point for all solution
techniques for integer programming.
3.4
Branch-and-Bound
Capital Budgeting Example Algorithm
Complete Enumeration
investment budget = $14,000 Branch-and-Bound
Algorithm
Investment 1 2 3 4 5
Cash Required $5,000 $4,000 $7,000 $3,000 $6,000
Present Value $12,000 $11,000 $13,000 $8,000 $15,000
3.5
Branch-and-Bound
Complete enumeration Algorithm
Branch-and-Bound
Usual idea: iteratively break the problem into two. Algorithm
3.6
Branch-and-Bound
An Enumeration Tree Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.7
Branch-and-Bound
An Enumeration Tree Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.8
Branch-and-Bound
An Enumeration Tree Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.9
Branch-and-Bound
An Enumeration Tree Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.10
Branch-and-Bound
An Enumeration Tree Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
Complete Enumeration
Suppose that we could evaluate 1 billion solutions per Branch-and-Bound
second. Algorithm
Solution times
- n = 30, 1 second
- n = 40, 17 minutes
- n = 50, 11.6 days
- n = 60, 31 years
- n = 70, 31,000 years
3.12
Branch-and-Bound
How to solve large size integer program faster? Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.13
Branch-and-Bound
Subtrees of an enumeration tree Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
Basic Idea: Enumeration procedure can always find the Complete Enumeration
optimal solution for any bounded IP problem. But it takes Branch-and-Bound
Algorithm
too much time. So, we consider the partial enumeration.
That is, divide and conquer.
3.15
Branch-and-Bound
A simpler problem to work with Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.16
Branch-and-Bound
LP Relaxation Algorithm
Branch-and-Bound
IP: Algorithm
LP Relaxation:
3.17
Branch-and-Bound
IP and LP Relaxation Algorithm
3.18
Branch-and-Bound
Why can’t we solve the LP relaxation and round it up/down to Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
Max z = x2
s.t. −x1 + x2 ≤ 0.5
x1 + x2 ≤ 3.5
x1 , x2 ≥ 0 and
are integers
3.19
Branch-and-Bound
Why can’t we solve the LP relaxation and round it up/down to Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
Max z = x1 + 5x2
s.t. x1 + 10x2 ≤ 20
x1 ≤ 2
x1 , x2 ≥ 0 and
are integers
3.20
Branch-and-Bound
Branch-and-Bound Algorithm
Branch-and-Bound
2 Eliminate the subtree (fathom it) if Algorithm
3.21
Branch-and-Bound
Bounding - For each problem or subproblem (will define Algorithm
3.22
Branch-and-Bound
Bounding - For each problem or subproblem (will define Algorithm
3.23
Branch-and-Bound
Solving the LP relaxation (LP(1)) Algorithm
Branch-and-Bound
0 ≤ xi ≤ 1 for i = 1 to 4 Algorithm
item 1 2 3 4
unit value $1.6 $1.571 $1.5 $1.333
Consider the unit value of the four items. Put items into the
knapsack in decreasing order of unit value. What do you get?
3.24
Branch-and-Bound
Solving the LP relaxation (LP(1)) Algorithm
Branch-and-Bound
0 ≤ xi ≤ 1 for i = 1 to 4 Algorithm
item 1 2 3 4
unit value $1.6 $1.571 $1.5 $1.333
Consider the unit value of the four items. Put items into the
knapsack in decreasing order of unit value. What do you get?
⇒ (x1 , x2 , x3 , x4 ) = (1, 1, 0.5, 0), with z = 22
⇒ No integer solution will have value lager than 22.
3.25
Branch-and-Bound
Branching - partitioning the entire set of feasible solutions Algorithm
Branch-and-Bound
Algorithm
3.27
Branch-and-Bound
Solving the LP relaxation (LP(2)) Algorithm
IP(2): x3 = 0
0 ≤ xi ≤ 1 for i = 1, 2, 4
item 1 2 3 4
unit value $1.6 $1.571 $0 $1.333
3.28
Branch-and-Bound
Solving the LP relaxation (LP(3)) Algorithm
IP(3): x3 = 1
0 ≤ xi ≤ 1 for i = 1, 2, 4
item 1 2 4
unit value $1.6 $1.571 $1.333
3.29
Branch-and-Bound
Enumeration Tree Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.30
Branch-and-Bound
Enumeration Tree Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.36
Branch-and-Bound
Branch-and-Bound Algorithm Algorithm
Branch-and-bound strategy:
Solve the linear relaxation of the problem.
If the solution is integer, then we are done.
Otherwise, create two new subproblems by branching on a Complete Enumeration
3.37
Branch-and-Bound
A branch-and-bound algorithm for mixed integer Algorithm
programming
n
X
Max z= cj xj Complete Enumeration
j=1 Branch-and-Bound
Algorithm
n
X
s.t. aij xj ≤ bi , for i = 1, . . . , m
j=1
xj ≥ 0, for j = 1, . . . , n
xj is integer, for j = 1, . . . , I (I ≤ n)
Modifications:
branching variables: only variables considered are the
integer-restricted variables that have a noninteger value in
the optimal solution for the LP relaxation of the current
subproblem.
values assigned to the branching variable for creating the
new smaller subproblems:
xj ≤ bxj∗ c and xj ≥ dxj∗ e
3.38
Branch-and-Bound
Example Algorithm
3.39
Branch-and-Bound
Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.40
Branch-and-Bound
Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.41
Branch-and-Bound
Algorithm
Complete Enumeration
Branch-and-Bound
Algorithm
3.42
Branch-and-Bound
Lessons learned Algorithm
3.43
Branch-and-Bound
How to Branch? Algorithm
3.45
Branch-and-Bound
The Best First Approach Algorithm
Branch-and-Bound
Algorithm
Drawbacks of Best First
Doesn’t necessarily find feasible solutions quickly since
feasible solution are "more likely" to be found deep in the
tree.
Node setup costs are high. The linear program being solved
may change quite a bit from one node evaluation to the
next.
Memory usage is high. It can require a lot of memory to
store the candidate list, since the tree can grow "broad".
3.46
Branch-and-Bound
The Depth First Approach Algorithm
3.47
Branch-and-Bound
Example Algorithm
3.48
Branch-and-Bound
Example Algorithm
3.49
Branch-and-Bound
Example Algorithm
s − 58 x3 + 35 x4 − 15 x5 = − 54
x1 1 0 0 − 14 1
5 − 25 2
5
Branch-and-Bound
Algorithm
8
x2 0 1 0 5 − 35 1
5
19
5
s 0 0 1 − 85 3
5 − 15 − 45
3 2 11
z 0 0 0 5 5 5 − 71
5
3.50
Branch-and-Bound
Example Algorithm
x1 x2 s x3 x4 x5 solution
x1 1 0 0 − 14 1
5 − 25 2
5 Complete Enumeration
8
x2 0 1 0 5 − 35 1
5
19
5
Branch-and-Bound
Algorithm
s 0 0 1 − 85 3
5 − 15 − 45
3 2 11
z 0 0 0 5 5 5 − 71
5
Leaving variable: s
Entering variable: xj is selected such that |zj /yjs | is the
minimum amongst all yjs < 0. Since
z3 z5 3/5 11/5 3
min , = min , =
y3s y5s −8/5 −1/5 8
3.51
Branch-and-Bound
Example Algorithm
x1 x2 s x3 x4 x5 solution
x1 1 0 − 18 0 1
8 − 38 1
2
Complete Enumeration
Branch-and-Bound
Algorithm
x2 0 1 1 0 0 0 3
x3 0 0 − 58 1 − 38 1
8
1
2
3 5 17
z 0 0 8 0 8 8 − 29
2
3.52
Branch-and-Bound
Rounding down to improve bounds Algorithm
Branch-and-Bound
Algorithm
3.53
Branch-and-Bound
A bad example Algorithm
Branch-and-Bound
xi ∈ {0, 1} for i = 1, 2, . . . , 100. Algorithm
3.54
Branch-and-Bound
Adding constraints to improve bounds Algorithm
3.55
Branch-and-Bound
Algorithm
Opt LP(A)
Max 4x1 + 3x2 + 3x3 + 3x4
x ∗ = (1, 0.5, 0, 0)
s.t. 2x1 + 2x2 + 2x3 + 2x4 ≤ 3 A zLP = 5.5
xi ∈ {0, 1} for i = 1, . . . , 4 Complete Enumeration
Branch-and-Bound
Algorithm
Opt LP(C)
Max 4x1 + 3x2 + 3x3 + 3x4
x ∗ = (1, 0, 0, 0)
s.t. x1 + x2 + x3 + x4 ≤ 1 C zLP = 4
xi ∈ {0, 1} for i = 1, . . . , 4
There was not time in class to cover all of these ideas in Complete Enumeration
any detail. Branch-and-Bound
Algorithm
3.57