You are on page 1of 14

Chapter 12

Integer Programming
Part 2 – B&B Algorithm

Lecturer: Assoc. Prof. HO THANH PHONG

Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong


Solving Integer Programming problem
A. Principle of Branch-And-Bound Algorithm
• We have Solution Space; we don’t know where is optimal value O.
We have to find out point O by apply principle divide-and-conquer.
• Algorithm consists of two steps and repeated: Branching and
Bounding
• Branching: use relevant methods and techniques, number of
branches may be > 2
• Bounding: Finding an upper limit for Maximization problem and
a lower limit for Minimize problem
• Maximization: Upper 𝐵𝑜𝑢𝑛𝑑 𝑘 ≥ 𝑂𝑝𝑡𝑖. 𝑣𝑎𝑙𝑢𝑒 𝑂
• Minimization: Lower 𝐵𝑜𝑢𝑛𝑑 𝑘 ≤ 𝑂𝑝𝑡𝑖. 𝑣𝑎𝑙𝑢𝑒 𝑂
SS
1 Solution
x x
x
x
O?

Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong


Solving Integer Programming problem (Contd.)
A. Principle of Branch-Anh-Bound Algorithm) (TT)
• Selecting Branch
• Maximization: Select branch has largest Bound
• Minimization: Select branch has smallest Bound
• Not selecting branch that is infeasible
• Not selecting branch that bound is worst than the current best (incumbent).
Example: Bài toán Maximization, there are 2 branches, each with Bound as B1=10 and
B2=15. Now we're going to choose branch 2 and we don't need to look at branch 1
anymore. If you don't choose branch 2, what happens?
SS, Maximization
Selected branch
Bound
B1 = 10
B2 = 15
O?

• Choose a branch and continue the branching process, find bound, select the branch
until the optimal solution is identified.

Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong


Solving Mixed Integer Programming problem (Contd.)
A. Algorithm Branch-And-Bound (contd.)
1. Iteration 0:
- Distinguish remaining problem is the current solving problem, fathomed problem is the
confirmed and clear problem, is not need to be further considered.
- First, solve the relaxation problem: Solve the original problem with relaxation constraints:
eg. delete integer constraints.
• If no Solution then Stop, the relaxation have no solution means the original problem have
no solution.
• If there is a solution that satisfies the integer condition, stopped, the problem has been
confirmed (fathomed). If the integer condition is not met, then continue.

2. Branching
In the remaining problems, selecting the branching variable is the first variable in the list
that does not meet the integer conditions, 𝑥𝑗 , value is 𝑥𝑗∗ , integer part is 𝑥𝑗∗ . Divide into
2 branches by creating 2 sub-problems BT1 and BT2

- BT1: original constraints and adding constraint 𝒙𝒋 ≤ 𝒙∗𝒋


- BT2: original constraints and adding constraint 𝒙𝒋 ≥ 𝒙∗𝒋 + 𝟏

Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong


Solving Mixed Integer Programming problem (Contd.)
A. Algorithm Branch-And-Bound (contd.)
3. Bounding: For each new subproblem, obtain its bound by applying the
simplex method to its LP relaxation and using the value of Z for the resulting
optimal solution.
4. Fathoming: For each new subproblem, apply the three fathoming tests
given below, and discard those subproblems that are fathomed by any of the
tests.
Test 1: Its bound ≤ Z*, where Z* is the value of Z for the current optimal
incumbent.
Test 2: Its LP relaxation has no feasible solutions.
Test 3: The optimal solution for its LP relaxation has integer values for the
integer-restricted variables. If this solution is better than the incumbent, it
becomes the new incumbent and test 1 is reapplied to all unfathomed
subproblems with the new larger Z*.

Optimal conditions: The program stops when there are no more unconfirmed
sub-problems. Value of incumbents are the optimal value.

Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong


Solving Mixed Integer Programming problem (Contd.)
A. Algorithm Branch-And-Bound (contd.)
Example Branch And Bound Algorithm
Original
problem
Incumbent
Z*

Sub Sub
problem 1 problem 2

Bound B1 Bound B2
B2 < Z*: fathomed

B11 > B12 Sub Sub


problem 11 problem 12 B12 > Z*: new incumbent
Bound B11 Bound B12 Z* = B12
Z*=B12

B111 > Z* Sub Sub


New incumbent problem 111 problem 112 B112 < Z*
Bound Bound
B111 B112
Fathomed
Solving Mixed Integer Programming problem (Contd.)
B. Example MIP problem
A MIP is given
Max. Z = 4𝑥1 − 2𝑥2 + 7𝑥3 − 𝑥4
Sub. to:
𝑥1 +5𝑥3 ≤ 10;
𝑥1 + 𝑥2 − 𝑥3 ≤1;
6𝑥1 −5𝑥2 ≤0;
−𝑥1 + 2𝑥3 − 2𝑥4 ≤ 3;
𝑥1 , 𝑥2 , 𝑥3 : 𝑖𝑛𝑡𝑒𝑔𝑒𝑟
𝑥4 : 𝑟𝑒𝑎𝑙

Iteration 0: Solve the original problem with relaxation constraints: delete integer
constraints
Solutions: (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (1.25, 1.5, 1.75, 0), Z= 14.25; Let Z* = -∞.
Because solution 𝑥1 , 𝑥2 , 𝑥3 are not satisfied integer condition➔ Not fathomed, continue.
Iteration 1:
Select branching variable is 𝑥1 . Current value 𝑥1 =1.25, 𝑥1 = 1 create two sub-problems
BT1 and BT2
- BT1: Original problem + constraint 𝑥1 ≤ 1
- BT2: Original problem + constraint 𝑥1 ≥ 2

Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong


Giải bài toán Qui hoạch Nguyên (TT)
- BT1: Original problem + constraint 𝑥1 ≤ 1. Solutions (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (1, 1.2, 1.8, 0), Z
= 14.2 = Bound B1.
- BT2: Original problem + constraint 𝑥1 ≥ 2, infeasible. Delete this branch (fathomed)
Iteration 2:
Select 𝑥2 is branching variable, value 𝑥2 = 1.2, branching two sub-problem BT11 and BT12
- BT11: Original problem + (𝑥1 ≤ 1) + (𝑥2 ≤ 1). Solutions (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (0.83, 1, 1.83,
0), Z = 14.17 = Bound B11. Not satisfy integer condition, B11 > Z* ➔ not fathomed.
- BT12: Original problem + (𝑥1 ≤ 1) + (𝑥2 ≥ 2). Solutions (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (0.83, 2, 1.83,
0), Z = 12.17 = Bound B12. Not satisfy integer condition, B11 > Z* ➔ not fathomed.
We select branch BT11 to continue because Bound B11 > Bound B12.

Iteration 3:
Select 𝑥3 is branching variable, value 𝑥3 = 1.83, branching two sub-problem BT111 and
BT112
- BT111: Original problem + (𝑥1 ≤ 1) + (𝑥2 ≤ 1) + (𝑥3 ≤ 1). Give a solution
(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (0.83, 1, 1, 0), Z = 8.33 = Bound B111. Not satisfy integer condition,
B111 > Z* ➔ not fathomed.
- BT112: Original problem + (𝑥1 ≤ 1) + (𝑥2 ≤ 1) + (𝑥3 ≥ 2). Give a solution
(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (0, 0, 2, 0.5), Z = 13.5. Satisfy integer condition, Z*=13.5 incumbent.
Stop because it reaches optimal condition, this is final solution of the problem.

Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong


Giải bài toán Qui hoạch Nguyên (TT)
Example Branch And Bound Algorithm
Original
problem
Incumbent
Z*=− ∞

Sub
(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (1, 1.2, 1.8, 0) problem Sub
Z = 14.2 = Bound B1. BT1 problem 2 Infeasible
𝑥1 ≤ 1 𝑥1 ≥ 2

Sub Sub
(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (0.83, 1, 1.83, 0) problem 11
Z = 14.17 = Bound B11. problem 12 (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (0.83, 2, 1.83, 0)
𝑥1 ≤ 1 𝑥1 ≤ 1 Z = 12.17 = Bound B12.
B11 > B12 ➔ Select branch 11 𝑥2 ≤ 1 𝑥2 ≥ 2

(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (0.83, 1, 1, 0) Sub problem Sub problem 112


Z = 8.33 = Bound B111 111 (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (0, 0, 2, 0.5)
𝑥1 ≤ 1
𝑥1 ≤ 1 𝑥2 ≤ 1 Z = 13.5 = Z*. Optimal !
𝑥2 ≤ 1 𝑥3 ≥ 2
𝑥3 ≤ 1
Solving Mixed Binary Integer Programming (BIP) problem

B. Example Branch-And-Bound to solve Mixed BIP (includes binary & real variables).
A Mixed BIP is given
Max. Z = 4𝑥1 + 2𝑥2 + 7𝑥3 − 2𝑥4
Ràng buộc:
𝑥1 +5𝑥3 ≤ 5;
𝑥2 + 𝑥3 ≤2;
3𝑥1 +3𝑥2 +5𝑥3 ≤8;
−𝑥1 + 3𝑥3 − 2𝑥4 ≤ 2;
𝑥1 , 𝑥2 , 𝑥3 : 𝑏𝑖𝑛𝑎𝑟𝑦
𝑥4 : 𝑟𝑒𝑎𝑙

Iteration 0: Solve the original problem with relaxation constraints: delete binary integer
constraints
Solution: (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (1.5, 0, 0.7, 0), Z= 10.9; Let Z* = -∞.
Because 𝑥1 , 𝑥2 , 𝑥3 not satisfying integer conditions ➔ Not fathomed, continue.

Iteration 1: Because binary values, we create two branches only with x = 0 and x = 1.
Select branching variable is 𝑥1 . Current value is 𝑥1 =1.5, creating 2 sub-problems BT1 & BT2
- BT1: submit 𝑥1 = 1 into original problem.
- BT2: submit 𝑥1 = 0 into original problem
Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong
Giải bài toán Qui hoạch Nguyên (TT)
BT1 (𝑥1 = 1):
Max. Z = 4 + 2𝑥2 + 7𝑥3 − 2𝑥4
Ràng buộc:
5𝑥3 ≤ 4;
𝑥2 + 𝑥3 ≤2;
3𝑥2 +5𝑥3 ≤ 5;
3𝑥3 − 2𝑥4 ≤ 3;
𝑥2 , 𝑥3 : 𝑏𝑖𝑛𝑎𝑟𝑦; 𝑥4 : 𝑟𝑒𝑎𝑙
Lời giải relaxation, bỏ điều kiện binary: (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (1, 0.33, 0.8, 0)
Z = 6.27+4 = 10.27 = Bound B1.
BT2 (𝑥1 = 0):
Max. Z = 2𝑥2 + 7𝑥3 − 2𝑥4
Ràng buộc:
5𝑥3 ≤ 5;
𝑥2 + 𝑥3 ≤2;
3𝑥2 +5𝑥3 ≤8;
3𝑥3 − 2𝑥4 ≤ 2;
𝑥2 , 𝑥3 : 𝑏𝑖𝑛𝑎𝑟𝑦; 𝑥4 : 𝑟𝑒𝑎𝑙
Lời giải relaxation, bỏ điều kiện binary: (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (0, 1, 1, 0.5), Z = 8. Lời giải này
thỏa điều kiện binary nên là lời giải tối ưu hiện tại (incumbent), Z* =8 (nhánh này xác
nhận - fathomed).
Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong
Giải bài toán Qui hoạch Nguyên (TT)
Selec branch BT1 for branching. Select 𝑥2 as branching variable; Two branches:
BT11: BT1 + 𝑥2 = 1 and BT12: BT1 + 𝑥2 = 0.

BT11 (𝑥1 = 1, 𝑥2 = 1):


Max. Z = 6 + 7𝑥3 − 2𝑥4
Subject to:
5𝑥3 ≤ 4; Solution of relaxation problem, delete binary:
𝑥3 ≤ 1; (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (1, 1, 0.4, 0)
5𝑥3 ≤ 2; Z = 6+2.8 = 8.8 = Bound B11.
3𝑥3 − 2𝑥4 ≤ 3;
𝑥3 : 𝑏𝑖𝑛𝑎𝑟𝑦; 𝑥4 : 𝑟𝑒𝑎𝑙

BT12 (𝑥1 = 1, 𝑥2 = 0):


Solution of relaxation problem, delete binary :
Max. Z = 4 + 7𝑥3 − 2𝑥4
(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (1, 0, 0.8, 0)
Subject to :
Z = 4+5.6 = 9.6 = Bound B12.
5𝑥3 ≤ 4;
𝑥3 ≤2;
Because both 2 branched not fathomed and Bound
5𝑥3 ≤5;
B12 > Bound B11, select branch BT12 to continue.
3𝑥3 − 2𝑥4 ≤ 3;
𝑥3 : 𝑏𝑖𝑛𝑎𝑟𝑦; 𝑥4 : 𝑟𝑒𝑎𝑙

Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong


Giải bài toán Qui hoạch Nguyên (TT)
Select branch BT12 for branching. Select 𝑥3 as branching variable; Two branched :
BT121: BT11 + 𝑥3 = 1 and BT122: BT12 + 𝑥3 = 0.

BT121 (𝑥1 = 1, 𝑥2 = 0, 𝑥3 = 1):


Max. Z = 11 − 2𝑥4
Subject to :
5𝑥3 ≤ 4; Infeasible.
𝑥3 ≤2;
5𝑥3 ≤5;
3𝑥3 − 2𝑥4 ≤ 3;
𝑥4 : 𝑟𝑒𝑎𝑙;

BT122 (𝑥1 = 1, 𝑥2 = 0, 𝑥3 = 0):


Max. Z = 4 − 2𝑥4 Solution (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (1, 0, 0, 0)
Subject to : Z = 4. Bound B122 = 4. Vì B122 < Z* = 8: fathomed
−2𝑥4 ≤ 3;
𝑥4 : 𝑟𝑒𝑎𝑙
Because both two branched have fathomed, stop. Optimal solution for current problem is
incumbent Z* =8 corresponding (𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) = (0, 1, 1, 0.5).

With the Pure BIP problem, the solving procedure is the same as this algorithm.

Operations Research – Deterministic Model Assoc. Prof. Hồ Thanh Phong


Exercises
Text book: Introduction to Operations Research. F. Hillier & G. Lierberman.
Page 534
12.1- 1, 2, 4, 6
12.3- 1, 2, 3, 4, 5
12.4- 1, 5, 6, 7
12.5- 2, 3, 4
12.6- 2, 3
12.7- 2, 3, 7, 9, 10

You might also like