You are on page 1of 84

TRANSPORTATION ALGORITHM

Prepared by:
MARITESS B. PANABANG lectured by
MARIA NORIZA Q. HERRERA
Dept. of Agribusiness Management & Entrepreneurship
CEM, UP Los Baos

INTRODUCTION
The

transportation model is a special class


of LP that deals with shipping/distribution of
goods/commodity from several points of
supply (sources) to a number of points of
demand (destinations)
The objective is to schedule shipments from
sources to destinations so that total
transportation costs are minimized.

INTRODUCTION
o

Transportation models can also be used


when a firm is trying to decide where to
locate a new facility.
Good financial decisions concerning
facility location also attempt to minimize
total transportation and production costs
for the entire system.

DEFINITION
s1

Units of
supply

s2

sm

c11

cmn

d1

d2

dn

o There are m sources and n destination


each represented by a node.
o The arcs represent the routes linking the
sources and the destinations.

Units of
demand

DEFINITION
s1

Units of
supply

s2

sm

c11

cmn

d1

d2

dn

o The cost per unit of shipping items from


source i to destination j is cij.
o The amount of supply at source i is si
and the amount of demand at
destination j is dj

Units of
demand

DEFINITION
s1

Units of
supply

The

s2

sm

c11

cmn

d1

d2

dn

objective of the model is to determine


the number of units to ship from source i to
destination j, denoted by xij, that will
minimize transportation cost while satisfying
supply and demand constraints.

Units of
demand

DEFINITION
s1

Units of
supply

Note

s2

sm

c11

cmn

d1

d2

dn

that this model assumes that the


shipping cost is proportional to the number
of units shipped on a given route.

Units of
demand

SAMPLE PROBLEM

MG Auto has three plants in Los Angeles, Detroit


and New Orleans, and two major distribution center
in Denver and Miami. The capacities of the three
plants during the next quarter are 1000, 1500,1200
cars. The quarterly demands at the two distribution
centers are 2300 and 1400 cars. The mileage chart
and the per unit shipping cost from the plants to the
distribution centers are on the table.
Los Angeles
Detroit
New Orleans

Denver
1000, $80
1250, $100
1275, $102

Miami
2690, $215
1350, $108
850, $68

SAMPLE PROBLEM
1000

1500

80

215

Los Angeles
100
2
108

2300

Denver

Detroit 102
1200

68

New Orleans

Construct

1400

Miami

the transportation tableau based


from this network model.

TRANSPORTATION TABLEAU
Sources
1

2
:
m
Demand

1
c11
x11
c21
x21
:

Destination
2

c12
x12

c22
x22

:
cm1

xm1
d1

cm2

xm2
d2

n
c1n
x1n
c2n
x2n

s1

s2
:

:
cmn

Supply

xmn
dn

sm

SAMPLE PROBLEM
Destination
Sources
Denver
Miami
80
215
Los Angeles
x11
x12
100
108
Detroit
x21
x22
102
68
New
Orleans
x31
x32
Demand
2300
1400

Supply
1000
1500

1200
3700

TRANSPORTATION MODEL
Min Z = 80x11 + 215x12 + 100x21 + 108x22 + 102x31 +68x32
subject to:
(supply constraints)
x11 + x12 =1000
x21 +x22 =1500
x31 +x32 =1200
(demand constraints)
x11 +x21 +x31 =2300
x12 +x22 +x32 =1400
(non-negativity)
xij >0, i= 1, 2, 3; j=1, 2

TRANSPORTATION MODEL
The

LP model can be solved by the simplex


method. However, its special structure
allows us to solve the problem more
efficiently using the transportation
simplex/algorithm.
The transportation simplex is based on the
assumption that the model is balanced,
means that the total demand equals the
total supply.

DUMMMY NODES
If

the model is unbalanced, we can always


augment it with a dummy destination (or
dummy source) to restore balance.
In the MG model, suppose that the Detroit
plant capacity is 1300 cars.
Because total demand exceeds total supply,
introduce a dummy source with a capacity
of 200 cars.

DUMMY NODES
Destination
Sources
Denver
Miami
80
215
Los Angeles
x11
x12
100
108
Detroit
x21
x22
102
68
New
Orleans
x31
x32
0
0
Dummy
x41
x42
Demand
2300
1400

Supply
1000
1300
1200

200
3700

DUMMY NODES
The

unit transportation cost from the dummy


plant to each destination is 0, because the
dummy plant does not exist and no actual
shipping will take place.
However, in some cases, this unit
transportation cost may also assume positive
values.
In cases wherein the supply exceeds the
demand, introduce a dummy destination whose
demand is equal to the excess supply.
The unit transportation costs to the dummy
destination are 0 unless it is required to impose
other conditions.

TRANSPORTATION ALGORITHM
Find an initial solution
1. Northwest corner method
2. Least-cost (greedy) method
3. Vogel approximation method (VAM).
The three methods, differ in the quality of
the starting basic solution they produce, in
the sense that a better starting solution
yields a smaller objective value.
1.

TRANSPORTATION ALGORITHM
2.

3.

4.

Test the solution to see if it is optimal


Stepping-stone method
Modified distribution (MODI) method
Develop an improved solution.
Stepping-stone method
Steps 2 and 3 are repeated until an
optimal solution is reached.

SAMPLE PROBLEM: SUN RAY TRANSPORT

Sun Ray Transport Company ships truckloads of


grain from three silos to four mills. The supply and
the demand (both in truckloads) together with the
unit transportation costs per truckload (in 000
pesos) on the different routes are given below:
Silos

1
2
3
Demand

Mill

Supply

10
12
4
5

2
7
14
15

20
9
16
15

11
20
18
15

15
25
10
50

STEP 1. FIND AN INITIAL SOLUTION


Northwest

corner method
The method starts at the northwest corner
cell of the tableau
PROCEDURE:
1. Exhaust the supply of each row before
moving down to the next row and
exhaust the demand requirements of
each column before moving to the next
column to the right.
2. Check that all supply and demand
requirements are met.

STEP 1. FIND AN INITIAL SOLUTION


Northwest corner method
Sources
(Silos)
1
2
3
Demand

Destination (Mills)
1
2
3
10
2
20
5
10
12
7
9
5
15
4
14
16
5

15

15

Supply

4
11
20
5
18
10
15

15
25
10
50

Total cost = 5*10+10*2+5*7+15*9+5*20+10*18 = P520

STEP 2. TEST FOR OPTIMALITY


This

step involves testing each unused


route/cell to see if shipping one unit on that
route would increase or decrease total cost
Involves generating improvement indices (Iij)
for each unused cells
To be able to use either the MODI or
stepping-stone the solution to be improved
should satisfy the rim requirement: # of
occupied cells = (# of rows + # of columns) 1

STEP 2. TEST FOR OPTIMALITY


Stepping-stone

1.
2.

3.

method
Select an unused square to be evaluated.
Beginning at this square, trace a closed
path back to the original square via squares
that are currently being used and moving
with only horizontal and vertical moves.
Beginning with a plus (+) sign at the
starting unused square, place alternate
minus (-) signs and plus signs on each
square of the closed path just traced.

STEP 2. TEST FOR OPTIMALITY


Stepping-stone

4.

5.

method
Calculate an improvement index by adding
together the unit cost figures found in each
square containing a plus sign and then
subtracting the unit costs in each square
containing a minus sign.
Repeat steps 1 to 4 until an improvement
index has been calculated for all unused
squares. If all Iij 0 (min); Iij 0 (max), an
optimal solution has been reached. If not, it
is possible to improve the current solution
and decrease total shipping costs.

STEP 2. TEST FOR OPTIMALITY


Sample

problem improvement indices:

STEP 3. DEVELOP AN IMPROVED SOLUTION


Stepping-stone

method
1. Choose the route (unused square) with
the largest negative (positive for max)
improvement index.
2. Using the closed path of this route, select
the smallest number () found in the
squares with minus sign.
3. Change the shipping route by adding to
squares in the closed path with plus
signs and subtracting from squares with
minus sign.

STEP 3. DEVELOP AN IMPROVED SOLUTION


Improved solution
Sources
(Silos)
1

Destination (Mills)
1
2
3
10
2
20

2
3
Demand

Supply

4
11

12

20

14

16

18

15

15

15

15
25
10
50

DEGENERACY IN TRANSPORTATION PROBLEMS


We

cannot proceed to the next step


because the preceding solution did not
satisfy the rim requirement.
The solution is degenerate.
Degeneracy occurs if the filling of an empty
cell results in two (or more) filled cells
becoming empty simultaneously.
To correct this problem, a zero should be
put in one (or more) of the previously filled
squares (usually the one with the lower cost.

STEP 4. REPEAT STEPS 2 AND 3 UNTIL


OPTIMAL SOLUTION IS FOUND

Sources
(Silos)
1

Destination (Mills)
1
2
3
10
2
20

2
3
Demand

Supply

4
11

12

20

14

16

18

15

15

15

15
25
10
50

OPTIMAL SOLUTION
The following table summarizes the optimal solution:
From
silo

To
mill

# of
truckloads

Unit cost

The associated minimum transportation cost is

Total
cost

DEGENERACY IN AN INITIAL SOLUTION


Degeneracy

can also occur when


generating an initial solution
To correct the problem, we can place a zero
in an unused square
With a northwest corner method, this zero
is placed adjacently to one of the filled
cells so the stair-step pattern continues.
With the least cost method, this zero is
placed in the unused cell with the least
cost

DEGENERACY IN AN INITIAL SOLUTION

Warehouse
1

2
3
Demand

Customer
1
2
8
2
0
100
10
9
100
7
10
100

100

Supply

3
6

9
20
7
80
100

100

120
80
300

MORE THAN ONE OPTIMAL SOLUTION


Multiple

solutions are possible when one or


more improvement indices in the optimal
solution stages are equal to zero

Multiple

optimal solutions are provide


management with greater flexibility in
selecting and using resources

MAXIMIZATION TRANSPORTATION PROBLEMS


When

selecting the unused square to be


filled, the square with the largest
improvement index is selected

The

optimal solution to a maximization


problem has been found when all
improvement indices are negative or zero

UNACCEPTABLE OR PROHIBITED ROUTES


At

times there are transportation problems


in which one of the sources is unable to ship
to one or more of the destinations
The problem is said to have an
unacceptable or prohibited route
A prohibited route is assigned a very large
cost (M) to prevent it from being used, in
maximization problems, this cost is given a
negative sign, to denote a very bad profit

FACILITY LOCATION ANALYSIS


A

new location is an issue of major financial


importance to a company
When deciding as to where to locate facilities,
several alternative locations are ordinarily
considered and evaluated
Even though a wide variety of subjective factors
are considered, including quality of labor
supply, presence of labor unions, community
attitude and appearance, utilities, and
recreational and educational facilities for
employees, a final decision also involves
minimizing total shipping and production costs.

FACILITY LOCATION ANALYSIS


The

new location that will yield the minimum


cost for the entire system will be the one
recommended.
The analysis involves solving several
transportation problems (each
transportation problem incorporating one of
the facilities being evaluated) to find the
new facility with lowest system cost.

SAMPLE PROBLEM

The Hardgrave Machine Company produces


computer components at its plant in Cincinnati, Salt
Lake City and Pittsburgh. These plants have not
been able to keep up with demand for orders at
Hardgraves four warehouses in Detroit, Dallas,
New York and Los Angeles. As a result, the firm has
decided to build a new plant to expand its
productive capacity. The two sites being considered
are Seattle and Birmingham; both cities are
attractive in terms of labor supply, municipal
services and ease of factory financing.

SAMPLE PROBLEM
Warehouse

Monthly
Demand
(Units)

Production
Plant

Monthly
Supply

Cost to
Produce 1
Unit ($)

Detroit

10,000 Cincinnati

15,000 48

Dallas

12,000 Salt Lake

6,000 50

New York

15,000 Pittsburgh

14,000 52

Los Angeles

9,000

35,000

46,000
Supply needed from new plant = 46,000 35,000 = 11,000 units per
month
Estimated production cost per unit at proposed plants
Seattle

$53

Birmingham

$49

SAMPLE PROBLEM
Detroit

Dallas

New York

Los
Angeles

Cincinnati

$25

$55

$40

$60

Salt Lake

35

30

50

40

Pittsburgh

36

45

26

66

Seattle

60

38

65

27

Birmingham

35

30

41

50

Which of the new locations will yield the lowest cost for the firm in
combination with the existing plants and warehouses? Note that the cost
of each individual plant-to warehouse route is found by adding shipping
costs to the respective unit production costs.
To determine which new plant shows the lowest total systemwide cost of
distribution and production, we solve two transportation problems one
for each of the two possible combinations

LEAST-COST METHOD
This

method finds a better starting solution


by concentrating on the cheapest routes
PROCEDURE:
1. Assign as much as possible to the cell
with the smallest unit cost (break ties
arbitrarily).
2. Satisfied row or column is crossed out
and the amounts of supply and demand
are adjusted accordingly.

LEAST-COST METHOD
If

both a row and a column are satisfied


simultaneously, only one is crossed out.
3. Look for the uncrossed-out cell with the
smallest unit and repeat the process until
exactly one row or one column is left
uncrossed out

LEAST-COST METHOD
Sources
(Silos)
1

Destination (Mills)
1
2
3
10
2
20

2
3
Demand

Supply

4
11

12

20

14

16

18

15

15

15

15
25
10
50

LEAST-COST METHOD
Sources
(Silos)
1
2
3
Demand

Destination (Mills)
Supply
1
2
3
4
10
2
20
11
15
15
12
7
9
20
25
0
15
10
4
14
16
18
10
5
5
5
15
15
15
50

Total cost = 5*4+15*2+15*9+10*20+5*18 = 475

VOGELS APPROXIMATION METHOD (VAM)


This

method tackles the problem of finding


an initial solution by taking into account the
costs associated with each route alternative
PROCEDURE:
1. For each row and column, find the
difference between the two lowest unit
shipping costs. This represents the
opportunity cost of not using the best
route.

VOGELS APPROXIMATION METHOD (VAM)


Sources
(Silos)
1
2

Destination (Mills)
Supply
1
2
3
4
10
2
20
11
15
12

20

14

16

18

3
Demand

15

15

15

25

10

10

50

VOGELS APPROXIMATION METHOD (VAM)


PROCEDURE:

2.

3.

4.

Identify the row or column with the


greatest opportunity cost.
Assign as many units as possible to the
lowest-cost square in the row or column
selected.
Eliminate any row or column that has just
been completely satisfied by the
assignment made. This can be done by
placing Xs in each appropriate square.

VOGELS APPROXIMATION METHOD (VAM)


Sources
(Silos)
1
2

3
Demand

Destination (Mills)
Supply
1
2
3
4
10
2
20
11
15
X
12
7
9
20
25
X
4
14
16
18
10
5
5
15
15
15
50
6

8
2
10

VOGELS APPROXIMATION METHOD (VAM)


PROCEDURE:

5.

6.

Recompute the cost differences, omitting


rows or columns eliminated in the
preceding step.
Return to step 2 for the rows and columns
remaining and repeat the steps until an
initial feasible solution has been obtained.

VOGELS APPROXIMATION METHOD (VAM)


Sources
(Silos)
1
2

3
Demand

Destination (Mills)
Supply
1
2
3
4
10
2
20
11
15
X
12
7
9
20
25
X
4
14
16
18
10
5
5
15
15
15
50
6

8
2
10

VOGELS APPROXIMATION METHOD (VAM)


Sources
(Silos)
1

Destination (Mills)
1
2
3
10
2
20

2
3
Demand

Total cost =

Supply

4
11

12

20

14

16

18

15

15

15

15
25
10
50

COMPARISON OF THE THREE METHODS


Method
Northwest
corner
Least-cost
VAM

Total Cost of
Initial Solution

# of Tableaus
3

2
2

MODI METHOD
The

modified distribution method allows us


to compute improvement indices quickly for
each unused square without drawing all of
the closed paths.
It can often provide considerable time
savings over stepping-stone method for
solving transportation problems
This method only requires us to trace one
closed path, this is used to determine what
changes to be made to obtain an improved
solution

MODI METHOD
We

let
Ri = value assigned to row i
Kj = value assigned to column j
Cij = cost in square ij (cost of shipping from
source i to destination j)
PROCEDURE:
1. For used squares, set Ri + Kj = Cij
2. After all the equations have been written, set
R1 = 0
3. Solve the system of equations for R and K
values

MODI METHOD
PROCEDURE:

4.

4.

Compute the improvement index for each


unused square using the formula:
Iij = Cij Ri - Kj
Select the best negative index and proceed
to improving the solution as you did using
the stepping-stone method.

NOTE: R and K values are recomputed every


time an improved solution is obtained

MODI METHOD
Initial solution using the northwest corner method
Sources
(Silos)
1

Destination (Mills)
1
2
3
10
2
20

2
3
Demand

Supply

4
11

12

20

14

16

18

15

15

15

15
25
10
50

MODI METHOD

Improvement Indices

MODI METHOD
Improved solution
Sources
(Silos)
1

Destination (Mills)
1
2
3
10
2
20

2
3
Demand

Supply

4
11

12

20

14

16

18

15

15

15

15
25
10
50

ASSIGNMENT ALGORITHM

DEFINITION
o

Refers to the class of LP problems that


involve determining the most efficient
assignment of
o
people to projects,
o
salespeople to territories,
o
contracts to bidders,
o
jobs to machines, etc.
The objective is most often to minimize
total costs or total time of performing the
tasks at hand.

DEFINITION
One

important characteristic of assignment


problems is that only one job or worker is
assigned to one machine or project.
The assignment model is a special case of
the transportation model in which all supply
and demand amounts are equal to 1.
Hence, the transportation simplex can be
used to solve the assignment model but it
would have a severe degeneracy problem

STRUCTURE OF THE ASSIGNMENT MODEL


Jobs
Workers
1
2
:
n

1
c11
c21
:
cn1

2
c12
c22
:
cn2

:
cn3

n
c1n
c2n
:
cnn

The element cij in the above cost matrix is


defined as the cost of assigning worker i to job
j, where i,j (1, 2, , n)

SAMPLE PROBLEM

Fix-It-Shop has just received three new rush


projects to repair: (1) a radio, (2) a toaster oven,
and (3) a broken coffee table. Three repair persons,
each with different talents and abilities, are
available to do the jobs. The Fix-It-Shop owner
estimates what it will cost in wages to assign each
of the workers to each of the three projects. The
costs, which are shown in the table on the next
slide, differ because the owner believes that each
worker will differ in speed and skill on these varied
jobs. The owners objective is to assign the three
projects to the workers in a way that will result in
the lowest total cost to the shop.

SAMPLE PROBLEM
Person
Adam
Ben
Carlo

1
11
8
9

Project
2
14
10
12

3
6
11
7

SOLVING

ASSIGNMENT PROBLEMS
Complete

Enumeration
List all possible assignments and their
respective costs
Works well for small problems but quickly
becomes inefficient as assignment
problems become larger
For example, a problem involving the
assignment of four workers to four
projects requires that we consider 4! Or
24 alternatives

SOLUTION USING COMPLETE ENUMERATION


Project Assignment
1
2
3
Adam
Ben
Carlo
Adam
Carlo
Ben
Ben
Adam
Carlo
Ben
Carlo
Adam
Carlo
Adam
Ben
Carlo
Ben
Adam

Labor
Cost
11+10+7
11+12+11
8+14+7
8+12+6
9+14+11
9+10+6

Total
Cost
28
34
29
26
34
25

SOLVING

ASSIGNMENT PROBLEMS
Hungarian

Method (or Floods Technique)


Provides us with an efficient means of
finding the optimal solution without having
to make a direct comparison of every
option
Operates on a principle of matrix
reduction, which means that by
subtracting and adding appropriate
numbers in the cost table or matrix, we
can reduce the problem to a matrix of
opportunity costs

HUNGARIAN METHOD
1.

Find the opportunity cost by


a. For the original cost matrix, identify each
rows minimum and subtract it from all
entries of the row
Person
Adam
Ben
Carlo

1
11
8
9

Project
2
14
10
12

3
6
11
7

HUNGARIAN METHOD
b.

For the matrix resulting from 1-a, identify


each columns minimum and subtract it
from all the entries of the column

Person
Adam
Ben
Carlo

1
5
0
2

Project
2
8
2
5

3
0
3
0

HUNGARIAN METHOD
2.

Test the table resulting from step 1 to see


whether optimal assignment can be made
Draw the minimum number of horizontal
and vertical lines covering all 0 entries

Person
Adam
Ben
Carlo

1
5
0
2

Project
2
6
0
3

3
0
3
0

HUNGARIAN METHOD

If the number of lines equals either the


number of rows or columns in the table, an
optimal assignment can be made.
If the number of lines is less than the
number of rows or columns, proceed to
step 3

HUNGARIAN METHOD
3.

Revise the present opportunity cost table


Select the smallest uncovered element
and subtract it from every uncovered
element and then add it to every
element at the intersection of two lines
Person
Adam
Ben
Carlo

1
5
0
2

Project
2
6
0
3

3
0
3
0

HUNGARIAN METHOD
Person
Adam
Ben
Carlo
Person
Adam
Ben
Carlo

1
5
0
2

Project
2
6
0
3

3
0
3
0

1
3
0
0

Project
2
4
0
1

3
0
5
0

HUNGARIAN METHOD

Repeat step 2

Project
Person
1
2
3
Adam
3
4
0
Ben
0
0
5
Carlo
0
1
0
Since the number of lines is equal to the
number of rows/columns, an optimal
assignment can be made

MAKING THE FINAL ASSIGNMENT


Select a row or column that contains only one zero
cell
An assignment can be made to that cell, and then
draw lines through its row and column
From the uncovered rows and columns continue
the above steps

Person
Adam
Ben
Carlo

1
3
0
0

Project
2
4
0
1

3
0
5
0

HUNGARIAN METHOD
Therefore,

the optimal assignment is to


assign Adam to Project 3, Ben to Project 2
and Carlo to Project 1.
The total labor costs of this assignment is
P25.
NOTE:

The labor costs are computed from


the original cost table

SPECIAL CASES
1.

Unbalanced assignment problems


A balanced assignment problem is one
in which the number of rows equals the
number of columns
We have an unbalanced assignment
problem if the number of people or
objects to be assigned does not equal
the number of tasks or clients or
machines listed in the columns

SPECIAL CASES
1.

Unbalanced assignment problems


If the number of rows is more than the
number of columns, add a dummy
column (i.e., dummy task)
If the number of columns exceeds the
number of rows, add a dummy row (i.e.,
dummy person
Since the dummy task or person is
really nonexistent, it is reasonable to
enter zeros in its row or column as the
cost or time estimate

SPECIAL CASES
2.

Maximization assignment problems


Some assignment problems are
phrased in terms of maximizing the
payoff, profit, or effectiveness
Maximization assignment problems
should first be converted to minimization
problems before we can use the
Hungarian method
This is done by subtracting each rating
from the largest rating in the table

MAXIMIZATION ASSIGNMENT PROBLEMS


The

British navy wishes to assign four ships to


patrol four sectors of the North Sea. In some
areas, ships are to be on the outlook for illegal
fishing boats, and in other sectors to watch for
enemy submarines, so the commander rates
each ship in terms of its probable efficiency in
each sector. These relative efficiencies are
illustrated in the table on the next slide. On the
basis of the ratings shown, the commander
wants to determine the patrol assignments
producing the greatest overall efficiencies

MAXIMIZATION ASSIGNMENT PROBLEMS


Sector
Ship
1
2
3
4

A
20
60
80
65

B
60
30
100
80

C
50
80
90
75

D
55
75
80
70

MAXIMIZATION ASSIGNMENT PROBLEMS


Sector
Ship
1
2
3
4

A
20
60
80
65

B
60
30
100
80

C
50
80
90
75

Largest rating in the table

D
55
75
80
70

MAXIMIZATION ASSIGNMENT PROBLEMS


Sector
Ship
1
2
3
4

A
80
40
20
35

B
40
70
0
20

C
50
20
10
25

D
45
25
20
30

Opportunity costs for British ships


After converting the maximizing efficiency table
into the minimizing opportunity cost table above,
we can now use the assignment algorithm

SOURCES

Cagape, Denis. 2010. IE 214 (Introduction to


Operations Research) Lecture Notes.

Render, B., Stair, R. M. & Hanna, M. E. 2007.


Quantitative Analysis for Management Studies. 9th
edition. New Jersey: Prentice Hall.