Title: Integer Programming
1Integer Programming
Mathematical Programming ModelingENGC 6362
1
2
0-1 0-1 0-1 0-1 0-1 0-1 0-1 0-1 0-1
Lecture 7
Dr. Rifat Rustom
2Integer Programming problem (IP) is an LP in
which some or all of the variables are required
to be nonnegative integers.Pure integer
programming problemAn IP in which all variables
are required to be integers.Mixed integer
programming problemAn IP in which only some of
the variables are required to be integers.0-1
integer programming problemAn IP in which all
variables must equal 0 or 1.
Integer Programming
3Graphical Solution of IP
- Example
- Max 6x1 8x2
- Subject to
- 2) 4x1 6x2 lt 36
- 3) 10x1 7x2 lt 70
- x1 and x2 gt 0 and integer
X2
10
9
10x1 7x2 70
8
7
6
4x1 6x2 36
Step 1 Find the LP relaxation solution x1
5.25 x2 2.50 Z 51.50 (higher upper bound)
5
4
Relaxed optimum (node 1)
3
2
1
1
51.50
Initial Solution x1 5.25 x2 2.50
2
4
6
8
10
1
3
5
7
9
Z
X1
Node 1
4Follow 2 Graphical Solution of IP
Step 2 Select the variable with the largest
fractional part to branch on
X2
10
9
10x1 7x2 70
x1 5.25 x2 2.50 Explore x2 lt 2 or x2 gt 3
8
7
6
4x1 6x2 36
- Sub-problem 1
- For x2 lt 2 (node 2)
- Max 6x1 8x2
- Subject to
- 2) 4x1 6x2 lt 36
- 3) 10x1 7x2 lt 70
- 4 x2 lt 2
- x1 and x2 gt 0 and integer
5
(node 3) solution
4
(node 2) solution
x2 gt 3
3
2
x2 lt 2
1
X1
- Sub-problem 2
- For x2 gt 3 (node 3)
- Max 6x1 8x2
- Subject to
- 2) 4x1 6x2 lt 36
- 3) 10x1 7x2 lt 70
- 4 x2 gt 3
- x1 and x2 gt 0 and integer
2
4
6
8
10
1
3
5
7
9
5Follow 3 Graphical Solution of IP
Step 3 Select the node with the higher upper
bound value (Node 3)
X2
10
9
10x1 7x2 70
Explore x1 lt 4 or x1 gt 5
8
7
- Sub-problem 1
- For x1 lt 4 (node 4)
- Max 6x1 8x2
- Subject to
- 2) 4x1 6x2 lt 36
- 3) 10x1 7x2 lt 70
- 4) x2 gt 3
- 5) x1 lt 4
- x1 and x2 gt 0 and integer
6
4x1 6x2 36
X1 lt 4
X1 gt 5
5
(node 4) solution
4
x2 gt 3
3
(node 5) solution - infeasible
2
1
X1
- Sub-problem 2
- For x1 gt 5 (node 5)
- Max 6x1 8x2
- Subject to
- 2) 4x1 6x2 lt 36
- 3) 10x1 7x2 lt 70
- 4) x2 gt 3
- 5) x1 gt 5
- x1 and x2 gt 0 and integer
2
4
6
8
10
1
3
5
7
9
6Follow 4 Graphical Solution of IP
Step 4 Select the node with the higher upper
bound value (Node 4)
X2
10
9
10x1 7x2 70
Explore x2 lt 3 or x2 gt 4
8
7
- Sub-problem 1
- For x2 lt 3 (node 6)
- Max 6x1 8x2
- Subject to
- 2) 4x1 6x2 lt 36
- 3) 10x1 7x2 lt 70
- 4) x2 gt 3
- 5) x1 lt 4
- 6) x2 lt 3
- x1 and x2 gt 0 and integer
6
4x1 6x2 36
(node 7) solution
X1 lt 4
5
x2 gt 4
4
(node 6) solution
x2 3
3
2
1
X1
- Sub-problem 2
- For x2 gt 4 (node 7)
- Max 6x1 8x2
- Subject to
- 2) 4x1 6x2 lt 36
- 3) 10x1 7x2 lt 70
- 4) x2 gt 3
- 5) x1 gt 5
- 6) x2 gt 4
- x1 and x2 gt 0 and integer
2
4
6
8
10
1
3
5
7
9
x1 5.25 x2 2.50
1
51.50
x2 gt 3
x2 lt 2
3
2
x1 4.50 x2 3
x1 5.60 x2 2
51.00
49.60
x1 lt 4
4
5
x1 gt 5
50.67
infeasible
x1 4 x2 3.33
7Optimum Solution of IP
- Max 6x1 8x2
- Subject to
- 2) 4x1 6x2 lt 36
- 3) 10x1 7x2 lt 70
- x1 and x2 gt 0 and integer
x1 5.25 x2 2.50
1
51.50
x2 gt 3
x2 lt 2
3
2
x1 4.50 x2 3
x1 5.60 x2 2
51.00
49.60
- Optimum solution is found when two
- conditions are met
- A node consists of all integer values, or in the
case of a mixed-integer problem, the variables
that are required to be integer are all integers - No other node at a branch end has a higher upper
bound
x1 lt 4
x1 gt 5
5
4
50.67
x1 4 x2 3.33
infeasible
x2 gt 4
x2 lt 3
7
6
48
50
x1 3 x2 4
x1 4 x2 3
Optimum
8Computer Solution
LP OPTIMUM FOUND AT STEP 13 OBJECTIVE VALUE
51.5000000 SET X2 TO gt 3 AT
1, BND 51.00 TWIN 49.60 18 SET
X1 TO lt 4 AT 2, BND 50.67
TWIN-0.1000E31 20 SET X2 TO gt 4
AT 3, BND 50.00 TWIN 48.00
22 NEW INTEGER SOLUTION OF 50.0000000 AT
BRANCH 6 PIVOT 22 BOUND ON OPTIMUM
50.00000 DELETE X2 AT LEVEL 3 DELETE
X1 AT LEVEL 2 DELETE X2 AT LEVEL
1 ENUMERATION COMPLETE. BRANCHES 6
PIVOTS 22 LAST INTEGER SOLUTION IS THE
BEST FOUND RE-INSTALLING BEST SOLUTION...
OBJECTIVE FUNCTION VALUE 1)
50.00000 VARIABLE VALUE
REDUCED COST X1 3.000000
-6.000000 X2 4.000000
-8.000000 ROW SLACK OR SURPLUS
DUAL PRICES 2) 0.000000
0.000000 3) 12.000000
0.000000 NO. ITERATIONS 22 BRANCHES
6 DETERM. 1.000E 0
9Formulating Integer Programming Problems
- Either- Or Alternatives
-
- Two alternatives, X1 and X2 are being
considered, but only one will be needed. The
constraint that expresses this would be -
- X1 X2 1
- If there is a possibility that neither
alternative will be acquired, then the constraint
will be - X1 X2 lt 1
10Follow 2 formulating integer programming problems
- K-out-of-n-Alternatives
- To choose a specified number of alternatives
- The formulation for exactly two alternatives out
of five - X1 X2 X3 X4 X5 2
- For at least two Alternatives out of five
- X1 X2 X3 X4 X5 gt 2
- For no more than two out of five
- X1 X2 X3 X4 X5 lt 2
- A range of choices for two to four machines
- X1 X2 X3 X4 X5 gt 2
- X1 X2 X3 X4 X5 lt 4
11Follow 3 formulating integer programming problems
- If-Then Alternatives
- To take some action that would necessitates
another action that supports the initial
decision. For example, the purchase of machine
X2 may necessitate the purchase of another
machine X1. The appropriate formulation would be
- X1 gt X2
- X1 - X2 gt 0
- If the selection of either machine requires the
purchase of the other, the appropriate
formulation would be - X1 - X2 0
12Follow 4 formulating integer programming problems
- Either-or Constraint
- Case 1 To turn on or turn off a constraint
as appropriate. - Suppose the selection in question is choice X8,
which will require the constraint 5X4 3 X5 gt
100. Then If X8 is chosen - 5 X4 3 X5 gt 100 X8
- If X8 is selected, X8 1, and the constraint
will stand. - If X8 is not selected, then X8 0 , and the
constraint will drop out - Case 2 If there are two potential constraints,
one of which will apply if a certain choice (say,
X8) is made, and the other if that choice is not
made. - For example, suppose the constraints are 5X4 3
X5 gt 100 if X8 is chosen and 5X4 3 X5 gt
50 for any other choice ( i.e., X8 is not
chosen), this could be expressed as - 5 X4 3 X5 gt 100 X8 (applies if
X8 1 ) - 5 X4 3 X5 gt 50 (1 - X8) (applies if
X8 0 )
13Follow 5 formulating integer programming problems
- Case 3 The constraints relate to upper limit
(the constraints are lt) - Two potential constraints, one of which will
apply if a certain choice (say, y1) is made, and
the other if that choice is not made. 4X1 8
X2lt 40, or 2X1 X2 lt16, depending on whether
project y1 is not commissioned, and the second
if it is. This can be handled by writing the
constraints in this form - 4 X1 8 X2 lt 40 My1
- 2 X1 X2 lt 16 M(1 - y1) where M is
a very large number - In addition, we have
- y1 lt 1 (y1 1 indicates the
project is commissioned) - 1. If y1 is commissioned, then y1 1 and the
first constraint becomes so large that it is not
binding. - 2. Conversely, if y1 0, the reverse is true
The first constraint becomes binding, whereas the
second becomes very large, and therefore, not
binding.
14Follow 6 formulating integer programming problems
- Fixed Charge Problems
- It very often happens that the contribution that
a variable makes to profit is linear after a
fixed charge has been deducted. For instance,
the profit per unit produced on a machine may be
20 per unit after a setup cost of 80 has been
allowed for. Suppose the product is x1. - To allow for this, we can introduce another
variable, y1, which can assume values of 0 or 1
0 if x1 is greater than 0, and 1 if x1 is greater
than 0. - The portion of the of the objective function for
these two variables is - 20 x1 - 80 y1
- In addition, the following constraints will be
needed - x1 ltMy1 where M is a very large number
- y1 lt1
- The first constraint will force X1 to be zero if
y1 is zero. If y1 1, there will be no limit on
x1, assuming a very large value has been selected
for M.
15Follow 7 formulating integer programming problems
- Variables That Have Minimum Level Requirement
- A variable may has a value of 0 or an amount
that exceeds a specified value. -
- Example
- if X1 is produced, the minimum order size should
be 200 units. - To allow for this, we can introduce another
variable, y1, which can assume values of 0 or 1 - X1 - 200y1 gt 0
- y1 lt1
-
- If X1 0, then y1 will be 0. for any other
value of X1, the minimum value of X1 is 200.
16Example 1
Max 6x1 8x2 Subject to x1 6x2 lt 36 x1
7x2 lt 70 end GINT X1 GINT X2
LP OPTIMUM FOUND AT STEP 2 OBJECTIVE VALUE
51.5000000 SET X2 TO gt 3 AT
1, BND 51.00 TWIN 49.60
7 SET X1 TO lt 4 AT 2, BND 50.67
TWIN-0.1000E31 9 SET X2 TO gt
4 AT 3, BND 50.00 TWIN 48.00
11 NEW INTEGER SOLUTION OF
50.0000000 AT BRANCH 3 PIVOT 11
BOUND ON OPTIMUM 50.00000 DELETE X2 AT
LEVEL 3 DELETE X1 AT LEVEL 2
DELETE X2 AT LEVEL 1 ENUMERATION
COMPLETE. BRANCHES 3 PIVOTS 11 LAST
INTEGER SOLUTION IS THE BEST FOUND RE-INSTALLING
BEST SOLUTION... OBJECTIVE FUNCTION
VALUE 1) 50.0000 VARIABLE VALUE
REDUCED COST X1 3.000000
-6.000000 X2 4.000000
-8.000000 ROW SLACK OR SURPLUS
DUAL PRICES 2) 0.000000
0.000000 3) 12.000000
0.000000 NO. ITERATIONS 11 BRANCHES
3 DETERM. 1.000E 0
17Question 32 Textbook Management Science -
Stevenson
MAX 13A 10 B 12 C -150 Y1 - 120 Y2 - 110
Y3 SUBJECT TO 4A 3B 5C 1000Y1 - 1000Y2 -
1000Y3 lt 2000 3A 2B 4C - 1000Y1 1000Y2 -
1000Y3 lt 1800 2A 4B 2C - 1000Y1 - 1000Y2
1000Y3 lt 1700 A gt 40 B gt 40 C gt
40 Y1 Y2 Y3 1 END INT Y1 INT Y2 INT Y3
M1000
LP OPTIMUM FOUND AT STEP 6 OBJECTIVE VALUE
8997.09961 SET Y3 TO gt 1 AT
1, BND 3760. TWIN 7189. 14 NEW
INTEGER SOLUTION OF 3760.00000 AT BRANCH
1 PIVOT 14 BOUND ON OPTIMUM 7188.840
FLIP Y3 TO lt 0 AT 1 WITH BND
7188.8398 SET Y2 TO gt 1 AT 2,
BND 3480. TWIN 2983. 18 DELETE
Y2 AT LEVEL 2 DELETE Y3 AT LEVEL
1 ENUMERATION COMPLETE. BRANCHES 2
PIVOTS 18 LAST INTEGER SOLUTION IS THE
BEST FOUND RE-INSTALLING BEST SOLUTION...
OBJECTIVE FUNCTION VALUE 3760.000
VARIABLE VALUE REDUCED COST
Y1 0.000000 -6350.000000
Y2 0.000000 -6380.000000 Y3
1.000000 6610.000000 A
230.000000 0.000000 B
40.000000 0.000000 C
40.000000 0.000000
Solution
18Question 22 Textbook Management Science -
Stevenson
MAX 10 X1 15 X2 18X3 - 3Y1 - 4Y2 - 6Y3
SUBJECT TO 4X1 6X2 3X3 lt 70 90X1 80X2
100X3 lt 1200 X1-10000Y1 lt 0 X2-10000Y2 lt
0 X3-10000Y3 lt 0 END INT Y1 INT Y2 INT Y3
LP OPTIMUM FOUND AT STEP 6 OBJECTIVE VALUE
221.660217 OBJECTIVE FUNCTION
VALUE 1) 211.6667 VARIABLE
VALUE REDUCED COST Y1
0.000000 3.000000 Y2
1.000000 4.000000 Y3
1.000000 6.000000 X1
0.000000 6.416667 X2
9.444445 0.000000 X3
4.444445 0.000000
Solution