Title: Transportation-1
1Operations Research Modeling Toolset
Queueing Theory
Markov Chains
PERT/ CPM
Network Programming
Dynamic Programming
Simulation
Markov Decision Processes
Inventory Theory
Linear Programming
Stochastic Programming
Integer Programming
Forecasting
Decision Analysis
Nonlinear Programming
Game Theory
2Network Problems
- Linear programming has a wide variety of
applications - Network problems
- Special types of linear programs
- Particular structure involving networks
- Ultimately, a network problem can be represented
as a linear programming model - However the resulting A matrix is very sparse,
and involves only zeroes and ones - This structure of the A matrix led to the
development of specialized algorithms to solve
network problems
3Types of Network Problems
- Shortest Path
- Special case Project Management with PERT/CPM
- Minimum Spanning Tree
- Maximum Flow/Minimum Cut
- Minimum Cost Flow
- Special case Transportation and Assignment
Problems - Set Covering/Partitioning
- Traveling Salesperson
- Facility Location
- and many more
4The Transportation Problem
5The Transportation Problem
- The problem of finding the minimum-cost
distribution of a given commodity from a group
of supply centers (sources) i1,,mto a group of
receiving centers (destinations) j1,,n - Each source has a certain supply (si)
- Each destination has a certain demand (dj)
- The cost of shipping from a source to a
destination is directly proportional to the
number of units shipped
6Simple Network Representation
Sources
Destinations
1
Supply s1
1
Demand d1
2
Supply s2
2
Demand d2
xij
n
Demand dn
m
Supply sm
Costs cij
7Example PT Co.
- Produces canned peas at three canneries
- Bellingham, WA, Eugene, OR, and Albert Lea, MN
- Ships by truck to four warehouses
- Sacramento, CA, Salt Lake City, UT, Rapid City,
SD, and Albuquerque, NM - Estimates of shipping costs, production
capacities and demands for the upcoming season is
given - The management needs to make a plan on the least
costly shipments to meet demand
8Example PT Co. Map
1
2
3
3
2
1
4
9Example PT Co. Data
Warehouse Warehouse Warehouse Warehouse
Cannery 1 2 3 4 Supply (Truckloads)
1 464 513 654 867 75
2 352 216 690 791 125
3 995 682 388 685 100
Demand (Truckloads) 80 65 70 85
Shipping cost per truckload
10Example PT Co.
11Example PT Co.
- Linear programming formulation
- Let xij denote
- Minimize
- subject to
12General LP Formulation for Transportation Problems
13Feasible Solutions
- A transportation problem will have feasible
solutions if and only if - How to deal with cases when the equation doesnt
hold?
14Integer Solutions Property Unimodularity
- Unimodularity relates to the properties of the A
matrix(determinants of the submatrices, beyond
scope) - Transportation problems are unimodular, so we get
the integers solutions property -
- For transportation problems, when every si and
dj have an integer value, every BFS is integer
valued. - Most network problems also have this property.
15Transportation Simplex Method
- Since any transportation problem can be
formulated as an LP, we can use the simplex
method to find an optimal solution - Because of the special structure of a
transportation LP, the iterations of the simplex
method have a very special form - The transportation simplex method is nothing but
the original simplex method, but it streamlines
the iterations given this special form
16Transportation Simplex Method
Initialization (Find initial CPF solution)
Is the current CPF solution optimal?
Yes
Stop
No
Move to a better adjacent CPF solution
17The Transportation Simplex Tableau
Destination Destination Destination Destination Destination Destination Destination Supply ui
Source 1 1 2 2 n n Supply ui
1 c11 c12 c1n s1
1 s1
2 c21 c22 c2n s2
2 s2
m cm1 cm2 cmn sm
m sm
Demand d1 d1 d2 d2 dn dn Z Z
vj Z Z
18Prototype Problem
- Holiday shipments of iPods to distribution
centers - Production at 3 facilities,
- A, supply 200k
- B, supply 350k
- C, supply 150k
- Distribute to 4 centers,
- N, demand 100k
- S, demand 140k
- E, demand 300k
- W, demand 250k
- Total demand vs. total supply
19Prototype Problem
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200
A 200
B 14 13 19 15 350
B 350
C 9 20 23 10 150
C 150
Dummy 0 0 0 0 90
Dummy 90
Demand 100 100 140 140 300 300 250 250 Z Z
vj Z Z
20Finding an Initial BFS
- The transportation simplex starts with an initial
basic feasible solution (as does regular simplex) - There are alternative ways to find an initial
BFS, most common are - The Northwest corner rule
- Vogels method
- Russells method (beyond scope)
21The Northwest Corner Rule
- Begin by selecting x11, let x11 min s1, d1
- Thereafter, if xij was the last basic variable
selected, - Select xi(j1) if source i has any supply left
- Otherwise, select x(i1)j
22The Northwest Corner Rule
Destination Destination Destination Destination Destination Destination Destination Destination Supply
Source N N S S E E W W Supply
A 16 13 22 17 200
A 100 100 200
B 14 13 19 15 350
B 40 300 10 350
C 9 20 23 10 150
C 150 150
Dummy 0 0 0 0 90
Dummy 90 90
Demand 100 100 140 140 300 300 250 250
Z 10770
23Vogels Method
- For each row and column, calculate its
difference - (Second smallest cij in row/col) - (Smallest
cij in row/col) - For the row/col with the largest difference,
select entry with minimum cij as basic - Eliminate any row/col with no supply/demand left
from further steps - Repeat until BFS found
24Vogels Method (1) calculate differences
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 200 3
A 200 3
B 14 13 19 15 350 1
B 350 1
C 9 20 23 10 150 1
C 150 1
Dummy 0 0 0 0 90 0
Dummy 90 0
Demand 100 100 140 140 300 300 250 250
diff 9 9 13 13 19 19 10 10
25Vogels Method (2) select xDummyE as basic
variable
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 200 3
A 200 3
B 14 13 19 15 350 1
B 350 1
C 9 20 23 10 150 1
C 150 1
Dummy 0 0 0 0 90 0
Dummy 90 0
Demand 100 100 140 140 300 300 250 250
diff 9 9 13 13 19 19 10 10
90
26Vogels Method (3) update supply, demand and
differences
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 200 3
A 200 3
B 14 13 19 15 350 1
B 350 1
C 9 20 23 10 150 1
C 150 1
Dummy 0 0 0 0 --- ---
Dummy --- ---
Demand 100 100 140 140 210 210 250 250
diff 5 5 0 0 3 3 5 5
90
27Vogels Method (4) select xCN as basic variable
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 200 3
A 200 3
B 14 13 19 15 350 1
B 350 1
C 9 20 23 10 150 1
C 150 1
Dummy 0 0 0 0 --- ---
Dummy --- ---
Demand 100 100 140 140 210 210 250 250
diff 5 5 0 0 3 3 5 5
100
90
28Vogels Method (5) update supply, demand and
differences
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 200 4
A 200 4
B 14 13 19 15 350 2
B 350 2
C 9 20 23 10 50 10
C 50 10
Dummy 0 0 0 0 --- ---
Dummy --- ---
Demand --- --- 140 140 210 210 250 250
diff --- --- 0 0 3 3 5 5
100
90
29Vogels Method (6) select xCW as basic variable
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 200 4
A 200 4
B 14 13 19 15 350 2
B 350 2
C 9 20 23 10 50 10
C 50 10
Dummy 0 0 0 0 --- ---
Dummy --- ---
Demand --- --- 140 140 210 210 250 250
diff --- --- 0 0 3 3 5 5
100
50
90
30Vogels Method (7) update supply, demand and
differences
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 200 4
A 200 4
B 14 13 19 15 350 2
B 350 2
C 9 20 23 10 --- ---
C --- ---
Dummy 0 0 0 0 --- ---
Dummy --- ---
Demand --- --- 140 140 210 210 200 200
diff --- --- 0 0 3 3 2 2
100
50
90
31Vogels Method (8) select xAS as basic variable
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 200 4
A 200 4
B 14 13 19 15 350 2
B 350 2
C 9 20 23 10 --- ---
C --- ---
Dummy 0 0 0 0 --- ---
Dummy --- ---
Demand --- --- 140 140 210 210 200 200
diff --- --- 0 0 3 3 2 2
140
100
50
90
32Vogels Method (9) update supply, demand and
differences
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 60 5
A 60 5
B 14 13 19 15 350 4
B 350 4
C 9 20 23 10 --- ---
C --- ---
Dummy 0 0 0 0 --- ---
Dummy --- ---
Demand --- --- --- --- 210 210 200 200
diff --- --- --- --- 3 3 2 2
140
100
50
90
33Vogels Method (10) select xAW as basic variable
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 60 5
A 60 5
B 14 13 19 15 350 4
B 350 4
C 9 20 23 10 --- ---
C --- ---
Dummy 0 0 0 0 --- ---
Dummy --- ---
Demand --- --- --- --- 210 210 200 200
diff --- --- --- --- 3 3 2 2
140
60
100
50
90
34Vogels Method (11) update supply, demand and
differences
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 --- ---
A --- ---
B 14 13 19 15 350 4
B 350 4
C 9 20 23 10 --- ---
C --- ---
Dummy 0 0 0 0 --- ---
Dummy --- ---
Demand --- --- --- --- 210 210 140 140
diff --- --- --- ---
140
60
100
50
90
35Vogels Method (12) select xBW and xBE as basic
variables
Destination Destination Destination Destination Destination Destination Destination Destination Supply diff
Source N N S S E E W W Supply diff
A 16 13 22 17 --- ---
A --- ---
B 14 13 19 15 ---
B ---
C 9 20 23 10 --- ---
C --- ---
Dummy 0 0 0 0 --- ---
Dummy --- ---
Demand --- --- --- --- --- --- --- ---
diff --- --- --- ---
140
60
140
210
100
50
90
Z 10330
36Optimality Test
- In the regular simplex method, we needed to check
the row-0 coefficients of each nonbasic variable
to check optimality and we have an optimal
solution if all are ? 0 - There is an efficient way to find these row-0
coefficients for a given BFS to a transportation
problem - Given the basic variables, calculate values of
dual variables - ui associated with each source
- vj associated with each destination
- using cij ui vj 0 for xij basic, or ui
vj cij - (let ui 0 for row i with the largest number of
basic variables) - Row-0 coefficients can be found from
cijcij-ui-vj for xij nonbasic
37Optimality Test (1)
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200
A 200
B 14 13 19 15 350
B 350
C 9 20 23 10 150
C 150
Dummy 0 0 0 0 90
Dummy 90
Demand 100 100 140 140 300 300 250 250
vj
60
140
140
210
100
50
90
38Optimality Test (2)
- Calculate ui, vj using cij ui vj 0 for xij
basic - (let ui 0 for row i with the largest number of
basic variables)
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200 0
A 200 0
B 14 13 19 15 350 -2
B 350 -2
C 9 20 23 10 150 -7
C 150 -7
Dummy 0 0 0 0 90 -21
Dummy 90 -21
Demand 100 100 140 140 300 300 250 250
vj 16 16 13 13 21 21 17 17
140
60
210
140
100
50
90
39Optimality Test (3)
- Calculate cijcij-ui-vj for xij nonbasic
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200 0
A 0 1 200 0
B 14 13 19 15 350 -2
B 0 2 350 -2
C 9 20 23 10 150 -7
C 14 9 150 -7
Dummy 0 0 0 0 90 -21
Dummy 5 8 4 90 -21
Demand 100 100 140 140 300 300 250 250
vj 16 16 13 13 21 21 17 17
140
60
140
210
50
100
90
40Optimal Solution
Sources
Destinations
N
Demand 100
A
140
Supply 200
60
S
Demand 140
210
B
Supply 350
140
E
Demand 300 (shortage of 90)
100
C
Supply 150
50
W
Demand 250
Cost Z 10330
41An Iteration
- Find the entering basic variable
- Select the variable with the largest negative
cij - Find the leaving basic variable
- Determine the chain reaction that would result
from increasing the value of the entering
variable from zero - The leaving variable will be the first variable
to reach zero because of this chain reaction
42Initial Solution Obtained by the Northwest Corner
Rule
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200 0
A 3 2 200 0
B 14 13 19 15 350 0
B - 2 350 0
C 9 20 23 10 150 -5
C - 2 12 9 150 -5
Dummy 0 0 0 0 90 -15
Dummy - 1 2 - 4 90 -15
Demand 100 100 140 140 300 300 250 250
vj 16 16 13 13 19 19 15 15
100
100
40
10
300
150
90
43Iteration 1
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200 0
A 200 0
B 14 13 19 15 350 0
B 350 0
C 9 20 23 10 150 -5
C 150 -5
Dummy 0 0 0 0 90 -15
Dummy 90 -15
Demand 100 100 140 140 300 300 250 250
vj 16 16 13 13 19 19 15 15
44End of Iteration 1
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200
A 200
B 14 13 19 15 350
B 350
C 9 20 23 10 150
C 150
Dummy 0 0 0 0 90
Dummy 90
Demand 100 100 140 140 300 300 250 250
vj
100
100
40
100
210
150
90
45Optimality Test
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200 0
A 3 2 200 0
B 14 13 19 15 350 0
B - 2 350 0
C 9 20 23 10 150 -5
C - 2 12 9 150 -5
Dummy 0 0 0 0 90 -19
Dummy 3 6 4 90 -19
Demand 100 100 140 140 300 300 250 250
vj 16 16 13 13 19 19 15 15
100
100
40
100
210
150
90
46Iteration 2
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200 0
A 200 0
B 14 13 19 15 350 0
B 350 0
C 9 20 23 10 150 -5
C 150 -5
Dummy 0 0 0 0 90 -19
Dummy 90 -19
Demand 100 100 140 140 300 300 250 250
vj 16 16 13 13 19 19 15 15
-
100
100
-
100
210
40
?
150
90
47End of Iteration 2
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200
A 200
B 14 13 19 15 350
B 350
C 9 20 23 10 150
C 150
Dummy 0 0 0 0 90
Dummy 90
Demand 100 100 140 140 300 300 250 250
vj
140
60
40
100
210
150
90
48Optimality Test
Destination Destination Destination Destination Destination Destination Destination Destination Supply ui
Source N N S S E E W W Supply ui
A 16 13 22 17 200 2
A 1 0 200 2
B 14 13 19 15 350 0
B 2 350 0
C 9 20 23 10 150 -5
C 0 14 9 150 -5
Dummy 0 0 0 0 90 -19
Dummy 5 8 4 90 -19
Demand 100 100 140 140 300 300 250 250
vj 14 14 11 11 19 19 15 15
140
60
40
100
210
150
90
Z 10330
49Optimal Solution
Sources
Destinations
N
Demand 100
60
A
Supply 200
140
S
Demand 140
40
B
Supply 350
210
E
Demand 300 (shortage of 90)
100
C
Supply 150
150
W
Demand 250
Cost Z 10330
50The Assignment Problem
- The problem of finding the minimum-costly
assignment of a set of tasks (i1,,m) to a set
of agents (j1,,n) - Each task should be performed by one agent
- Each agent should perform one task
- A cost cij associated with each assignment
- We should have mn (if not?)
- A special type of linear programming problem, and
- A special type of transportation problem,with
sidj ?
51Prototype Problem
- Assign students to mentors
- Each assignment has a mismatch index
- Minimize mismatches
Mentor Mentor Mentor Mentor Mentor Mentor Supply
Student Snape Snape McGonagall McGonagall Lupin Lupin Supply
Harry 5 2 3 1
Harry 1
Draco 1 4 5 1
Draco 1
Goyle 2 4 4 1
Goyle 1
Demand 1 1 1 1 1 1
52Prototype Problem
- Linear programming formulation
- Let xij denote
- Minimize
- subject to
53General LP Formulation for Assignment Problems
54Solving the Assignment Problem
- It is a linear programming problem, so we could
use regular simplex method - It is a transportation problem, so we could use
transportation simplex method - However, it has a very special structure, such
that it can be solved in polynomial time - Many such algorithms exist, but the best known
(and one of the oldest) is the Hungarian Method
55The Hungarian Method
- Subtract row minimums from each element in the
row - Subtract column minimums from each element in the
column - Cover the zeroes with as few lines as possible
- If the number of lines n, then optimal solution
is hidden in zeroes - Otherwise, find the minimum cost that is not
covered by any lines - Subtract it from all uncovered elements
- Add it to all elements at intersections (covered
by two lines) - Back to step 3
56The Hungarian Method Optimal Solution
- How to identify the optimal solution
- Make the assignments one at a time in positions
that have zero elements. - Begin with rows or columns that have only one
zero. Cross out both the row and the column
involved after each assignment is made. - Move on to the rows and columns that are not yet
crossed out to select the next assignment, with
preference given to any such row or column that
has only one zero that is not crossed out. - Continue until every row and every column has
exactly one assignment and so has been crossed
out.
57Hungarian Method
Mentor Mentor Mentor
Student Snape McG Lupin
Harry
Draco
Goyle
Mentor Mentor Mentor
Student Snape McG Lupin
Harry 5 2 3
Draco 1 4 5
Goyle 2 4 4
Mentor Mentor Mentor
Student Snape McG Lupin
Harry
Draco
Goyle
Mentor Mentor Mentor
Student Snape McG Lupin
Harry
Draco
Goyle