ENGR 3157-Operations Research-Lecture 09-IntegerProgramming
ENGR 3157-Operations Research-Lecture 09-IntegerProgramming
ENGR 3157
Lecture 09 – Integer Programming
Office: F220
Tel: 705-675-1151 ext. 2195
Email: [email protected]
2
Recall: Types of Mathematical Programming
1
3
MILP – Mine Production Scheduling
• Objective function: Maximize Net Present Value
T N
Max v nt × x nt - q nt × y nt
t=1 n=1
• Constraints N
– Mining Tl on wn ynt Tut
t
n 1
N
– Processing Tl on xnt Tut
t
n=1
– Blocks extraction precedence
4
A Simple LP Problem1
2 from, R. Fourer, D. Gay, B. Kernighan, AMPL, Boyd & Fraser, 1993, pp. 2-10.
2
5
A Simple LP Problem – Solution
• Formulation:
Maximize: 25 xB 30 xC
0 xB 6000
0 xC 4000
6
A Simple LP Problem – Solution (2)
Coils
Coils
Constraints Profit
6000 6000
Hours
192K
4000 4000
Optimal solution
Bands 0 Bands
0
0 2000 4000 6000 8000 0 2000 4000 6000 8000
Optimal Solution:
Bands = 6000
Coils = 1400
3
7
Expressed as an ILP Problem
• Assume that orders for bands and coils are placed (and
filled) in truckloads of 1,000s of tons only
0 xC 4 integer
8
Expressed as an ILP Problem (2)
• Solving graphically:
Coils
6 $185K
2
Feasible integer solutions
0 Bands
0 2 4 6 8
4
9
Fixed-Charge ILP Problems
10
In-Class Problem – Fixed-Charge ILP Problem
5
11
1/0 ILP Problems with Logical Constraints
12
Formulating Logical Constraints
6
13
Formulating Logical Constraints (2)
14
In-Class Problem – Logical Constraints
7
15
Formulating Either-Or Constraints
16
Formulating If-Then Constraints
8
17
In-Class Problem – Either-Or and If-Then
18
Formulating Piecewise Linear Costs
0
0 2 4 6 8 10 12
9
19
Formulating Piecewise Linear Costs (2)
20
In-Class Problem – Piecewise Linear Costs
10
21
Solving ILP Problems: Branch-and-Bound
22
Solving ILP Problems: Branch-and-Bound (2)
11
23
Solving ILP Problems: Branch-and-Bound (3)
24
Example – Branch and Bound
Solution Bounds
LP relaxation of 1
Obj. = 151 0 x1 10
original problem x1 = 3.4 0 x2 10
x2 = 6.8
1
Bounds x1
0 x1 3 Bounds
0 x2 10 4 x1 10 10
2 3
0 x2 10 9
8
7
6
5
4
3
2
1 x2
0
0 1 2 3 4 5 6 7 8 9 10
12
25
Example – Branch and Bound (2)
Solution Bounds
1
Obj. = 151 0 x1 10
x1 = 3.4 0 x2 10
1 x2 = 6.8
2
Solution Bounds x1
Obj. = 156 0 x1 3 Bounds
x1 = 2.4 0 x2 10 4 x1 10 10
2 3
x2 = 7.6 0 x2 10 9
8
7
Bounds 6
Bounds 0 x1 3 5
0 x1 3 8 x2 10
0 x2 7 4 5 4
3
2
1 x2
0
0 1 2 3 4 5 6 7 8 9 10
26
Example – Branch and Bound (3)
Solution Bounds
1
Obj. = 151 0 x1 10
x1 = 3.4 0 x2 10
1 x2 = 6.8
4
Solution Bounds x1
Obj. = 156 0 x1 3 Bounds
x1 = 2.4 0 x2 10 4 x1 10 10
2 3
x2 = 7.6 0 x2 10 9
8
2 7
Bounds 6
Solution Bounds 0 x1 3 5
Obj. = 169 0 x1 3 8 x2 10
x1 = 3.0 0 x2 7 4 5 4
x2 = 6.0 3
Integer Solution 2
1 x2
0
0 1 2 3 4 5 6 7 8 9 10
13
27
Example – Branch and Bound (4)
Solution Bounds
1
Obj. = 151 0 x1 10
x1 = 3.4 0 x2 10
1 x2 = 6.8
5
Solution Bounds x1
Obj. = 156 0 x1 3 Bounds
x1 = 2.4 0 x2 10 4 x1 10 10
2 3
x2 = 7.6 0 x2 10 9
8
2 7
3 4 Solution Bounds 6
Solution Bounds Obj. = 162 0 x1 3 5
Obj. = 169 0 x1 3 x1 = 2.9 8 x2 10
x1 = 3.0 0 x2 7 4 5 4
x2 = 8.0
x2 = 6.0 3
Integer Solution 2
1 x2
0
0 1 2 3 4 5 6 7 8 9 10
28
Example – Branch and Bound (5)
Solution Bounds
1
Obj. = 151 0 x1 10
x1 = 3.4 0 x2 10
1 x2 = 6.8
6
Solution Bounds x1
Obj. = 156 0 x1 3 Bounds
x1 = 2.4 0 x2 10 4 x1 10 10
2 3
x2 = 7.6 0 x2 10 9
8
2 7
3 4 Solution Bounds 6
Solution Bounds Obj. = 162 0 x1 3 5
Obj. = 169 0 x1 3 x1 = 2.9 8 x2 10
x1 = 3.0 0 x2 7 4 5 4
x2 = 8.0
x2 = 6.0 3
Integer Solution
5
2
1 x2
Solution Bounds Bounds 0
Obj. = 164 0 x1 2 3 x1 3 0 1 2 3 4 5 6 7 8 9 10
x1 = 1.9 8 x2 10 6 7 8 x2 10
x2 = 8.4
14
29
Example – Branch and Bound (6)
Solution Bounds
1
Obj. = 151 0 x1 10
x1 = 3.4 0 x2 10
1 x2 = 6.8
8
Solution Bounds x1
Obj. = 156 0 x1 3 Bounds
x1 = 2.4 0 x2 10 4 x1 10 10
2 3
x2 = 7.6 0 x2 10 9
8
2 7
3 4 Solution Bounds 6
Solution Bounds Obj. = 162 0 x1 3 5
Obj. = 169 0 x1 3 x1 = 2.9 8 x2 10
x1 = 3.0 0 x2 7 4 5 4
x2 = 8.0
x2 = 6.0 3
Integer Solution
5
2
1 x2
Solution Bounds Bounds 0
Obj. = 164 0 x1 2 3 x1 3 0 1 2 3 4 5 6 7 8 9 10
x1 = 1.9 8 x2 10 6 7 8 x2 10
x2 = 8.4
6
Solution Bounds
Obj. = 166 0 x1 2
x1 = 2.0 8 x2 8 Bounds
x2 = 8.0 0 x1 2
8 9
Integer Solution 9 x2 10 Source: J. Doucette, Ph.D. Thesis, UofA, 2004
30
Example – Branch and Bound (7)
Solution Bounds
1
Obj. = 151 0 x1 10
x1 = 3.4 0 x2 10
1 x2 = 6.8
Solution Bounds x1
Obj. = 156 0 x1 3 Bounds
x1 = 2.4 0 x2 10 4 x1 10 10
2 3
x2 = 7.6 0 x2 10 9
8
2 7
3 4 Solution Bounds 6
Solution Bounds Obj. = 162 0 x1 3 5
Obj. = 169 0 x1 3 x1 = 2.9 8 x2 10
x1 = 3.0 0 x2 7 4 5 4
x2 = 8.0
x2 = 6.0 3
Integer Solution
5
2
1 x2
Solution Bounds 0
Obj. = 164 0 x1 2 0 1 2 3 4 5 6 7 8 9 10
x1 = 1.9 8 x2 10 6 7
x2 = 8.4
6
Solution Bounds
Obj. = 166 0 x1 2 7 8
x1 = 2.0 8 x2 8 Solution Bounds
x2 = 8.0 infeasible 0 x1 2
8 9
Integer Solution 9 x2 10 Source: J. Doucette, Ph.D. Thesis, UofA, 2004
15
31
Example – Branch and Bound (8)
Solution Bounds
1
Obj. = 151 0 x1 10
x1 = 3.4 0 x2 10
1 x2 = 6.8
7
Solution Bounds x1
Obj. = 156 0 x1 3 Bounds
x1 = 2.4 0 x2 10 4 x1 10 10
2 3
x2 = 7.6 0 x2 10 9
8
2 7
3 4 Solution Bounds 6
Solution Bounds Obj. = 162 0 x1 3 5
Obj. = 169 0 x1 3 x1 = 2.9 8 x2 10
x1 = 3.0 0 x2 7 4 5 4
x2 = 8.0
x2 = 6.0 3
Integer Solution
5
2
1 x2
Solution Bounds 10 11
Solution Bounds 0
Obj. = 164 0 x1 2 Obj. = 168 3 x1 3 0 1 2 3 4 5 6 7 8 9 10
x1 = 1.9 8 x2 10 6 7 x1 = 3.0 8 x2 10
x2 = 8.4 x2 = 9.0
Integer Solution
6 9
Solution Bounds
Obj. = 166 0 x1 2 7 8
x1 = 2.0 8 x2 8 Solution Bounds
x2 = 8.0 infeasible 0 x1 2
8 9
Integer Solution 9 x2 10 Source: J. Doucette, Ph.D. Thesis, UofA, 2004
32
Example – Branch and Bound (9)
Solution Bounds
1
Obj. = 151 0 x1 10
x1 = 3.4 0 x2 10
1 x2 = 6.8
3
Solution Bounds 14 15 x1
Obj. = 156 0 x1 3 Solution Bounds
x1 = 2.4 0 x2 10 Obj. = 167 4 x1 10 10
2 3
x2 = 7.6 x1 = 4.0 0 x2 10 9
x2 = 7.4 8
2 13 7
3 4 Solution Bounds 6
Solution Bounds Obj. = 162 0 x1 3 5
Obj. = 169 0 x1 3 x1 = 2.9 8 x2 10
x1 = 3.0 0 x2 7 4 5 4
x2 = 8.0
x2 = 6.0 3
Integer Solution
5 12
2
1 x2
Solution Bounds 10 11
Solution Bounds 0
Obj. = 164 0 x1 2 Obj. = 168 3 x1 3 0 1 2 3 4 5 6 7 8 9 10
x1 = 1.9 8 x2 10 6 7 x1 = 3.0 8 x2 10
x2 = 8.4 x2 = 9.0
Integer Solution
6 9
Solution Bounds
Obj. = 166 0 x1 2 7 8
x1 = 2.0 8 x2 8 Solution Bounds
x2 = 8.0 infeasible 0 x1 2
8 9
Integer Solution 9 x2 10 Source: J. Doucette, Ph.D. Thesis, UofA, 2004
16
33
Example – Branch and Bound (10)
Solution Bounds
1
Obj. = 151 0 x1 10
x1 = 3.4 0 x2 10
1 x2 = 6.8
Solution Bounds 14 15 x1
Obj. = 156 0 x1 3 Solution Bounds
x1 = 2.4 0 x2 10 Obj. = 167 4 x1 10 10
2 3
x2 = 7.6 x1 = 4.0 0 x2 10 9
x2 = 7.4 8
2 13 7
3 4 Solution Bounds 6
Solution Bounds Obj. = 162 0 x1 3 5
Obj. = 169 0 x1 3 x1 = 2.9 8 x2 10
x1 = 3.0 0 x2 7 4 5 4
x2 = 8.0
x2 = 6.0 3
Integer Solution
5 12
2
1 x2
Solution Bounds 10 11
Solution Bounds 0
Obj. = 164 0 x1 2 Obj. = 168 3 x1 3 0 1 2 3 4 5 6 7 8 9 10
x1 = 1.9 8 x2 10 6 7 x1 = 3.0 8 x2 10
x2 = 8.4 x2 = 9.0
Integer Solution
Solution Bounds
6 9 Overall best solution:
Obj. = 166 0 x1 2 7 8
x1 = 2.0 8 x2 8 Solution Bounds
x1 = 2 and x2 = 8
x2 = 8.0 infeasible 0 x1 2
8 9
Integer Solution 9 x2 10 Source: J. Doucette, Ph.D. Thesis, UofA, 2004
34
Branch and Bound Take Home
Max Z = 2x1 x2
Subject to: 5 x1 2 x2 8
x1 x2 3
x1, x2 0; x1 integer
17