Вы находитесь на странице: 1из 91

Transportation and

Assignment Problems

The Transportation Model

Solution of a Transportation
Problem
The Assignment Model
Solution of the Assignment Model

The Transportation Model


Characteristics

A product is transported from a number


of sources to a number of destinations at
the minimum possible cost.

Each source is able to supply a fixed


number of units of the product, and each
destination has a fixed demand for the
product.
The linear programming model has
constraints for supply at each source and
demand at each destination.
All constraints are equalities in a balanced

Transportation Model Example


Problem Definition and Data
- Problem:How many tons of wheat to transport from
each grain elevator to each mill on a monthly basis in
order to minimize the total cost of transportation ?
- Data:
Mill

Grain Elevator

Supply

Demand
1. Kansas City

150

A. Chicago

200

2. Omaha

175

B. St.Louis

100

3. Des Moines

275

C. Cincinnati

300

Total

600 tons

Total

600 tons

Transportation Model Example


Model Formulation
minimize Z = $6x1A + 8x1B + 10x1C + 7x2A + 11x2B +
11x2C + 4x3A + 5x3B + 12x3C
subject to x1A + x1B + x1C = 150where xij = tons of
x2A + x2B + x2C = 175wheat from each grain
elevator, i, i = 1, 2, 3,
x3A + x3B+ x3C = 275to each mill j,
j=
A,B,C
x1A + x2A + x3A = 200
Network of transportation
x1B + x2B + x3B = 100
routes for wheat shipments
x1C + x2C + x3C = 300
xij 0

Solution of the Transportation Model


Tableau Format
Transportation problems are solved manually within

a tableau format.
Each cell in a transportation tableau is analogous to
a decision variable that indicates the amount
allocated from a source to a destination.
The supply and demand values along the outside rim
of a tableau are called rim values.

The
Transporta
tion
Tableau

Solution of the Transportation Model


Solution Methods

Transportation models do not start at the


origin where all decision values are zero;
they must instead be given an initial feasible
solution.

Initial feasible solution determination


methods include:
- northwest corner method
- minimum cell cost method
- Vogels Approximation Method
Methods for solving the transportation
problem itself (Optimal sol)include:
- stepping-stone method and

The Northwest Corner Method


- In the northwest corner method the largest possible
allocation is made to the cell in the upper left-hand corner
of the tableau , followed by allocations to adjacent feasible
cells.

The Initial
NW Corner
Solution

- The initial solution is complete when all rim requirements are


satisfied.

- Transportation cost is computed by


evaluating the objective function: Z = $6x1A +
8
8x + 10x + 7x + 11x + 11x + 4x + 5x +

The Northwest Corner Method


Summary of Steps

1. Allocate as much as possible to the cell in the


upper left-hand
corner, subject to the supply
and demand conditions.
2. Allocate as much as possible to the next
adjacent feasible cell.
3. Repeat step 2 until all requirements are met.
9

The Minimum Cell Cost Method


In the minimum cell cost method as much as
possible is allocated to the cell with the
minimum(least) cost followed by allocation to the
feasible cell with minimum cost in remaining table.
-

75

nitial Minimum Cell Cost Allocation


25

The Second Minimum Cell Cost Alloca


10

The Minimum Cell Cost Method


(2 of 3)
- The complete initial minimum cell cost solution; total

cost = $4,550.
- The minimum cell cost method will provide a solution

with a lower cost than the northwest corner solution


because it considers cost in the allocation process.
125

The Initial Solution

12

The Minimum Cell Cost Method


Summary of Steps
(3 of 3)

1. Allocate as much as possible to the

feasible
cell
with
transportation cost, and
remaining requirements.

minimum
adjust the

2. Repeat step 1 until


requirements have been met.

all

rim

13

Initial sol by North West corner rule= $5,925


Initial sol by Minimum cost cell rule= $4,550

Vogels Approximation Method


(VAM)

Vogels Approximation Method (VAM)


- Method is based on the concept of
penalty cost or regret.
- In VAM the first step is to develop a penalty
cost for each source and destination.
- Penalty cost is calculated by subtracting the
minimum cell cost from the next higher cell cost
in each row and column.
2

AM Penalty Costs

16

Vogels Approximation Method (VAM)


(2 of 5)
- VAM allocates as much as possible to the minimum cost cell in the row
or column with the largest penalty cost.

The Initial VAM


Allocation

17

Vogels Approximation Method (VAM)


(3 of 5)
- After each VAM cell allocation, all row and column penalty costs are
recomputed.

The Second
VAM
Allocation

18

Vogels Approximation Method (VAM)


(4 of 5)
- Recomputed penalty costs after the third allocation.

The Third VAM


Allocation

19

Vogels Approximation Method (VAM)


(5 of 5)
-

The initial VAM solution; total cost = $5,125

- VAM and minimum cell cost methods both


provide better initial solutions than does the
northwest corner method.

The Initial
VAM Solution

20

Vogels Approximation Method (VAM)


Summary of Steps
1. Determine the penalty cost for each

row and column.


2. Select the row or column with the
highest penalty cost.
3. Allocate as much as possible to the
feasible cell with the
lowest
transportation cost in the row or column
with the highest penalty cost.
4. Repeat steps 1, 2, and 3 until all rim
requirements have been
met.
21

The Stepping-Stone Solution Method


(1 of 12)
- Once an initial solution is derived, the problem must be solved using
either the stepping-stone method or the modified distribution method
(MODI).
- The initial solution used as a starting point in this problem is the
minimum cell cost method solution because it had the minimum total cost of
the three methods used.

The Minimum
Cell Cost
Solution

22

The Stepping-Stone Solution Method


(2 of 12)

The stepping-stone method determines if


there is a cell with no allocation that would
reduce cost if used.
-

+1

The Allocation of One Ton to Cell 1A

23

The Stepping-Stone Solution Method


(3 of 12)
- Must subtract one ton from another allocation along that row.

The
Subtraction of
One Ton from
Cell 1B

24

The Stepping-Stone Solution Method


(4 of 12)
- A requirement of this solution method is that units can only be added to
and subtracted from cells that already have allocations, thus one ton must be
added to a cell as shown.

The Addition
of One Ton to
Cell 3B and
the
Subtraction of
One Ton from
Cell 3A

6-8+5-4=
-1

25

The Stepping-Stone Solution Method


(5 of 12)
- An empty cell that will reduce cost is a potential entering variable.
- To evaluate the cost reduction potential of an empty cell, a closed path
connecting used cells to the empty cells is identified.

The
Steppin
g-Stone
Path
for Cell
2A

26

The Stepping-Stone Solution Method


(6 of 12)
- The remaining stepping-stone paths and resulting computations for cells
2B and 3C.

The
SteppingStone Path
for Cell 2B

The
Stepping
-Stone
Path for
Cell 3C

27

The Stepping-Stone Solution Method


(7 of 12)
- After all empty cells are evaluated, the one with the greatest
cost reduction potential is the entering variable.
- A tie can be broken arbitrarily.

The
SteppingStone
Path for
Cell 1A

28

The Stepping-Stone Solution Method


(8 of 12)

- When reallocating units to the entering variable (cell), the amount is the
minimum amount subtracted on the stepping-stone path.
- At each iteration one variable enters and one leaves (just as in the
simplex method).

The Second
Iteration of the
Stepping-Stone
Method

29

The Stepping-Stone Solution Method


(9 of 12)

- Check to see if the solution is optimal.

The Stepping-Stone
Path for Cell 2A

The SteppingStone Path for


Cell 1B
30

The Stepping-Stone Solution Method


(10 of 12)
- Continuing check for optimality.

The SteppingStone Path for Cell


2B

The SteppingStone Path for


Cell 3C
31

The Stepping-Stone Solution Method


(11 of 12)

- The stepping-stone process is repeated until none of the

empty cells will reduce costs


(i.e., an optimal solution).
- In example, evaluation of four paths indicates no cost
reductions, therefore Table 19 solution is optimal.
- Solution and total minimum cost :
x1A = 25 tons, x2C = 175 tons, x3A = 175 tons, x1C = 125
tons, x3B = 100 tons
Z = $6(25) + 8(0) + 10(125) + 7(0) + 11(0) + 11(175)
+ 4(175) + 5(100) + 12(0)
= $4,525
32

The Stepping-Stone Solution Method


(12 of 12)
- A multiple optimal solution occurs when an empty cell has a cost
change of zero and all other empty cells are positive.
- An alternate optimal solution is determined by allocating to the
empty cell with a zero cost change.
- Alternate optimal total minimum cost also equals $4,525.

The Alternative
Optimal Solution

33

The Stepping-Stone Solution Method


Summary of Steps

1. Determine the stepping-stone paths and cost


changes for
each empty cell in the tableau.
2. Allocate as much as possible to the empty cell
with the
greatest net decrease in cost.
3. Repeat steps 1 and 2 until all empty cells have
positive cost
changes that indicate an optimal
solution.

34

The Modified Distribution Method (MODI)


(1 of 6)
MODI is a modified version of the stepping-stone
method in which math equations replace the steppingstone paths.
In the table, the extra left-hand column with the u i
symbols and the extra top row with the vj symbols
represent values that must be computed.
-Computed for all cells with allocations :
ui + vj = cij = unit transportation
cost for cell ij.

35

The Modified Distribution Method (MODI)


(2 of 6)
- Formulas for cells containing allocations:
x1B: u1 + vB = 8
x1C: u1 + vC = 10
x2C: u2 + vC = 11
x3A: u3 + vA = 4
x3B: u3 + vB = 5

cost = 4550
The Initial Solution with All ui and vj Values

Five equations with 6 unknowns, therefore let u 1 = 0 and solve to


obtain:

vB = 8, vC = 10, u2 = 1, u3 = -3, vA= 7


unique solution

**** this is not

36

The Modified Distribution Method (MODI)


(3 of 6)
- Each MODI allocation replicates the stepping-stone
allocation.
- Use following to evaluate all empty cells:
cij - ui - vj = kij
where kij equals the cost increase or decrease that
would occur by allocating to a cell. - For the empty cells
in Table :
x1A: k1A = c1A - u1 - vA = 6 - 0 - 7 = -1
x2A: k2A = c2A - u2 - vA = 7 - 1 - 7 = -1
x2B: k2B = c2B - u2 - vB = 11- 1 - 8 = +2
37

x3C: k3C = c3C - u3 -vC = 12 - (-3) - 10 = +5

The Modified Distribution Method (MODI)


(4 of 6)

- After each allocation to an empty cell, the ui and vj values must be


recomputed.

The Second Iteration of the MODI Solution Method

Cost == 4525
at the rate of

note earlier cost was 4550 it is reduced


for

X 1A = 25 i.e 25 X 1 =

38

The Modified Distribution Method (MODI)


(5 of 6)
- Recomputing ui and vj values: assuming u1 = 0

x1A: u1 + vA = 6, vA = 6
= 11, u2 = 1
x3A: u3 + vA = 4, u3 = -2

x1C: u1 + vC = 10, vC = 10

x2C: u2 + vC

x3B: u3 + vB = 5, vB = 7

The New ui and vj Values for the Second Iteration


39

The Modified Distribution Method (MODI)


(6 of 6)

- Cost changes for the empty cells,

cij - ui - vj = kij;

x1B: k1B = c1B - u1 - vB = 8 - 0 - 7 = +1


x2A: k2A = c2A - u2 - vA = 7 - 1 - 6 = 0
x2B: k2B = c2B - u2 - vB = 11 - 1 -7 = +3
x3C: k2B = c2B - u3 - vC = 12 - (-2) - 10 = +4
- Since none of the values are negative, solution obtained is
optimal.
40

The Modified Distribution Method (MODI)


Summary of Steps

1. Develop an initial solution.


2. Compute the ui and vj values for each row and
column.
3. Compute the cost change, kij, for each empty cell.
4. Allocate as much as possible to the empty cell
that will
result in the greatest net decrease in cost
(most negative kij)
5. Repeat steps 2 through 4 until all kij values are
positive or zero.
41

The Unbalanced Transportation Model


(1 of 2)
-

When demand exceeds supply

a dummy row is added to the tableau.

An Unbalanced
Model (Demand .
Supply)

42

The Unbalanced Transportation Model


(2 of 2)
- When supply exceeds demand, a dummy column is added

to the tableau.
- The dummy column (or dummy row) has no effect on the
initial solution methods or the optimal solution methods.

An Unbalanced Model (Supply . Demand)


43

Degeneracy
(1 of 3)

- In a transportation tableau with m rows and n columns, there must be m


+ n - 1 cells with allocations; if not, it is degenerate.
- The tableau in the figure does not meet the condition since 3 + 3 -1 = 5
cells and there are only 4 cells with allocations.

The Minimum Cell Cost Initial Solution

44

Degeneracy
(2 of 3)
- In a degenerate tableau, all the stepping-stone paths or MODI
equations cannot be developed.
-To rectify a degenerate tableau, an empty cell must artificially
be treated as an occupied cell.

The Initial Solution

45

Degeneracy
(3 of 3)
- The stepping-stone path s and cost changes for this tableau:
2A 2C 1C
x2A:

1A

7 - 11 + 10 - 6 = 0
2B 2C 1C

1B

x2B: 11 - 11 + 10 - 8 = + 2
3B 1B 1A

3A

x3B: 5 - 8 + 6 - 4 = - 1
3C 1C 1A

3A

x3C: 12 - 10 + 6 - 4 = + 4

The Second Stepping-Stone Iteration

46

Prohibited Routes

-A

prohibited route is assigned a large cost


such as M.
When the prohibited cell is evaluated, it will
always
contain the cost M, which will keep it
from being selected as an entering variable.

47

Maximization case
Convert the given maximization
problem into that of minimization by
replacing each element of the table
by the difference from the highest
element of the table.

Four factories, A, B, C and D produce sugar and the


capacity of each factory is given below: Factory A
produces 10 tons of sugar and B produces 8 tons of
sugar, C produces 5 tons of sugar and that of D is 6
tons of sugar. The sugar has demand in three
markets X, Y and Z. The demand of market X is 7
tons, that of market Y is 12 tons and the demand of
market Z is 4 tons. The following matrix gives the
transportation cost of 1 ton of sugar from each
factory to the destinations. Find the Optimal Solution
for least cost transportation cost.

Solution by Least cost cell (or inspection)


Method

Solution by Vogels Approximation Method: (Opportunity


cost method

Check the suitability(optimality) of the following solution

Class Assignment problem


Find the optimal solution using
stepping stone method for the
following transportation problem
A

suppl
y

30

11

40

13

50

28

32

25

Deman 35
d

Optimal answer
A

10

35

Cost Rs 776

20

18

32

Assignment Problem (AP)


(special cases of Linear
Programming)

Assignment Problem
An assignment problem seeks to minimize
the total cost assignment of m workers to
m jobs, given that the cost of worker i
performing job j is cij.
It assumes all workers are assigned and
each job is performed.
The network representation of an
assignment problem with three workers
and three jobs is shown on the next slide.

Assignment Problem
Network Representation
1

c11
c13
c21

c12

c22

c23
c31
3

c33

WORKERS

c32
3

JOBS

An assignment problem is a
special case of a transportation
problem in which all supplies
and all demands are equal to 1;
hence assignment problems may
be solved as transportation
problem/linear programs.

Assignment Problem
Linear Programming Formulation
Min cijxij
s.t.
for each worker i

for each job j

ij
xij = 1
j
xij = 1
i
xij = 0 or 1

for all i and j.


Note: A modification to the right-

Example: Hungry Owner


A contractor pays his subcontractors a fixed
fee plus mileage for work performed. On a given
day the contractor is faced with three electrical
jobs associated with various projects. Given
below are the distances between the
subcontractors and the projects.
Project
A
B
C
Westside
50 36 16
Subcontractors
Federated
28 30 18
Goliath
35 32 20
Universal
25 25 14
How should the contractors be assigned to
minimize total distance (and total cost)?

Example: Hungry Owner


Network Representation
West.

50
36

16
28

Fed.

18

35

25

32
20

Gol.

Univ.

30

25
14

Example: Hungry Owner


LP Formulation
Decision Variables Defined
xij = 1 if subcontractor i is assigned
to project j
= 0 otherwise
where: i = 1 (Westside),
2 (Federated),
3 (Goliath), and
4 (Universal)
j = 1 (A), 2 (B), and 3 (C)

Example: Hungry Owner


LP Formulation
Objective Function
Minimize total distance:
Min 50x11 + 36x12 + 16x13 + 28x21 +
30x22 + 18x23
+ 35x31 + 32x32 + 20x33 + 25x41 +
25x42 + 14x43

Example: Hungry Owner


LP Formulation
Constraints
x11 + x12 + x13 < 1 (no more than one
x21 + x22 + x23 < 1

project assigned

x31 + x32 + x33 < 1

to any one

x41 + x42 + x43 < 1

subcontractor)

x11 + x21 + x31 + x41 = 1 (each


project must
x12 + x22 + x32 + x42 = 1 be assigned
to just
x13 + x23 + x33 + x43 = 1 one

Example: Hungry Owner


Optimal Assignment
Subcontractor Project
Distance
Westside
C
Federated
A
28
Universal
B
25
Goliath

16

The Hungarian Algorithm


=> solving the assignment problem of a least
cost assignment of m workers to m jobs

Assumptions:
1. There is a cost assignment matrix for the m
people to be assigned to m tasks.
(If necessary dummy rows or columns consisting
of all 0s are added so that the numbers of people
and tasks are the same.)
2. All costs are nonnegative.
3. The problem is a minimization problem.

Theorem:
If a number is added to or subtracted
from all of the entries of any one row or
column of a cost matrix,
then on optimal assignment for the
resulting cost matrix is also an optimal
assignment for the original cost matrix.

Max
ij

cij

Min cij
ij
Where Cij

Minimize
Minimize
i.e.
maximize

xij

xij
= M-Cij

Min (M-)Xij
Cij

M (Xij) cij
xij
= M m -c
xij
ij
cij

xij

The Hungarian Algorithm


Initialization
1. For each row, subtract the minimum number from
all numbers in that row.
2. In the resulting matrix, subtract the minimum
number in each column from all numbers in the
column.

Iterative Steps
1. Make as many 0 cost assignments as possible. If
all workers are assigned, STOP; this is the minimum
cost assignment. Otherwise draw the minimum
number of horizontal and vertical lines necessary to
cover all 0s in the matrix. (A method for making the
maximum number of 0 cost assignments and
drawing the minimum number of lines to cover all
0s follows.)
2. Find the smallest value not covered by the lines;
this number is the reduction value.
3. Subtract the reduction value from all numbers not
covered by any lines. Add the reduction value to any
number covered by both a horizontal and vertical
line.
GO TO STEP 1.

For small problems, one can usually determine the maximum


number of zero cost assignments by observation. For larger
problems, the following procedure can be used:
Determining the Maximum Number of Zero-Cost Assignments
1. For each row, if only one 0 remains in the row, make that
assignment and eliminate the row and column from consideration in
the steps below.
2. For each column, if only one 0 remains, make that assignment
and eliminate that row and column from consideration.
3. Repeat steps 1 and 2 until no more assignments can be made. (If
0s remain, this means that there are at least two 0s in each
remaining row and column. Make an arbitrary assignment to one of
these 0s and repeat steps 1 and 2.)

Again, for small problems, the minimum number of lines required


to cover all the 0s can usually be determined by observation. The
following procedure, based on network flow arguments, can be
used for larger problems:
Drawing the Minimum Number of Lines to Cover All 0s
1. Mark all rows with no assignments (with a ).
2. For each row just marked, mark each column that has a 0 in
that row (with a ).
3. For each column just marked, mark each row that has an
assignment in that column (with a ).
4. Repeat steps 2 and 3 until no more marks can be made.
5. Draw lines through unmarked rows and marked columns.

Example:

First try to make


assignments
Draw minimum no of lines
to cover all zeros

Minimum uncovered
1

number

2
2. Find the smallest value not covered by the lines; this
number is the reduction value.
3. Subtract the reduction value from all numbers not covered
by any lines. Add the reduction value to any number covered
by both a horizontal and vertical line

Minimum uncovered
number

Now no of assignments
are 4

CONVERSION OF A MAXIMIZATION
PROBLEM TO A MINIMIZATION
PROBLEM
The Hungarian algorithm works only if the matrix is a
cost matrix. A maximization assignment problem can be
converted to a minimization problem by creating a lost
opportunity matrix. The problem then is to minimize the
total lost opportunity.

Profit Matrix:
J1 J2 J3 J4
W1

67 58 90 55

W2

58 88 89 56

W3

74 99 80 22

(D)

The lost opportunity matrix given below is derived by


subtracting each number in the J1 column from 74, each
number in the J2 column from 99, each number in the J3
column from 90, and each number in the J4 from 56.

J1 J2 J3 J4
W1

41 0

W2

16 11 1

W3

(D)

74 99 90 56

0 10 34

The Hungarian algorithm can now be applied to this lost


opportunity matrix to determine the maximum profit set of
assignments.

Example Assignment problem

Вам также может понравиться