Documente Academic
Documente Profesional
Documente Cultură
Assignment 5
1. 9.7-1 Without using your OR Courseware, consider the minimum cost
flow problem shown below, where the bi values (net lows generated) are
given by the nodes, the cij values (costs per unit flow) are given by the
arcs, and the uij vlalues (arc capacities) are given to the right of the
network.
[20]
A
[0]
C
3
5
2
B
[10]
Arc capacities
[-30]
E
A C: 10
B C: 25
Others:
4
5
D
[0]
Flow
20
10
10
20
Nonbasic Arc
AB
AC
BD
[10]
A
(15)
2
B
[-15]
-6 (5)
[35]
C
(30)
[-30]
E
3
D
[0]
(0)
Arc capacities
C A: 10
C B: 25
Others:
(b)
Nonbasic arc
unique cycle
CB
CB BA AC
AD
AD DE EC CA
BD
BD DE EC CA AB
Z when = 1
3 2 (6) = 7 > 0
5+436 =0
5+436+2= 2> 0
AD
DE
EC
CA
[20]
A
(15)
2
B
[-15]
(c)
[25]
C
6
5
(5)
3
5
D
[0]
(25)
[-30]
E
(5)
Arc capacities
A C: 10
C B: 25
Others:
All the other optimal solutions that are not BF solutions can be
obtained by sending a flow of unit along the cycle AD DE
EC CA for some 0 < < 5. That is, xAC = 5 , xAD = ,
xAB = 15, xBC = 25, xBD = 0, xCE = 30 , xDE = .
Nonbasic arc
unique cycle
AB
AB BC CE ED CB
AC
AC CE ED DA
BD
BD DE EC CB
Z when = 1
2 + 3 + 3 4 5 = 1 < 0
6+345 =0
5+433 =3 >0
<
15
20
20
[20]
A
[25]
C
6
5
(15)
2
(5)
B
[-15]
(25)
[-30]
E
(5)
Arc capacities
A C: 10
B C: 25
Others:
D
[0]
[40]
S1
6
7
4
D2 [40]
5
S2
[60]
D1 [30]
8
6
4
D3 [30]
[40]
6 (30)
S1
7 (10)
4
5
D1 [30]
D2 [40]
8 (30)
S2
[60]
6 (30)
D3 [30]
For S1 D3 , Z = 4 6 + 8 7 = 1. For S2 D1 , Z =
5 6 + 7 8 = 2. S2 D1 is the entering BV, S1 D1 is the
leaving BV. = 30. The new BF solution is
[40]
6
S1
D1 [30]
7 (40)
4
(30)
5
S2
[60]
D2 [40]
8 (0)
6 (30)
D3 [30]
For S1 D1 , Z = 6 5 + 8 7 = 2. For S1 D3 , Z =
4 6 + 8 7 = 1. S1 D3 is the entering BV and S2 D3 is the
[40]
6
S1
D1 [30]
7 (10)
4
(30)
5
S2
[60]
D2 [40]
(30)
8 (30)
D3 [30]
3. 9.7-8 Consider the minimum cost flow problem shown below, where the
bi values are given by the nodes, the cij values are given by the arcs,
and the finite uij values are given in parentheses by the arcs. Obtian
an initial BF solution by solving the feasible spanning tree with basic
arcs A C, B A, C D, and C E, where one of the nonbasic
arc (D A) is a reverse arc. Then use the network simplex method
to solve this problem.
[50]
A
(uAD=40)
[0]
C
1
2
B
[80]
[-70]
D
3
5
(uBE=40)
E
[-60]
[10]
A
-6
4
(90)
[0]
C
1 (80)
2
B
[80]
[-30]
D
(uDA=40)
(30)
(60)
3
5
E
[-60]
(uBE=40)
Nonbasic arc
unique cycle
DA
DA AC CD
BC
BC CA AB
BE
BE EC CA AB
Z when = 1
6 + 4 + 3 = 1
2 4 1 = 3
5 5 4 1 = 5
[10]
A
-6
4
(50)
[0]
C
1 (40)
2
B
[40]
-5
[-30]
D
(uDA=40)
(30)
(20)
(uEB=40)
Nonbasic arc
unique cycle
DA
DA AC CD
BC
BC CA AB
EB
EB BA AC CE
3
5
E
[-20]
Z when = 1
6 + 4 + 3 = 1
2 4 1 = 3
5 + 1 + 4 + 5 = 5
[10]
A
-6
4
(10)
[0]
C
1
2
B
[40]
(30)
3
5
(20)
(40)
-5
[-30]
D
(uDA=40)
E
[-20]
(uEB=40)
Nonbasic arc
unique cycle
DA
DA AC CD
BA
BA AC CB
EB
EB BC CE
Z when = 1
6 + 4 + 3 = 1
1+42=3
5 + 2 + 5 = 2
[50]
A
6
4
(uDA=40)
(10)
[0]
C
1
2
B
[80]
(30)
(20)
(40)
(uEB=40)
[-70]
D
(40)
(40)
3
5
E
[-60]
and
x1 , x2 , x3 are nonnegative integers.
Use dynamic programming to solve this problem.
Solution: Number of stages = 3. For n = 1, 2, 3, at stage n, we determine the value of xn . Let sn be the remaining slack in the functional
constraint, i.e.,
11
n=1
sn =
s 2x1
n=2
1
s2 4x2
n=3
We have
f3 (s3 ) =
max
x3 =0,1,...,bs3 /3c
s3 f3 (s3 )
0
0
1
0
2
0
3
10
4
10
5
10
6
20
7
20
8
20
9
30
10
30
11
30
f2 (s2 ) =
max
x2 =0,1,...,bs2 /4c
10x3
x3
0
0
0
1
1
1
2
2
2
3
3
3
s2
0
1
2
3
4
5
6
7
8
9
10
11
f1 (s1 ) =
0
0
0
0
10
10
10
20
20
20
30
30
30
x2
1
20
20
20
30
30
30
50
50
40
40
40
50
max
x1 =0,1,...,5
f2 (s2 )
0
0
0
10
20
20
20
30
40
40
50
50
x2
0
0
0
0
1
1
1
2
2
2
1
1, 2
x1
s1 0
11 50
1
57
2 3 4 5
62 65 66 65
f1 (s1 ) x1
66
4
x1 x2 + x3 1
x1 0, x2 0, x3 0.
At stage 3 we
max f3 (S3 , x3 ) = x3
s.t.
x3 S3
2
Since f2 = S2 S2 x2 +x2 x22 , f20 = S2 +12x2 . f20 = 0 = x2 = 1S
.
2
1S2
Now we consider the constraints. S2 = 1 x1 1, therefore 2 0
is always true. The other constraint is x2 S2 or x2 S2 .
1 S2
< S2 = S2 < 1
2
So in the case of S2 < 1 we will take the left endpoint (which is closer
2
to 1S
) S2 .
2
1S2
if S2 1;
2
x2 =
S2
if S2 < 1
and
f2
(S2 ) =
1
4
(1 + S2 )2
0
At stage 1 we
if S2 1;
if S2 < 1
max f1 (x1 ) = x1 f2 (1 x1 )
s.t.
x1 0
Note here that it is not necessary for x1 to be less than or equal to 1
for x2 is negative in the original constraint. S1 = 1 is not used. Since
S2 = 1 x1 , S2 1 x1 2.
(2x1 )2
x
if 0 x1 2
1
4
f1 (x1 ) =
0
if x1 > 2
11
For
(2 x1 )2
1
f1 (x1 ) = x1
= x1 x21 + x31
4
4
3
1
f10 (x1 ) = 1 2x1 + x21 = (3x1 2) (x1 2)
4
4
2
or x1 = 2
3
It is easy to check (just check x1 = 0, 23 and 2) that x1 = 23 and f1 =
8
2
z = 27
. Since S2 = 13 > 1, x2 = 1S
= 13 and x3 = S3 = S2 + x2 = 23 .
2
f10 = 0 = x1 =
1
if product i is produced
yi =
0
otherwise
Let M be a very large number. The problem can be formulated as
follows:
M aximize Z = 70x1 + 60x2 + 90x3 + 80x4
50000y1 40000y2 70000y3 60000y4
subject to
(1)
4
X
i=1
yi 2
xi M yi i = 1, 2, 3, 4
(2) y3 + y4 y1 + y2
(3) 5x1 + 3x2 + 6x3 + 4x4 6000 + wM
4x1 + 6x2 + 3x3 + 5x4 6000 + (1 w)M
xi 0 i = 1, 2, 3, 4. yi is binary for i = 1, 2, 3, 4. w is binary.
7. 12.2-4 Consider the following mathematical model.
M aximize Z = 3x1 + 2f (x2 ) + 2x3 + 3g (x4 ) ,
subject to the restrictions
1. 2x1 x2 + x3 + 3x4 15.
10
10
10
10.
4. x3 = 1, or 2, or 3.
5. xj 0 (j = 1, 2, 3, 4),
where
f (x2 ) =
5 + 3x2
0
if x2 > 0,
if x2 = 0,
g (x4 ) =
3 + 5x4
0
if x4 > 0,
if x4 = 0.
and
10 + M y4
10 + M y5
10 + M y6
10 + M y7
2
15