CHAPTER 3-Distribution Models
CHAPTER 3-Distribution Models
LEARNING OBJECTIVES
At the end of the lessons, the students are expected to:
1. formulate distribution models;
2. analyze and solve transportation problems; and
3. analyze and solve assignment problems.
Distribution Models
A distribution problem is a special type of linear programming problem. There are two
main types of distribution problems:
Transportation Problem
Assignment Problem
The transportation problem deals with shipments from number of sources to a number of
destinations while on the contrary, the assignment problem deals with finding the best one-to-one
match for each of a given number of viable candidates to variety of proposed “positions”. The
objective is to induce maximum reward or minimum cost.
Transportation Problem
Transportation problem deals with shipments (of materials, goods, people, etc.) from
a number of sources to a number of destinations. Every source has generally the restricted supply
and every destination has usually known demand. Unit shipping cost between each source and
destination is determined. The objective is to seek out a possible shipping schedule (shipped
quantities) with minimal total shipping cost. This model can also be used when a company is
deciding where to locate a new facility. Sensible monetary decisions regarding facility location
also attempt to minimize total transportation and production costs for the entire system.
If the total supply equals the total demand, the model is termed balanced transportation
model. In real-life situations the problem is usually unbalanced, i.e. the total demand exceeds the
total supply, or the total supply exceeds the total demand. Unbalanced models can be transformed
into balanced by introducing a dummy source or destination. Whereas shipments from a dummy
source correspond to unsatisfied requirements, shipments to a dummy destination represent
remains of suppliers.
Example #1
Star Coffee, Inc. operating in the Czech Republic is going to establish three subsidiaries
producing coffee. They should be located in following cities: Benešov, Jihlava and Tábor.
The main ingredient – coffee beans - will be supplied from two warehouses in Humpolec
and Pelhřimov (see Figure 1).
Destination Weekly
Benešov Jihvala Tábor Supply [t]
Warehouse
Humpolec 330 250 350 70
Pelhřimov 300 240 250 80
Weekly 150
Demand [t] 45 60 35 140
Tab. 1 Supply, Demand and Unit Shipping Cost
The objective is to ascertain such deliveries from warehouses to destinations that minimize
the total shipping value. This shipping schedule must satisfy the requirement of each
destination, and should not exceed supply of any warehouse.
Formulation
As it is apparent from Table 1 the problem is unbalanced - total demand (140 tons) is less
than the total supply (150 tons). The balanced model can be obtained after introducing a dummy
destination with demand 10 tons (computed as the difference between the values 150 and 140):
Destination Weekly
Benešov Jihvala Tábor
Dummy Supply [t]
Warehouse
Humpolec 330 250 350 0 70
Pelhřimov 300 240 250 0 80
Weekly 150
Demand [t] 45 60 35 10 150
Tab. 1.2 Balanced Transportation Model
Since the dummy destination does not exist, no physical shipping occurs and therefore
all the corresponding unit transportation costs equal zeroes.
In distribution models, it is reasonable to define the variables with two indices (generally
xij). In case of transportation model the variable xij corresponds to the amount transported from
the source i to the destination j.
If parameter cij is generally a unit shipping cost corresponding to the source i and the
destination j, then cij xij is the total shipping cost. If we evaluate the total shipping cost
corresponding to all the sources and destinations, their sum gives the total shipping cost for our
transportation problem. Thus, the objective function can be expressed as follows:
3. The constraints
Real shipping must not exceed supply of warehouses and must satisfy demand
of destinations. In the example, there are 6 constraints:
x1
1 + x21 = 45
x
12 + x22 = 60
x
13 + x23 = 35
x + x24
14 = 10
Optimal Solution
Table 1.3 shows the optimal solution. Every week, 60 tons is delivered from Humpolec
to Jihlava. From Pelhřimov, 45 tons are transported to Benešov and 35 tons to Tábor. This
shipping schedule minimizes the total weekly cost at the level 37 250 CZK. In Humpolec, 10
tons remain. This amount can be used for another purpose or the management should consider
increase in the production of the subsidiaries.
Humpolec - 60 - 10 70
Pelhřimov 45 - 35 - 80
Weekly 150
Demand [t] 45 60 35 10 150
The initial basic possible solution can be obtained by using Northwest Corner Rule. The
procedure for constructing an initial basic feasible solution selects the basic variables one at a time.
The method begins with an allocation at the top left-hand corner of the tableau and proceeds
systematically along either a row or a column and make allocations to subsequent cells until the
bottom right-hand corner is reached, by which time enough allocations will have been made to
constitute an initial solution. The procedure for constructing an initial solution using the North
West Corner rule is as follows:
b. If the supply is 0, then cross (strike) that row and move down to the next cell.
c. If the demand is 0, then cross (strike) that column and move right to the next
cell.
d. If supply and demand both are 0, then cross (strike) both row & column and
move diagonally to the next cell.
Step-3: Repeat this steps until all supply and demand values are 0.
Example-2
1. Find Solution using North-West Corner method
D1 D2 D3 D4 Supply
S1 19 30 50 10 7
S2 70 30 40 60 9
S3 40 8 70 20 18
Demand 5 8 7 14
Solution:
TOTAL number of supply constraints : 3
TOTAL number of demand constraints : 4
Problem Table is
D1 D2 D3 D4 Supply
S1 19 30 50 10 7
S2 70 30 40 60 9
S3 40 8 70 20 18
Demand 5 8 7 14
Demand 0 8 7 14
D1 D2 D3 D4 Supply
S1 19(5) 30(2) 50 10 0
S2 70 30 40 60 9
S3 40 8 70 20 18
Demand 0 6 7 14
Demand 0 0 7 14
D1 D2 D3 D4 Supply
S1 19(5) 30 (2) 50 10 0
S2 70 30(6) 40(3) 60 0
S3 40 8 70 20 18
Demand 0 0 4 14
D1 D2 D3 D4 Supply
S1 19(5) 30(2) 50 10 0
S2 70 30(6) 40(3) 60 0
S3 40 8 70(4) 20 14
Demand 0 0 0 14
D1 D2 D3 D4 Supply
S1 19(5) 30(2) 50 10 0
S2 70 30(6) 40(3) 60 0
S3 40 8 70 (4) 20(14) 0
Demand 0 0 0 0
D1 D2 D3 D4 Supply
S1 19 (5) 30 (2) 50 10 7
S2 70 30 (6) 40 (3) 60 9
S3 40 8 70 (4) 20 (14) 18
Demand 5 8 7 14
The Least Cost Method is another method used to acquire the initial feasible solution for
the transportation problem. Using this, the allocation begins with the cell which has the minimum
cost. The lower cost cells are selected over the higher-cost cell with the objective to have the least
cost of transportation.
b. If the supply si is 0, then cross (strike) that row and If the demand dj is 0 then
cross (strike) that column.
c. If min unit cost cell is not unique, then select the cell where maximum allocation
can be possible
Step-3: Repeat this steps for all uncrossed (unstriked) rows and columns until all supply
and demand values are 0.
The next step is determining whether the present allocation at any stage of the solution
process is ideal. The Stepping Stone method originates its name from the analogy of crossing a
pond using stepping stones. The occupied cells are analogous to the stepping stones, which are
used in making certain movements in this method. The Stepping Stone Method is used to check
the optimality of the initial feasible solution and a process for finding the potential of any non-
basic variables (empty cells) in terms of the objective function
Step-3: Beginning with a plus (+) sign at the unused square, place alternative minus (-)
signs and plus signs on each corner square of the closed path just traced.
Step-4: Calculate an improvement index, Iij 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.
Step-5: Repeat steps 1 to 4 until an improvement index has been calculated for all unused
squares.
• If all indices computed are greater than or equal to zero, an optimal solution has
been reached.
• If not, it is possible to improve the current solution and decrease total shipping
costs.
Example-1
Find Solution using Voggel's Approximation method, also find optimal solution using stepping
stone method
D1 D2 D3 D4 Supply
S1 19 30 50 10 7
S2 70 30 40 60 9
S3 40 8 70 20 18
Demand 5 8 7 14
Solution:
TOTAL number of supply constraints : 3
TOTAL number of demand constraints : 4
Problem Table is
D1 D2 D3 D4 Supply
S1 19 30 50 10 7
S2 70 30 40 60 9
S3 40 8 70 20 18
Demand 5 8 7 14
Table-1
Demand 5 8 7 14
Column
21=40-19 22=30-8 10=50-40 10=20-10
Penalty
Table-2
Demand 5 0 7 14
Column
21=40-19 -- 10=50-40 10=20-10
Penalty
Table-3
Demand 0 0 7 14
Column
-- -- 10=50-40 10=20-10
Penalty
Demand 0 0 7 4
Column
-- -- 10=50-40 50=60-10
Penalty
Table-5
Demand 0 0 7 2
Column
-- -- 40 60
Penalty
Table-6
Demand 0 0 7 0
Column
-- -- 40 --
Penalty
Demand 5 8 7 14
21 22 10 10
21 -- 10 10
Column -- -- 10 10
Penalty -- -- 10 50
-- -- 40 60
-- -- 40 --
D1 D2 D3 D4 Supply
S1 19 (5) 30 50 10 (2) 7
S2 70 30 40 (7) 60 (2) 9
S3 40 8 (8) 70 20 (10) 18
Demand 5 8 7 14
Iteration-1 of optimality test
2. Select the unoccupied cell having the highest negative net cost change i.e. cell S2D2=-18.
and draw a closed path from S2D2.
Closed path is S2D2→ S2D4→ S3D4→ S3D2
Closed path and plus/minus allocation for current unoccupied cell S2D2
D1 D2 D3 D4 Supply
S1 19 (5) 30 [32] 50 [60] 10 (2) 7
S2 70 [1] 30 [-18] (+) 40 (7) 60 (2) (-) 9
S3 40 [11] 8 (8) (-) 70 [70] 20 (10) (+) 18
Demand 5 8 7 14
3. Minimum allocated value among all negative position (-) on closed path = 2
Subtract 2 from all (-) and Add it to all (+)
D1 D2 D3 D4 Supply
S1 19 (5) 30 50 10 (2) 7
S2 70 30 (2) 40 (7) 60 9
S3 40 8 (6 70 20 (12) 18
Demand 5 8 7 14
Unoccupied
Closed path Net cost change
cell
S1D2 S1D2→S1D4→S3D4→S3D2 30 - 10 + 20 - 8 = 32
S1D3→S1D4→S3D4→S3D2→S2D2→S2 50 - 10 + 20 - 8 + 30 - 40 =
S1D3
D3 42
S2D1→S2D2→S3D2→S3D4→S1D4→S1 70 - 30 + 8 - 20 + 10 - 19 =
S2D1
D1 19
S2D4 S2D4→S2D2→S3D2→S3D4 60 - 30 + 8 - 20 = 18
S3D1 S3D1→S3D4→S1D4→S1D1 40 - 20 + 10 - 19 = 11
S3D3 S3D3→S3D2→S2D2→S2D3 70 - 8 + 30 - 40 = 52
D1 D2 D3 D4 Supply
S1 19 (5) 30 50 10 (2) 7
S2 70 30 (2) 40 (7) 60 9
S3 40 8 (6 70 20 (12) 18
Demand 5 8 7 14
The concept of MODI can be further comprehended through an illustration given below:
b. Calculate other ui's and vj's using cij=ui+vj, for all occupied cells.
Step-3: For all unoccupied cells, calculate dij=cij-(ui+vj), .
Step-4: Check the sign of dij
a. If dij>0, then current basic feasible solution is optimal and stop this
procedure.
b. If dij=0 then alternative soluion exists, with different set allocation and same
transportation cost. Now stop this procedure.
b. If dij<0, then the given solution is not an optimal solution and further
improvement in the solution is possible.
Step-5: Select the unoccupied cell with the largest negative value of dij, and included in
the next solution.
Step-6: Draw a closed path (or loop) from the unoccupied cell (selected in the previous
step). The right angle turn in this path is allowed only at occupied cells and at
the original unoccupied cell. Mark (+) and (-) sign alternatively at each corner,
starting from the original unoccupied cell.
Step-7: 1. Select the minimum value from cells marked with (-) sign of the closed path.
2. Assign this value to selected unoccupied cell (So unoccupied cell becomes
occupied cell).
3. Add this value to the other occupied cells marked with (+) sign.
4. Subtract this value to the other occupied cells marked with (-) sign.
Step-8: Repeat Step-2 to step-7 until optimal solution is obtained. This procedure stops
when all dij≥0 for unoccupied cells.
Example-1
Find Solution using Voggel's Approximation method, also find optimal solution using MODI
method
D1 D2 D3 D4 Supply
S1 19 30 50 10 7
S2 70 30 40 60 9
S3 40 8 70 20 18
Demand 5 8 7 14
Solution:
TOTAL number of supply constraints : 3
TOTAL number of demand constraints : 4
Problem Table is
D1 D2 D3 D4 Supply
S1 19 30 50 10 7
S2 70 30 40 60 9
S3 40 8 70 20 18
Demand 5 8 7 14
Table-1
Demand 5 8 7 14
Column
21=40-19 22=30-8 10=50-40 10=20-10
Penalty
Table-2
Demand 5 0 7 14
Column
21=40-19 -- 10=50-40 10=20-10
Penalty
The maximum penalty, 21, occurs in column 𝐷1.
The minimum 𝑐𝑖𝑗 in this column is 𝑐11 = 19.
The maximum allocation in this cell is min(7,5) = 5.
It satisfy demand of 𝐷1 and adjust the supply of 𝑆1 from 7 to 2 (7 - 5 = 2).
Table-3
Demand 0 0 7 14
Column
-- -- 10=50-40 10=20-10
Penalty
Table-4
Demand 0 0 7 4
Column
-- -- 10=50-40 50=60-10
Penalty
Table-5
Demand 0 0 7 2
Column
-- -- 40 60
Penalty
Table-6
Demand 0 0 7 0
Column
-- -- 40 --
Penalty
Demand 5 8 7 14
21 22 10 10
21 -- 10 10
Column -- -- 10 10
Penalty -- -- 10 50
-- -- 40 60
-- -- 40 --
D1 D2 D3 D4 Supply
S1 19 (5) 30 50 10 (2) 7
S2 70 30 40 (7) 60 (2) 9
S3 40 8 (8) 70 20 (10) 18
Demand 5 8 7 14
D1 D2 D3 D4 Supply ui
S1 19 (5) 30 50 10 (2) 7 u1=10
S2 70 30 40 (7) 60 (2) 9 u2=60
S3 40 8 (8) 70 20 (10) 18 u3=20
Demand 5 8 7 14
vj v1=9 v2=-12 v3=-20 v4=0
2. Find dij for all unoccupied cells(i,j), where dij=cij-(ui+vj)
1.d12=c12-(u1+v2)=30-(10-12)=32
2.d13=c13-(u1+v3)=50-(10-20)=60
3.d21=c21-(u2+v1)=70-(60+9)=1
4.d22=c22-(u2+v2)=30-(60-12)=-18
5.d31=c31-(u3+v1)=40-(20+9)=11
6.d33=c33-(u3+v3)=70-(20-20)=70
D1 D2 D3 D4 Supply ui
S1 19 (5) 30 [32] 50 [60] 10 (2) 7 u1=10
S2 70 [1] 30 [-18] 40 (7) 60 (2) 9 u2=60
S3 40 [11] 8 (8) 70 [70] 20 (10) 18 u3=20
Demand 5 8 7 14
vj v1=9 v2=-12 v3=-20 v4=0
3. Now choose the minimum negative value from all dij (opportunity cost) = d22 = [-18]
and draw a closed path from S2D2.
Closed path is S2D2→S2D4→S3D4→S3D2
Closed path and plus/minus sign allocation...
D1 D2 D3 D4 Supply ui
S1 19 (5) 30 [32] 50 [60] 10 (2) 7 u1=10
S2 70 [1] 30 [-18] (+) 40 (7) 60 (2) (-) 9 u2=60
S3 40 [11] 8 (8) (-) 70 [70] 20 (10) (+) 18 u3=20
Demand 5 8 7 14
vj v1=9 v2=-12 v3=-20 v4=0
4. Minimum allocated value among all negative position (-) on closed path = 2
Substract 2 from all (-) and Add it to all (+)
D1 D2 D3 D4 Supply
S1 19 (5) 30 50 10 (2) 7
S2 70 30 (2) 40 (7) 60 9
S3 40 8 (6 70 20 (12) 18
Demand 5 8 7 14
5. Repeat the step 1 to 4, until an optimal solution is obtained.
D1 D2 D3 D4 Supply ui
S1 19 (5) 30 50 10 (2) 7 u1=0
S2 70 30 (2) 40 (7) 60 9 u2=32
S3 40 8 (6) 70 20 (12) 18 u3=10
Demand 5 8 7 14
vj v1=19 v2=-2 v3=8 v4=10
1.d12=c12-(u1+v2)=30-(0-2)=32
2.d13=c13-(u1+v3)=50-(0+8)=42
3.d21=c21-(u2+v1)=70-(32+19)=19
4.d24=c24-(u2+v4)=60-(32+10)=18
5.d31=c31-(u3+v1)=40-(10+19)=11
6.d33=c33-(u3+v3)=70-(10+8)=52
D1 D2 D3 D4 Supply ui
S1 19 (5) 30 [32] 50 [42] 10 (2) 7 u1=0
S2 70 [19] 30 (2) 40 (7) 60 [18] 9 u2=32
S3 40 [11] 8 (6) 70 [52] 20 (12) 18 u3=10
Demand 5 8 7 14
vj v1=19 v2=-2 v3=8 v4=10
Demand 5 8 7 14
Assignment Problem
The assignment problem refers to the class of linear programming problems that include
determining the most efficient assignment of people to projects, salespeople to territories,
contracts to bidders, jobs to machines, and etc. The goal of the method is to minimize the total
costs or total time of performing the tasks at hand.
Consider the situation where some objects (service teams, jobs, employees, projects, etc.)
should be assigned on a one-to-one basis to other objects. Every assignment can bring profit or
incur cost. The objective is to maximize the total profit or minimize the total cost ensuing from
the assignment structure.
Example 6
VP Inc. gets four commissions for building family houses in various parts of Prague
(Michle, Prosek, Radlice, Trója). In the first step the company must solve the problem of
excavating the shafts for basements. Each excavation takes 5 days. Management of the company
decided to use four own excavators stored in four separated garages. The objective is to allocate
each excavator to exactly one excavation with minimal cost. Since the costs are derived from
distances [in km] between garages and destinations (Table 2.9), we can concentrate only on
these distances to define the objective.
Garage
Garage 1 5 22 12 18
Garage 2 15 17 6 10
Garage 3 8 25 5 20
Garage 4 10 12 19 12
2. The objective is to minimize the total distance necessary for all excavators’
movement
If parameter cij is a distance between the garage i and the destination j, the
objective function can be expressed as follows:
44
Minimize z = ∑∑cij xij ,
i =1 j=1
or using real unit cost:
Minimize z = 5x11 + 22x12 + ... + 12x44 .
The objective function corresponds to the sum of kilometers that all machines go
together.
3. The constraints
From each garage exactly one excavator goes away:
x11 + x12 + x13 + x14 = 1
x 21 + x22 + x23 + x24 = 1
x 31 + x32 + x33 + x34 = 1
x 41 + x42 + x43 + x44 = 1
Optimal Solution
In Table 2.10 the optimal assignment is dark shaded. The excavators go from Garage 1 to
Michle, from Garage 2 to Trója, from Garage 3 to Radlice and from Garage 4 to Prosek. All
machines go together 32 km (5 + 10 + 5 + 12). If the excavators return every day to their
garages, the total daily distance is 64 km and in 5 days all machines would go 320 km.
This value can be a basis for evaluating the total transportation cost.
Garage
Garage 1 5 22 12 18
Garage 2 15 17 6 10
Garage 3 8 25 5 20
Garage 4 10 12 19 12
Hungarian Algorithm
The Hungarian algorithm uses the following theorem for polynomial runtime complexity
and guaranteed optimality:
If a number is added to or subtracted from all of the entries of any one row or column of
a cost matrix, then an optimal assignment for the resulting cost matrix is also an optimal
assignment for the original cost matrix.
By using the Hungarian theorem, we decrease our original weight matrix to contain zeros.
We try to assign tasks to agents such that each agent is doing only one task and the penalty
incurred in each case is zero.
Core of the algorithm (assuming square matrix):
Step 1- For each row of the matrix, find the smallest element and subtract it from every
element in its row.
Step 2- Do the same (as step 1) for all columns.
Step 3- Cover all zeros in the matrix using minimum number of horizontal and vertical lines.
Step 4- Test for Optimality: If the minimum number of covering lines is n, an optimal
assignment is possible and we are finished. Else if lines are lesser than n, we haven’t
found the optimal assignment, and must proceed to step 5.
Step 5- Determine the smallest entry not covered by any line. Subtract this entry from each
uncovered row, and then add it to each covered column. Return to step 3.