linear programming ppt
TRANSCRIPT
1
The LAST CHAPTERThe LAST CHAPTERThe LAST CHAPTERThe LAST CHAPTER
Optimization TechniquesOptimization Techniques
What is optimization ???????????What is optimization ???????????
What are the techniques ????????What are the techniques ????????
2
The Last ChapterThe Last ChapterThe Last ChapterThe Last Chapter
Formulation of LP, Graphical Solution and Formulation of LP, Graphical Solution and Hungarian Technique Hungarian Technique ( ICFAI Supplement) ( ICFAI Supplement)
TransportationTransportation
- North west corner Rule, - North west corner Rule,
- Stepping stone method, - Stepping stone method,
- Vogel Approximation, (VAM)- Vogel Approximation, (VAM)
- MOdified Distribution Method (MODI)- MOdified Distribution Method (MODI)
(XEROX MATERIAL)(XEROX MATERIAL)
(Better keep the slides while studying for the topics)(Better keep the slides while studying for the topics)
3
The LAST CHAPTERThe LAST CHAPTERThe LAST CHAPTERThe LAST CHAPTER
Linear Programming with Graphical solution only.Linear Programming with Graphical solution only. Assignment Problem Assignment Problem Transportation problem- Transportation problem-
- North west corner Rule, - North west corner Rule,
- Stepping stone method, - Stepping stone method,
- Vogel Approximation, (VAM)- Vogel Approximation, (VAM)
- MOdified Distribution Method (MODI)- MOdified Distribution Method (MODI)
4
Introduction To Linear ProgrammingIntroduction To Linear ProgrammingIntroduction To Linear ProgrammingIntroduction To Linear Programming
Today many of the resources needed as inputs to Today many of the resources needed as inputs to operations are in limited supply.operations are in limited supply.
Managers must understand the impact of this Managers must understand the impact of this situation on meeting their objectives.situation on meeting their objectives.
Linear programming (LP) is one way that managers Linear programming (LP) is one way that managers can determine how best to allocate their can determine how best to allocate their scarce scarce resourcesresources..
NOTE: Linear Programming is presented in NOTE: Linear Programming is presented in Supplement for QM. Only graphical solution is in the Supplement for QM. Only graphical solution is in the course.course.
5
Linear Programming (LP) in OMLinear Programming (LP) in OMLinear Programming (LP) in OMLinear Programming (LP) in OM
There are five common types of decisions in which There are five common types of decisions in which LP may play a roleLP may play a role Product mixProduct mix Production planProduction plan Ingredient mixIngredient mix TransportationTransportation AssignmentAssignment
6
LP Problems in OM: Production PlanLP Problems in OM: Production PlanLP Problems in OM: Production PlanLP Problems in OM: Production Plan
ObjectiveObjectiveTo select the mix of products or services that results To select the mix of products or services that results in maximum profits for the planning periodin maximum profits for the planning period
Decision VariablesDecision VariablesHow much to produce on straight-time labor and How much to produce on straight-time labor and overtime labor during each month of the yearovertime labor during each month of the year
ConstraintsConstraintsAmount of products demanded in each month; Amount of products demanded in each month; Maximum labor and machine capacity available in Maximum labor and machine capacity available in each month; Maximum inventory space available in each month; Maximum inventory space available in each montheach month
7
Recognizing LP ProblemsRecognizing LP ProblemsRecognizing LP ProblemsRecognizing LP Problems
Characteristics of LP Problems in OMCharacteristics of LP Problems in OM A well-defined single objective must be stated.A well-defined single objective must be stated. There must be alternative courses of action.There must be alternative courses of action. The total achievement of the objective must be The total achievement of the objective must be
constrained by scarce resources or other restraints.constrained by scarce resources or other restraints. The objective and each of the constraints must be The objective and each of the constraints must be
expressed as linear mathematical functions.expressed as linear mathematical functions.
8
Steps in Formulating LP ProblemsSteps in Formulating LP ProblemsSteps in Formulating LP ProblemsSteps in Formulating LP Problems
1.1. Define the objective. (min or max)Define the objective. (min or max)
2.2. Define the decision variables. (positive, binary) Define the decision variables. (positive, binary)
3.3. Write the mathematical function for the objective. Write the mathematical function for the objective.
4.4. Write a 1- or 2-word description of each constraint. Write a 1- or 2-word description of each constraint.
5.5. Write the right-hand side (RHS) of each constraint. Write the right-hand side (RHS) of each constraint.
6.6. Write Write <<, =, or , =, or >> for each constraint. for each constraint.
7.7. Write the decision variables on LHS of each constraint. Write the decision variables on LHS of each constraint.
8.8. Write the coefficient for each decision variable in each Write the coefficient for each decision variable in each constraint.constraint.
9
Cycle Trends is introducing two new lightweight bicycle frames, the Deluxe and the Professional, to be made from aluminum and steel alloys. The anticipated unit profits are $10 for the Deluxe and $15 for the Professional.
The number of pounds of each alloy needed per frame is summarized on the next slide. A supplier delivers 100 pounds of the aluminum alloy and 80 pounds of the steel alloy weekly. How many Deluxe and Professional frames should Cycle Trends produce each week?
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
10
Aluminum AlloyAluminum Alloy Steel AlloySteel Alloy
DeluxeDeluxe 2 3 2 3
Professional Professional 4 4 22
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
Pounds of each alloy needed per frame
11
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
Define the objective Maximize total weekly profit
Define the decision variables x1 = number of Deluxe frames produced weekly
x2 = number of Professional frames produced weekly
Write the mathematical objective function Max Z = 10x1 + 15x2
12
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
Write a one- or two-word description of each constraint Aluminum available Steel available
Write the right-hand side of each constraint 100 80
Write <, =, > for each constraint < 100 < 80
13
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
Write all the decision variables on the left-hand side Write all the decision variables on the left-hand side of each constraintof each constraint x1 x2 < 100
x1 x2 < 80
Write the coefficient for each decision in each constraint
+ 2x1 + 4x2 < 100
+ 3x1 + 2x2 < 80
14
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
LP in Final FormLP in Final Form Max Z = 10x1 + 15x2
Subject To 2x1 + 4x2 < 100 ( aluminum constraint) 3x1 + 2x2 < 80 ( steel constraint) x1 , x2 >> 0 (non-negativity constraints)
15
SolutionSolutionSolutionSolution
x1
x2
2x1+4x2<=100
3x1+2x2<= 80
o
AB
C
Feasible region OABC
Solutions are At OABC
Find Z at O,A,B & C, select the value which maximizes the profit,Generally the solution lies at intersection of the linesHere in this case, x1=15 & x2=17.5
16
Montana Wood Products manufacturers two-high quality products, tables and chairs. Its profit is $15 per chair and $21 per table. Weekly production is constrained by available labor and wood. Each chair requires 4 labor hours and 8 board feet of wood while each table requires 3 labor hours and 12 board feet of wood. Available wood is 2400 board feet and available labor is 920 hours. Management also requires at least 40 tables and at least 4 chairs be produced for every table produced. To maximize profits, how many chairs and tables should be produced?
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
17
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
Define the objective Maximize total weekly profit
Define the decision variables x1 = number of chairs produced weekly
x2 = number of tables produced weekly
Write the mathematical objective function Max Z = 15x1 + 21x2
18
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
Write a one- or two-word description of each constraint Labor hours available Board feet available At least 40 tables At least 4 chairs for every table
Write the right-hand side of each constraint 920 2400 40 4 to 1 ratio
Write <, =, > for each constraint < 920 < 2400 >> 40 40 4 to 1 1
19
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
Write all the decision variables on the left-hand side of each Write all the decision variables on the left-hand side of each constraintconstraint
x1 x2 < 920
x1 x2 < 2400
x2 >> 40 40
4 to 1 ratio x1 / x2 ≥ 4/1
Write the coefficient for each decision in each constraint + 4x1 + 3x2 < 920
+ 8x1 + 12x2 < 2400
x2 >> 40 40
x1 ≥ 4 x2
20
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
LP in Final FormLP in Final Form Max Z = 15x1 + 21x2
Subject To 4x1 + 3x2 < 920 ( labor constraint) 8x1 + 12x2 < 2400 ( wood constraint) x2 - 40 >> 0 (make at least 40 tables) 0 (make at least 40 tables) x1 - 4 x2 >> 0 (at least 4 chairs for every table) 0 (at least 4 chairs for every table) x1 , x2 >> 0 (non-negativity constraints)
21
The Sureset Concrete Company produces concrete. Two ingredients in concrete are sand (costs $6 per ton) and gravel (costs $8 per ton). Sand and gravel together must make up exactly 75% of the weight of the concrete. Also, no more than 40% of the concrete can be sand and at least 30% of the concrete be gravel. Each day 2000 tons of concrete are produced. To minimize costs, how many tons of gravel and sand should be purchased each day?
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
22
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
Define the objective Minimize daily costs
Define the decision variables x1 = tons of sand purchased
x2 = tons of gravel purchased
Write the mathematical objective function Min Z = 6x1 + 8x2
23
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
Write a one- or two-word description of each constraint 75% must be sand and gravel No more than 40% must be sand At least 30% must be gravel
Write the right-hand side of each constraint .75(2000) .40(2000) .30(2000)
Write <, =, > for each constraint = 1500 < 800 800 >> 600 600
24
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
Write all the decision variables on the left-hand side of Write all the decision variables on the left-hand side of each constrainteach constraint x1 x2 = 1500
x1 < 800 800
x2 >> 600 600
Write the coefficient for each decision in each constraint + x1 + x2 = 1500
+ x1 < 800
x2 >> 600 600
25
Example: LP FormulationExample: LP FormulationExample: LP FormulationExample: LP Formulation
LP in Final FormLP in Final Form Min Z = 6x1 + 8x2
Subject To x1 + x2 = 1500 ( mix constraint) x1 < 800 ( mix constraint) x2 >> 600 ( mix constraint ) 600 ( mix constraint ) x1 , x2 >> 0 (non-negativity constraints)
26
LP Problems in GeneralLP Problems in GeneralLP Problems in GeneralLP Problems in General
Units of each term in a constraint must be the same as Units of each term in a constraint must be the same as the RHSthe RHS
Units of each term in the objective function must be Units of each term in the objective function must be the same as Zthe same as Z
Units between constraints do not have to be the sameUnits between constraints do not have to be the same LP problem can have a mixture of constraint typesLP problem can have a mixture of constraint types
27
Linear Programming: Assignment ProblemLinear Programming: Assignment ProblemLinear Programming: Assignment ProblemLinear Programming: Assignment Problem
28
IntroductionIntroductionIntroductionIntroduction
There are special classes of LP problems such as the There are special classes of LP problems such as the assignment problem (AP).assignment problem (AP).
Efficient solutions methods exist to solve AP.Efficient solutions methods exist to solve AP.
29
AP can be formulated as an LP and solved by AP can be formulated as an LP and solved by general purpose LP codes. general purpose LP codes.
However, there are many computer packages, However, there are many computer packages, which contain separate computer codes for these which contain separate computer codes for these models which take advantage of the problem models which take advantage of the problem network structure.network structure.
Assignment ProblemAssignment ProblemAssignment ProblemAssignment Problem
30
Assignment ProblemAssignment ProblemAssignment ProblemAssignment Problem
An An assignment problemassignment problem seeks to minimize the total cost seeks to minimize the total cost assignment of assignment of mm workers to workers to mm jobs, given that the cost of jobs, given that the cost of worker worker ii performing job performing job jj is is ccijij. .
It assumes all workers are assigned and each job is It assumes all workers are assigned and each job is performed. performed.
An assignment problem is a special case of a An assignment problem is a special case of a transportation problem in which all supplies and all transportation problem in which all supplies and all demands are equal to 1; hence assignment problems may demands are equal to 1; hence assignment problems may be solved as linear programs.be solved as linear programs.
The network representation of an assignment problem The network representation of an assignment problem with three workers and three jobs is shown on the next with three workers and three jobs is shown on the next slide.slide.
31
Assignment ProblemAssignment ProblemAssignment ProblemAssignment Problem
Network RepresentationNetwork Representation
2222
3333
1111
2222
3333
1111cc1111
cc1212
cc1313
cc2121 cc2222
cc2323
cc3131cc3232
cc3333
WORKERSWORKERS JOBSJOBS
32
Assignment ProblemAssignment ProblemAssignment ProblemAssignment Problem
Linear Programming FormulationLinear Programming Formulation
Min Min ccijijxxijij
i ji j
s.t. s.t. xxijij = 1 for each resource (row) = 1 for each resource (row) ii jj
xxijij = 1 for each job (column) = 1 for each job (column) jj ii
xxijij = 0 or 1 for all = 0 or 1 for all ii and and jj..
Note: Note: A modification to the right-hand side of the first constraint set 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.can be made if a worker is permitted to work more than 1 job.
33
Hungarian MethodHungarian MethodHungarian MethodHungarian Method
The The Hungarian methodHungarian method solves minimization solves minimization assignment problems with assignment problems with mm workers and workers and mm jobs. jobs.
34
Hungarian MethodHungarian MethodHungarian MethodHungarian Method
Step 1: Step 1: For each row, subtract the minimum number in that For each row, subtract the minimum number in that row from all numbers in that row.row from all numbers in that row.
Step 2: Step 2: For each column, subtract the minimum number in that For each column, subtract the minimum number in that column from all numbers in that column. column from all numbers in that column.
Step 3: Step 3: Draw the minimum number of lines to cover all zeroes. Draw the minimum number of lines to cover all zeroes. If this number = If this number = mm, STOP — an assignment can be made., STOP — an assignment can be made.
Step 4: Step 4: Determine the minimum uncovered number Determine the minimum uncovered number (call it (call it dd).).
Subtract Subtract dd from uncovered numbers. from uncovered numbers. Add Add dd to numbers covered by two lines. to numbers covered by two lines. Numbers covered by one line remain the same.Numbers covered by one line remain the same. Then, GO TO STEP 3.Then, GO TO STEP 3.
35
Hungarian MethodHungarian MethodHungarian MethodHungarian Method
Finding the Minimum Number of Lines and Determining the Finding the Minimum Number of Lines and Determining the Optimal SolutionOptimal Solution
Step 1: Step 1: Find a row or column with only one unlined zero Find a row or column with only one unlined zero and circle it. (If all rows/columns have two or more and circle it. (If all rows/columns have two or more unlined zeroes choose an arbitrary zero.)unlined zeroes choose an arbitrary zero.)
Step 2: Step 2: If the circle is in a row with one zero, draw a line If the circle is in a row with one zero, draw a line through its column. If the circle is in a column with one through its column. If the circle is in a column with one zero, draw a line through its row. One approach, when all zero, draw a line through its row. One approach, when all rows and columns have two or more zeroes, is to draw a rows and columns have two or more zeroes, is to draw a line through one with the most zeroes, breaking ties line through one with the most zeroes, breaking ties arbitrarily.arbitrarily.
Step 3: Step 3: Repeat step 2 until all circles are lined. If this Repeat step 2 until all circles are lined. If this minimum number of lines equals minimum number of lines equals mm, the circles provide the , the circles provide the optimal assignment.optimal assignment.
36
Example 1: APExample 1: APExample 1: APExample 1: APA contractor pays his subcontractors a fixed fee plus mileage for work A contractor pays his subcontractors a fixed fee plus mileage for work performed. On a given day the contractor is faced with three electrical performed. On a given day the contractor is faced with three electrical jobs associated with various projects. Given below are the distances jobs associated with various projects. Given below are the distances between the subcontractors and the projects.between the subcontractors and the projects.
ProjectProject AA BB CC
Westside Westside 50 36 1650 36 16 Subcontractors Subcontractors Federated Federated 28 30 18 28 30 18
Goliath Goliath 35 32 2035 32 20 Universal Universal 25 25 1425 25 14
How should the contractors be assigned to minimize total costs?How should the contractors be assigned to minimize total costs?NoteNote: There are four subcontractors and three projects. We create a : There are four subcontractors and three projects. We create a dummy project Dum, which will be assigned to one subcontractor (i.e. dummy project Dum, which will be assigned to one subcontractor (i.e. that subcontractor will remain idle)that subcontractor will remain idle)
37
Example 1: APExample 1: APExample 1: APExample 1: AP
Network Representation (note the dummy project)Network Representation (note the dummy project)5050
3636
161600
28283030
181800
3535 3232
2020
00
2525 2525
1414
00
West.West.West.West.
Dum.Dum.Dum.Dum.
CCCC
BBBB
AAAA
Univ.Univ.Univ.Univ.
Gol.Gol.Gol.Gol.
Fed.Fed.Fed.Fed.
38
Example 1: APExample 1: APExample 1: APExample 1: AP
Initial Tableau SetupInitial Tableau Setup
Since the Hungarian algorithm requires that there Since the Hungarian algorithm requires that there be the same number of rows as columns, add a Dummy be the same number of rows as columns, add a Dummy column so that the first tableau is (the smallest elements column so that the first tableau is (the smallest elements in each row are marked red):in each row are marked red):
AA BB CC DummyDummy
WestsideWestside 50 50 3636 16 16 00
FederatedFederated 28 28 3030 18 18 00
GoliathGoliath 35 35 3232 20 20 00
UniversalUniversal 2525 2525 1414 00
39
Example 1: APExample 1: APExample 1: APExample 1: AP
Step 1: Step 1: Subtract minimum number in each row from Subtract minimum number in each row from all numbers in that row. Since each row has a zero, all numbers in that row. Since each row has a zero, we simply generate the original matrix (the smallest we simply generate the original matrix (the smallest elements in each column are marked red). This yields:elements in each column are marked red). This yields:
AA B B CC DummyDummy
Westside 50 36 16 0Westside 50 36 16 0
Federated 28 30 18 0Federated 28 30 18 0
Goliath 35 32 20 0Goliath 35 32 20 0
Universal Universal 2525 2525 1414 00
40
Example 1: APExample 1: APExample 1: APExample 1: AP
Step 2: Step 2: Subtract the minimum number in each Subtract the minimum number in each column from all numbers in the column. For A it is column from all numbers in the column. For A it is 25, for B it is 25, for C it is 14, for Dummy it is 0. 25, for B it is 25, for C it is 14, for Dummy it is 0. This yields:This yields:
AA BB CC DummyDummy
Westside 25 11 2 0Westside 25 11 2 0
Federated 3 5 4 0Federated 3 5 4 0
Goliath 10 7 6 Goliath 10 7 6 00
Universal 0 0 0 0 Universal 0 0 0 0
41
Example 1: APExample 1: APExample 1: APExample 1: AP
Step 3: Step 3: Draw the minimum number of lines to cover all zeroes (called Draw the minimum number of lines to cover all zeroes (called minimum cover). Although one can "eyeball" this minimum, use the minimum cover). Although one can "eyeball" this minimum, use the following algorithm. If a "remaining" row has only one zero, draw a line following algorithm. If a "remaining" row has only one zero, draw a line through the column. If a remaining column has only one zero in it, draw through the column. If a remaining column has only one zero in it, draw a line through the row. Since the number of lines that cover all zeros is 2 a line through the row. Since the number of lines that cover all zeros is 2 < 4 (# of rows), the current solution is not optimal. < 4 (# of rows), the current solution is not optimal.
AA BB CC DummyDummy
Westside 25 11 2 0 Westside 25 11 2 0 Federated 3 5 4 0 Federated 3 5 4 0 Goliath 10 7 6 0 Goliath 10 7 6 0 Universal 0 0 0 0Universal 0 0 0 0
Step 4: Step 4: The minimum uncovered number is 2 (circled). The minimum uncovered number is 2 (circled).
42
Example 1: APExample 1: APExample 1: APExample 1: AP
Step 5: Step 5: Subtract 2 from uncovered numbers; add 2 to Subtract 2 from uncovered numbers; add 2 to all numbers at line intersections; leave all other all numbers at line intersections; leave all other numbers intact. This gives:numbers intact. This gives:
AA BB CC DummyDummy
Westside 23 9 0 0 Westside 23 9 0 0
Federated 1 3 2 0 Federated 1 3 2 0
Goliath 8 5 4 0 Goliath 8 5 4 0
Universal 0 0 0 Universal 0 0 0 22
43
Example 1: APExample 1: APExample 1: APExample 1: AP
Step 3: Step 3: Draw the minimum number of lines to cover all Draw the minimum number of lines to cover all zeroes. Since 3 (# of lines) < 4 (# of rows), the current zeroes. Since 3 (# of lines) < 4 (# of rows), the current solution is not optimal. solution is not optimal.
AA BB CC DummyDummy
Westside 23 9 0 0 Westside 23 9 0 0
Federated 1 3 2 0 Federated 1 3 2 0
Goliath 8 5 4 0 Goliath 8 5 4 0
Universal 0 0 0 2Universal 0 0 0 2
Step 4: Step 4: The minimum uncovered number is 1 (circled).The minimum uncovered number is 1 (circled).
44
Example 1: APExample 1: APExample 1: APExample 1: AP
Step 5: Step 5: Subtract 1 from uncovered numbers. Add 1 Subtract 1 from uncovered numbers. Add 1 to numbers at intersections. Leave other numbers to numbers at intersections. Leave other numbers intact. This gives:intact. This gives:
AA BB CC DummyDummy
Westside 23 9 0 Westside 23 9 0 11
Federated 0 2 1 0 Federated 0 2 1 0
Goliath 7 4 3 0 Goliath 7 4 3 0
Universal 0 0 0 Universal 0 0 0 33
45
Example 1: APExample 1: APExample 1: APExample 1: AP
Find the minimum cover:Find the minimum cover:
AA BB CC DummyDummy
Westside 23 9 0 Westside 23 9 0 1 1
Federated 0 2 1 0 Federated 0 2 1 0
Goliath 7 4 3 0 Goliath 7 4 3 0
Universal 0 0 0 Universal 0 0 0 3 3
Step 4: Step 4: The minimum number of lines to cover all 0's is The minimum number of lines to cover all 0's is four. Thus, the current solution is optimal (minimum four. Thus, the current solution is optimal (minimum cost) assignment.cost) assignment.
46
Example 1: APExample 1: APExample 1: APExample 1: AP
The optimal assignment occurs at locations of zeros The optimal assignment occurs at locations of zeros such that there is exactly one zero in each row and such that there is exactly one zero in each row and each column:each column:
AA BB CC DummyDummy
Westside 23 9 Westside 23 9 00 1 1
Federated Federated 00 2 1 0 2 1 0
Goliath 7 4 3 Goliath 7 4 3 00
Universal 0 Universal 0 00 0 0 3 3
47
Example 1: APExample 1: APExample 1: APExample 1: AP
The optimal assignment is (go back to the original table The optimal assignment is (go back to the original table for the distances):for the distances):
SubcontractorSubcontractor ProjectProject DistanceDistance
Westside C 16Westside C 16
Federated A 28Federated A 28
Universal B 25Universal B 25
Goliath (unassigned) Goliath (unassigned)
Total Distance = 69 miles Total Distance = 69 miles
48
SolveSolveSolveSolve
Determine how jobs should be assigned to machines to Determine how jobs should be assigned to machines to minimizeminimize setup times, which are given below: setup times, which are given below:
Job 1 Job 2 Job 3 Job 4
Machine 1 14 5 8 7
Machine 2 2 12 6 5
Machine 3 7 8 3 9
Machine 4 2 4 6 10
49
ExampleExampleExampleExample
We must determine how jobs should be assigned to machines We must determine how jobs should be assigned to machines to to minimizeminimize setup times, which are given below: setup times, which are given below:
Job 1 Job 2 Job 3 Job 4
Machine 1 14 5 8 7
Machine 2 2 12 6 5
Machine 3 7 8 3 9
Machine 4 2 4 6 10
50
Hungarian AlgorithmHungarian AlgorithmHungarian AlgorithmHungarian Algorithm
Step 1Step 1: (a) Find the minimum element in each row of : (a) Find the minimum element in each row of the cost matrix. Form a new matrix by subtracting the cost matrix. Form a new matrix by subtracting this cost from each row. (b) Find the minimum cost in this cost from each row. (b) Find the minimum cost in each column of the new matrix, and subtract this from each column of the new matrix, and subtract this from each column. This is the each column. This is the reduced cost matrixreduced cost matrix..
51
Example: Step 1(a)Example: Step 1(a)Example: Step 1(a)Example: Step 1(a)
Job 1 Job 2 Job 3 Job 4
Machine 1 14 5 8 7
Machine 2 2 12 6 5
Machine 3 7 8 3 9
Machine 4 2 4 6 10
Job 1 Job 2 Job 3 Job 4
Machine 1 9 0 3 2
Machine 2 0 10 4 3
Machine 3 4 5 0 6
Machine 4 0 2 4 8
Row Reduction
52
Example: Step 1(b)Example: Step 1(b)Example: Step 1(b)Example: Step 1(b)
Job 1 Job 2 Job 3 Job 4
Machine 1 9 0 3 0
Machine 2 0 10 4 1
Machine 3 4 5 0 4
Machine 4 0 2 4 6
Job 1 Job 2 Job 3 Job 4
Machine 1 9 0 3 2
Machine 2 0 10 4 3
Machine 3 4 5 0 6
Machine 4 0 2 4 8
Column Reduction
53
Hungarian AlgorithmHungarian AlgorithmHungarian AlgorithmHungarian Algorithm
Step 2Step 2: Draw the minimum number of lines that are : Draw the minimum number of lines that are needed to cover all the zeros in the reduced cost needed to cover all the zeros in the reduced cost matrix. If m lines are required, then an optimal matrix. If m lines are required, then an optimal solution is available among the covered zeros in the solution is available among the covered zeros in the matrix. Otherwise, continue to Step 3.matrix. Otherwise, continue to Step 3.
How do we find the minimum
number of lines?!
54
Example: Step 2Example: Step 2Example: Step 2Example: Step 2
Job 1 Job 2 Job 3 Job 4
Machine 1 9 0 3 0
Machine 2 0 10 4 1
Machine 3 4 5 0 4
Machine 4 0 2 4 6
We need 3<4 lines, so continue to Step 3
55
Hungarian AlgorithmHungarian AlgorithmHungarian AlgorithmHungarian Algorithm
Step 3Step 3: Find the smallest nonzero element (say, : Find the smallest nonzero element (say, kk) in ) in the reduced cost matrix that is uncovered by the lines. the reduced cost matrix that is uncovered by the lines. Subtract Subtract kk from each uncovered element, and add from each uncovered element, and add kk to to each element that is covered by two lines. Return to each element that is covered by two lines. Return to Step 2.Step 2.
56
Example: Step 3Example: Step 3Example: Step 3Example: Step 3
Job 1 Job 2 Job 3 Job 4
Machine 1 9 0 3 0
Machine 2 0 10 4 1
Machine 3 4 5 0 4
Machine 4 0 2 4 6
Job 1 Job 2 Job 3 Job 4
Machine 1 10 0 3 0
Machine 2 0 9 3 0
Machine 3 5 5 0 4
Machine 4 0 1 3 5
57
Example: Step 2 (again)Example: Step 2 (again)Example: Step 2 (again)Example: Step 2 (again)
Job 1 Job 2 Job 3 Job 4
Machine 1 10 0 3 0
Machine 2 0 9 3 0
Machine 3 5 5 0 4
Machine 4 0 1 3 5
Need 4 lines, so we have the optimal assignment and we stop
Zero Assignment
58
Example: Final SolutionExample: Final SolutionExample: Final SolutionExample: Final Solution
Job 1 Job 2 Job 3 Job 4
Machine 1 10 0 3 0
Machine 2 0 9 3 0
Machine 3 5 5 0 4
Machine 4 0 1 3 5
Optimal assignment
1,1,1,1 24413312 xxxx
How did we know which 0’s
to choose?!
59
TransportationTransportationTransportationTransportation
Transportation models deals with the transportation Transportation models deals with the transportation of a product manufactured at different plants or of a product manufactured at different plants or factories supply origins) to a number of different factories supply origins) to a number of different warehouses (demand destinations). warehouses (demand destinations).
The objective to satisfy the destination requirements The objective to satisfy the destination requirements within the plants capacity constraints at the minimum within the plants capacity constraints at the minimum transportation cost. transportation cost.
60
Transportation ModelingTransportation ModelingTransportation ModelingTransportation Modeling
An interactive procedure that finds the An interactive procedure that finds the least costly means of moving products least costly means of moving products from a series of sources to a series of from a series of sources to a series of destinationsdestinations
Can be used to Can be used to help resolve help resolve distribution distribution and location and location decisionsdecisions
61
A typical transportation problem containsA typical transportation problem containsA typical transportation problem containsA typical transportation problem contains
Inputs:Inputs: Sources with availabilitySources with availability
Destinations with requirementsDestinations with requirements Unit cost of transportation from various sources to Unit cost of transportation from various sources to
destinationsdestinations Objective:Objective: To determine schedule of transportationTo determine schedule of transportation to to minimizeminimize total total
transportation costtransportation cost
62
How to solve?How to solve?How to solve?How to solve?
Define the objective function to be minimized with Define the objective function to be minimized with the constraints imposed on the problem.the constraints imposed on the problem.
Set up a transportation table with Set up a transportation table with mm rows rows representing the sources and representing the sources and nn columns columns representing the destinationrepresenting the destination
Develop an initial feasible solution to the problem Develop an initial feasible solution to the problem by any of these methods by any of these methods
a) The North west corner rule a) The North west corner rule
b) Lowest cost entry method (Not in the course)b) Lowest cost entry method (Not in the course)
c)Vogel’s approximation methodc)Vogel’s approximation method
63
The Northwest Corner RuleThe Northwest Corner RuleThe Northwest Corner RuleThe Northwest Corner Rule
64
Definition-Definition-Definition-Definition-
A procedure to find a basic and feasible A procedure to find a basic and feasible solution for a transportation problem.solution for a transportation problem.
65
How it works.How it works.How it works.How it works.
Start in the upper left-hand (North West) corner of Start in the upper left-hand (North West) corner of the tableau and assign the most you can to the the tableau and assign the most you can to the variable (considering supply and demand).variable (considering supply and demand).
You then move down or to the right depending on You then move down or to the right depending on supply and demand until you reach the south east supply and demand until you reach the south east corner.corner.
66
X X X X
X X X X
X X X X
32
1
4
2
3
1Distributor
Factory
Demand
Supply
10
15
68 4 12 7
11 12 13 14
21 22 23 24
31 32 33 34
67
32
1
4
2
3
1Distributor
Factory
Demand
Supply
10
15
68 4 12 7
Beginning the Journey: The feasible solution
8 2
2 12 1
6
68
A Transportation Model RequiresA Transportation Model RequiresA Transportation Model RequiresA Transportation Model Requires
The origin points, and the capacity or supply per The origin points, and the capacity or supply per period at eachperiod at each
The destination points and the demand per period at The destination points and the demand per period at eacheach
The cost of shipping one unit from each origin to The cost of shipping one unit from each origin to each destinationeach destination
70C-70
Define problemDefine problem Set up transportation table (matrix)Set up transportation table (matrix)
Summarizes all dataSummarizes all data Keeps track of computationsKeeps track of computations
Develop Develop initialinitial solution solution Northwest corner ruleNorthwest corner rule
Find Find optimaloptimal solution solution Stepping stone methodStepping stone method
Transportation ProblemTransportation ProblemSolution StepsSolution Steps
Transportation ProblemTransportation ProblemSolution StepsSolution Steps
71
Transportation CostsTransportation CostsTransportation CostsTransportation Costs
FromTo
(Destination)(Sources) Albuquerque Boston Cleveland
Des Moines $5 $4 $3
Evansville $8 $4 $3
FortLauderdale
$9 $7 $5
72
Transportation TableTransportation TableTransportation TableTransportation Table
DestinationSource Supply
Demand
1
2
:
m
a1
a2
:
am
1 2 . . n
b1 b2 bn
Quantity demanded or required
73
Transportation TableTransportation TableTransportation TableTransportation Table
Destination
Source 1 2 . . n Supply
1 x11 c11 x12 c12 . . x1n c1n a1
2 x21 c21 x22 c22 . . x2n c2n a2
: : : : : : : : : :
m xm1 cm1 xm2 cm2 . . xmn cmn am
Demand b1 b2 . . bn
Cost of supplying 1 unit from sources to destinations
Cost of supplying 1 unit from sources to destinations
74
Transportation TableTransportation TableTransportation TableTransportation Table
DestinationSource Supply
Demand
1
2
:
m
a1
a2
:
am
1 2 . . n
b1 b2 bn
x11 x12 . . x1n
x21 x22 . . 2n
: : : : : : :
xm1 xm2 . . xmn
:
xQuantity supplied from sources to destinations
75
Transportation TableTransportation TableTransportation TableTransportation Table
ToFrom
Albuquerque(A)
Boston(B)
Cleveland(C)
FactoryCapacity
Des Moines(D) 100
Evansville(E) 300
Fort Lauderdale(F) 300
WarehouseRequirements 300 200 200 700
5
8
9 7
4
4 3
3
5
76
Transportation MatrixTransportation MatrixTransportation MatrixTransportation Matrix
Factory capacity
Warehouse requirement
300
300
300 200 200
100
700
Cost of shipping 1 unit from FortCost of shipping 1 unit from FortLauderdale factory to Boston warehouseLauderdale factory to Boston warehouse
Des MoinesDes Moinescapacitycapacityconstraintconstraint
Cell Cell representing a representing a possible possible source-to-source-to-destination destination shipping shipping assignment assignment (Evansville to (Evansville to Cleveland)Cleveland)
Total demandTotal demandand total supplyand total supply
ClevelandClevelandwarehouse demandwarehouse demand
Figure C.2Figure C.2
77
Initial Solution Using the Northwest Corner Initial Solution Using the Northwest Corner RuleRule
Initial Solution Using the Northwest Corner Initial Solution Using the Northwest Corner RuleRule
ToFrom
Albuquerque(A)
Boston(B)
Cleveland(C)
FactoryCapacity
Des Moines(D) 100 100
Evansville(E) 200 100 300
Fort Lauderdale(F) 100 200 300
WarehouseRequirements 300 200 200 700
5
8
9 7
4
4 3
3
5
78
Northwest-Corner RuleNorthwest-Corner RuleNorthwest-Corner RuleNorthwest-Corner Rule
Computed Shipping CostComputed Shipping Cost
RouteRouteFromFrom ToTo Tubs ShippedTubs Shipped Cost per UnitCost per Unit Total CostTotal Cost
DD AA 100100 $5$5 $ 500$ 500EE AA 200200 88 1,6001,600EE BB 100100 44 400400FF BB 100100 77 700700FF CC 200200 55 $1,000$1,000
Total: $4,200Total: $4,200
This is a feasible solution but not necessarily the lowest cost alternative
79
Stepping-Stone MethodStepping-Stone MethodStepping-Stone MethodStepping-Stone Method
1.1. Select any unused square to evaluateSelect any unused square to evaluate
2.2. Beginning at this square, trace a closed Beginning at this square, trace a closed path back to the original square via path back to the original square via squares that are currently being usedsquares that are currently being used
3.3. Beginning with a plus (+) sign at the Beginning with a plus (+) sign at the unused corner, place alternate minus and unused corner, place alternate minus and plus signs at each corner of the path just plus signs at each corner of the path just tracedtraced
80
Stepping-Stone MethodStepping-Stone MethodStepping-Stone MethodStepping-Stone Method
4.4. Calculate an improvement index by first Calculate an improvement index by first adding the unit-cost figures found in each adding the unit-cost figures found in each square containing a plus sign and square containing a plus sign and subtracting the unit costs in each square subtracting the unit costs in each square containing a minus signcontaining a minus sign
5.5. Repeat steps 1 though 4 until you have Repeat steps 1 though 4 until you have calculated an improvement index for all calculated an improvement index for all unused squares. If all indices are ≥ 0, you unused squares. If all indices are ≥ 0, you have reached an optimal solution.have reached an optimal solution.
81
Stepping-Stone MethodStepping-Stone MethodStepping-Stone MethodStepping-Stone Method
+-
-+
11100100
201201 9999
9999
100100200200Figure C.5Figure C.5
Des Moines- Boston index
= $4 - $5 + $8 - $4
= +$3
82
Stepping-Stone MethodStepping-Stone MethodStepping-Stone MethodStepping-Stone Method
Figure C.6Figure C.6
+-
+
-+
-
Des Moines-Cleveland index
= $3 - $5 + $8 - $4 + $7 - $5 = +$4
83
Stepping-Stone MethodStepping-Stone MethodStepping-Stone MethodStepping-Stone Method
Evansville-Cleveland index
= $3 - $4 + $7 - $5 = +$1
(Closed path = EC - EB + FB - FC)
Fort Lauderdale-Albuquerque index
= $9 - $7 + $4 - $8 = -$1
(Closed path = FA - FB + EB - EA)
84
Stepping-Stone MethodStepping-Stone MethodStepping-Stone MethodStepping-Stone Method
1.1. If an improvement is possible, choose the If an improvement is possible, choose the route (unused square) with the largest route (unused square) with the largest negative improvement indexnegative improvement index
2.2. On the closed path for that route, select On the closed path for that route, select the smallest number found in the squares the smallest number found in the squares containing minus signscontaining minus signs
3.3. Add this number to all squares on the Add this number to all squares on the closed path with plus signs and subtract it closed path with plus signs and subtract it from all squares with a minus signfrom all squares with a minus sign
85
Stepping-Stone MethodStepping-Stone MethodStepping-Stone MethodStepping-Stone Method
Figure C.7Figure C.7
+
+-
-
1. Add 100 units on route FA2. Subtract 100 from routes FB3. Add 100 to route EB4. Subtract 100 from route EA
86
Stepping-Stone MethodStepping-Stone MethodStepping-Stone MethodStepping-Stone Method
Total CostTotal Cost = $5(100) + $8(100) + $4(200) + $9(100) + $5(200)= $5(100) + $8(100) + $4(200) + $9(100) + $5(200)= $4,000= $4,000
87
The Modified Distribution MethodThe Modified Distribution Method
88
The Modified Distribution MethodThe Modified Distribution MethodThe Modified Distribution MethodThe Modified Distribution Method
Use Northwest Corner Rule to arrive at initial feasible Use Northwest Corner Rule to arrive at initial feasible SolutionSolution
ToFrom
Albuquerque(A)
Boston(B)
Cleveland(C)
FactoryCapacity
Des Moines(D) 100 100
Evansville(E) 200 100 300
Fort Lauderdale(F) 100 200 300
WarehouseRequirements 300 200 200 700
5
8
9 7
4
4 3
3
5
89
The Modified Distribution MethodThe Modified Distribution Method1.1. Determine a set of number for each row and each column. Determine a set of number for each row and each column.
Calculate Calculate UUii ( i= 1,2,..m)and ( i= 1,2,..m)and VVj j (j = 1,2..n)for each column, (j = 1,2..n)for each column,
and and CCij ij = (= (UUii + + VVj j ) for occupied cells.) for occupied cells.
2.2. Compute the opportunity costCompute the opportunity cost
ΔΔij ij = = CCij ij - (- (UUii + + VVj j ) for each unoccupied cells.) for each unoccupied cells.
90
44. . Check the sign of each opportunity cost: if all the Check the sign of each opportunity cost: if all the
ΔΔij ij are positive or zero, the given solution is optimum. If one are positive or zero, the given solution is optimum. If one of the values is zero there is another alterative solution for of the values is zero there is another alterative solution for the same transportation cost. If any value is negative the the same transportation cost. If any value is negative the given solution is not optimum. Further improvement is given solution is not optimum. Further improvement is possible.possible.
5. Select the unoccupied cell with the largest negative 5. Select the unoccupied cell with the largest negative opportunity cost as the cell to be included in the next solution.opportunity cost as the cell to be included in the next solution.
6. Draw a closed path or loop for the unoccupied cell selected in 6. Draw a closed path or loop for the unoccupied cell selected in step 5.It may be noted that right angle turns in this path are step 5.It may be noted that right angle turns in this path are permitted only a occupied cells and at the original unoccupied permitted only a occupied cells and at the original unoccupied cellcell
91
7. Assign alternative plus and minus signs at the unoccupied cells 7. Assign alternative plus and minus signs at the unoccupied cells on the corner points of the closed path with a plus sign at the on the corner points of the closed path with a plus sign at the cell being evaluated.cell being evaluated.
8.Determine the maximum number of units that should be 8.Determine the maximum number of units that should be shipped to this unoccupied cell. The smallest one with a shipped to this unoccupied cell. The smallest one with a negative position on the closed path indicates the number of negative position on the closed path indicates the number of units that can be shipped to the entering cell. This quantity is units that can be shipped to the entering cell. This quantity is added to all the cells on the path marked with plus sign and added to all the cells on the path marked with plus sign and subtract from those cells mark with minus sign. In this way the subtract from those cells mark with minus sign. In this way the unoccupied cell under consideration becomes an occupied cell unoccupied cell under consideration becomes an occupied cell making one of the occupied cells as unoccupied cell.making one of the occupied cells as unoccupied cell.
9.Repeat the whole procedure until an optimum solution is 9.Repeat the whole procedure until an optimum solution is
attained i.e. attained i.e. ΔΔij ij is positive or zero. Finally calculate new is positive or zero. Finally calculate new transportation cost.transportation cost.
92
VAMVAMVAMVAM
VOGEL APPROXIMATION METHODVOGEL APPROXIMATION METHOD
A method of obtaining initial feasible solution which A method of obtaining initial feasible solution which is often an optimal solutionis often an optimal solution
Not always an optimal solution…need to check it by Not always an optimal solution…need to check it by MODI.MODI.
An opportunity cost method proceeded by calculating An opportunity cost method proceeded by calculating penalty at each step.penalty at each step.
93
Vogel's Approximation MethodVogel's Approximation Method (VAM) (VAM)
Compute a penalty for each row and column in the Compute a penalty for each row and column in the transportation table. The penalty for a given row transportation table. The penalty for a given row and column is merely the difference between the and column is merely the difference between the smallest cost and next smallest cost in that smallest cost and next smallest cost in that particular row or column.particular row or column.
94
VAMVAMVAMVAM
Identify the row or column with the largest penalty. Identify the row or column with the largest penalty. In this identified row or column, choose the cell In this identified row or column, choose the cell which has the smallest cost and allocate the which has the smallest cost and allocate the maximum possible quantity to the lowest cost cell in maximum possible quantity to the lowest cost cell in that row or column so as to exhaust either the supply that row or column so as to exhaust either the supply at a particular source or satisfy demand at at a particular source or satisfy demand at warehouse.( If a tie occurs in the penalties, select that warehouse.( If a tie occurs in the penalties, select that row/column which has minimum cost. If there is a tie row/column which has minimum cost. If there is a tie in the minimum cost also, select the row/column in the minimum cost also, select the row/column which will have maximum possible assignmentswhich will have maximum possible assignments
95
Transportation TableTransportation TableTransportation TableTransportation Table
ToFrom
Albuquerque(A)
Boston(B)
Cleveland(C)
FactoryCapacity
Des Moines(D) 100
Evansville(E) 300
Fort Lauderdale(F) 300
WarehouseRequirements 300 200 200 700
5
8
9 7
4
4 3
3
5
96
3.Reduce the row supply or the column demanded by the 3.Reduce the row supply or the column demanded by the assigned to the cellassigned to the cell
4.If the row supply is now zero, eliminate the row, if the column 4.If the row supply is now zero, eliminate the row, if the column demand is now zero, eliminate the column, if both the row, demand is now zero, eliminate the column, if both the row, supply and the column demand are zero, eliminate both the supply and the column demand are zero, eliminate both the row and column.row and column.
VAMVAMVAMVAM
97
VAMVAMVAMVAM
5. Recompute the row and column difference for the 5. Recompute the row and column difference for the reduced transportation table, omitting rows or reduced transportation table, omitting rows or columns crossed out in the preceding step.columns crossed out in the preceding step.
6. Repeat the above procedure until the entire supply at 6. Repeat the above procedure until the entire supply at factories are exhausted to satisfy demand at factories are exhausted to satisfy demand at different warehouses.different warehouses.
98
Problem: 4 A distribution system has the following Problem: 4 A distribution system has the following constraints.constraints.
Factory capacity (in units)Factory capacity (in units) AA 4545 BB 1515 CC 4040 WarehouseWarehouse Demand (in units) Demand (in units) II 2525 IIII 5555 IIIIII 2020 The transportation costs per unit( in rupees) allocated with The transportation costs per unit( in rupees) allocated with
each route are as follows.each route are as follows.
EXERCISE PROBLEMSEXERCISE PROBLEMSEXERCISE PROBLEMSEXERCISE PROBLEMS
99
To/From
I II III
A 10 7 8
B 15 12 9
C 7 8 12
100
Find the optimum transportation schedule and the minimum Find the optimum transportation schedule and the minimum total cost of transportation.total cost of transportation.
Problem 3Problem 3 A company is spending Rs.1,000 on transportation of its units A company is spending Rs.1,000 on transportation of its units
from these plants to four distribution centres. The supply and from these plants to four distribution centres. The supply and demand of units, with unity cost of transporataion are given in demand of units, with unity cost of transporataion are given in the table. the table.
What can be the maximum saving by optimum scheduling.What can be the maximum saving by optimum scheduling.
101
To/from
D1 D2 D3 D4 Available
P1 19 30 50 12 7
P2 70 30 40 60 10
P3 40 10 60 20 18
Requiremet
ns
5 8 7 15
102
Special cases in TransportationSpecial cases in Transportation Unbalanced transportationUnbalanced transportation MaximisationMaximisation Restricted routes Restricted routes
103
A product is produced by 4 factories F1, F2,F3 and A product is produced by 4 factories F1, F2,F3 and F4. Their unit production cost are Rs.2,3,1,and 5 F4. Their unit production cost are Rs.2,3,1,and 5 only. Production capacity of the factories are only. Production capacity of the factories are 50,70,40 and 50 units respectively. The product is 50,70,40 and 50 units respectively. The product is supplied to 4 stores S1,S2,S3 and S4., the supplied to 4 stores S1,S2,S3 and S4., the requirements of which are 25,35,105 and 20 requirements of which are 25,35,105 and 20 respectively. Unit cost of transportation are given respectively. Unit cost of transportation are given belowbelow
104
S1 S2 S3 S4
F1 2 4 6 11
F2 10 8 7 5
F3 13 3 9 12
F4 4 6 8 3
105
Find the optimal Find the optimal transportation plan such transportation plan such that total production and that total production and transportation cost is transportation cost is minimum.minimum.
PROBLEMPROBLEM A particular product is A particular product is
manufactured in factories manufactured in factories A,B ,C and D: it is sold at A,B ,C and D: it is sold at centres 1,2,and 3. the cost centres 1,2,and 3. the cost in rupees of product per in rupees of product per unit and capacity of each unit and capacity of each plant is given belowplant is given below
Factory Cost Rs Per unit
Capacity
A 12 100
B 15 20
C 11 60
D 13 80
106
The sales prices is Rs The sales prices is Rs per unit and the demand per unit and the demand are as follows.are as follows.
Find the optimal Find the optimal solutionsolution
Sales centers
Sales price
per unit
Demand
1 15 120
2 14 90
3 16 50