Professional Documents
Culture Documents
Linear Programming: Transportation, Assignment, and Transshipment Problems
Linear Programming: Transportation, Assignment, and Transshipment Problems
Sources Destinations
1
Transportation Problem
Transportation Problem
• LP Formulation
The LP formulation in terms of the amounts • LP Formulation Special Cases
shipped from the origins to the destinations, xij , can The following special-case modifications to
be written as: the linear programming formulation can be
made:
Min ΣΣcijxij
ij – Minimum shipping guarantee from i to j:
s.t. Σxij < si for each origin i xij > Lij
j
Acme Block Company has orders for 80 tons of Delivery Cost Per Ton
concrete blocks at three suburban locations
as follows: Northwood -- 25 tons, Northwood Westwood Eastwood
Westwood -- 45 tons, and Plant 1 24 30 40
Eastwood -- 10 tons. Acme Plant 2 30 40 42
e
has two plants, each of which
can produce 50 tons per week.
Acm
Delivery cost per ton from each plant
to each suburban location is shown on the next slide.
How should end of week shipments be made to fill
the above orders?
2
Transportation Simplex Method Transportation Simplex Method
• The transportation problem is solved in two phases: • Phase I - Minimum-Cost Method
– Phase I -- Finding an initial feasible solution – Step 1: Select the cell with the least cost. Assign to
this cell the minimum of its remaining row supply or
– Phase II – Iterating to the optimal solution
remaining column demand.
• In Phase I, the Minimum-Cost Method can be used – Step 2: Decrease the row and column availabilities
to establish an initial basic feasible solution without by this amount and remove from consideration all
doing numerous iterations of the simplex method. other cells in the row or column with zero
availability/demand. (If both are simultaneously
• In Phase II, the Stepping Stone Method, using the
reduced to 0, assign an allocation of 0 to any other
MODI method for evaluating the reduced costs may unoccupied cell in the row or column before deleting
be used to move from the initial feasible solution to both.) GO TO STEP 1.
the optimal one.
MODI Method (for obtaining reduced costs) Acme Block Company has orders for 80 tons of
Associate a number, ui, with each row and vj with concrete blocks at three suburban locations
each column. as follows: Northwood -- 25 tons,
• Step 1: Set u1 = 0. Westwood -- 45 tons, and
• Step 2: Calculate the remaining ui's and vj's by Eastwood -- 10 tons. Acme
e
Acm
solving the relationship cij = ui + vj for occupied cells. has two plants, each of which
• Step 3: For unoccupied cells (i,j), the reduced cost = can produce 50 tons per week.
cij - ui - vj.
Delivery cost per ton from each plant
to each suburban location is shown on the next slide.
How should end of week shipments be made to fill
the above orders?
3
Example: ABC Example: ABC
30 40 42 0
Plant 2 50
Demand 25 45 10 20
continued
Iteration 1 Iteration 1
• MODI Method • MODI Method (continued)
1. Set u1 = 0 Calculate the reduced costs (circled numbers on the
2. Since u1 + vj = c1j for occupied cells in row 1, then next slide) by cij - ui + vj.
v1 = 24, v2 = 30, v4 = 0. Unoccupied Cell Reduced Cost
3. Since ui + v2 = ci2 for occupied cells in column 2, (1,3) 40 - 0 - 32 = 8
then u2 + 30 = 40, hence u2 = 10.
(2,1) 30 - 24 -10 = -4
4. Since u2 + vj = c2j for occupied cells in row 2, then
(2,4) 0 - 10 - 0 = -10
10 + v3 = 42, hence v3 = 32.
4
Example: ABC Example: ABC
Iteration 2 Iteration 2
• MODI Method • MODI Method (continued)
The reduced costs are found by calculating Calculate the reduced costs (circled numbers on the
the ui's and vj's for this tableau. next slide) by cij - ui + vj.
1. Set u1 = 0.
Unoccupied Cell Reduced Cost
2. Since u1 + vj = cij for occupied cells in row 1, then
(1,3) 40 - 0 - 32 = 8
v1 = 24, v2 = 30.
(1,4) 0 - 0 - (-10) = 10
3. Since ui + v2 = ci2 for occupied cells in column 2,
(2,1) 30 - 10 - 24 = -4
then u2 + 30 = 40, or u2 = 10.
4. Since u2 + vj = c2j for occupied cells in row 2, then
10 + v3 = 42 or v3 = 32; and, 10 + v4 = 0 or v4 = -10.
5
Example: ABC Example: ABC
Iteration 3 Iteration 3
• MODI Method • MODI Method (continued)
The reduced costs are found by calculating Calculate the reduced costs (circled numbers on the
the ui's and vj's for this tableau. next slide) by cij - ui + vj.
1. Set u1 = 0
Unoccupied Cell Reduced Cost
2. Since u1 + vj = c1j for occupied cells in row 1, then
(1,3) 40 - 0 - 36 = 4
v1 = 24 and v2 = 30.
(1,4) 0 - 0 - (-6) = 6
3. Since ui + v1 = ci1 for occupied cells in column 2,
(2,2) 40 - 6 - 30 = 4
then u2 + 24 = 30 or u2 = 6.
4. Since u2 + vj = c2j for occupied cells in row 2, then
6 + v3 = 42 or v3 = 36, and 6 + v4 = 0 or v4 = -6.
vj 24 30 36 -6
Partial Spreadsheet Showing Problem Data Partial Spreadsheet Showing Optimal Solution
A B C D E F G H A B C D E F G
1 LHS Coefficients 10 X11 X12 X13 X21 X22 X23
11 Dec.Var.Values 5 45 0 20 0 10
2 Constraint X11 X12 X13 X21 X22 X23 RHS
12 Minimized Total Shipping Cost 2490
3 #1 1 1 1 50
13
4 #2 1 1 1 50
14 LHS RHS
Constraints
5 #3 1 1 25 15 P1.Cap. 50 <= 50
6 #4 1 1 45 16 P2.Cap. 30 <= 50
7 #5 1 1 10 17 N.Dem. 25 = 25
8 Obj.Coefficients 24 30 40 30 40 42 30 18 W.Dem. 45 = 45
19 E.Dem. 10 = 10
6
Example: Acme Block Co. Example: Acme Block Co.
7
Example: Zeron Shelving
Example: Zeron Shelving
Because of long standing contracts based on past
The Northside and Southside facilities of orders, unit costs from the manufacturers to the
Zeron Industries supply three firms (Zrox, suppliers are:
Hewes, Rockrite) with customized shelving for
its offices. They both order shelving from the Zeron N Zeron S
Arnold 5 8
same two manufacturers, Arnold
Supershelf 7 4
Manufacturers and Supershelf, Inc.
Currently weekly demands by the users The costs to install the shelving at the various
are 50 for Zrox, 60 for Hewes, and 40 for locations are:
Rockrite. Both Arnold and Supershelf can
supply at most 75 units to its customers. Zrox Hewes Rockrite
Thomas 1 5 8
Additional data is shown on the next slide. Washburn 3 4 4
8
Example: Zeron Shelving Example: Zeron Shelving
7 3 4 6 0.000 -10.000
Super Zeron 7 0.000 -10.000
75 Shelf WASH 40
4 S
BURN
75 4
Rock-
Rite 40
Assignment Problem
Assignment Problem
• An assignment problem seeks to minimize the • Network Representation
total cost assignment of m workers to m jobs,
given that the cost of worker i performing job j is c11
1 1
cij. c12
• It assumes all workers are assigned and each job c13
Agents Tasks
is performed. c21
c22
• An assignment problem is a special case of a 2 2
transportation problem in which all supplies and c23
all demands are equal to 1; hence assignment
problems may be solved as linear programs. c31
c32
3 c33 3
9
Assignment Problem
Assignment Problem
• LP Formulation
LP Formulation Special Cases
xij : Agent i assigned to task j
xij = 0 or 1 for all i and j
•Number of agents exceeds the number of tasks:
Σxij < 1 for each agent i
Min ΣΣcijxij j
ij
•Number of tasks exceeds the number of agents:
s.t. Σxij = 1 for each agent i
j Add enough dummy agents to equalize the
number of agents and the number of tasks.
Σxij = 1 for each task j The objective function coefficients for these
i new variable would be zero.
Note: A modification to the right-hand side of the
first constraint set can be made if a worker is
permitted to work more than 1 job.
Dr. Ahmed Mohib 55 Dr. Ahmed Mohib 56
10
Hungarian Method Hungarian Method
The Hungarian method solves minimization Step 1: For each row, subtract the minimum number in
assignment problems with m workers and m jobs. that row from all numbers in that row.
Special considerations can include: Step 2: For each column, subtract the minimum number
• number of workers does not equal the number of in that column from all numbers in that column.
jobs -- add dummy workers or jobs with 0 Step 3: Draw the minimum number of lines to cover all
assignment costs as needed zeroes. If this number = m, STOP -- an assignment can be
• worker i cannot do job j -- assign cij = +M made.
• maximization objective -- create an opportunity loss continued
matrix subtracting all profits for each job from the
maximum profit for that job before beginning the
Hungarian method
Step 4: Determine the minimum uncovered number (call Finding the Minimum Number of Lines and
it d). Determining the Optimal Solution
• Subtract d from uncovered numbers. • Step 1: Find a row or column with only one unlined
• Add d to numbers covered by two lines. zero and circle it. (If all rows/columns have two or
• Numbers covered by one line remain the same. more unlined zeroes choose an arbitrary zero.)
• Then, GO TO STEP 3. • Step 2: If the circle is in a row with one zero, draw a
line through its column. If the circle is in a column
with one zero, draw a line through its row. One
approach, when all rows and columns have two or
more zeroes, is to draw a line through one with the
most zeroes, breaking ties arbitrarily.
continued
Finding the Minimum Number of Lines and An electrical contractor pays his subcontractors a
Determining the Optimal Solution (continued) fixed fee plus mileage for work performed. On a given
day the contractor is faced with three electrical jobs
• Step 3: Repeat step 2 until all circles are lined. If this associated with various projects. Given below are the
minimum number of lines equals m, the circles distances between the subcontractors and the projects.
provide the optimal assignment.
Projects
Subcontractor A B C
Westside 50 36 16
Federated 28 30 18
Goliath 35 32 20
Universal 25 25 14
How should the subcontractors be assigned to
minimize total mileage costs?
11
Example: Who’s Doing What? Example: Who’s Doing What?
Step 3: Draw the minimum number of lines to Step 5: Subtract 2 from uncovered numbers; add
cover all zeroes using the following rules. If a 2 to all numbers covered by two lines. This gives:
"remaining" row has only one zero, draw a line through
the column. If a remaining column has only one zero in
A B C Dummy
it, draw a line through the row.
Westside 23 9 0 0
A B C Dummy Federated 1 3 2 0
Westside 25 11 2 0 Goliath 8 5 4 0
Federated 3 5 4 0 Universal 0 0 0 2
Goliath 10 7 6 0
Universal 0 0 0 0
Step 3: Draw the minimum number of lines to Step 5: Subtract 1 from uncovered numbers. Add
cover all zeroes. 1 to numbers covered by two lines. This gives:
A B C Dummy A B C Dummy
Westside 23 9 0 0 Westside 23 9 0 1
Federated 1 3 2 0 Federated 0 2 1 0
Goliath 8 5 4 0 Goliath 7 4 3 0
Universal 0 0 0 2 Universal 0 0 0 3
12
Example: Who’s Doing What?
Example: Who Does What?
Step 4: The minimum number of lines to cover all • The optimal assignment is:
0's is four. Thus, there is a minimum-cost assignment of
0's with this tableau. The optimal assignment is: Subcontractor Project Distance
Westside C 16
Subcontractor Project Distance
Federated A 28
Westside C 16
Goliath (unassigned)
Federated A 28
Universal B 25
Goliath (unassigned)
Total Distance = 69 miles
Universal B 25
Total Distance = 69 miles
The Hungarian method solves minimization Step 1: For each row, subtract the minimum number in
assignment problems with m workers and m jobs. that row from all numbers in that row.
Special considerations can include: Step 2: For each column, subtract the minimum number
• number of workers does not equal the number of in that column from all numbers in that column.
jobs -- add dummy workers or jobs with 0 Step 3: Draw the minimum number of lines to cover all
assignment costs as needed zeroes. If this number = m, STOP -- an assignment can be
• worker i cannot do job j -- assign cij = +M made.
• maximization objective -- create an opportunity loss continued
matrix subtracting all profits for each job from the
maximum profit for that job before beginning the
Hungarian method
Step 4: Determine the minimum uncovered number (call Finding the Minimum Number of Lines and
it d). Determining the Optimal Solution
• Subtract d from uncovered numbers. • Step 1: Find a row or column with only one unlined
• Add d to numbers covered by two lines. zero and circle it. (If all rows/columns have two or
• Numbers covered by one line remain the same. more unlined zeroes choose an arbitrary zero.)
• Then, GO TO STEP 3. • Step 2: If the circle is in a row with one zero, draw a
line through its column. If the circle is in a column
with one zero, draw a line through its row. One
approach, when all rows and columns have two or
more zeroes, is to draw a line through one with the
most zeroes, breaking ties arbitrarily.
continued
13
Hungarian Method • Faculty of Engineering
Finding the Minimum Number of Lines and
Determining the Optimal Solution (continued)
• Step 3: Repeat step 2 until all circles are lined. If this
minimum number of lines equals m, the circles
provide the optimal assignment.
14