You are on page 1of 35

TRƯỜNG ĐẠI HỌC BÁCH KHOA

ĐẠI HỌC QUỐC GIA TP HỒ CHÍ MINH

-----🙞🙜🕮🙞🙜-----

HOMEWORK 3

SUBJECT

INTRODUCTION TO OPERATION RESEARCH

CLASS CC01 --- HK 222

Instructor: Assoc. Prof. Ho Thanh Phong

NAME MSSV
Phùng Gia Bảo 2153213

Hồ Chí Minh city – 2023


PROBLEM 12.1-1

SOLUTION

Solution:

a) Decision Variables:

xj = 1 if factory is built , j = 1,2,3

0 if factory is not built

yj = 1 if factory is built , j = 1,2,3

0 if factory is not built

Objective Function:

Maximize Z = 8 x 1+ 5 x 2 +7 x 3+ 6 y 1+ 4 y 2 +5 y 3
Constraints:

6 x 1+ 3 x 2 + 4 x 3+5 y 1 +2 y 2+ 3 y 3 ≤ 10

y1 + y2 + y3 ≤ 1

y 1−x 1 ≤ 0

y 2−x 2 ≤0

y 3−x 3 ≤ 0

xj, yj are binary variables.

b & c) Table in Excel:

+ We call “Solver” to solve the problem:


Result:
Therefore, the total NPV is maximized at $17 million when factories are built in
cities SF and SD, and the warehouse is built in SD.

PROBLEM 12.1-2
SOLUTION

a) Mj = 1 if j does marketing,
0 if j does not do marketing

Cj = 1 if j does cooking,

0 if j does not do cooking

Dj = 1 if j does dishwashing,

0 if j does not do diswashing

Lj = 1 if j does laundry,

0 if j does not do laundry

For j = E (Eve), S (Steven).

+ Formulate a BIP as shown below:

Minimize T = 4.5ME + 7.8 CE + 3.6DE + 2.9LE + 4.9MS + 7.2CS + 4.3DS + 3.1LS

ME + CE + DE + LE = 2

MS + CS + DS + LS = 2

ME + MS = 1; CE + CS = 1

DE + DS = 1; LE + LS = 1

ME, MS, CE, CS, DE, DS, LE, LS binary.

b - c)
Result:
Therefore, the optimal solution is:

- Eve will do Marketing and Dishwashing

- Steven will do Cooking and Laundry

- Total hours spent will be 18.4 hours.


PROBLEM 12.1-3.

SOLUTION

a) Formulate a BIP as shown below:


Maximize Z = a + 1.8b + 1.6c + 1.8d +1.4e

Subject to

6 a+ 12b +10 c+ 4 d +8 e ≤20

b & c)
Call “solver” to solve the problem:

Result:
PROBLEM 12.1-4.

SOLUTION

a) Formulate a BIP model


Maximize Z = 15X1 + 12X2 + 16X3 + 18X4 + 9X5 + 11X6

S.t:

38X1 + 33X2 + 39X3 + 45X4 + 23X5 + 27X6 <= 100


X1 + X2 <= 1
X3 + X4 <= 1
X3 <= X1 + X2
X4 <= X1 + X2

b) Solution by POM-QM

the Maximum Value will be 40 and Investing in Opportunity 1, 3, 5


PROBLEM 12.1-6.

SOLUTION

a) Formulate an IP model

Maximize Z =130X1 + 150X2


3.2X1 + 2.4X2 <= 16
2X1 + 3X2 <= 15
X1, X2 Integer

b) Graphical approach to solve by POM-QM


c) Solution

The solution is X2 = 5, and the Maximum Value is 750.


PROBLEM 12.3-1.

SOLUTION

a) Formulate a mixed BIP model

M is a very large number


Maximize Z = 70y1 - 50000x1 + 60y2 - 40000x2 + 90y3 - 70000x3 + 80y4 - 60000x4;
x1 + x2 + x3 + x4 <= 2;
x3 <= x1 + x2;
x4 <= x1 + x2;
5y1 + 3y2 + 6y3 + 4y4 <= 6000 + Mx5;
4y1 + 6y2 + 3y3 + 5y4 <= 6000 + M(1-x5);
y1 <= Mx1;
y2 <= Mx2;
y3 <= Mx3;
y4 <= Mx4;
x1, x2, x3, x4 binary.

b) Solution by Lingo

The Maximun Profit will be 80000 with the 2000 Product 2 are produced.
PROBLEM 12.3-2.

SOLUTION
|x 1−x 2|=0 → x 1−x 2=0 ;

|x 1−x 2|=3 → x 1−x 2=± 3 ;

|x 1−x 2|=6 → x 1−x 2=± 6 ;

x 1−x 2=0 x 1+3 x 2−3 x 3+6 x 4−6 x 5

x1, x2, x3, x4, x5 is binary

PROBLEM 12.3-3.

SOLUTION
1) 3 x 1−x 2−x 3+ x 4 ≤ 12+ y 1 M
x 1+ x 2+ x 3+ x 4 ≤ 15+ M ( y 1−1)
Y1 is a binary number
2) 2 x 1+5 x 2−x 3+ x 4 ≤ 30+ My 2
−x 1+3 x 2+5 x 3+ x 4 ≤ 40+ My 3
3 x 1−x 2+3 x 3−x 4 ≤ 60+ My 4
2 ≤ y 2+ y 3+ y 4
Y1,y2,y3,y4 is binary

PROBLEM 12.3-4.
a) Let and be binary variables that y1 & y2 indicate whether or not toys 1 and 2 are
produced. Let and be the number of toys x1 and x2 that are produced. Also, let be z
0 if factory 1 is used and 1 if factory 2 is used.
Maximize: 10x1 + 15x2 – 50000y1 – 80000y2
Subject to:
X1 ≤ My1
X2 ≤ My2
1 1
x 1+ x 2 ≤ 500+ Mz
50 40
1 1
x 1+ x 2 ≤ 700+ M (z−1)
40 25
X1, x2 ≥ 0
Y1, y2, z is binary
c) Coding and result:
MAX = 10*X1 + 15*X2 - 50000*Y1 - 80000*Y2 ;
X1 <= 100000*Y1;
X2 <= 100000*Y2;
1/50 * X1 + 1/40* X2 <= 500 + 100000*Z;
1/40*X1 + 1/25*X2 <= 700 + 100000*(1-Z);
@GIN(X1);
@GIN(X2);
@BIN(Y1);
@BIN(Y2);
@BIN(Z);
Objective value: 230000.0
Variable Value
X1 28000.00
X2 0.000000
Y1 1.000000
Y2 0.000000
 Z = 1.000000
PROBLEM 12.3-6.

SOLUTION
a) Let: X1 = Y11 + 2Y12
X2 = Y21 + 2Y22
Max: Z = X1 + 5X2 = Y11 + 2Y12 + 5Y21 + 10Y22
Subject to Y11 + 2Y12 + 10Y21 + 20Y22 <= 20
Y11 + 2Y12 <= 2
Yij binary, for I, I = 1, 2
b)
When input to POM, symbolize X1=Y11, X2=Y12, X3=Y21, X4=Y22, X5=X1,
X6=X2
 Max: X1 + 2X2 + 5X3 + 10X4
X1 + 2X2 + 10X3 + 20X4 <= 20
X1 + 2X2 <= 2
- X1 - 2X2 + X5 = 0
- X3 - 2X4 + X6 = 0
Solution:
PROBLEM 12.4-1.

Recalled from 12.3-7:


SOLUTION

a) Yij = {1 ,if xi= j(0 ,produce j units of i)


otherwise
For i=1, 2, 3 and j=1, 2, 3, 4, 5.
Max: Z = –Y11 + 2Y12 + 4Y13 + Y21 + 5Y22 + Y31 + 3Y32 + 5Y33 +
6Y34 + 7Y35
Subject to:
Y11 + Y12 + Y13 <= 1
Y21 + Y22 <= 1
Y31 + Y32 + Y33 + Y34 + Y35 <=1
Y11 + 2Y12 + 3Y13 + 2Y21 + 4Y22 + Y31 + 2Y32 + 3Y33 + 4Y34 + 5Y35
<= 5
With Yij binary
b) When input data to POM, symbolize X1 = Y11, X2 = Y12, X3 = Y13, X4 =
Y21, X5 = Y22, X6 = Y31, X7 = Y32, X8 = Y33, X9 = Y34, X10 = Y35.
 Max: - X1 + 2X2 + 4X3 + X4 + 5X5 + X6 + 3X7 + 5X8 + 6X9 +
7X10
X1 + X2 + X3 <= 1
X4 + X5 <= 1
X6 + X7 + X8 + X9 + X10 <= 1
X1 + 2X2 + 3X3 + 2X4 + 4X5 + X6 + 2X7 + 3X8 + 4X9 + 5X10 <= 5
Solution:

c) Yij = {01, otherwise


, if xi ≥ j

For i = 1, 2, 3 and j = 1, 2, 3, 4, 5.
Max: Z = –Y11 + 3Y12 + 2Y13 + Y21 + 4Y22 + Y31 + 2Y32 + 2Y33 + Y34
+ Y35
Subject to:
Y13 <= Y12 <= Y11
Y22 <= Y21
Y35 <= Y34 <= Y33 <= Y32 <= Y31
Y11 + Y12 + Y13 + 2Y21 + 2Y22 + Y31 + Y32 + Y33 + Y34 + Y35 <= 5
With Yij binary
d) When input data to POM, symbolize X1 = Y11, X2 = Y12, X3 = Y13, X4 =
Y21, X5 = Y22, X6 = Y31, X7 = Y32, X8 = Y33, X9 = Y34, X10 = Y35.
 Max: - X1 + 3X2 + 2X3 + X4 + 4X5 + X6 + 2X7 + 2X8 + X9 + X10
- X1 + X2 <= 0
- X2 + X3 <= 0
- X4 + X5 <= 0
- X6 + X7 <= 0
- X7 + X8 <= 0
- X8 + X9 <= 0
- X9 + X10 <= 0
X1 + X2 + X3 + 2X4 + 2X5 + X6 + X7 + X8 + X9 + X10 <= 5
Solution:
PROBLEM 12.4-3.

Information from 3.1-11:

SOLUTION
a) Introduce the auxiliary binary variables Y1, Y2 and Y3 to represent positive
production levels
Max Z = 50X1 + 20X2 + 25X3
Subject to:
9X1 + 3X2 + 5X3 <= 500
5X1 + 4X2 <= 350
3X1 + 2X3 <= 150
X3 <= 20
X1 <= MY1, X2 <= MY2, X3 <= MY3
Y1 + Y2 + Y3 <= 2
X1, X2, X3 >= 0
Y1, Y2, Y3 binary
b) When input data in POM, symbolize X1 = X1, X2 = X2, X3 = X3, X4 = Y1, X5 =
Y2, X6 = Y3, M = 999
 Max 50X1 + 20X2 + 25X3
9X1 + 3X2 + 5X3 <= 500
5X1 + 4X2 <= 350
3X1 + 2X3 <= 150
X3 <= 20
X4 + X5 + X6 <= 2
X1 - 999X4 <= 0
X2 - 999X5 <= 0
X3 - 999X6 <= 0
Solution:
PROBLEM 12.4-4.

SOLUTION
a) When x1 + x2 <= 3 => x1, x2 = 0;1;2;3.

For i=1,2 and j = 1,2,3.


+ Suppose: x1, x2 = 0;1;2;3, then in Maximizal Z solution we have:
3y11+8 y12+9 y13 + 9y21+ 24y22+ 9y23 = Z
+ Also, we have only 1 solution for x1, x2 then:

+ Because x1 + x2 <= 3 then we have the following constrants:

b) The solution:

 y11 = 0 except y11 = y22 = 1 => x1 = 1, x2 = 2, Z= 27.


c) Because:

For i=1,2 and j = 1,2,3.


From x1, x2 = 0;1;2;3, we can have optimal solution:
Maximize Z = 3 y 11 +5 y 12+ y 13+9 y 21 +15 y 22−15 y 23
y 13 ≤ y 12 ≤ y 11

y 23 ≤ y 22 ≤ y 21

y 11 + y 23 ≤1

y 12+ y 22 ≤ 1

y 13 + y 21 ≤ 1

d)

-> y 11 = y 21= y 22 = 1 -> x 1=1 ; x2=2-> Z = 27.


PROBLEM 12.4-5

SOLUTION

a)
Min = 3 x 12+6 x 13+ 6 x 24+5 x 25 +4 x 34 +3 x 35+3 x 46 +2 x56
x 12+ x 13=1

x 25+ x 24 + x 35 + x34 =1

x 46 + x 56=1

x 24 + x 25−x12=0

x 34 + x 35− x13=0

−x 24−x 34 + x 46=0

−x 35−x 25+ x 56=0

x IJ is binary
b) Coding:

RESULT
 x 12=x 25=x56=1 => Z = 10.
Path: 1 -> 2 -> 5 -> 6.

PROBLEM 12.4-6.
SOLUTION

+ Cost: cj = [6 4 7 5 4 6 5 3 7 6];

[ ]
1 0 0 0 1 0 0 0 1 0
0 2 0 1 0 2 0 0 2 2
0 0 3 3 0 0 3 0 3 0
2 0 0 0 0 1 0 1 0 0
+ xij = 0 0 2 2 0 3 0 0 0 0 ; yj = 0 or 1.
0 1 0 0 2 0 0 0 0 0
3 0 0 0 0 0 1 2 0 3
0 0 1 0 3 0 0 0 0 1
0 3 0 4 0 0 2 0 0 0

10

Minimize: Z = ∑ c J y J ;
J =1

10

Subject: ∑ xij y j >= 1 , for i=1,..,9 ;


J =1

10

∑ y J =3.
5=1

Yij = 0 or 1.
b)Coding:
Solution:
 Y4 = Y5 = Y8 = 1 -> Assign sequence 4, 5, 8 to a crew.

You might also like