Professional Documents
Culture Documents
Transportation and Assignment Problem
Transportation and Assignment Problem
Slide
1
Network Models
Slide
2
Network Models…..
Slide
3
Slide
4
Transportation Problem
Slide
5
Transportation Problem
Network Representation
1 b1
c11
a1 1 c12
c13
2 b2
c21 c
22
a2 2
c23
3 b3
SOURCES DESTINATIONS
Slide
6
Transportation Problem
LP Formulation
The linear programming formulation in terms of the
amounts shipped from the sources to the destinations, xij ,
can be written as:
Min cijxij (total transportation cost)
ij
s.t. xij < ai for each source i (supply constraints)
j
xij ≥ bj for each destination j (demand constraints)
i
xij > 0 for all i and j (non-negativity constraints)
Slide
7
Transportation Problem
Basic requirement to solve the transportation problem by
its special purpose algorithm is
• the sum of the supplies at the sources should be
equal to the sum of the demands at the destinations.
If the total supply is greater than the total demand
• a dummy destination is added with demand equal
to the excess supply, and shipping costs from all
sources are zero.
Similarly, if total supply is less than total demand
• a dummy source is added.
When solving a transportation problem by its special
purpose algorithm, unacceptable shipping routes are
given a cost of +M (a large number).
Slide
8
Transportation Problem
D1 D2 D3 Supply
15 30 20
S1 50
30 40 35
S2 30
Demand 25 45 10
Slide
9
Problem formulation
The LP model for this problem is as follows:
X11 + X21 = 25
X12 + X22 = 45
X13 + X23 = 10 demand constraints
Slide
10
Why not Simplex Method to Solve transportation
problem
Slide
11
Transportation Problem
The transportation problem is solved in two phases:
• Phase I -- Obtaining an initial feasible solution
• Phase II -- Moving toward optimality
In Phase I,
• the Minimum-Cost Procedure can be used to establish an
initial basic feasible solution without doing numerous
iterations of the simplex method.
In Phase II,
• MODI method is used for evaluating the reduced costs
which hepls to move from the initial feasible solution to the
optimal one.
• the Stepping Stone path can be used for transformation of
basic variables.
Slide
12
PHASE I
Methods to obtain an initial feasible solution
(Initial Tableau)
There are three popular method for finding the initial tableau
for the transportation problem which are:
1. Northwest corner
2. Least cost
3. Vogle’s approximation method
Slide
13
Northwest corner
Northwest corner:
• Begin by selecting X11 (that is, start in the northwest corner of
the transportation tableau).
• Otherwise, next select Xi+1 j (that is, move one row down).
Slide
14
Northwest corner
30 40 35
S2 20 10 30
Demand 25 45 10
Step 1:
• Select the cell with the least cost.
• Assign to this cell the minimum of its remaining row
supply or remaining column demand.
Step 2:
• Decrease the row and column availabilities by this amount
and remove from consideration all other cells in the row
or column with zero availability/demand.
• (If both are simultaneously reduced to 0, assign an
allocation of 0 to any other unoccupied cell in the row or
column before deleting both.) GO TO STEP 1.
Slide
16
Least-Cost Method
Step 1: Select the cell with the least cost. Assign to this cell the
minimum of its remaining row supply or remaining column demand.
Step 2: Decrease the row and column availabilities by this amount
and remove from consideration all other cells in the row or column
with zero availability/demand. (If both are simultaneously reduced
to 0, assign an allocation of 0 to any other unoccupied cell in the row
or column before deleting both.) GO TO STEP 1.
D1 D2 D3 Supply
15 30 20
Total S1 25 15 10 50
cost is 30 40 35
$2225 S2 30 30
Demand 25 45 10 Slide
17
3. Vogel’s Method
Step 1:
• Begin with computing each row and column a penalty.
• The penalty will be equal to the difference between the two
smallest shipping costs in the row or column.
Step 2:
• Identify the row or column with the largest penalty.
• Find the first basic variable which has the smallest
shipping cost in that row or column.
• Then assign the highest possible value to that variable, and
cross-out the row or column as in the previous methods.
Step 3:
• Compute new penalties and use the same procedure.
Slide
18
An example for Vogel’s Method
Step 1: Compute the penalties.
6 7 8
10 7-6=1
15 80 78
15 78-15=63
Demand 15 5 5
19 19
Copyright © 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Step 2: Identify the largest penalty and assign the
highest possible value to the variable.
6 7 8
5 8-6=2
5
15 80 78
15 78-15=63
Demand 15 X 5
20 20
Copyright © 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Step 3: Identify the largest penalty and assign the
highest possible value to the variable.
6 7 8
0 _
5 5
15 80 78
15 _
Demand 15 X X
21 21
Copyright © 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Step 4: Identify the largest penalty and assign the
highest possible value to the variable.
6 7 8
X _
0 5 5
15 80 78
15 _
Demand 15 X X
Column Penalty _ _ _
22 22
Copyright © 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Step 5: Finally the bfs is found as X11=0, X12=5,
X13=5, and X21=15
6 7 8
X _
0 5 5
15 80 78
X _
15
Demand X X X
Column Penalty _ _ _
23 23
Copyright © 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Phase II – MODI Method
Step 1: For each unoccupied cell, calculate the reduced cost by
the MODI method described below.
• Select the unoccupied cell with the most negative reduced
cost.
• For maximization problems select the unoccupied cell with
the largest reduced cost.
• If none, STOP.
Step 2: For this unoccupied cell,
• generate a stepping stone path by forming a closed loop
with this cell and occupied cells by drawing connecting
alternating horizontal and vertical lines between them.
• Determine the minimum allocation where a subtraction is
to be made along this path.
Slide
24
Phase II – MODI Method(continued……)
Step 3:
• Add this allocation to all cells where additions are to be
made,
• and subtract this allocation to all cells where
subtractions are to be made along the stepping stone
path.
• (Note: An occupied cell on the stepping stone path
now becomes 0 (unoccupied). If more than one cell
becomes 0, make only one unoccupied; make the
others occupied with 0's.)
• GO TO STEP 1.
Slide
25
Phase II – MODI Method(continued……)
• Step 1: Set u1 = 0.
Slide
27
Example1: BBC (Solution)
30 40 42 0
Plant 2 50
Demand 25 45 10 20
Slide
28
Phase I
Slide
29
Phase I (solution)
Initial tableau
30 40 42 0
Plant 2 40 10 50
Demand 25 45 10 20
Slide
30
Phase II
MODI Method
• Iteration 1
1. Set u1 = 0
2. Since u1 + vj = c1j for occupied cells in row 1,
then
v1 = 24, v2 = 30, v4 = 0.
3. Since ui + v2 = ci2 for occupied cells in column 2,
then u2 + 30 = 40, hence u2 = 10.
4. Since u2 + vj = c2j for occupied cells in row 2,
then
10 + v3 = 42, hence v3 = 32.
Slide
31
Example: BBC
Iteration 1
• MODI Method (continued)
Calculate the reduced costs (circled numbers on
the next slide) by cij –( ui + vj)
Iteration 1 Tableau
30 40 42 0
Plant 2 -4 40 10 -10 10
vj 24 30 32 0
Slide
33
Example: BBC
Iteration 1
• Stepping Stone Path
The stepping stone path for cell (2,4) is (2,4), (1,4),
(1,2), (2,2). The allocations in the subtraction cells are 20
and 40, respectively. The minimum is 20, and hence
reallocate 20 along this path. Thus for the next tableau:
x24 = 0 + 20 = 20 (0 is its current allocation)
x14 = 20 - 20 = 0 (blank for the next tableau)
x12 = 5 + 20 = 25
x22 = 40 - 20 = 20
The other occupied cells remain the same.
Slide
34
Example: BBC
Iteration 1 Tableau
Plant 1
24 + 30 40 - 0
0
25 5 20
30 - 40 42 + 0
Plant 2 40 10 - 10
vj 24 30 32 0
Slide
35
Example: BBC
30 40 42 0
Plant 2 20 10 20 50
Demand 25 45 10 20
New
quantity
Total transportation cost is $2570 = 2770 – 10 (20)
Reduced cost of cell
(2,4) Slide
36
Example: BBC
Iteration 2
• MODI Method
The reduced costs are found by calculating
the ui's and vj's for this tableau.
1. Set u1 = 0.
2. Since u1 + vj = cij for occupied cells in row 1, then
v1 = 24, v2 = 30.
3. Since ui + v2 = ci2 for occupied cells in column 2,
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.
Slide
37
Example: BBC
Iteration 2
• MODI Method (continued)
Calculate the reduced costs (circled numbers on
the next slide) by cij - ui + vj.
Iteration 2 Tableau
30 40 42 0
Plant 2 -4 20 10 20 10
vj 24 30 36 -6
Slide
39
Example: BBC
Iteration 2
• Stepping Stone Path
The most negative reduced cost is = -4 determined
by x21. The stepping stone path for this cell is (2,1),(1,1),
(1,2),(2,2). The allocations in the subtraction cells are 25
and 20 respectively. Thus the new solution is obtained by
reallocating 20 on the stepping stone path. Thus for the
next tableau:
x21 = 0 + 20 = 20 (0 is its current allocation)
x11 = 25 - 20 = 5
x12 = 25 + 20 = 45
x22 = 20 - 20 = 0 (blank for the next tableau)
The other occupied cells remain the same.
Slide
40
Example: BBC
30 40 42 0
Plant 2 20 10 20 50
Demand 25 45 10 20
Slide
41
Example: BBC
Iteration 3
• MODI Method
The reduced costs are found by calculating
the ui's and vj's for this tableau.
1. Set u1 = 0
2. Since u1 + vj = c1j for occupied cells in row 1, then
v1 = 24 and v2 = 30.
3. Since ui + v1 = ci1 for occupied cells in column 2,
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.
Slide
42
Example: BBC
Iteration 3
• MODI Method (continued)
Calculate the reduced costs (circled numbers on
the next slide) by cij - ui + vj.
Iteration 3 Tableau
Since all the reduced costs are non-negative, this
is the optimal tableau.
30 40 42 0
Plant 2 20 +4 10 20 6
vj 24 30 36 -6
Slide
44
Example: BBC
Optimal Solution
Slide
45
Determination of the Starting Solution
Slide
46
What happens if basic solution consists of more than m + n - 1
basic variables?
Then the allocations are not independent. It results in loops
which has to be broken.
Slide
47
Simplex Method Explanation of the MODI
method
The relationship between the MODI method and the
simplex method can be explained based on the primal-
dual relationships . From the special structure
of the LP representing the transportation model the
associated dual problem can be written as
Slide
48
the objective-function coefficients (reduced costs) of the variable
Xij equal the difference between the left- and right-hand sides
of the corresponding dual constraint-that is, Ui + Vj - Cij
However, we know that this quantity must equal zero for each
basic variable, which then produces the following result:
Slide
49
There are m + n - 1 such equations whose solution (after
assuming an arbitrary value Ui = 0) yields the multipliers Ui
and Vj.
Once these multipliers are computed, the entering variable is
determined from all the nonbasic variables as the one having
the largest positive Ui + Vj – Cij.
Slide
50
Example1: A department store wishes to purchase the following
quantities of ladies dresses per month:
Dress Type A B C D
Quantity 100 300 200 100
Tenders are submitted by 3 different manufacturers who
undertake to supply not more than the quantities below (all
types of dress combined)
The store estimates that its profit per dress will vary the
manufacturer as shown in Table. How should orders be placed.
Manufacturers W X Y
Quantity 500 600 400
Dress
Manufacturers A B C D
W 2 3 4 2
X 1 3 3 2
Y 3 4 5 4 Slide
51
Assignment Problem
Slide
52
Assignment Problem
Network Representation
c11
1 1
c12
c13
c21
2 c22 2
c23
c32
c31
3 c33 3
WORKERS JOBS
Slide
53
Assignment Problem
Min cijxij
ij
s.t. xij = ai for each worker i
j
xij = bj for each job j
i
xij = 0 or 1 for all i and j.
• ai , bi = 1
• 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.
Slide
54
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)?
Slide
55
Example: Hungry Owner
Network Representation
50
West. 36
A
16
28
30
Fed. B
18
35 32
20
Gol. C
25 25
14
Univ.
Slide
56
Example: Hungry Owner
LP Formulation
• Decision Variables Defined
xij = 1 if subcontractor i is assigned to project
j
= 0 otherwise
Slide
57
Example: Hungry Owner
LP Formulation
• Objective Function
Minimize total distance:
Min 50x11 + 36x12 + 16x13 + 28x21 + 30x22 + 18x23
+ 35x31 + 32x32 + 20x33 + 25x41 + 25x42 + 14x43
Slide
58
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 subcontractor)
all xij > 0 (non-negativity)
Slide
59
Example: Hungry Owner
Optimal Assignment
Slide
60
Variations of Assignment Problem
Slide
61
Hungarian Method
Slide
62
Hungarian Method
Slide
63
Hungarian Method
Slide
64
Example: Hungry Owner
Slide
65
Example: Hungry Owner
0 16
28
30
Subcontractors
Fed. B
18
Projects
0
35 32
20
Gol. C
0
25 25
14
Univ. Dum.
0
Slide
66
Example: Hungry Owner
A B C Dummy
Westside 50 36 16 0
Federated 28 30 18 0
Goliath 35 32 20 0
Universal 25 25 14 0
Slide
67
Example: Hungry Owner
A B C Dummy
Westside 25 11 2 0
Federated 3 5 4 0
Goliath 10 7 6 0
Universal 0 0 0 0
Slide
68
Example: Hungry Owner
Slide
69
Example: Hungry Owner
A B C Dummy
Westside 23 9 0 0
Federated 1 3 2 0
Goliath 8 5 4 0
Universal 0 0 0 2
Slide
70
Example: Hungry Owner
Slide
71
Example: Hungry Owner
A B C Dummy
Westside 23 9 0 1
Federated 0 2 1 0
Goliath 7 4 3 0
Universal 0 0 0 3
Slide
72
Example: Hungry Owner
Slide
73
Example: Timing of the trains services
Train Number Departure(Hours) Arrival (Hours)
2243/2244 09.45 16.45
2429/2430 21.00 06.00
6033/6034 12.00 12.00
5033/5034 22.15 05.15
2651/2652 18.30 08.30
6021/6022 07.30 13.30
Slide
74
1 2 3 4 5 6
1 17 4.15
2
3
4
5
6
Slide
75
Example Problem
Chore
Child 1 2 3 4
1 $1 4 6 3
2 9 7 10 9
3 4 5 11 7
4 8 7 8 5
Slide
76
Note:
Assignment problem becomes LPP when the 0-1 constraint is
removed.
Similarities between TP and AP
Objective function and coefficient matrix are same
Difference between TP and AP
AP has a square and ai =1, bj =1.
Why not transportation algorithms?
It becomes degenerate TP. Degenerate problem take long time
to get solution.
Slide
77
A feasible solution to the n * n assignment problem has exactly
n assignments while LP has n square decision variables and 2n
constraints.
Out of 2n constrains there are 2n-1 basic variables because the
coefficient matrix represents a linear dependent system of
equations
Since assignment solution has n allocations out of 2n-1 basic
variables. It means n-1 basic variables take value 0 indicating
degeneracy.
Slide
78
Properties of optimal solution
Property 1: If the cost coefficents Cij >= 0, a feasible solution
with Z =0 is optimal.
Property 2: If all the elements of row or column is increased
or decreased by same constant, the optimal solution to the
assignment problem does not change. Only the value of the
objective function changes.
Slide
79
Optimality of the Hungarian Algorithm
Slide
80
Example
Cost of assigning a job
5 9 3 6
8 7 8 2
6 10 12 7
3 10 8 6
Slide
81
U and v are feasible solution to the dual because it satisfies
the constraints.
Column minimum subtraction
2 2 0 3
6 1 6 0
0 0 6 1
0 3 5 3
Slide
82
M/s Cow and calf Dairies make threetypes of milk
products.. They own three plants , one of which is to be
selected foe each product. Data given below.
Unit processing costs (Rs./Litre)
I II II
SM 5.50 5.0 6.0
FM 6.0 7.0 6.50
Y 6.50 6.0 7.0
Slide
83
Daily production and selling price of products
Slide
84