Exercise 1.: Optimization 2agi ENIT 2017 2018

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

OPTIMIZATION

‐ 2AGI ENIT 2017‐2018

Homework #1 Solution


Exercise 1.

Decision variables:
xj = number of produced vehicles of type i, i=1,2,3.

Also, we have the condition: if type i vehicle is produced, i.e. xi>0, then we must have xi>1000.
Then we need to define a binary variable yi, and use it as follows:

max z = 2000 x1 + 3000 x2 + 4000 x3
s.to:
1.5 x1 + 3x2 + 5x3  6000
30x1 + 25x2 + 40x3  60000
1000 –M(1‐y1)  x1 My1
1000 –M(1‐y2)  x2 My2
1000 –M(1‐y3)  x3 My3
xi 0; yi {0,1}, i=1,2,3
where M is a large constant (M 5000)

Exercise 2.

Decision variables :
xij = 1 if building i is started during year j, = 0 otherwise.
Note we can exclude all variables xi4 (or set xi4=0) since there is no reason to start any
building at year 4.

Objective function :
Max z = 2(50) x11 + 50 x12 + 2(30) x21 + 30 x22 + 40 x31

Here, if building 1 is started at year, 1 it will bring rent money for 2 years (3 and 4). This
explains the term 2(50) x11. If it is started at year 2, it will finish at year 3; thus, it will bring
revenue only for one year (year 4). This explains the term 50 x12…etc.

Constraints :
‐ Year 1 workers: 30x11 + 20x21+ 20x31  60
‐ Year 2 workers: 30(x11 + x12) + 20(x21 + x22)+ 20(x31 + x32)  60
‐ Year 3 workers: 30(x12 + x13) + 20(x22 + x23)+ 20(x31+x32 + x33)  60
‐ Year 4 workers: 30x13 + 20x23 + 20(x32 + x33)  60

‐ No more than one building is started during each year j = 1, 2, 3: x1j + x2j + x3j  1

‐ Each building i = 1, 2, 3, is started at most once: xi1 + xi2 + xi3  1
1/3
OPTIMIZATION ‐ 2AGI ENIT 2017‐2018


‐Building 2 has to finish by end of year 4 : x21 + x22 + x23 = 1.

‐ All variables are binary.

Note :
We can also set x13 = x23 = x32 = 0 since this decision will not bring any revenue (buildings will
not finish before year 4).

Exercise 3.

1)
Decision variables:
xij = 1 if project i is selected during year j; 0 otherwise.

Objective function: min 20(x11 + x12+ x13 ) + 40(x21 + x22+ x23 ) +
20(x31 + x32+ x33 ) +15(x41 + x42+ x43 ) + 30 (x51 + x52+ x53 )
s. to xi1 + xi2+ xi3 ≤ 1  i=1,…, 5

5x11 + 4x21+ 3x31 + 7x41 + 8x51 ≤ 25
x12 + 7x22+ 9x32 + 4x42 + 6x52 ≤ 25
8x13 + 10x23+ 2x33 + x43 + 10x53 ≤ 25

xij  {0,1}  i=1,…, 5; j=1,2,3

2)
a‐ x11 ≤ x12
b‐ x13 + x23+ x33 + x43 + x53 ≤ 2
c‐ x12 + x52 ≥ 1


Exercise 4.

Max z = 3 x1 + 6 x2 ‐ 10 u2 + 2 x3 + 15 x4 ‐ 9 u4
S. to
2 x1 ‐ x2 + x3 + 3 x4  15

x1 + x2 + x3 + x4  4 + M1 y1
3 x1 ‐ x2 ‐ x3 + x4  3 + M1 (1 ‐ y1)
y1 = 0 or 1,

5 x1 + 3 x2 + 3 x3 ‐ x4  10 + M2 z1
2 x1 + 5 x2 ‐ x3 + 3 x4  10 + M2 z2
‐ x1 + 3 x2 + 5 x3 + 3 x4  10 + M2 z3
3 x1 ‐ x2 + 3 x3 + 5 x4  10 + M2 z4
z1 + z2 + z3 + z4  1

x2  M3 u2
u2 = 0 or 1

2/3
OPTIMIZATION ‐ 2AGI ENIT 2017‐2018

x4  M4 u4
u4 = 0 or 1

1  x3  3, x3 integer,
xj  0, j = 1, 2, 3, 4

Note : The choice of k constraints out of N :
f1(x)  d1 f1(x)  d1 + M y1
f2(x)  d2 f2(x)  d2 + M y2
f2(x)  d2 f3(x)  d3 + M y3

fN(x)  dN fN(x)  dN + M yN
y1 + y2 +…+yN = N – k
yi = 0 or 1.

3/3

You might also like