flow 9

1
OR Deterministic Model 2013 (Final Exam.)
2013. 12.19 (Thur.)
ID Number (
), Name (
)
< Full Credit: 140 Pts, 6 Problems, 9 pages, 100 Minutes allowed >
You may write your answers on the space below the question. If needed, use the rear page.
주의 : 스테이플 묶음을 뜯지 마시오. 지면이 부족할 경우 해당문제의 뒷면을 이용하시오.
1. (30 Pts.) The following is on the transportation problem. Three suppliers (S1, S2, S3) can
provide with at most (10, 80, 15) units respectively, and three customers (D1, D2, D3) require
at least (75, 20, 50) units respectively. Numbers in the small box (dotted line) denote the unit
transportation cost C ij incurred by the delivery from the supplier i to the customer j. For
example, the transportation cost from S3 to D2 is 2 won(₩) per unit. The total demand
exceeds the total supply.
5
1
7
6
4
6
3
2
5
75
20
10
80
15
50
(a) Under the unbalanced transportation requirement, some of the demands may not be met.
But the demand D3, 50, must be satisfied completely. Develop the relevant
transportation table, and find the initial solution using the least cost method. (Not
necessary to find the optimal solution). (Hint: Generate the artificial supplier, S4, with
a proper supply capacity and proper transportation cost for each customer)
Answer:
2
(b) There is no strict requirement on the demand, i.e., the assumption of (a) is not valid any
more. Instead, suppose that the penalty costs per unit of unsatisfied demand are (5, 3, 2)
won(₩)per unit for customers (D1, D2, D3), respectively. Develop the relevant
transportation table, and find the initial solution using the least cost method. Using
the initial solution, find the optimal solution.
5
1
7
6
4
6
3
2
5
75
20
10
80
15
50
Answer:
1. Initial solution
Since c22 has the most positive value, then variable x22 enters the basis.
2. Pivoting and find optimal solution
3
All nonbasic variables’ c̅ij are negative and current solution is optimal
Total cost = 1×10+6×60+4×10+6×10+3×15+2×40 = 595
4
2. (30 Pts.) Bus company operates the buses between Seoul and Haenam (the farthest city from
Seoul). The company provides the trip 4 times a day for both directions. A bus single trip
takes 6 hours. The departure times of trips are given in the table below. Transportation
Department law requires that a driver rest for four hours or more hours between trips. A
driver’s workday consists of two trips: one trip from Seoul to Haenam (S1,S2,S3,S4 trip),
and one trip from Haenam to Seoul (H1,H2,H3,H4 trip). In other words, driver’s trip duty
can be either (S trip + H trip) or (H trip + S trip), whichever is the better. The pay for the
driver is set to the proportional to the working time of (Trip + Downtime + returning Trip).
Therefore the company’s goal is to minimize the total downtime for all drivers. The
objective is to make a combination of trips (one of S + one of H) which may cover all trips.
S trip (Seoul to Haenam)
S1
S2
S3
S4
Departure Time
6 AM
10 AM
3 PM
10 PM
H trip (Haenam to Seoul)
H1
H2
H3
H4
Departure Time
8 AM
1 PM
8 PM
12 AM (midnight)
(a) It can be formulated using the assignment problem. Construct the cost table in terms
of the downtime. The downtime should include at least 4 hours by regulation.
Answer:
-Cost table
ex) S1-H1 : Infeasible
H1-S1 : 8 AM + 6 hours = 14 (2 PM) arrival
 14~6 AM : 16 hours
ex2) S1-H3 : 6 AM + 6 hours = 12 PM arrival
 12~8 PM : 8 hours
H3-S1: 8 PM + 6 hours = 2 AM arrival
 2 ~ 6 AM : 4 hours
∴ The better is 4 hours
5
(b) Using the cost table found in (a), find the optimal solution by Hungarian method.
Answer:
ⅰ)
ⅱ)
ⅲ)
Only 3 lines are required to cover all the zeros, so proceed to step ⅳ)
6
ⅳ)
Two more solutions are possible with optimal Cost = 28
- S1-H3  S2-H4  S3-H1  S4-H2
- S1-H3  S2-H4  S3-H2  S4-H1
7
3. (20 Pts.) For the given network, we want to find the maximum flow from the node 1 to node
6, where the numbers beside the link indicate the flow capacity.
(a) Give the mathematical formulation for the maximal flow problem. (xij = flow from
node i to node j)
Answer:
𝑀𝑎𝑥 𝑍0
Z0 = 𝑥12 + 𝑥13
x12 ≤ 7
x45 ≤ 2
x12 = x23 + x25
x13 ≤ 3
x56 ≤ 2
x13 + x23 + x53 = x34
x25 + x45 = 𝑥53 + 𝑥56
x23 ≤ 1
x25 ≤ 6
x46 ≤ 8
o.w. xij ≤ 0
x34 = x45 + x46
x53 ≤ 3
x56 + x46 = Z0
x34 ≤ 8
(b) Find the optimal solution using the augmented path algorithm.
Answer:
ⅰ) Augmented path: 1-2-5-6
- min(7,6,2) = 2
ⅱ) Augmented path: 1-3-4-6
- min(3,8,8) = 3
8
ⅲ) Augmented path: 1-2-3-4-6
ⅳ) Augmented path: 1-2-5-3-4-6
- min(5, 1, 5, 5) = 1
- min(4, 4, 3, 4, 4) = 3
ⅴ) There’s no available augmented path. It is optimal solution with flow 9
9
4. (30 Pts.) Consider the following network with 5 nodes: numbers in bracket at the nodes
indicates the net flow (+: supply, -: consumption). Numbers on the link indicate the
transportation cost per unit. The link capacity for (i,j) is denoted by U(i,j) : U(1,2)=25,
U(1,3)=12, U(2,4)=30, U(2,5)=20, U(3,4)=13. We want to find the flow on the link
satisfying the node requirement with minimal cost.
(a) With one feasible solution found: x12  20, x24  10, x13  12, x25  10, x34  12 ,
construct the basic feasible solution to apply the Network Simplex algorithm. And
draw the corresponding network with updated node requirement and link flow to
show which links are basic variables. (Hint: for the link hitting the capacity, the
variable has to be replaced with the non-basic variable with flow equal to zero, i.e.,
using UB technique)
Answer:
Since x13 = 12 hits the capacity, y13 = 12 − x13 = 0 and y13 : 𝑁𝐵
 4 Basic variable link : x12 , x24 , 𝑥25 , 𝑥34
10
(b) Evaluate the current solution. Discuss the optimality if it is optimal, otherwise, find
the optimal solution.
Answer:
ⅰ) Step 1
x13 ∶ −11 + 15 + 6 − 4 = 6
x23 ∶ 5 + 4 − 6 = 3
x35 ∶ 5 − 10 + 6 − 4 = −𝟑
Not Optimal
x45 ∶ 14 − 10 + 6 = 10
∴ 𝐱 𝟑𝟓 enters with 𝛉
x35 = θ
x25 = 10 − θ ≥ 0  θ ≤ 10
x24 = 10 + θ ≤ 30  θ ≤ 20
x34 = 12 − θ ≥ 0  θ ≤ 12
∴ 𝛉 ≤ 𝟏𝟎
ⅱ) Step 2
x13 ∶ −11 + 15 + 6 − 4 = 6
x23 ∶ 5 + 4 − 6 = 3
x25 ∶ 10 − 5 + 4 − 6 = 3
x45 ∶ 14 − 5 + 4 = 13
Since all 𝐱 𝐢𝐣 is positive, this solution is optimal
Optimal Solution
x12 ∶ 20
x24 ∶ 20
x34 ∶ 2
With total cost 610
x35 ∶ 10
x13 ∶ 12
11
5. (20 Pts.) Glueco produces three types of glue on two different production lines. Each line
can be utilized by up to seven workers at a time. Workers are paid $500 per week on
production line 1, and $900 per week on production line 2. A week of production costs
$1,000 to set up production line 1, $2,000 to set up production line 2. During a week on a
production line, each worker produces (20,30,40) units of glue (1,2,3), respectively, on
production line 1, (50,35,45) units of glue (1,2,3) , respectively, on production line 2. Each
week, at least (120, 150, 200) units of glue (1,2,3) must be produced, respectively. What
kinds of decisions are to be made? Formulate an Integer Programming to minimize the
total cost of meeting weekly demands.
Answer:
-Decision Variable
xi = # 𝑜𝑓 𝑤𝑜𝑟𝑘𝑒𝑟𝑠 𝑒𝑚𝑝𝑙𝑜𝑦𝑒𝑑 𝑖𝑛 𝐿𝑖𝑛𝑒 𝑖
𝑦𝑖 = 1 𝑖𝑓 𝑙𝑖𝑛𝑒 𝑖 𝑖𝑠 𝑢𝑠𝑒𝑑. 0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
-Objective function
𝑀𝑖𝑛 𝑧 = 1000y1 + 2000𝑦2 + 500𝑥1 + 900𝑥2
-Constraints
s.t.
20x1 + 50𝑥2 ≥ 120
30x1 + 35𝑥2 ≥ 150
40x1 + 45𝑥2 ≥ 200
x1 ≤ 7𝑦1
x2 ≤ 7𝑦2
x1 , 𝑥2 ≥ 0, y1 , 𝑦2 ∈ {0,1}
12
6. (10 Pts.) Three friends are planning to open the party tonight and want to divide works.
Everybody has his own preference for each work, and wants to assign each job to whom
like it the most. The following table shows the preference indicator. Each work has to be
assigned to the different people.
Cooking(1) Cleaning(2)
Inviting friends(3)
Park (1)
8
7
6
Lee (2)
6
2
9
Kim (3)
8
5
5
The mathematical formulation for the problem is as follows: Let the decision variable xij=1
if friend i takes the work j, xij=0, otherwise. Let the preference data given in the table above
be pij. Then the formulation should be:
Max
p x
ij ij
, s.t.
x
j
ij
 1 i ,
x
ij
 1 j , xij = 0 or 1.
i
Give OPL code to solve the following assignment problem using the range form and for,
sum expression.
Answer:
int friend = 3;
int work = 3;
range friends = 1..friend;
range works = 1..work;
int p[friends][works] = [ [8,7,6], [6,2,9], [8,5,5] ];
dvar boolean x[friends][works];
maximize sum(i in friends, j in works) p[i][j]*x[i][j];
subject to
{
forall(i in friends)
sum(j in works) x[i][j] == 1;
forall(j in works)
sum(i in friends) x[i][j] == 1;
}