Upload
elsa-albany
View
214
Download
0
Tags:
Embed Size (px)
Citation preview
Prepared by Mr. PrabhuAssistant Professor, Mechanical DepartmentVelTech Dr.RR & Dr.SR Technical University
1
Operation and Planning ControlU7MEA37
Unit ILinear programming
2
Introduction to Operations Research
• Operations research/management science
– Winston: “a scientific approach to decision making, which seeks to determine how best to design and operate a system, usually under conditions requiring the allocation of scarce resources.”
– Kimball & Morse: “a scientific method of providing executive departments with a quantitative basis for decisions regarding the operations under their control.”
Introduction to Operations Research
• Provides rational basis for decision making– Solves the type of complex problems that turn up in
the modern business environment– Builds mathematical and computer models of
organizational systems composed of people, machines, and procedures
– Uses analytical and numerical techniques to make predictions and decisions based on these models
Introduction to Operations Research
• Draws upon – engineering, management, mathematics
• Closely related to the "decision sciences" – applied mathematics, computer science,
economics, industrial engineering and systems engineering
Methodology of Operations Research*The Seven Steps to a Good OR Analysis
Identify the Problemor Opportunity
Understand the System
Formulate a Mathematical Model
Verify the Model
Select the Best Alternative
Implement and Evaluate
Present the Results ofthe Analysis
Methodology of Operations Research*The Seven Steps to a Good OR Analysis
Identify the Problemor Opportunity
Understand the System
Formulate a Mathematical Model
Verify the Model
Select the Best Alternative
Implement and Evaluate
Present the Results ofthe Analysis
•What are the objectives?
•Is the proposed problem too narrow?
•Is it too broad?
Methodology of Operations Research*The Seven Steps to a Good OR Analysis
Identify the Problemor Opportunity
Understand the System
Formulate a Mathematical Model
Verify the Model
Select the Best Alternative
Implement and Evaluate
Present the Results ofthe Analysis
•What data should be collected?
•How will data be collected?
•How do different components of the system interact with each other?
Methodology of Operations Research*The Seven Steps to a Good OR Analysis
Identify the Problemor Opportunity
Understand the System
Formulate a Mathematical Model
Verify the Model
Select the Best Alternative
Implement and Evaluate
Present the Results ofthe Analysis
•What kind of model should be used?
•Is the model accurate?
•Is the model too complex?
Methodology of Operations Research*The Seven Steps to a Good OR Analysis
Identify the Problemor Opportunity
Understand the System
Formulate a Mathematical Model
Verify the Model
Select the Best Alternative
Implement and Evaluate
Present the Results ofthe Analysis
•Do outputs match current observations for current inputs?
•Are outputs reasonable?
•Could the model be erroneous?
Methodology of Operations Research*The Seven Steps to a Good OR Analysis
Identify the Problemor Opportunity
Understand the System
Formulate a Mathematical Model
Verify the Model
Select the Best Alternative
Implement and Evaluate
Present the Results ofthe Analysis
•What if there are conflicting objectives?
•Inherently the most difficult step.
•This is where software tools will help us!
Methodology of Operations Research*The Seven Steps to a Good OR Analysis
Identify the Problemor Opportunity
Understand the System
Formulate a Mathematical Model
Verify the Model
Select the Best Alternative
Implement and Evaluate
Present the Results ofthe Analysis
•Must communicate results in layman’s terms.
•System must be user friendly!
Methodology of Operations Research*The Seven Steps to a Good OR Analysis
Identify the Problemor Opportunity
Understand the System
Formulate a Mathematical Model
Verify the Model
Select the Best Alternative
Implement and Evaluate
Present the Results ofthe Analysis
•Users must be trained on the new system.
•System must be observed over time to ensure it works properly.
Linear ProgrammingLinear Programming
14
Objectives– Requirements for a linear programming model.
– Graphical representation of linear models.
– Linear programming results:• Unique optimal solution• Alternate optimal solutions• Unbounded models• Infeasible models
– Extreme point principle.
15
Objectives - continued
– Sensitivity analysis concepts:• Reduced costs• Range of optimality--LIGHTLY• Shadow prices• Range of feasibility--LIGHTLY• Complementary slackness• Added constraints / variables
– Computer solution of linear programming models
• WINQSB• EXCEL• LINDO
16
• A Linear Programming model seeks to maximize or minimize a linear function, subject to a set of linear constraints.
• The linear model consists of the following components:– A set of decision variables.– An objective function.– A set of constraints.
– SHOW FORMAT17
3.1 Introduction to Linear Programming
• The Importance of Linear Programming
– Many real static problems lend themselves to linear programming formulations.
– Many real problems can be approximated by linear models.
– The output generated by linear programs provides useful “what’s best” and “what-if” information.
18
Assumptions of Linear Programming
• The decision variables are continuous or divisible, meaning that 3.333 eggs or 4.266 airplanes is an acceptable solution
• The parameters are known with certainty• The objective function and constraints exhibit
constant returns to scale (i.e., linearity)• There are no interactions between decision variables
19
Methodology of Linear Programming
Determine and define the decision variablesFormulate an objective function
verbal characterizationMathematical characterization
Formulate each constraint
20
MODEL FORMULATION
• Decisions variables::
– X1 = Production level of Space Rays (in dozens per week).
– X2 = Production level of Zappers (in dozens per week).
• Objective Function:
– Weekly profit, to be maximized
21
The Objective FunctionThe Objective Function
Each dozen Space Rays realizes $8 in profit.Each dozen Space Rays realizes $8 in profit.Total profit from Space Rays is 8X1.Total profit from Space Rays is 8X1.Each dozen Zappers realizes $5 in profit.Each dozen Zappers realizes $5 in profit.Total profit from Zappers is 5X2.Total profit from Zappers is 5X2.The total profit contributions of both isThe total profit contributions of both is 8X1 + 5X28X1 + 5X2(The profit contributions are additive because of (The profit contributions are additive because of
the linearity assumption)the linearity assumption)
22
The Linear Programming Model
Max 8X1 + 5X2 (Weekly profit)subject to2X1 + 1X2 < = 1200 (Plastic)3X1 + 4X2 < = 2400 (Production Time) X1 + X2 < = 800 (Total production) X1 - X2 < = 450 (Mix) Xj> = 0, j = 1,2 (Nonnegativity)
23
3.4 The Set of Feasible Solutions for Linear Programs
24
The set of all points that satisfy all the
constraints of the model is called a
FEASIBLE REGIONFEASIBLE REGION
Using a graphical presentation
we can represent all the constraints,
the objective function, and the three
types of feasible points.
25
26
1200
600
The Plastic constraint
Feasible
The plastic constraint: 2X1+X2<=1200
X2
Infeasible
Production Time3X1+4X2<=2400
Total production constraint: X1+X2<=800
600
800
Production mix constraint:X1-X2<=450
• There are three types of feasible pointsInterior points.
Boundary points.Extreme points.
X1
Linear Programming- Simplex method
• “...finding the maximum or minimum of linear functions in which many variables are subject to constraints.” (dictionary.com)
• A linear program is a “problem that requires the minimization of a linear form subject to linear constraints...” (Dantzig vii)
Important Note
• Linear programming requires linear inequalities
• In other words, first degree inequalities only!Good: ax + by + cz < 3
Bad: ax2 + log2y > 7
Lets look at an example...
• Farm that produces Apples (x) and Oranges (y)• Each crop needs land, fertilizer, and time.• 6 acres of land: 3x + y < 6• 6 tons of fertilizer: 2x + 3y < 6• 8 hour work day: x + 5y < 8• Apples sell for twice as much as oranges• We want to maximize profit (z): 2x + y = z• We can't produce negative: x > 0, y > 0
Traditional Method
• Graph the inequalities• Look at the line we're trying to maximize.
x = 1.71y = .86z = 4.29
Problems...
• More variables?• Cannot eyeball the answer?
Simplex Method
• George B. Dantzig in 1951• Need to convert equations• Slack variables
Performing the Conversion
• -z + 2x + y = 0 (Objective Equation)• s1 + x + 5y = 8
• s2 + 2x + 3y = 6
• s3 + 3x + y = 6
• Initial feasible solution
More definitions
• Non-basic: x, y• Basic variables: s1, s2, s3, z
• Current Solution: Set non-basic variables to 0• -z + 2x + y = 0 => z = 0• Valid, but not good!
Next step...
• Select a non-basic variable– -z + 2x + 1y = 0 – x has the higher coefficient
• Select a basic variable– s1 + 1x + 5y = 8 1/8
– s2 + 2x + 3y = 6 2/6
– s3 + 3x + y = 6 3/6
• 3/6 is the highest, use equation with s3
New set of equations
• Solve for x– x = 2 - (1/3)s3 -(1/3)y
• Substitute in to other equations to get...– -z – (2/3)s3 +(1/3)y = -4
– s1– (1/3)s3 + (14/3)y = 6
– s2 – (2/3)s3 +(7/3)y = 2
– x + (1/3)s3 +(1/3)y = 2
Redefine everything...
• Update variables• Non-Basic: s3 and y
• Basic: s1, s2, z, and x
• Current Solution: – -z – (2/3)s3 +(1/3)y = -4 => z = 4
– x + (1/3)s3 +(1/3)y = 2 => x = 2
– y = 0
• Better, but not quite there.
Do it again!
• Repeat this process• Stop repeating when the coefficients in the
objective equation are all negative.
Improvements
• Different kinds of inequalities• Minimized instead of maximized• L. G. Kachian algorithm proved polynomial
Artificial Variable Technique (The Big-M Method)
Big-M Method of solving LPP
The Big-M method of handling instances with artificial variables is the “commonsense approach”. Essentially, the notion is to make the artificial variables, through their coefficients in the objective function, so costly or unprofitable that any feasible solution to the real problem would be preferred....unless the original instance possessed no feasiblesolutions at all. But this means that we need to assign, in theobjective function, coefficients to the artificial variables that areeither very small (maximization problem) or very large(minimization problem); whatever this value,let us call it Big M.In fact, this notion is an old trick in optimization in general; wesimply associate a penalty value with variables that we do notwant to be part of an ultimate solution(unless such an outcomeIs unavoidable).
Indeed, the penalty is so costly that unless any of the respective variables' inclusion is warranted algorithmically,such variables will never be part of any feasible solution.This method removes artificial variables from the basis. Here, we assign a large undesirable (unacceptable penalty) coefficients to artificial variables from the objective function point of view. If the objective function (Z) is to be minimized, then a very large positive price (penalty, M) is assigned to each artificial variable and if Z is to be minimized, then a very large negative price is to be assigned. The penalty will be designated by +M for minimization problem and by –M for a maximization problem and also M>0.
Example: Minimize Z= 600X1+500X2
subject to constraints,2X1+ X2 >or= 80 X1+2X2 >or= 60 and X1,X2 >or= 0Step1: Convert the LP problem into a system of linear equations.We do this by rewriting the constraint inequalities as equations by subtracting new “surplus & artificial variables" and assigning them zero & +M coefficientsrespectively in the objective function as shown below.So the Objective Function would be: Z=600X1+500X2+0.S1+0.S2+MA1+MA2
subject to constraints, 2X1+ X2-S1+A1 = 80 X1+2X2-S2+A2 = 60 X1,X2,S1,S2,A1,A2 >or= 0
Step 2: Obtain a Basic Solution to the problem.We do this by putting the decision variables X1=X2=S1=S2=0,so that A1= 80 and A2=60. These are the initial values of artificial variables.
Step 3: Form the Initial Tableau as shown.
Cj 600 500 0 0 M M
CB
Basic Variable (B)
Basic Soln(XB)
X1 X2 S1 S2 A1 A2
M A1 80 2 1 -1 0 1 0 80M A2 60 1 2 0 -1 0 1 60
3M 3M M M M M
600-3M 500-3M M M 0 0
Min.Ratio (XB/Pivotal
Col.)
Zj
Cj - Zj
It is clear from the tableau that X2 will enter and A2 will leave the basis. Hence 2 is the key element in pivotal column. Now,the new row operations are as follows:R2(New) = R2(Old)/2R1(New) = R1(Old) - 1*R2(New)
Cj 600 500 0 0 M
CB
Basic Variable (B)
Basic Soln(XB)
X1 X2 S1 S2 A1
M A1 50 3 2 0 -1 1 2 1 100/3500 X2 30 1 2 1 0 - 1/2 0 60
3M/2+250 500 M M/2-250 M
350-3M/2 0 M 250-M/2 0
Min.Ratio (XB/Pivota
l Col.)
Zj
Cj - Zj
It is clear from the tableau that X1 will enter and A1 will leave the basis. Hence 2 is the key element in pivotal column. Now,the new row operations are as follows:R1(New) = R1(Old)*2/3R2(New) = R2(Old) – (1/2)*R1(New)
Cj 600 500 0 0
CB
Basic Variable (B)
Basic Soln(XB)
X1 X2 S1 S2
600 X1 100/3 1 0 2 3 1 3500 X2 40/3 0 1 1 3 2 3
600 500 700 3 400 30 0 700 3 400 3
Zj
Cj - Zj
Min.Ratio (XB/Pivotal Col.)
Since all the values of (Cj-Zj) are either zero or positive and also both the artificial variables have been removed, an optimum solution has been arrived at with X1=100/3 , X2=40/3 and Z=80,000/3.
48
Unit IIDynamic Programming
Characteristics and Examples
49
Overview
• What is dynamic programming?• Examples• Applications
50
What is Dynamic Programming?
• Design technique – ‘optimization’ problems (sequence of related decisions) – Programming does not mean ‘coding’ in this context, it
means ‘solve by making a chart’- or ‘using an array to save intermediate steps”. Some books call this ‘memoization’ (see below)
– Similar to Divide and Conquer BUT subproblem solutions are SAVED and NEVER recomputed
– Principal of optimality: the optimal solution to the problem contains optimal solutions to the subproblems (Is this true for EVERYTHING?)
51
Characteristics
• Optimal substructure– Unweighted shortest path?– Unweighted longest simple path?
• Overlapping Subproblems– What happens in recursion (D&C) when this happens?
• Memoization (not a typo!)– Saving solutions of subproblems (like we did in Fibonacci)
to avoid recomputation
52
Examples
• Matrix chain• Longest common subsequence (called the LCS
problem”
53
Review of Technique
• You have already applied dynamic programming and understand it why it may result in a good algorithm – Fibonacci– Ackermann– Combinations
54
Principal of Optimality
• Often called the “optimality condition” • What it means in plain English: you apply the divide
and conquer technique so the subproblems are SMALLER VERSIONS OF THE ORIGINAL PROBLEM: if you solve “optimize” the answer to the small problems , does that fact automatically mean that the solution to the big problem is also optimized????? If the answer is yes , then DP applies to his problem
55
Example 1
• Assume your problem is to draw a straight line between two points A and B. You solve this by divide and conquer by drawing a line from A to the midpoint and from the midpoint to B. QUESTION: if you paste the two smaller lines together will the RESULTING LINE FROM A TO B BE THE SHORTEST DISTANCE FROM A to B???
56
Example 2
• Say you want to buy Halloween candy – 100 candy bars. You do plan to do this by divide and conquer – buying 10 sets of 10 bars. Is this necessarily less expensive per bar than just buying 2 packages of 50? Or perhaps 1 package of 100?
57
How To Apply DP
• There are TWO ways to apply dynamic programming– METHOD 1: solve the problem at hand recursively,
notice where the same subproblem is being ‘re-solved’ and implement the algorithm as a TABLE (example: fibonacci)
– METHOD 2: generate all feasible solutions to a problem but prune (eliminate) the solutions that cannot be optimal (example: shortest path)
58
Practice Is the Only Way to Learn This Technique
• See class webpage for homework.• Do problems in textbook not assigned but for
practice – even after term ends. It took me two years after I took this course before I could apply DP in the real world.
59
Dynamic programmingDesign technique, like divide-and-conquer.
Example: Longest Common Subsequence (LCS)• Given two sequences x[1 . . m] and y[1 . . n], find
a longest subsequence common to them both.
x: A B C B D A B
y: B D C A B A
“a” not “the”
BCBA = LCS(x, y)
functional notation, but not a function
Review: Dynamic programming• DP is a method for solving certain kind of
problems• DP can be applied when the solution of a
problem includes solutions to subproblems• We need to find a recursive formula for the
solution• We can recursively solve subproblems,
starting from the trivial case, and save their solutions in memory
• In the end we’ll get the solution of the whole problem
04/18/23 60
Properties of a problem that can be solved with dynamic programming
• Simple Subproblems– We should be able to break the original
problem to smaller subproblems that have the same structure
• Optimal Substructure of the problems– The solution to the problem must be a
composition of subproblem solutions
• Subproblem Overlap– Optimal subproblems to unrelated problems can
contain subproblems in common
04/18/23 61
Review: Longest Common Subsequence (LCS)
• Problem: how to find the longest pattern of characters that is common to two text strings X and Y
• Dynamic programming algorithm: solve subproblems until we get the final solution
• Subproblem: first find the LCS of prefixes of X and Y.
• this problem has optimal substructure: LCS of two prefixes is always a part of LCS of bigger strings
04/18/23 62
Review: Longest Common Subsequence (LCS) continued
• Define Xi, Yj to be prefixes of X and Y of length i and j; m = |X|, n = |Y|
• We store the length of LCS(Xi, Yj) in c[i,j]
• Trivial cases: LCS(X0 , Yj ) and LCS(Xi, Y0) is empty (so c[0,j] = c[i,0] = 0 )
• Recursive formula for c[i,j]:
04/18/23 63
otherwise]),1[],1,[max(
],[][ if1]1,1[],[
jicjic
jyixjicjic
c[m,n] is the final solution
Review: Longest Common Subsequence (LCS)
• After we have filled the array c[ ], we can use this data to find the characters that constitute the Longest Common Subsequence
• Algorithm runs in O(m*n), which is much better than the brute-force algorithm: O(n 2m)
04/18/23 64
0-1 Knapsack problem
• Given a knapsack with maximum capacity W, and a set S consisting of n items
• Each item i has some weight wi and benefit
value bi (all wi , bi and W are integer values)
• Problem: How to pack the knapsack to achieve maximum total value of packed items?
04/18/23 65
0-1 Knapsack problem:a picture
04/18/23 66
W = 20
wi bi
109
85
54
43
32
Weight Benefit value
This is a knapsackMax weight: W = 20
Items
0-1 Knapsack problem• Problem, in other words, is to find
04/18/23 67
Ti
iTi
i Wwb subject to max
The problem is called a “0-1” problem, because each item must be entirely accepted or rejected.
Just another version of this problem is the “Fractional Knapsack Problem”, where we can take fractions of items.
0-1 Knapsack problem: brute-force approach
Let’s first solve this problem with a straightforward algorithm
• Since there are n items, there are 2n possible combinations of items.
• We go through all combinations and find the one with the most total value and with total weight less or equal to W
• Running time will be O(2n)
04/18/23 68
0-1 Knapsack problem: brute-force approach
• Can we do better?
• Yes, with an algorithm based on dynamic programming
• We need to carefully identify the subproblems
04/18/23 69
Let’s try this:If items are labeled 1..n, then a subproblem would be to find an optimal solution for Sk = {items labeled 1, 2, .. k}
Defining a Subproblem If items are labeled 1..n, then a subproblem
would be to find an optimal solution for Sk = {items labeled 1, 2, .. k}
• This is a valid subproblem definition.
• The question is: can we describe the final solution (Sn ) in terms of subproblems (Sk)?
• Unfortunately, we can’t do that. Explanation follows….
04/18/23 70
Defining a Subproblem
04/18/23 71
Max weight: W = 20For S4:Total weight: 14;total benefit: 20
w1 =2
b1 =3
w2 =4
b2 =5
w3 =5
b3 =8
w4 =3
b4 =4 wi bi
10
85
54
43
32
Weight Benefit
9
Item
#
4
3
2
1
5
S4
S5
w1 =2
b1 =3
w2 =4
b2 =5
w3 =5
b3 =8
w4 =9
b4 =10
For S5:Total weight: 20total benefit: 26
Solution for S4 is not part of the solution for S5!!!
?
Defining a Subproblem (continued)
• As we have seen, the solution for S4 is not part of the solution for S5
• So our definition of a subproblem is flawed and we need another one!
• Let’s add another parameter: w, which will represent the exact weight for each subset of items
• The subproblem then will be to compute B[k,w]
04/18/23 72
Recursive Formula for subproblems
• It means, that the best subset of Sk that has total weight w is one of the two:
1) the best subset of Sk-1 that has total weight w, or
2) the best subset of Sk-1 that has total weight w-wk plus the item k
04/18/23 73
else }],1[],,1[max{
if ],1[],[
kk
k
bwwkBwkB
wwwkBwkB
Recursive formula for subproblems:
Recursive Formula
• The best subset of Sk that has the total weight w, either contains item k or not.
• First case: wk>w. Item k can’t be part of the solution, since if it was, the total weight would be > w, which is unacceptable
• Second case: wk <=w. Then the item k can be in the solution, and we choose the case with greater value
04/18/23 74
else }],1[],,1[max{
if ],1[],[
kk
k
bwwkBwkB
wwwkBwkB
0-1 Knapsack Algorithmfor w = 0 to W
B[0,w] = 0
for i = 0 to n
B[i,0] = 0
for w = 0 to W
if wi <= w // item i can be part of the solution
if bi + B[i-1,w-wi] > B[i-1,w]
B[i,w] = bi + B[i-1,w- wi]
else
B[i,w] = B[i-1,w]
else B[i,w] = B[i-1,w] // wi > w 04/18/23 75
Running timefor w = 0 to W
B[0,w] = 0
for i = 0 to n
B[i,0] = 0
for w = 0 to W
< the rest of the code >
04/18/23 76
What is the running time of this algorithm?
O(W)
O(W)
Repeat n times
O(n*W)Remember that the brute-force algorithm
takes O(2n)
Example
04/18/23 77
Let’s run our algorithm on the following data:
n = 4 (# of elements)W = 5 (max weight)Elements (weight, benefit):(2,3), (3,4), (4,5), (5,6)
Example (2)
04/18/23 78
for w = 0 to WB[0,w] = 0
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
4
Example (3)
04/18/23 79
for i = 0 to nB[i,0] = 0
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0
4
Example (4)
04/18/23 80
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=1bi=3
wi=2
w=1w-wi =-1
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
Example (5)
04/18/23 81
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=1bi=3
wi=2
w=2w-wi =0
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
3
Example (6)
04/18/23 82
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=1bi=3
wi=2
w=3w-wi=1
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
3
3
Example (7)
04/18/23 83
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=1bi=3
wi=2
w=4w-wi=2
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
3
3
3
Example (8)
04/18/23 84
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=1bi=3
wi=2
w=5w-wi=2
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
3
3
3
3
Example (9)
04/18/23 85
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=2bi=4
wi=3
w=1w-wi=-2
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
3
3
3
3
0
Example (10)
04/18/23 86
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=2bi=4
wi=3
w=2w-wi=-1
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
3
3
3
3
0
3
Example (11)
04/18/23 87
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=2bi=4
wi=3
w=3w-wi=0
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
3
3
3
3
0
3
4
Example (12)
04/18/23 88
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=2bi=4
wi=3
w=4w-wi=1
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
3
3
3
3
0
3
4
4
Example (13)
04/18/23 89
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=2bi=4
wi=3
w=5w-wi=2
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
3
3
3
3
0
3
4
4
7
Example (14)
04/18/23 90
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=3bi=5
wi=4
w=1..3
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0
3
3
3
3
00
3
4
4
7
0
3
4
Example (15)
04/18/23 91
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=3bi=5
wi=4
w=4w- wi=0
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0 00
3
4
4
7
0
3
4
5
3
3
3
3
Example (15)
04/18/23 92
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=3bi=5
wi=4
w=5w- wi=1
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0 00
3
4
4
7
0
3
4
5
7
3
3
3
3
Example (16)
04/18/23 93
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=3bi=5
wi=4
w=1..4
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0 00
3
4
4
7
0
3
4
5
7
0
3
4
5
3
3
3
3
Example (17)
04/18/23 94
if wi <= w // item i can be part of the solution if bi + B[i-1,w-wi] > B[i-1,w] B[i,w] = bi + B[i-1,w- wi] else B[i,w] = B[i-1,w] else B[i,w] = B[i-1,w] // wi > w
0
0
0
0
0
0
W0
1
2
3
4
5
i 0 1 2 3
0 0 0 0i=3bi=5
wi=4
w=5
Items:1: (2,3)2: (3,4)3: (4,5) 4: (5,6)
4
0 00
3
4
4
7
0
3
4
5
7
0
3
4
5
7
3
3
3
3
Comments
• This algorithm only finds the max possible value that can be carried in the knapsack
• To know the items that make this maximum value, an addition to this algorithm is necessary
• Please see LCS algorithm from the previous lecture for the example how to extract this data from the table we built
04/18/23 95
Conclusion• Dynamic programming is a useful technique
of solving certain kind of problems
• When the solution can be recursively described in terms of partial solutions, we can store these partial solutions and re-use them as necessary
• Running time (Dynamic Programming algorithm vs. naïve algorithm):– LCS: O(m*n) vs. O(n * 2m)
– 0-1 Knapsack problem: O(W*n) vs. O(2n)04/18/23 96
Unit IIIUnit IIINetwork ModelsNetwork Models
Chapter Outline
12.1 Introduction
12.2 Minimal-Spanning Tree Technique
12.3 Maximal-Flow Technique
12.4 Shortest-Route technique
Learning Objectives
Students will be able to– Connect all points of a network while minimizing
total distance using the minimal-spanning tree technique.
– Determine the maximum flow through a network using the maximal-flow technique.
– Find the shortest path through a network using the shortest-route technique.
– Understand the important role of software in solving network problems.
Minimal-Spanning Tree Technique
• Determines the path through the network that connects all the points while minimizing total distance.
Minimal-Spanning TreeSteps
1. Select any node in the network.2. Connect this node to the nearest node that minimizes the
total distance.3. Considering all of the nodes that are now connected, find
and connect the nearest node that is not connected.4. Repeat the third step until all nodes are connected.5. If there is a tie in the third step and two or more nodes that
are not connected are equally near, arbitrarily select one and continue. A tie suggests that there might be more than one optimal solution.
Minimal-Spanning TreeLauderdale Construction
1
2
3
4
5
7
8
6
33
3 54
2
13
25
2
6
7
Minimal-Spanning TreeIterations 1&2
1
2
3
4
5
7
8
6
33
3 54
2
13
25
2
6
7
3
1
2
3
4
5
7
8
6
33 5
4
2
13
25
2
6
7
First Iteration
Second IterationSecond Iteration
Minimal-Spanning TreeIterations 3&4
1
2
3
4
5
7
8
6
33
3 54
2
13
25
2
6
7
3
1
2
3
4
5
7
8
6
33 5
4
2
13
25
2
6
7
Third IterationThird Iteration
Fourth IterationFourth Iteration
Minimal-Spanning TreeIterations 4&5
1
2
3
4
5
7
8
6
33
3 54
2
13
25
2
6
7
3
1
2
3
4
5
7
8
6
33 5
4
2
13
25
2
6
7
Fourth IterationFourth Iteration
Fifth IterationFifth Iteration
Minimal-Spanning TreeIterations 6&7
1
2
3
4
5
7
8
6
33
3 54
2
13
25
2
6
7
3
1
2
3
4
5
7
8
6
33 5
4
2
13
25
2
6
7
Sixth iterationSixth iteration
Seventh & final Seventh & final iterationiteration
Minimum Distance: 16Minimum Distance: 16
The Maximal-Flow Technique
1. Pick any path (streets from west to east) with some flow.
2. Increase the flow (number of cars) as much as possible.
3. Adjust the flow capacity numbers on the path (streets).
4. Repeat the above steps until an increase in flow is no longer possible.
Maximal-FlowRoad Network for Waukesha
1
2
4
3
5
6
12
1
1 1
1
2
0
6
1
2
30
10
23
0
1
EastPoint
WestPoint
Maximal-FlowRoad Network for Waukesha
1
2
4
3
5
6
12
1
1 1
1
2
0
6
1
2
30
10
23
0
1
EastPoint
WestPoint
Add 2Add 2
Subtract 2Subtract 2
Road Network for WaukeshaFirst Iteration
12-110
1
2
4
3
5
6
30
1
1 1
1
4
0
6
1
2
30
10
21
0
1
EastPoint
WestPoint
Add 1Add 1
Subtract 1Subtract 1
Road Network for WaukeshaSecond Iteration
1
2
4
3
5
6
40
0
2 0
2
4
0
6
1
2
30
10
20
0
1
EastPoint
WestPoint
Add 2Add 2
Subtract 2Subtract 2
Road Network for WaukeshaThird Iteration
1
2
4
3
5
6
40
0
2 0
2
4
2
4
3
0
32
8
20
0
1
EastPoint
WestPoint
Path Flow (CarsPer Hour)
1-2-6 2001-2-4-6 1001-3-5-6 200Total 500
The Shortest-Route Technique• 1. Find the nearest node to the origin (plant). Put the
distance in a box by the node.– In some cases, several paths will have to be checked to
find the nearest node.• 2. Repeat this process until you have gone through the
entire network. The last distance at the ending node will be the distance of the shortest route. You should note that the distances placed in the boxes by each node are the shortest route to this node. These distances are used as intermediate results in finding the next nearest node.
Shortest-Route ProblemRay Design, Inc.
200
1 6
53
42
Roads from Ray’s Plant to the Roads from Ray’s Plant to the WarehouseWarehouse
Plant Warehouse
100
100
100
150
100
40
50
200
Ray Design, Inc.First Iteration
200
1 6
53
42
Plant Warehouse
100
100
100
150
100
40
50
200
100
Ray Design, Inc.Second Iteration
200
1 6
53
42
Plant Warehouse
100
100
100
150
100
40
50
200
100
150
Ray Design, Inc.Third Iteration
200
1 6
53
42
Plant Warehouse
100
100
100
150
100
40
50
200
100
150 190
Ray Design, Inc.Fourth Iteration
200
1 6
53
42
Plant Warehouse
100
100
100
150
100
40
50
200
100
150 190
290
Project Management - CPM/PERT
120
Project Scheduling and Control Techniques
Gantt Chart
Critical Path Method (CPM)
Program Evaluation and Review Technique (PERT)
121
History of CPM/PERT
• Critical Path Method (CPM)– E I Du Pont de Nemours & Co. (1957) for construction of new
chemical plant and maintenance shut-down– Deterministic task times– Activity-on-node network construction– Repetitive nature of jobs
• Project Evaluation and Review Technique (PERT)– U S Navy (1958) for the POLARIS missile program– Multiple task time estimates (probabilistic nature)– Activity-on-arrow network construction– Non-repetitive jobs (R & D work)
122
Project Network• Network analysis is the general name given to certain specific techniques which can be used for the planning, management and control of projects• Use of nodes and arrows Arrows An arrow leads from tail to head directionally
– Indicate ACTIVITY, a time consuming effort that is required to perform a part of the work.
Nodes A node is represented by a circle- Indicate EVENT, a point in time where one or more activities start and/or
finish.• Activity
– A task or a certain amount of work required in the project
– Requires time to complete
– Represented by an arrow
• Dummy Activity
– Indicates only precedence relationships
– Does not require any time of effort
123
CPM calculation
• Path– A connected sequence of activities leading from
the starting event to the ending event
• Critical Path– The longest path (time); determines the project
duration
• Critical Activities– All of the activities that make up the critical path
124
Forward Pass• Earliest Start Time (ES)
– earliest time an activity can start – ES = maximum EF of immediate predecessors
• Earliest finish time (EF)– earliest time an activity can finish– earliest start time plus activity time
EF= ES + t
Latest Start Time (LS)
Latest time an activity can start without delaying critical path time
LS= LF - t
Latest finish time (LF)
latest time an activity can be completed without delaying critical path time
LS = minimum LS of immediate predecessors
Backward Pass
125
CPM analysis
• Draw the CPM network• Analyze the paths through the network• Determine the float for each activity
– Compute the activity’s float float = LS - ES = LF - EF
– Float is the maximum amount of time that this activity can be delay in its completion before it becomes a critical activity, i.e., delays completion of the project
• Find the critical path is that the sequence of activities and events where there is no “slack” i.e.. Zero slack– Longest path through a network
• Find the project duration is minimum project completion time
Consider below table summarizing the details of a project involving 10 activities
Activity Immediate precedence durationa - 6b - 8c - 5d b 13e c 9f a 15g a 17h f 9i g 6j d,e 12
Construct the CPM network. Determine the critical path and project completion time .Also compute total float and free floats for the non-critical activities
126
127
CPM Example: • CPM Network
a, 6a, 6a, 6a, 6
f, 15f, 15f, 15f, 15
b, 8b, 8b, 8b, 8
c, 5c, 5c, 5c, 5e, 9e, 9e, 9e, 9
d, 13d, 13d, 13d, 13
g, 17g, 17g, 17g, 17 h, 9h, 9h, 9h, 9
i, 6i, 6i, 6i, 6
j, 12j, 12j, 12j, 12
128
CPM Example• ES and EF Times
a, 6a, 6a, 6a, 6
f, 15f, 15f, 15f, 15
b, 8b, 8b, 8b, 8
c, 5c, 5c, 5c, 5
e, 9e, 9e, 9e, 9
d, 13d, 13d, 13d, 13
g, 17g, 17g, 17g, 17 h, 9h, 9h, 9h, 9
i, 6i, 6i, 6i, 6
j, 12j, 12j, 12j, 12
0 6
0 8
0 5
129
CPM Example
• ES and EF Times
a, 6a, 6a, 6a, 6
f, 15f, 15f, 15f, 15
b, 8b, 8b, 8b, 8
c, 5c, 5c, 5c, 5
e, 9e, 9e, 9e, 9
d, 13d, 13d, 13d, 13
g, 17g, 17g, 17g, 17 h, 9h, 9h, 9h, 9
i, 6i, 6i, 6i, 6
j, 12j, 12j, 12j, 12
0 6
0 8
0 5
5 14
8 21
6 23
6 21
130
CPM Example
• ES and EF Times
a, 6a, 6a, 6a, 6
f, 15f, 15f, 15f, 15
b, 8b, 8b, 8b, 8
c, 5c, 5c, 5c, 5
e, 9e, 9e, 9e, 9
d, 13d, 13d, 13d, 13
g, 17g, 17g, 17g, 17 h, 9h, 9h, 9h, 9
i, 6i, 6i, 6i, 6
j, 12j, 12j, 12j, 12
0 6
0 8
0 5
5 14
8 21 21 33
6 23 21 30
23 29
6 21
Project’s EF = 33Project’s EF = 33
131
CPM Example
• LS and LF Times
a, 6a, 6a, 6a, 6
f, 15f, 15f, 15f, 15
b, 8b, 8b, 8b, 8
c, 5c, 5c, 5c, 5
e, 9e, 9e, 9e, 9
d, 13d, 13d, 13d, 13
g, 17g, 17g, 17g, 17
h, 9h, 9h, 9h, 9
i, 6i, 6i, 6i, 6
j, 12j, 12j, 12j, 12
0 6
0 8
0 5
5 14
8 21 21 33
6 23
21 30
23 29
6 21
21 33
27 33
24 33
132
CPM ExampleCPM Example
• LS and LF Times
a, 6a, 6a, 6a, 6
f, 15f, 15f, 15f, 15
b, 8b, 8b, 8b, 8
c, 5c, 5c, 5c, 5
e, 9e, 9e, 9e, 9
d, 13d, 13d, 13d, 13
g, 17g, 17g, 17g, 17
h, 9h, 9h, 9h, 9
i, 6i, 6i, 6i, 6
j, 12j, 12j, 12j, 12
0 6
0 8
0 5
5 14
8 21 21 33
6 23
21 30
23 29
6 21
4 10
0 8
7 12
12 21
21 33
27 33
8 21
10 27
24 33
18 24
133
CPM ExampleCPM Example• Float
a, 6a, 6a, 6a, 6
f, 15f, 15f, 15f, 15
b, 8b, 8b, 8b, 8
c, 5c, 5c, 5c, 5e, 9e, 9e, 9e, 9
d, 13d, 13d, 13d, 13
g, 17g, 17g, 17g, 17
h, 9h, 9h, 9h, 9
i, 6i, 6i, 6i, 6
j, 12j, 12j, 12j, 12
0 6
0 8
0 5 5 14
8 21 21 33
6 23
21 30
23 29
6 21
3 9
0 8
7 12 12 21
21 33
27 33
8 21
10 27
24 33
9 24
3 4
3
3
4
0
0
7 7
0
134
CPM Example• Critical Path
a, 6a, 6a, 6a, 6
f, 15f, 15f, 15f, 15
b, 8b, 8b, 8b, 8
c, 5c, 5c, 5c, 5
e, 9e, 9e, 9e, 9
d, 13d, 13d, 13d, 13
g, 17g, 17g, 17g, 17 h, 9h, 9h, 9h, 9
i, 6i, 6i, 6i, 6
j, 12j, 12j, 12j, 12
darla/smbs/vit 135
PERT • PERT is based on the assumption that an activity’s duration
follows a probability distribution instead of being a single value• Three time estimates are required to compute the parameters
of an activity’s duration distribution:– pessimistic time (tp ) - the time the activity would take if
things did not go well– most likely time (tm ) - the consensus best estimate of the
activity’s duration– optimistic time (to ) - the time the activity would take if
things did go well
Mean (expected time): te =tp + 4 tm + to
6
Variance: Vt =2 =tp - to
6
2
136
PERT analysis• Draw the network.• Analyze the paths through the network and find the critical path.• The length of the critical path is the mean of the project duration
probability distribution which is assumed to be normal• The standard deviation of the project duration probability
distribution is computed by adding the variances of the critical activities (all of the activities that make up the critical path) and taking the square root of that sum
• Probability computations can now be made using the normal distribution table.
137
Probability computation
Determine probability that project is completed within specified time
Z = x -
where = tp = project mean time
= project standard mean time
x = (proposed ) specified time
138
Normal Distribution of Project Time
= tp Timex
Z
Probability
139
PERT Example Immed. Optimistic Most Likely Pessimistic
Activity Predec. Time (Hr.) Time (Hr.) Time (Hr.) A -- 4 6 8B -- 1 4.5 5C A 3 3 3
D A 4 5 6 E A 0.5 1 1.5 F B,C 3 4 5 G B,C 1 1.5 5 H E,F 5 6 7 I E,F 2 5 8 J D,H 2.5 2.75 4.5 K G,I 3 5 7
140
PERT Example
AA
DD
CC
BBFF
EE
GG
II
HH
KK
JJ
PERT Network
141
PERT Example Activity Expected Time Variance A 6 4/9
B 4 4/9 C 3 0 D 5 1/9 E 1 1/36 F 4 1/9 G 2 4/9 H 6 1/9 I 5 1 J 3 1/9 K 5 4/9
142
PERT Example
Activity ES EF LS LF Slack A 0 6 0 6 0 *critical
B 0 4 5 9 5 C 6 9 6 9 0 * D 6 11 15 20 9 E 6 7 12 13 6 F 9 13 9 13 0 * G 9 11 16 18 7 H 13 19 14 20 1 I 13 18 13 18 0 * J 19 22 20 23 1 K 18 23 18 23 0 *
143
PERT Example
Vpath = VA + VC + VF + VI + VK
= 4/9 + 0 + 1/9 + 1 + 4/9 = 2path = 1.414
z = (24 - 23)/(24-23)/1.414 = .71 From the Standard Normal Distribution
table: P(z < .71) = .5 + .2612 = .7612
PROJECT COST
145
Cost consideration in project
• Project managers may have the option or requirement to crash the project, or accelerate the completion of the project.
• This is accomplished by reducing the length of the critical path(s).• The length of the critical path is reduced by reducing the duration
of the activities on the critical path.• If each activity requires the expenditure of an amount of money to
reduce its duration by one unit of time, then the project manager selects the least cost critical activity, reduces it by one time unit, and traces that change through the remainder of the network.
• As a result of a reduction in an activity’s time, a new critical path may be created.
• When there is more than one critical path, each of the critical paths must be reduced.
• If the length of the project needs to be reduced further, the process is repeated.
146
Project Crashing• Crashing
– reducing project time by expending additional resources• Crash time
– an amount of time an activity is reduced• Crash cost
– cost of reducing activity time• Goal
– reduce project duration at minimum cost
147
Time-Cost Relationship Crashing costs increase as project duration decreases Indirect costs increase as project duration increases Reduce project length as long as crashing costs are less than
indirect costsTime-Cost Tradeoff
cost
time
Direct cost
Indirect cost
Total project costMin total cost = optimal project time
148
Benefits of CPM/PERT• Useful at many stages of project management• Mathematically simple• Give critical path and slack time• Provide project documentation• Useful in monitoring costs
•How long will the entire project take to be completed? What are the risks involved? •Which are the critical activities or tasks in the project which could delay the entire project if they were not completed on time? •Is the project on schedule, behind schedule or ahead of schedule? •If the project has to be finished earlier than planned, what is the best way to do this at the least cost?
CPM/PERT can answer the following important questions:
149
Limitations to CPM/PERT• Clearly defined, independent and stable activities• Specified precedence relationships• Over emphasis on critical paths• Deterministic CPM model• Activity time estimates are subjective and depend on judgment• PERT assumes a beta distribution for these time estimates, but
the actual distribution may be different• PERT consistently underestimates the expected project
completion time due to alternate paths becoming critical
To overcome the limitation, Monte Carlo simulations can be performed on the network to eliminate the optimistic bias
150
CPM PERT
CPM uses activity oriented network. PERT uses event oriented Network.
Durations of activity may be estimated with a fair degree of accuracy.
Estimate of time for activities are not so accurate and definite.
It is used extensively in construction projects.
It is used mostly in research and development projects, particularly projects of non-repetitive nature.
Deterministic concept is used. Probabilistic model concept is used.
CPM can control both time and cost when planning.
PERT is basically a tool for planning.
In CPM, cost optimization is given prime importance. The time for the completion of the project depends upon cost optimization. The cost is not directly proportioned to time. Thus, cost is the controlling factor.
In PERT, it is assumed that cost varies directly with time. Attention is therefore given to minimize the time so that minimum cost results. Thus in PERT, time is the controlling factor.
PERT vs CPM
Unit IVUnit IVInventory ManagementInventory Management
The objective of inventory The objective of inventory management is to strike a balance management is to strike a balance between inventory investment and between inventory investment and
customer servicecustomer service
Inventory control
It means stocking adequate number and kind of stores, so that the materials are available whenever required and wherever required. Scientific inventory control results in optimal balance
What is inventory?
Inventory is the raw materials, component parts, work-in-process, or finished products
that are held at a location in the supply chain.
Input MaterialManagement department
Inventory(money)
Goods in storesWork-in-progressFinished products
Equipment etc.
OutputProductiondepartment
Basic inventory model
Zero Inventory?
• Reducing amounts of raw materials and purchased parts and subassemblies by having suppliers deliver them directly.
• Reducing the amount of works-in process by using just-in-time production.
• Reducing the amount of finished goods by shipping to markets as soon as possible.
Importance of InventoryImportance of Inventory
One of the most expensive assets of many companies representing as much as 50% of total invested capital
Operations managers must balance inventory investment and customer service
FUNCTIONS OF INVENTORY
• To meet anticipated demand.
• To smoothen production requirements.
• To decouple operations.
SUPPLY PROCESS
PRODUCTS
DEMAND
INVENTORY
PRODUCTS
DEMAND
DEMANDPROCESS
Functions Of Inventory (Cont’d)
• To protect against stock-outs.
• To take advantage of order cycles.
• To help hedge against price increases.
• To permit operations.
• To take advantage of quantity discounts.
Types of InventoryTypes of Inventory Raw material
Purchased but not processed
Work-in-process Undergone some change but not completed
A function of cycle time for a product
Maintenance/repair/operating (MRO) Necessary to keep machinery and processes productive
Finished goods Completed product awaiting shipment
The Material Flow CycleThe Material Flow Cycle
Input Wait for Wait to Move Wait in queue Setup Run Outputinspection be moved time for operator time time
Cycle time
95% 5%
Service level
Safety Stock
Probabilityof stock-out
Safety stock =(safety factor z)(std deviation in LT demand)
Read z from Normal table for a given service level
Average Inventory = (Order Qty)/2 + Safety Stock
Receive order
Time
Placeorder
Lead Time
InventoryLevel
Order Quantity
Safety Stock (SS)
EOQ/2AverageInventory
Managing Inventory Managing Inventory
1. How inventory items can be classified
2. How accurate inventory records can be maintained
Inventory Models for Inventory Models for Independent DemandIndependent Demand
1. Basic economic order quantity
2. Production order quantity
3. Quantity discount model
Need to determine when and how Need to determine when and how much to ordermuch to order
Economic order of quantityEOQ = Average Monthly Consumption X Lead Time [in
months] + Buffer Stock – Stock on hand
CARRYING COST
PURCHASING COST
ECONOMIC ORDER OF QUANTITY(EOQ)
•Re-order level: stock level at which fresh order is placed.•Average consumption per day x lead time + buffer stock•Lead time: Duration time between placing an order & receipt of material•Ideal – 2 to 6 weeks.
Basic EOQ ModelBasic EOQ Model
1. Demand is known, constant, and independent
2. Lead time is known and constant
3. Receipt of inventory is instantaneous and complete
4. Quantity discounts are not possible
5. Only variable costs are setup and holding
6. Stockouts can be completely avoided
Important assumptions
An EOQ ExampleAn EOQ Example
Determine optimal number of needles to orderD = 1,000 unitsS = $10 per orderH = $.50 per unit per year
Q* =2DS
H
Q* =2(1,000)(10)
0.50= 40,000 = 200 units
An EOQ Example
Determine optimal number of needles to orderD = 1,000 units Q* = 200 unitsS = $10 per orderH = $.50 per unit per year
= N = =Expected
number of orders
DemandOrder quantity
DQ*
N = = 5 orders per year 1,000200
An EOQ Example
Determine optimal number of needles to orderD = 1,000 units Q* = 200 unitsS = $10 per order N = 5 orders per yearH = $.50 per unit per year
= T =Expected time between orders
Number of working days per year
N
T = = 50 days between orders250
5
Classification Criteria
A-B-C Annual value of consumption of the items
V-E-D Critical nature of the components with respect to products.
H-M-L Unit price of material
F-S-N Issue from stores
S-D-E Purchasing problems in regard to availability
S-O-S Seasonality
G-O-L-F Channel for procuring the material
X-Y-Z Inventory value of items stored
Classification of Materials for
Inventory Control
Holding costsHolding costs - the costs of holding or “carrying” inventory over time
Ordering costsOrdering costs - the costs of placing an order and receiving goods
Setup costsSetup costs - cost to prepare a machine or process for manufacturing an order
Relevant Inventory Costs
• Stationary
• Clerical and processing, salaries/rentals
• Postage
• Processing of bills
• Staff work in expedition /receiving/ inspection and documentation
Ordering Costs
Holding/Carrying Costs
• Storage space (rent/depreciation)• Property tax on warehousing• Insurance• Deterioration/Obsolescence• Material handling and maintenance, equipment• Stock taking, security and documentation• Capital blocked (interest/opportunity cost)• Quality control
• Loss of business/ profit/ market/ advise
• Additional expenditure due to urgency of purchases
a) telegraph / telephone charges
b) purchase at premium
c) air transport charges
• Loss of labor hours
Stock out Costs
Balancing Carrying against Ordering Costs
16
Annual Cost ($)Annual Cost ($)
Order QuantityOrder Quantity
MinimumMinimumTotal AnnualTotal Annual
Stocking CostsStocking Costs
AnnualAnnualCarrying CostsCarrying Costs
AnnualAnnualOrdering CostsOrdering Costs
Total AnnualTotal AnnualStocking CostsStocking Costs
SmallerSmaller LargerLarger
Lo
wer
Lo
wer
Hig
her
Hig
her
EOQEOQ
Unit V Queuing Theory
Outlines
Introduction
• Involves the mathematical study of queues or waiting line.• The formulation of queues occur whenever the demand for a
service exceeds the capacity to provide that service.• Decisions regarding the amount of capacity to provide must
be made frequently in industry and elsewhere.• Queuing theory provides a means for decision makers to
study and analyze characteristics of the service facility for making better decisions.
Basic structure of queuing model• Customers requiring service are generated over time by an
input source.• These customers enter the queuing system and join a queue.• At certain times, a member of the queue is selected for
service by some rule know as the service disciple.• The required service is then performed for the customer by
the service mechanism, after which the customer leaves the queuing system
The basic queuing process
Input source Queue
Service mechanis
mCustomers
Served Customers
Queuing system
Characteristics of queuing models• Input or arrival (interarrival) distribution• Output or departure (service) distribution• Service channels• Service discipline• Maximum number of customers allowed in the system• Calling source
Kendall and Lee’s Notation
Kendall and Lee introduced a useful notation representing the 6 basic characteristics of a queuing model.
Notation: a/b/c/d/e/fwherea = arrival (or interarrival) distributionb = departure (or service time) distributionc = number of parallel service channels in the systemd = service disciplee = maximum number allowed in the system (service + waiting)f = calling source
Conventional Symbols for a, b
M = Poisson arrival or departure distribution (or equivalently exponential distribution or service times distribution)
D = Deterministic interarrival or service timesEk = Erlangian or gamma interarrival or service time distribution
with parameter kGI = General independent distribution of arrivals (or interarrival
times)G = General distribution of departures (or service times)
Conventional Symbols for d
• FCFS = First come, first served• LCFS = Last come, first served• SIRO = Service in random order• GD = General service disciple
Transient and Steady StatesTransient state• The system is in this state when its operating characteristics
vary with time.• Occurs at the early stages of the system’s operation where its
behavior is dependent on the initial conditions.
Steady state• The system is in this state when the behavior of the system
becomes independent of time.• Most attention in queuing theory analysis has been directed
to the steady state results.
Queuing Model Symbols
n = Number of customers in the systems = Number of serverspn(t) = Transient state probabilities of exactly n customers in the
system at time tpn = Steady state probabilities of exactly n customers in the
systemλ = Mean arrival rate (number of customers arriving per unit
time)μ = Mean service rate per busy server (number of customers
served per unit time)
Queuing Model Symbols (Cont’d)
ρ = λ/μ = Traffic intensityW = Expected waiting time per customer in the systemWq = Expected waiting time per customer in the queueL = Expected number of customers in the systemLq = Expected number of customers in the queue
Relationship Between L and W
If λn is a constant λ for all n, it can be shown that
L = λWLq = λ Wq
If λn are not constant then λ can be replaced in the above equations by λbar,the average arrival rate over the long run.
If μn is a constant μ for all n, thenW = Wq + 1/μ
Relationship Between L and W (cont’d)
These relationships are important because:• They enable all four of the fundamental quantities L, W, Lq
and Wq to be determined as long as one of them is found analytically.
• The expected queue lengths are much easier to find than that of expected waiting times when solving a queuing model from basic principles.
Single server queuing models• M/M/1/FCFS/∞/∞ Model
when the mean arrival rate λn and mean service μn are all constant we have
,...2,1for,1
Thus
11
1
1
1
where
,...2,1for,
Therefore
,...2,1for,
11
0
1
0
0
np
p
npp
nc
nn
n
n
n
n
nn
nn
n
Single server queuing models (cont’d)
Consequently
11
1
1)1()1(
)1()1(
0
00
d
d
d
d
d
dnL
n
n
n
n
n
n
Single server queuing models (cont’d)
nnq
LW
LW
pLpnL
1
istimewaitingexpectedThe
)(1)1(
Similarly2
01
Multi server queuing models
• M/M/s/FCFS/∞/∞ ModelWhen the mean arrival rate λn and mean service μn, are all constant, we have the following rate diagram
Multi server queuing models (cont’d)
,1,!
1!!
1where,,2,1
!
Therefore
,1,!
,,2,1!
havewecasethisIn
0
00
ssnpss
ssn
psnpn
p
ssnss
snnc
sn
n
sn
n
n
sn
n
n
n
Multi server queuing models (cont’d)
1
)()!1(
thatfollowsIt
02
1
q
q
s
q
WW
LW
LL
pss
L
Thank You
198