Optimization-L4-6 (Integer Programming)
Optimization-L4-6 (Integer Programming)
BITS Pilani
Pilani Campus
Outline
• Introduction
• Integer Linear Programming
– Branch-and-Bound (B&B)
– Cutting-plane
2
Introduction
3
Integer Programming
• Decision variables only have integer values.
– When assigning people, machines, and vehicles to activities
• Requiring integers is the only way in which an IP
deviates from an LPP.
– Mixed integer programming.
– Pure integer programming.
4
Integer Programming (Ex. 9.1-1)
Capital budgeting: Five projects are being evaluated over a 3-year
planning horizon. The following table gives the expected returns for
each project and the associated yearly expenditures:
Subject to:
5x1 + 4x2 + 3x3 + 7x4 + 8x5 ≤ 25 (Y1 Funds)
1x1 + 7x2 + 9x3 + 4x4 + 6x5 ≤ 25 (Y2 Funds)
8x1 + 10x2 + 2x3 + 1x4 + 10x5 ≤ 25 Y3 Funds
xi = {0,1}
6
Integer Programming (Ex. 9.1-1)
Maximize:
20x1 + 40x2 + 20x3 + 15x4 + 30x5
Subject to:
5x1 + 4x2 + 3x3 + 7x4 + 8x5 ≤ 25 (Y1 Funds)
1x1 + 7x2 + 9x3 + 4x4 + 6x5 ≤ 25 (Y2 Funds)
8x1 + 10x2 + 2x3 + 1x4 + 10x5 ≤ 25 Y3 Funds
xi = {0,1}
IP solution: x1 = x2 = x3 = x4 = 1, x5 = 0 ⇒ z = 95
8
Integer Programming
• Fixed-charge problem (Ex. 9.1-3)
• Either-Or and If-Then Constraints (Ex. 9.1-4)
9
Cutting-Plane
Method
10
Cutting-Plane Method
• Starts at the continuous optimum LP solution
• Special constraints (called cuts) added to the solution
space that render an integer optimum extreme point.
11
Cutting-Plane Method (Ex. 9.2-2)
Maximize: z = 7x1 + 10x2
Subject to:
−x1 + 3x2 ≤ 6
−7x1 + 3x2 ≤ 35
x1 , x2 ≥ 0 and integer
12
Cutting-Plane Method (Ex. 9.2-2)
Maximize: z = 7x1 + 10x2 Maximize: z = 7x1 + 10x2
13
Cutting-Plane Method (Ex. 9.2-2)
Maximize: z = 7x1 + 10x2
Subject to:
−x1 + 3x2 + x3 = 6
−7x1 + 3x2 + x4 = 35
x1 , x2 ≥ 0 and integer
x3 , x4 ≥ 0 and integer
14
Cutting-Plane Method (Ex. 9.2-2)
Optimum LP Tableau:
15
Cutting-Plane Method (Ex. 9.2-2)
Take constraint no. 2 (any constraint with fractional RHS)
Constraint:
1 3 1
x1 − x3 + x4 = 4
22 22 2
Factor all non-integer coefficients into an integer value and a
positive fractional component (less than 1)
1 21
− = −1 +
22 22
3 3
=0+
22 22
1 1
4 =4+
2 2
16
Cutting-Plane Method (Ex. 9.2-2)
Take constraint no. 2 (any constraint with fractional RHS)
Constraint:
21 3 1
1 x1 + −1 + x3 + 0 + x4 = 4 +
22 22 2
21 3 1
⇒ x1 − x3 + x3 + x4 = 4 +
22 22 2
Thus,
21 3 1 1 1
x3 + x4 = or 1 or 2 or …
22 22 2 2 2
17
Cutting-Plane Method (Ex. 9.2-2)
Thus,
21 3 1 1 1
x3 + x4 = or 1 or 2 or …
22 22 2 2 2
21 3 1
⇒ x3 + x4 ≥
22 22 2
21 3 1
⇒ x3 + x4 − s1 = Gomory’s
22 22 2
Fractional
s1 ≥ 0 Cut
s1 has to be an integer
Constraint:
7 1 1
x2 + x3 + x4 = 3
22 22 2
Factor all non-integer coefficients into an integer value and a
positive fractional component (less than 1)
7 7
=0+
22 22
1 1
=0+
22 22
1 1
3 =3+
2 2
19
Cutting-Plane Method (Ex. 9.2-2)
Take constraint no. 1
Constraint:
7 1 1
1 x2 + 0 + x3 + 0 + x4 = 3 +
22 22 2
7 1 1
⇒ x2 + x3 + x4 = 3 +
22 22 2
Thus,
7 1 1 1 1 1
x3 + x4 = or 1 or 2 or 3
22 22 2 2 2 2
20
Cutting-Plane Method (Ex. 9.2-2)
Thus,
7 1 1 1 1 1
x3 + x4 = or 1 or 2 or 3
22 22 2 2 2 2
7 1 1
⇒ x3 + x4 ≥
22 22 2
7 1 1
⇒ x3 + x4 − s1 =
22 22 2
s1 ≥ 0
s1 has to be an integer
Basic x𝟏 x𝟐 x3 x𝟒 𝐬𝟏 Solution
63 31 1
z 0 0 0 66
22 22 2
7 1 1
x𝟐 0 1 0 3
22 22 2
1 3 1
x1 1 0 − 0 4
22 22 2
7 1 1
s1 0 0 − − 1 −
22 22 2
22
Cutting-Plane Method (Ex. 9.2-2)
Basic x𝟏 x𝟐 x3 x𝟒 𝐬𝟏 Solution
63 31 1
z 0 0 0 66
22 22 2
7 1 1
x𝟐 0 1 0 3
22 22 2
1 3 1
x1 1 0 − 0 4
22 22 2
7 1 1
s1 0 0 − − 1 −
22 22 2
23
Cutting-Plane Method (Ex. 9.2-2)
• Decide leaving and entering variables
Basic x𝟏 x𝟐 x3 x𝟒 𝐬𝟏 Solution
63 31 1
z 0 0 0 66
22 22 2
7 1 1
x𝟐 0 1 0 3
22 22 2
1 3 1
x1 1 0 − 0 4
22 22 2
7 1 1
s1 0 0 − − 1 −
22 22 2
24
Cutting-Plane Method (Ex. 9.2-2)
• Optimal tableau
Basic x𝟏 x𝟐 x3 x𝟒 𝐬𝟏 Solution
z 0 0 0 1 9 62
x𝟐 0 1 0 0 1 3
1 1 4
x1 1 0 0 − 4
7 7 7
1 22 4
x3 0 0 1 − 1
7 7 7
25
Cutting-Plane Method (Ex. 9.2-2)
• Optimal tableau
Basic x𝟏 x𝟐 x3 x𝟒 𝐬𝟏 Solution
z 0 0 0 1 9 62
x𝟐 0 1 0 0 1 3
1 1 4
x1 1 0 0 − 4
7 7 7
1 22 4
x3 0 0 1 − 1
7 7 7
26
Cutting-Plane Method (Ex. 9.2-2)
• Final solution
Basic x𝟏 x𝟐 x3 x𝟒 𝐬𝟏 𝐬𝟐 Solution
z 0 0 0 0 3 7 58
x𝟐 0 1 0 0 1 0 3
x1 1 0 0 0 −1 1 4
x3 0 0 1 0 −4 1 1
x4 0 0 0 1 6 −7 4
27
B&B Method
28
B&B Method
Maximize:
z = 5x1 + 4x2
Subject to:
x1 + x2 ≤ 5
10x1 + 6x2 ≤ 45
xi ≥ 0 and integers
29
B&B Method
Maximize: z = 5x1 + 4x2
Subject to: x1 + x2 ≤ 5, 10x1 + 6x2 ≤ 45
30
B&B Method
Maximize: z = 5x1 + 4x2
Subject to: x1 + x2 ≤ 5, 10x1 + 6x2 ≤ 45
LP1 space + 𝐱 𝟐 ≥ 𝟐
LP1 space + 𝐱 𝟐 ≤ 𝟏
31
B&B Method
Branching from LP1 space:
Branching
variable
35
Integer Programming (Examples)
• Fixed-charge problem (Ex. 9.1-3)
• Either-Or and If-Then Constraints (Ex. 9.1-4)
36
Fixed charge problem
Sitka Manufacturing is planning to build at least one new plant and
three cities are being considered in: Baytown, Lake Charles, and
Dayton. Once the plant or plants are built, the company want to
have capacity to produce at least 38,000 units each year.
37
Fixed charge problem
Decision variables:
38
Fixed charge problem
Formulate the objective function
Minimize:
340,000f1 + 270,000f2 + 290,000f3 +
32x1 + 33x2 + 30x3
39
Fixed charge problem
Formulate the constraints
Variable cost Annual
Site Annual fixed cost
(per unit) capacity
Baytown, TX $340,000 $32 21,000
Lake Charles, LA $270,000 $33 20,000
Dayton, OH $290,000 $30 19,000
Subject to:
x1 + x2 + x3 ≥ 38,000 (reqd. units)
x1 ≤ 21,000f1 (Max capacity)
x2 ≤ 20000f2 (Max capacity)
x3 ≤ 19,000f3 (Max capacity)
f1 , f2 , f3 = {0,1}
x1 , x2 , x3 ≥ 0 and integer
Optimal:
f1 = 0, f2 = 1, f3 = 1, x1 = 0, x2 = 19,000, x3 = 19,000
41
Either-Or Constraints
Suppose that one of the requirements in the overall problem is that
Either:
3x1 + 2x2 ≤ 18
Or
x1 + 4x2 ≤ 16
How will you add this as a constraint in an LPP/IP?
42
Either-Or Constraints
Suppose that one of the requirements in the overall problem is that
Either:
3x1 + 2x2 ≤ 18
Or
x1 + 4x2 ≤ 16
How will you add this as a constraint in an LPP/IP?
3x1 + 2x2 ≤ 18 + My
and
x1 + 4x2 ≤ 16 + M(1 − y)
where y is either 0 or 1.
43
If-Then Constraints
Suppose that one of the requirements in the overall problem is that
If:
3x1 + 2x2 ≤ 18
Then
x1 + 4x2 ≤ 16
How will you add this as a constraint in an LPP/IP?
44
If-Then Constraints
Suppose that one of the requirements in the overall problem is that
If:
C1 : 3x1 + 2x2 ≤ 18
Then
C2 : x1 + 4x2 ≤ 16
Equivalent to C1
Either:
C2
C2 : x1 + 4x2 ≤ 16
Or
C1 ′: 3x1 + 2x2 > 18
45
If-Then Constraints
Suppose that one of the requirements in the overall problem is that
If:
3x1 + 2x2 ≤ 18
Then
x1 + 4x2 ≤ 16
Equivalent to C1
Either:
C2
x1 + 4x2 ≤ 16
Or
3x1 + 2x2 ≥ 18 + ε
46
If-Then Constraints
Suppose that one of the requirements in the overall problem is that
If:
3x1 + 2x2 ≤ 18
Then
x1 + 4x2 ≤ 16
Equivalent to
Either:
x1 + 4x2 ≤ 16
Or
−3x1 − 2x2 ≤ −18 − ε
47
If-Then Constraints
Suppose that one of the requirements in the overall problem is that
Either:
x1 + 4x2 ≤ 16
Or
−3x1 − 2x2 ≤ −18 − ε
x1 + 4x2 ≤ 16 + My
and
−3x1 − 2x2 ≤ −18 − ε + M(1 − y)
49
Problem 9-30.
Decision variables:
50
Problem 9-30.
Formulate the objective:
Minimize:
2x11 + x12 + 8x13 + 5x14 + 4x21 + 6x22 + 3x23 + x24 +
5s1 + 6s2
51
Problem 9-30.
Formulate the constraints:
x11 + x21 = 1 (reach taget 1)
x12 + x22 = 1 (reach taget 2)
x13 + x23 = 1 (reach taget 3)
x14 + x24 = 1 (reach taget 4)
x11 + x12 + x13 + x14 ≤ Ms1
x21 + x22 + x23 + x24 ≤ Ms2
Optimal:
x11 = 1, x12 = 1, x23 = 1, x24 = 1, and z = 18
52
Problem 9-23.
Bill wants to celebrate by seeing every movie showing in theaters at
least once. If he travels to another town, he will see all the movies
being offered (regardless of repetitions). The table provides the
information about the movie offerings and the round-trip distance
to the neighboring town:
The cost of driving is 0.75$ per mile. Bill wishes to determine the
towns he needs to visit while minimizing his total cost.
53
Problem 9-23.
Decision variables:
• xj = 0 or 1: if town j is visited
54
Problem 9-23.
Formulate the objective.
Minimize:
Cost = 0x1 + 25 × 0.75 × x2 + 30 × 0.75 × x3 + ⋯ +
2 × 7.95 × x1 + 3 × 5.5 × x2 + ⋯
55
Problem 9-23.
Subject to:
x1 + x2 + x4 + x6 ≥ 1 (movie 1)
x3 + x5 ≥ 1 (movie 2)
x1 + x6 ≥ 1 (movie 3)
57
Cutting-Plane Method (Ex. 9.2-2)
Basic x𝟏 x𝟐 x3 x𝟒 𝐬𝟏 Solution
63 31 1
z 0 0 0 66
22 22 2
7 1 1
x𝟐 0 1 0 3
22 22 2
1 3 1
x1 1 0 − 0 4
22 22 2
7 1 1
s1 0 0 − − 1 −
22 22 2
58