OR chapter 6
OR chapter 6
AGRICULTURAL ECONOMICS
(AgEc 332)
BY
Zelalem F (MSc)
1
CHAPTER 4
DISTRIBUTION MODELS
2
DISTRIBUTION MODELS
• One important application of linear programming has been
in the area of the physical distribution (transportation) of
resources, from one place to another, to meet a specific set
of requirement.
• describes two special –purpose algorithms: the
transportation model and the assignment model. Model
formulation and manual solution are covered for each of
these classes of problems.
• Both transportation and assignment problems are
members of a category of linear programming techniques
called networkflow problems.
3
4.1. TRANSPORTATION PROBLEMS
• Transportation problem deals with the distribution of goods from
several points of supplies (sources) to a number of points of
demands (destinations).
• Consider a corporation engaged in the manufacture of products.
• Most of such big corporations are of “multiple-product” and
“multi-unit” organizations having production units situated at
different places.
• Items are produced for sales. Sales take place at different
markets which are, again located at different places.
• It is not feasible to co-locate production and market.
• Markets are located away from the manufacturing places. Hence
products are sent to factory warehouses set up near market
outlets.
• Cost of product consists of production cost and distribution
cost. 4
cont…
Cost of product = production cost + distribution cost
Distribution cost consists of mainly the transportation cost of items from its
production (manufacturing) center to the warehouses.
In order to identify products, it is necessary to work out per unit distribution cost
of each product.
We also know the production capacity of each product in each factory is fixed.
5
The characteristics of transportation problem are as follows
3. The quantities of supply at each source and the demand at each destination
are constant.
4. The shipping or transportation costs per unit from each source to each
destination are assumed to be constant.
All supply and demand quantities are given in whole number or integers.
6. The problem is to determine how many units shipped from each source to
each destination so that all demands are satisfied at the minimum total
shipping costs. 6
Uses of transportation techniques
1. Reduce distribution or transportation cost
2. Improve competitiveness of product
3. Assist proper location of warehouses
4. Assist proper location of new factories or plants being planned.
5. Close down warehouses which are found costly and uneconomical.
7
4.1.1. The Transportation Method
• The solution algorithm to a transportation problem may be
summarized into the following steps:
Step 1:
✓ Formulate the problem and set up in the matrix form
✓ The formulation of the problem is similar to the linear programming.
✓ Here the objective function is the total transportation cost and the
constraints are the supply and demand available at each source and
destination respectively.
Step 2:
✓ Obtain an initial basic feasible solution
There are 3 methods to find the initial feasible solution.
1.North-West Corner Method (NWCM)
2.Least Cost Method (LCM)
3.Vogel’s Approximation Method (VAM)
8
cont…
The initial solution obtained by any of the three methods must satisfy the following condition:
i) The solution must be feasible i.e.: It must satisfy all the supply and demand constraints
ii) The number of positive allocations must equal to m+n-1,
where m=the number of rows (or origins or supply centers) and n= the number of columns(or
destination centers or demand centers)
• Example:
• m=3 origins and n=4 destinations ==>m+n-1=3+4 -1=6 (i.e. the
transportation model should have 6 occupied cells).
Note:
• The number of occupied cells < m+n-1==> degenerate solution
9
cont…
• Step 3:
• Test the initial solution for optimality
• If the current solution is optimal, then stop.
Otherwise, determine the new improved solution.
• Step 4:
• Repeat step 3 until an optimal solution is reached
10
4.1.2. Linear programming formulation of the transportation problem
• Example
• Suppose that a firm has three factories /sources of supply/ & four
warehouses/point of demand/.
• The firm's production capacity at the three factories, the demand for
the four distribution centers located at various regions & the cost of
shipping each unit from the factories to the warehouses through
each route is given as follows:
Destinations (dd) =j
Origin Factory
(Supply) W1 W2 W3 W4 Capacity =i
F1 Br.3 2 7 6 5000
7 5 2 3
F2 6000
2 5 4 5
F3 2500
Requirements of the
Warehouses 6000 4000 2000 1500 13500
( Units of demand) 11
cont…
Using all the above information
i. Express the following transportation problem as an LPP
Solution
Let xij =The amount of commodity to be transported form source i (i =1,2,3 ) to
destination j( j= 1,2,3,4).
• Then the objective function of the problem (minimization of the total
transportation cost) can be formulated as:
12
cont…
In the above LPP, there are m x n = 3x4 =12 decision variables & m + n = 3+4 =7
constraints. Thus, if this problem is solved by the simplex method, then it may take
considerable computational time.
ii. The network representation of the transportation LPP is called Network flow
13
METHODS OF FINDING INITIAL FEASIBLE SOLUTION
A. NORTH- WEST CORNER METHOD (NWCM)
• This method does not take into account the cost of transportation on any
route of transportation.
• The NWCM gets its name because the starting point for the allocation
process is the Upper Left-hand (Northwest) corner of the transportation
table. Therefore, allocate to the Northwest corner as many units as
possible.
• Northwest corner rule:
1. Begin with the upper left hand cell (Left, upper most in the table), & allocate
as many units as possible to that cell. This will be the smaller amount of
either the row supply or the column demand. Adjust the row & column
quantities to reflect the allocation.
2. Subtract from the row supply & from the column demand the amount
allocated
3. If the column demand is now zero, move to the cell next to the right, if the
row supply is zero, move down to the cell in the next row.
If both are zero, move first to the next cell on the right then down one cell.
4. Once a cell is identified as per step (3), it becomes a northwest cell. Allocate
to it an amount as per step (1)
5. Repeat, the above steps (1) - (4) until all the remaining supply and demand14
is
gone.
cont…
Example:
• Consider the following transportation problem:
15
cont…
==>m + n-1; m=3 and n=4 3+4-1= 6 cells occupied (Feasible solution)
16
cont…
17
cont…
• Note:
1. Total Supply= Total demand ===> Balanced TP
2. Total Supply ≠ total demand ===> Unbalanced TP
3. Convert the unbalanced TP into a balanced TP by using
dummy destination/dummy source.
* If total Supply > Total demand, then create a fictitious
or artificial destination called dummy destination
i.e: total Supply > Total demand===> Add dummy
column
* Excess demand (Supply < demand)
- Add a dummy source
- Add a dummy row
Note: the cost of “shipments” to the dummy is usually set
at zero ==> No real cost 18
cont…
19
B. THE LEAST- COST METHOD (LCM) or (LARGEST- PROFIT) METHOD
• LCM is the method used a minimum cost in the allocation.
• It begins a solution by sequentially assigning to the ratios or cells with the minimum
cost as many units as possible.
• The first allocation be made to the cell with the lowest cost (the highest profit in a
maximization case)
• The Least- Cost Method yields not only an initial feasible solution but also one
that is close to optimal in small problems.
Example
• 1.Suppose that a firm has three factories / sources of supply
/& four warehouses/point of demand/ .The firm's production
capacity at the three factories, the demand for the four
destination centers located at various regions & the cost of
shipping each unit from the factories to the warehouses
through each route is given as follows:
20
cont…
LCM
LCM
21
C. VOGEL'S APPROXIMATION METHOD (VAM)or PENALTY METHOD
22
cont…
• VAM determines the penalty for not using the minimum cost routes, where the
objective is to avoid large penalties so that the penalty from not using the routes is
minimized.
1. Calculate penalties for each row (column) by taking the smallest & the next
smallest unit transportation cost in the same row (column). This difference
indicates the penalty or extra cost which has to be paid if one fails to allocate
to the cell with the minimum unit transportation cost
2. Select the row or column with the largest penalty & allocate as much unit as
possible in the cell having the least cost in the selected row or column
satisfying the conditions. If there is a tie in the values of penalties, then it
can be broken by selecting the cell where maximum allocation can be made.
23
cont…
3. Adjust the supply & demand & cross out the satisfied row
or column.
25
cont…
• m= 3, n=4 ==> 3+4-1 =6 Occupied cells (feasible)
• The transportation cost associated with this solution is:
• Total cost= 5x2 + 20x0+15x5x9 =+95x3+10x4= $185
•exercises
26
4.3. OPTIMALITY TESTS
• Optimum solution to a TP can be obtained by following two methods. These
methods are much simpler compared to simplex method of an LPP.
A. Stepping stone Method
B. Modified Distribution method (MODI Method)
A. Stepping-stone method
The Stepping-stone method is an iterative technique for moving from an
initial feasible solution to an optimal solution in transportation problems.
3. Move vertically or horizontally (but never diagonally) to another occupied cell “stepping
–over” unoccupied or occupied cells (if necessary) without changing them. Follow the same
procedure to other occupied cells until returning to the original empty cell.
4. Begin with a plus (+) sign at the unused cell, place alternative (-) signs and plus signs on
each corner square of the closed path just traced.
i.e At each turn of the loop ( the loop may cross over itself at times), plus and minus
signs are alternately placed in the cells, starting with a + sign in an empty cell.
5. There must be exactly one cell with a + sign and exactly one cell with a - sign in any row
or column in which the loop turns.
6. An even no of at least four cells must participate in a loop and the occupied cells can be
visited once and only once.
7. Repeat steps 1 to 4 until an improvement index has been calculated for all unused squares
(cells). 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.
28
cont…
Note:
In a non-degenerate problem, there is only one possible way of drawing the loop
for each empty cell.
The value of a cell evaluator is the sum of the per unit shipping costs in the gaining
cells less the sum of the per unit shipping costs in the losing cells of the closed
loop. This evaluation process must be extended to all unoccupied cells.
• If one or more of the cell evaluators is negative, the existing solution is not optimal.
• i.e: For minimization (cost) problems, all the cell evaluators must be positive for
optimality.
• Analysis of test:
• Check all the empty cells and select for improvement the one with the
largest improvement potential.
29
Example 1
30
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.
+1
The Subtraction of
One Ton from Cell
1B
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 Stepping-
Stone Path for
Cell 2A
The Stepping-Stone Solution Method
(6 of 12)
- The remaining stepping-stone paths and resulting computations for cells 2B and 3C.
The Stepping-
Stone Path for
Cell 3C
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 Stepping-Stone
Path for Cell 1A
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 Stepping-
Stone Path for Cell
1B
The Stepping-Stone Solution Method
(10 of 12)
- Continuing check for optimality.
The Stepping-Stone
Path for Cell 2B
The Stepping-Stone
Path for Cell 3C
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
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
The Stepping-Stone Solution Method
Summary of Steps
44
• Steps involved in MODI method to test and improve the solution are the followings
• Step 1: From the initial basic solution, calculate Ui and Vj for each row and column using the occupied cells.
• To start with, assign zero for a particular Ui or Vj where there are maximum number of allocations in a row or
column. If there is a tie select arbitrarily.
• Then, compute Ui ‘s and Vj ‘s for other rows and columns, respectively, using the relation Cij= Ui+Vj for all
occupied cells (i, j).
• Step 2: For unoccupied (empty) cells, calculate the net contribution by using the relation:
• ∆ij =Cij-(Ui+Vj) for all i and j
• Compute the sum of Ui and Vj and write that at the bottom left corner of that empty cell.
• Compute the net contribution and write that at the bottom right corner of that empty cell.
• Step 3: Examine the sign of ∆ij for empty cell
• This step gives us the opportunity criteria
• If ∆ij ≥0 for all empty cell, the current basic feasible solution is optimum.
• If ∆ij =0 for some empty cell, then the current solution will remain optimum but an alternative solution
exists.
• If ∆ij ≤ 0 for one or more empty cells, the current basic feasible solution is not optimum. So that an improved
solution can be obtained by entering unoccupied cell (i, j) in the basis.
• Step 4: Select an empty cell having the largest –ve number of ∆ij as entering variable (cell).
• Step 5: Identify the leaving variable (cell).
• The method (criteria) of identifying the leaving variable and determining the new solution is the same as the
stepping-stone method.
• Construct the loop (closed path) for entering variable (cell)
• Assign +ve and –ve sign alternatively
• Examine the loop with minus sign and select the cell with lowest (smallest) shipment (allocation) as leaving
variable.
• Step 6: Generate a new solution
• The new solution can be generated by adding the shipment (allocation) amount in leaving cell to each plus
sign cells and subtracting the amount from each minus cell in the selected loop.
• Step 7: Check for optimality of the current solution.
• If not optimal, repeat the steps from step 1 till an optimum basic feasible solution is obtained.
45
• The optimum solution is obtained when for all empty cell, ∆ij ≥0
The Modified Distribution Method (MODI)
(1 of 6)
- MODI is a modified version of the stepping-stone method in which math equations replace
the stepping-stone paths.
- In the table, the extra left-hand column with the ui 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.
53
cont…
2. Alternative optimal solutions:-is the condition
where opportunity cost for un occupied cells gets
zero. i.e pij=cij –(ui+vj) = 0
3.Prohibited transportation routes:-situation when it
is not possible to transport goods from certain
source to certain destination due to road hazards
like floods,snow,traffic regulations etc .
54
5.5. ASSIGNMENT PROBLEMS
• The Assignment Problem(AP) refers to the class of LPPs that involves
determining the most efficient assignment of people to projects, salespeople
to territories, contracts to bidders ,jobs to machines, and so on.
• The objective is to assign a number of resources to an equal number of
activities so as to minimize total costs or total time or maximize total profit
of allocation.
• The problem of assignment arises because available resources such as men,
machines, etc have varying degrees of efficiency for performing different
activities such as job.
• Therefore, cost, profit or time of performing the different activities is
different.
55
cont…Assumptions
• The AP is a special case of TP under the condition that the number of origins is
equal to the number of destinations.
• Each man or machine is loaded with one and only one job.
57
cont…
58
cont…
• Since all xij can be either 0 or 1, there will be one assignment
in each supply constraint and one assignment in each demand
constraint.
• As in the transportation problem, assignment problems can be
balanced or not.
• In a balanced case, the number of objects to be assigned
equals the number of objects to which they are assigned.
• Unbalanced problem can be balanced by adding a dummy
(dummies) with zero cost coefficients.
59
5.5.1. Methods of solving assignment problems
1. Enumeration method
2. Simplex method
3. Transportation method
4. Hungarian method
60
5.5.1.1. Hungarian Method/Flood’s Technique/
• The Hungarian Method (developed by Hungarian mathematician D.Konig)
of assignment provides us with efficient method of finding the optimal
solution without having to make a direct comparison of every solution.
• It works on the principle of reducing the given cost matrix (the principle
of matrix reduction) to a matrix of opportunity costs, 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.
• Opportunity costs show the relative penalties associated with assigning
resource to an activity as opposed to making the best or least-cost
assignment.
• If we can reduce the cost matrix to the extent of having at least one zero in
each row and column, then it will be possible to make optimal assignments.
61
Steps in solving assignment problems
• Step.1. Develop the cost table from the given problem
• If the number of rows does not equal the number of columns and vice versa, then a dummy row or dummy column must be added. The assignment costs for dummy
cells are always zero.
• Step 2.Find the opportunity cost table
• i.e. The transformation of the cost matrix to what is termed as a total-opportunity cost matrix.
• It involves two operations:
• a. Perform row operation
• i.e. Locate the smallest element in each row of the given cost table and then subtract that the given cost table and then subtract that from each element of that row
• b. Perform column operation
• i.e. In the reduced matrix obtained from 2(a) ,locate the smallest element in each column and then subtract that from each element of that column. Notice that each
row and column now have at least one zero value.
•
• Step 3.Test for an optimal assignment
• i.e. Test the table resulting from step 2 to see whether an optimal assignment can be made. The procedure is:
• a. Draw the minimum number of Horizontal and /or Vertical lines necessary to cover all zeros costs.
• Draw the lines by trial and error but always try to cover two or more zeros with one line.
• b. Count the number of the lines
• 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, an improvement is possible (we proceed to step 4).
•
• Step 4.Improve the present opportunity cost table (matrix)
• This is done by the following operations:
• a. Find the smallest entry in the uncovered cells (cells with no lines through them) and subtract it from all entries in the uncovered cells.
• b. Add the same smallest entry to those cells in which the lines intersect (cells with two lines them)
• c. Cells with one line through them are transferred (i.e. unchanged to the improved table).
• In those problems where the first improvement does not yield an optimal solution, we keep on improving the solution by repeating step 4 until an optimal solution is
achieved.
• Step 5: Make an optimal assignment
• An optimal assignment should be made to cells with a zero entry, maintaining the one-to-one requirement.
• If more than one optimal solution exists, a trial-and –error approach can be used to find all possible combination assignments in the zero cells.
• Note that multiple optimal solutions are possible.
• Example:
62
Example 1
63
Example 2
64
• Maximization case in assignment problems
•
• There may arise situations when the assignment problem
calls for maximization of profit, revenue, etc as the
objective function. Such problem may be solved by
converting the given maximization problem into a
minimization problem by the following procedure:
•
• Find the largest profit coefficient in the entire.
• Subtract each entry in the original table from the largest
profit coefficient.
• The transformed assignment problem so obtained can be
solved by using the Hungarian method.
65
• Example
• A company has four territories open, and four salesmen available for an
assignment. The territories are not equally rich in their sales potential.
Based on the past performance, the following table shows the annual
sales (in $) that can be generated by each salesman in each territory. Find
the optimal assignment and the maximum expected total sales.
66
Solution
67
NB
• Step-3
• A-tick all unassigned rows
• B-if ticked rows has zeros, then tick corresponding column
• C-if ticked column has assignment then tick corresponding rows
• D-repeat step B AND C till no more ticking is possible
• E-draw a line through unticked rows and ticked column
68
5.6. SPECIAL CASES IN THE ASSIGNMENT PROBLEMS
69