Slide09-Assignment and Network Optimization PDF
Slide09-Assignment and Network Optimization PDF
Zhou, Jian
Contents
Then the peas are shipped by truck to four distributing warehouses in the
western United States (Sacramento, California; Salt Lake City, Utah; Rapid
City, South Dakota; and Albuquerque, New Mexico).
In order to do that, an estimate has been made of the output from each
cannery, and each warehouse has been allocated a certain amount from the
total supply of peas (in units of truckloads), along with the shipping cost
per truckload for each cannery-warehouse combination.
Please determine which plan for assigning these shipments to the various
cannery-warehouse combinations would minimize the total shipping cost.
Zhou, Jian: zhou_jian@shu.edu.cn School of Management, Shanghai University 5 / 56
Operations Research Fall 2012
X Decision variables:
xij (i = 1, 2, 3; j = 1, 2, 3, 4) the number of truckloads to be shipped
from cannery i to warehouse j
X Objective function:
Z total shipping cost
X Constraints:
Cannery constraints and warehouse constraints, nonnegative
constraints
X Parameters:
Zhou, Jian: zhou_jian@shu.edu.cn School of Management, Shanghai University 6 / 56
Operations Research Fall 2012
min Z = 464x11 + 513x12 + 654x13 + 867x14 + 352x21 + 416x22
+690x23 + 791x24 + 995x31 + 682x32 + 388x33 + 685x34
subject to:
x11 + x12 + x13 + x14 = 75
x21 + x22 + x23 + x24 = 125
x31 + x32 + x33 + x34 = 100
x11 + x21 + x31 = 80
x12 + x22 + x32 = 65
x13 + x23 + x33 = 70
x14 + x24 + x34 = 85
xij 0, i = 1, 2, 3; j = 1, 2, 3, 4
C = [464, 513, 654, 867, 352, 416, 690, 791, 995, 682, 388, 685];
A = [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1;
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0;
0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0;
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0;
0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1];
B = [75, 125, 100, 80, 65, 70, 85];
L = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
[X , fval ] = linprog (C , [ ], [ ], A, B, L)
Zhou, Jian: zhou_jian@shu.edu.cn School of Management, Shanghai University 8 / 56
Operations Research Fall 2012
C = [464 352 995; 513 416 682; 654 690 388; 867 791 685];
[m, n] = size(C );
ae = zeros(m + n, m n);
for k =1:1:n
for h = (k 1) m + 1 : 1 : m k
ae(k, h) = 1;
end
end
for i =n+1:n+m
for h = (i n) : m : m n
ae(i, h) = 1;
end
end
A = ae;
B = [75 125 100 80 65 70 85];
L = zeors(m, n);
[X , fval ] = linprog(C , [ ], [ ], A, B, L)
Lindo Code:
Assignment Problem
The JOB SHOP COMPANY has purchased four new machines of different
types.
There are four available locations in the shop where a machine could be
installed.
Some of these locations are more desirable than others for particular
machines because of their proximity to work centers that will have a heavy
work flow to and from these machines.
Assignment Problem
The estimated cost in dollars per hour of materials handling involving each
of the machines is given in the table for the respective locations.
X Decision variables:
X Objective function:
X Constraints:
X Parameters:
Zhou, Jian: zhou_jian@shu.edu.cn School of Management, Shanghai University 17 / 56
Operations Research Fall 2012
Assignment Problem
min Z = 58x11 + 69x12 + 180x13 + 260x14 + 75x21 + 50x22 + 150x23
+230x24 + 65x31 + 70x32 + 170x33 + 250x34 + 82x41 + 55x42 + 200x43 + 2
subject to:
x11 + x12 + x13 + x14 = 1
x21 + x22 + x23 + x24 = 1
x31 + x32 + x33 + x34 = 1
x41 + x42 + x43 + x44 = 1
x11 + x21 + x31 + x41 = 1
x12 + x22 + x32 + x42 = 1
x13 + x23 + x33 + x43 = 1
x14 + x24 + x34 + x44 = 1
xij 0, i = 1, 2, 3, 4; j = 1, 2, 3, 4
C = [58, 69, 180, 260, 75, 50, 150, 230, 65, 70, 170, 250, 82, 55, 200, 280];
A = [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0;
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1;
1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0;
0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0;
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0;
0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1];
B = [1, 1, 1, 1, 1, 1, 1, 1];
L = zeros(1, 16);
[X , fval ] = bintprog (C , [ ], [ ], A, B, L)
Zhou, Jian: zhou_jian@shu.edu.cn School of Management, Shanghai University 20 / 56
Operations Research Fall 2012
C = [58, 75, 65, 82; 69, 50, 70, 55; 180, 150, 170, 200; 260, 230, 250, 280];
[m, n] = size(C );
ae = zeros(m + n, m n);
for k =1:1:n
for h = (k 1) m + 1 : 1 : m k
ae(k, h) = 1;
end
end
SEERVADA PARK has recently been set aside for a limited amount of
sightseeing and backpack hiking.
Cars are not allowed into the park, but there is a narrow, winding road
system for trams and for jeeps driven by the park rangers.
This road system is shown in Fig. 9.1, where location O is the entrance
into the park; other letters designate the locations of ranger stations .
The numbers give the distances of these winding roads in miles. The park
contains a scenic wonder at station T.
A small number of trams are used to transport sightseers from the park
entrance to station T and back.
Determine which route from the park entrance to station T has the
smallest total distance for the operation of the trams.
The road system for Seervada Park.
X Decision variables:
xij (i = 1, 2, 3; j = 1, 2, 3, 4) The path from the origin to the
destination
X Objective function:
Z The total distance of the path
X Constraints:
Connected network constraints and nonnegative constraints
X Parameters:
Zhou, Jian: zhou_jian@shu.edu.cn School of Management, Shanghai University 29 / 56
Operations Research Fall 2012
Objective of nth iteration: Find the nth nearest node to the origin.
Input for nth iteration: n 1 nearest nodes to the origin, including
their shortest path and distance from the origin. (Solved nodes;
unsolved nodes.)
Candidates for nth nearest node: Each solved node that is directly
connected by a link to one or more unsolved nodes provides one
candidate - the unsolved node with the shortest connecting link.
Calculation of nth nearest node: For each such solved node and its
candidate, add the distance between them and the distance of the
shortest path from the origin to this solved node. The candidate with
the smallest such total distance is the nth nearest node , and its
shortest path is the one generating this distance.
The question is where the lines should be laid to accomplish this with a
minimum total number of miles of line installed.
X Decision variables:
A network providing a path between each pair of nodes
X Objective function:
Z The total length of the links
X Constraints:
Links must provide a path between each pair of nodes and
nonnegative constraints
X Parameters:
Zhou, Jian: zhou_jian@shu.edu.cn School of Management, Shanghai University 33 / 56
Operations Research Fall 2012
During the peak season, a strict ration has been placed on the number of
tram trips that can be made on each of the roads per day.
The question pertains to how to route the various trips to maximize the
number of trips that can be made per day without violating the limits on
any individual road.
X Decision variables:
Combinations of routes
X Objective function:
Z The total number of trips
X Constraints:
Rout constraints, outgoing trip constraints and nonnegative constraints
X Parameters:
X Decision variables:
xi (i = 1, 2) the number of batches of product i produced per week
X Objective function:
Z total profit per week from producing these two products
X Constraints:
Production capacity constraints, integer and nonnegative constraints
X Parameters:
max Z = 3x1 + 5x2
subject to:
x1 4
2x2 12
3x1 + 2x2 18
x1 0, x2 0 integers.
C = [3 5];
A = [1 0; 0 2; 3 2; ];
B = [4 12 18];
LB = [0, 0];
Aeq = [ ];
Beq = [ ];
[x, fval ] = linprog (C , A, B, Aeq, Beq, LB)
D3 = SUMPRODUCT (B3 : C 3 B9 : C 9)
D4 = SUMPRODUCT (B4 : C 4 B9 : C 9)
Zhou, Jian: zhou_jian@shu.edu.cn School of Management, Shanghai University 45 / 56
Operations Research Fall 2012
Lindo Code:
Results by Lindo:
X Decision variables:
Fraction of the maximum feasible use of an abatement method (so xj
cannot exceed 1), xj (j = 1, 2, , 6)
X Objective function:
Z Minimum total annual cost
X Constraints:
Reduction requirements, fraction constraints and nonnegative
constraints
X Parameters:
Zhou, Jian: zhou_jian@shu.edu.cn School of Management, Shanghai University 50 / 56
Operations Research Fall 2012
Lindo Code:
Results by Lindo