Integer Programming Practice
Integer Programming Practice
Alice
Bob
Cooking
Dishwashing
Laundry
7.8 hours
7.2 hours
3.6 hours
4.3 hours
2.9 hours
3.1 hours
b)
18.4000
DECISION VARIABLES
PLAIN VARIABLES
Variable Name
Activity
Reduced
Cost
----------------------------------------------------MA
1.0000
4.5000
CA
0.0000
7.8000
DA
1.0000
3.6000
LA
0.0000
2.9000
MB
4.9000
CB
7.2000
DB
4.3000
LB
3.1000
0.0000
1.0000
0.0000
1.0000
Product 1
$50,000
$70
Product 2
$40,000
$60
Product 3
$70,000
$90
Product 4
$60,000
$80
Let the continuos variables x1, x2, x3, and x4 be the production levels of products
1,2,3,and 4, respectively. Management has imposed the following policy constraints on
these variables:
No more than two of the products can be produce
Either product 3 or 4 can be produced only if either product 1 or 2 is produced
Either
i. 5 x1 + 3 x2 + 6 x3 + 4 x4 <= 6,000 or
ii. 4 x1 + 6 x2 + 3 x3 + 5 x4 <= 6,000
a) Introduce auxiliary binary variables to formulate a mixed Binary Integer Problem
model for this problem
b) Use the computer to solve this model.
X1 = Production level of Product #1
X2 = Production level of Product #2
X3 = Production level of Product #3
X4 = Production level of Product #4
a)
Y1 = 1 if X1 > 0;
Y2 = 1 if X2 > 0;
Y3 = 1 if X3 > 0;
Y4 = 1 if X4 > 0;
Y5 = either/or auxiliary binary variable
Maximize: Z = 70X1 50,000Y1 + 60X2 40,000Y2 + 90X3 70,000Y3
+ 80X4 60,000Y4
s.t.
1) Y1 + Y2 + Y3 + Y4 2
( 2 products can be
produced)
(Y3 only if either Y1
2.a) Y3 Y1 + Y2
or Y2)
2.b) Y4 Y1 + Y2
(Y4 only if either Y1
or Y2)
3.a) 5X1 + 3X2 + 6X3 + 4X4 6,000 + MY5
(either 3.a or 3.b
holds)
(either 3.a or 3.b
3.b) 4X1 + 6X2 + 3X3 + 5X4 6,000 + M(1-Y5)
holds)
(Y1 = 1 when X1 > 0)
4) X1 MY1
5) X2 MY2
(Y2 = 1 when X2 > 0)
6) X3 MY3
(Y3 = 1 when X3 > 0)
7) X4 MY4
(Y4 = 1 when X4 > 0)
8) X1, X2, X3, X4 0
(Non-negativity)
(Binary)
9) Y1, Y2, Y3, Y4, Y5 Binary
b)
MPL Output
SOLUTION RESULT
Optimal integer solution found
MAX Z
80000.0000
DECISION VARIABLES
PLAIN VARIABLES
Variable Name
Activity
Reduced Cost
-----------------------------------------------------X1
0.0000
-30.0000
Y1
0.0000
-50000.0000
X2
2000.0000
0.0000
Y2
1.0000
-40000.0000
X3
0.0000
-30.0000
Y3
0.0000
-70000.0000
X4
0.0000
0.0000
Y4
0.0000
-60000.0000
Y5
0.0000
200000000.0000
------------------------------------------------------
3 Formulate Sudoku as a Binary Integer Program problem. Assume that you are given
an initial sudoku instance and that the instance may or may not be filled in completely.
Your goal is to maximize the number of cells that can be filled in.
variables: xijk {0,1} for all rows i, columns j and numbers k:
xijk = 1 if cell [i,j] has number k
xijk = 0 otherwise
Objective function:
Max i j k xijk
constraints:
each number appears once in each row:
j xijk = 1 for all rows i and numbers k
each number appears once in each column:
i xijk = 1 for all columns i and numbers k
each number appears once in each block:
[i,j]B xijk = 1 for all numbers k and blocks B
one number per cell:
k xijk = 1 for all rows i and columns j
pre-assigned cells:
xijk = 1 if cell [i,j] has pre-assigned number k
xijk = 0 for all numbers kk if cell [i,j] has pre-assigned number k