IE426 - Optimization Models and Application: 1 Goal Programming
IE426 - Optimization Models and Application: 1 Goal Programming
Goal Programming
1. Check that the original LP is infeasible by solving it with AMPL.
Answer: we can build the LP model in AMPL as
set row = 1..5;
# number of linear constraints
set col = 1..4;
# number of variables
param coef_obj {col};
param coef_con {row,col};
# coefficient of objective
# coefficient of constraints
# variables
minimize obj:
sum{j in
subject to row1:
sum{j in
subject to row2:
sum{j in
subject to row3:
sum{j in
subject to row4:
sum{j in
subject to row5:
sum{j in
with data
data;
param: coef_obj:=
1 1
2 1
3 1
4 1;
param coef_con:
1
2
1 1
3
2 3
1
3 5
3
4 0
1
5 1
1
3
2
2
3
0
-1
4 :=
4
1
3
1
1;
y1 + y2 + y3 + y4 + y5
s.t.
5 + M (1 y1 )
3x1 + x2 + 2x3 + x4
4 + M (1 y2 )
3 M (1 y4 )
x1 + x2 x3 + x4
1 M (1 y5 )
xi 0, yj B
i, j
5 + y1
3x1 + x2 + 2x3 + x4
4 + y2
= 9 + y31 y32
x2 + x4
3 y4
x1 + x2 x3 + x4
1 y5
xi 0, yj 0
3
i, j
min
y1
s.t.
5 + y1
3x1 + x2 + 2x3 + x4
x1 + x2 x3 + x4
xi 0, y1 0
Logic
1. b c (d a)
Answer: the statement is true if and only if
xb + (1 xc ) + x1
x1 (1 xd ) + xa 1
x1
(1 xd )
x1
xa
2. The opposite of b c (d a)
Answer: the opposite is
(b c (d a)) = (b) ((c (d a)))
= (b) ((c (d a)))
= b c (d a)
The statement is true if and only if
(1 xb ) =
xc =
x1 =
x1 xd + (1 xa )
x1
xd
x1
(1 xa )
3. c d (a b)
Answer: the statement can be formulated as
x1
x2
x1
(1 xc )
x1
(xd )
x1 + 1 (1 xa ) + xd
x2
xa + xb
x2
xa
x2
xb
4. (a b) (a c) d c
xl
xr x1 + x2
x1
xr
x2
xr
x1
xa
x1
xb
x1 + 1 xa + xb
x2
xa
x2
xc
x2 + 1 xa + xc
xl
xd
xl
xc
xl + 1 xd + xc
5. Answer: the statement can be formulated as
2x1 + x2 + 3x3 5 + M1 (1 z1 )
2x1 + x2 + 3x3
5 + M1 z 1
2x6 x7 + x8 3 M2 (1 z2 )
2x6 x7 + x8
3 + M 2 z2
x9 + x10 1 M3 (1 z3 )
x9 + x10
1 + M 3 z3
z1 + z2
1 + zR
z1
zR
z2
zR
zR
z3
Formulations
1. Formulate S = {x + y R : |x| + |y| 1} as a linear programming problem.
x,yR
x+y 1
s.t.
xy 1
x y 1
x + y 1
2. Answer: with the objective arbitrarily specified, let the MILP is formulated as
min
x,yR,zB4
x + y 1 M 1(1 z1 )
s.t.
x + y 1 + M 1(1 z1 )
x y 1 M 2(1 z2 )
x y 1 + M 2(1 z2 )
x + y 1 M 3(1 z3 )
x + y 1 + M 3(1 z3 )
x y 1 M 4(1 z4 )
x y 1 + M 4(1 z4 )
z1 + z2 + z 3 + z4 1
3. The key part of the reformulation is x 6= x
, which can first be formulated as
n
X
i=1
|xi x
i | 1.
However since this is a binary problem we can separate the indices. Let set A be the set of
indices where x
i = 0, and set B includes indices where x
i = 1. Then we can formulate the
problem as follow:
cT x
max
s,tRn ,zBn
Ax b
s.t.
P
P
iA xi
iB
1 + M (1 z1 )
xi |B| 1 + M (1 z2 )
z1 + z 2 1
x Bn , z1 , z2 B
4. (a) We can associate binary variable xi {0, 1} to each node of the graph which represents
if a node i is selected for the subset or not. So the objective function would be simply
to maximize the number of selected nodes.
X
xi
Max
iV
Now the constraint would be to have edges between every selected node. One simple
way to do this is to remove cases that allow selecting nodes without edges between them.
So if E is set set of nodes we can have the following constraint:
xi + xj 1,
(i, j) 6 E
(b) Assuming that x is the optimal solution of the maximum clique problem, we can add
the following constraint to the above problem so that we find the next largest clique.
X
xi 1
iV|xi =0
param n;
# number of nodes
set V := 1..n;
# set of nodes
set E within {i in V, j in V: i < j};
# set of edges
var x {V} binary;
maximize size: sum {i in V} x[i];
cut {i in V, j in V: i < j and (i,j) not in E}: x[i] + x[j] <= 1;
data;
param n := 14;
set E := (1,2) (1,8) (1,10) (2,3) (2,5) (2,8) (3,5) (3,6)
(4,6) (4,7) (5,6) (5,13) (6,9) (7,9) (7,11) (7,12)
(8,9) (8,10) (8,13) (9,11) (9,12) (10,14) (11,12)
(12,13) (13,14);
10