shado w price sensiti v it y anal y sis
play

Shado w price sensiti v it y anal y sis SU P P LY C H AIN AN ALYTIC - PowerPoint PPT Presentation

Shado w price sensiti v it y anal y sis SU P P LY C H AIN AN ALYTIC S IN P YTH ON Aaren St u bber eld S u ppl y Chain Anal y tics Mgr . Define shado w price Modeling in iss u es : Inp u t for model constraints are o en estimates Will


  1. Shado w price sensiti v it y anal y sis SU P P LY C H AIN AN ALYTIC S IN P YTH ON Aaren St u bber � eld S u ppl y Chain Anal y tics Mgr .

  2. Define shado w price Modeling in iss u es : Inp u t for model constraints are o � en estimates Will changes to inp u t change o u r sol u tion ? Shado w Prices : The change in optimal v al u e of the objecti v e f u nction per u nit increase in the right - hand - side for a constraint , gi v en e v er y thing else remain u nchanged . SUPPLY CHAIN ANALYTICS IN PYTHON

  3. Conte x t - Glass Compan y - Reso u rce Planning : Reso u rce Prod . A Prod . B Prod . C Prod u ction ho u rs 6 5 8 WH Capacit y sq . �. 10.5 20 10 Pro � t $ US $500 $450 $600 Constraints : Prod u ction Capacit y Ho u rs ≤ 60 Wareho u se Capacit y ≤ 150 sq . �. Ma x Prod u ction of A ≤ 8 SUPPLY CHAIN ANALYTICS IN PYTHON

  4. Code e x ample # Initialize Class, Define Vars., and Objective # Constraint 3 model = LpProblem("Max Glass Co. Profits", model += A <= 8 LpMaximize) A = LpVariable('A', lowBound=0) # Solve Model B = LpVariable('B', lowBound=0) model.solve() C = LpVariable('C', lowBound=0) print("Model Status: model += 500 * A + 450 * B + 600 * C {}".format(pulp.LpStatus[model.status])) print("Objective = ", value(model.objective)) # Constraint 1 for v in model.variables(): model += 6 * A + 5 * B + 8 * C <= 60 print(v.name, "=", v.varValue) # Constraint 2 model += 10.5 * A + 20 * B + 10 * C <= 150 SUPPLY CHAIN ANALYTICS IN PYTHON

  5. E x ample sol u tion Sol u tion : Prod u cts Prod . A Prod . B Prod . C Prod u ction Cases 6.667 4 0 Objecti v e v al u e is $5133.33 SUPPLY CHAIN ANALYTICS IN PYTHON

  6. Re v ie w constraints Decision Variable : A thro u gh C = N u mber of cases of respecti v e A thro u gh C prod u cts Constraints : 6 A + 5 B + 8 C ≤ 60 ( limited prod u ction capacit y ) 10 A + 20 B + 10 C ≤ 150 ( limited w areho u se capacit y ) A ≤ 8 ( ma x prod u ction of A ) SUPPLY CHAIN ANALYTICS IN PYTHON

  7. Print shado w price P y thon Code : o = [{'name':name, 'shadow price':c.pi} for name, c in model.constraints.items()] print(pd.DataFrame(o)) SUPPLY CHAIN ANALYTICS IN PYTHON

  8. Shado w prices e x plained O u tp u t : Remember the Constraints : name shadow price 1. limited prod u ction capacit y _C1 78.148148 2. limited w areho u se capacit y _C2 2.962963 3. ma x prod u ction of A _C3 -0.000000 SUPPLY CHAIN ANALYTICS IN PYTHON

  9. Constraint slack slack : The amo u nt of a reso u rce that is u n u sed . P y thon : o = [{'name':name, 'shadow price':c.pi, 'slack': c.slack} for name, c in model.constraints.items()] print(pd.DataFrame(o)) SUPPLY CHAIN ANALYTICS IN PYTHON

  10. Constraint slack e x plained O u tp u t : Remember the Constraints : name shadow price slack 1. limited prod u ction capacit y _C1 78.148148 -0.000000 2. limited w areho u se capacit y _C2 2.962963 -0.000000 3. ma x prod u ction of A _C3 -0.000000 1.333333 More Abo u t Binding slack = 0, then binding Changing binding constraint , changes sol u tion SUPPLY CHAIN ANALYTICS IN PYTHON

  11. S u mmar y Ho w to comp u te : shadow prices constraint slack Identif y Binding Constraints slack = 0, then binding slack > 0, then not - binding SUPPLY CHAIN ANALYTICS IN PYTHON

  12. Tr y it o u t ! SU P P LY C H AIN AN ALYTIC S IN P YTH ON

  13. Capacitated plant location - case st u d y P 3 SU P P LY C H AIN AN ALYTIC S IN P YTH ON Aaren St u bber � eld S u ppl y Chain Anal y tics Mgr .

  14. Capacitated plant location model Modeling Prod u ction at regional facilities T w o plant si z es ( lo w / high ) E x porting prod u ction to other regions Prod u ction facilities open / close SUPPLY CHAIN ANALYTICS IN PYTHON

  15. E x pected ranges What sho u ld w e e x pected for v al u es of o u r decision v ariables ? Prod u ction Q u antities : High prod u ction in regions w ith lo w v ariable prod u ction and shipping costs Ma x ed prod u ction in regions that also ha v e relati v el y lo w �x ed prod u ction costs Prod u ction Plant Open Or Closed : High capacit y prod u ction plant in regions w ith high demand High capacit y prod u ction plant in regions w ith relati v el y lo w �x ed costs SUPPLY CHAIN ANALYTICS IN PYTHON

  16. Sensiti v it y anal y sis of constraints Total Prod u ction = Total Demand : shadow prices = Represent changes in total cost per increase in demand for a region slack = Sho u ld be z ero Total Prod u ction ≤ Total Prod u ction Capacit y: shadow prices = Represent changes in total costs per increase in prod u ction capacit y slack = Regions w hich ha v e e x cess prod u ction capacit y SUPPLY CHAIN ANALYTICS IN PYTHON

  17. from pulp import * y = LpVariable.dicts( import pandas as pd "plant_", [(i,s) for s in size for i in loc], # Initialize Class cat='Binary') model = # Define Objective Function LpProblem("Capacitated Plant Location Model", model += LpMinimize) (lpSum([fix_cost.loc[i,s]*y[(i,s)] for s in size for i in loc]) # Define Decision Variables + lpSum([var_cost.loc[i,j]*x[(i,j)] loc = ['A', 'B', 'C', 'D', 'E'] for i in loc for j in loc])) size = ['Low_Cap','High_Cap'] x = LpVariable.dicts( # Define the Constraints "production_", for j in loc: model += [(i,j) for i in loc for j in loc], lpSum([x[(i, j)] lowBound=0, upBound=None, for i in loc]) == demand.loc[j,'Dmd'] cat='Continuous') for i in loc: model += lpSum([x[(i, j)] for j in loc]) <= lpSum( [cap.loc[i,s]*y[(i,s)]for s in size]) SUPPLY CHAIN ANALYTICS IN PYTHON

  18. # Solve model.solve() # Print Decision Variables and Objective Value print(LpStatus[model.status]) o = [{'prod':"{} to {}".format(i,j), 'quant':x[(i,j)].varValue} for i in loc for j in loc] print(pd.DataFrame(o)) o = [{'loc':i, 'lc':y[(i,size[0])].varValue, 'hc':y[(i,size[1])].varValue} for i in loc] print(pd.DataFrame(o)) print("Objective = ", value(model.objective)) # Print Shadow Price and Slack o = [{'name':name, 'shadow price':c.pi, 'slack': c.slack} for name, c in model.constraints.items()] print(pd.DataFrame(o)) SUPPLY CHAIN ANALYTICS IN PYTHON

  19. B u siness q u estions Likel y Q u estions : What is the e x pected cost of this s u ppl y chain net w ork model ? If demand increases in a region ho w m u ch pro � t is needed to co v er the costs of prod u ction and shipping to that region ? Which regions still ha v e prod u ction capacit y for f u t u re demand increase ? SUPPLY CHAIN ANALYTICS IN PYTHON

  20. S u mmar y Re v ie w ed : E x pected ranges for decision v ariables Interpreted the o u tp u t of sensiti v it y anal y sis ( shadow prices and slack ) Code to sol v e and o u tp u t res u lts Likel y b u siness related q u estion SUPPLY CHAIN ANALYTICS IN PYTHON

  21. Great w ork ! Yo u r t u rn SU P P LY C H AIN AN ALYTIC S IN P YTH ON

  22. Sim u lation testing sol u tion SU P P LY C H AIN AN ALYTIC S IN P YTH ON Aaren St u bber � eld S u ppl y Chain Anal y tics Mgr .

  23. Ca u tion Problems that take a long time to sol v e sho u ld not be u sed w ith LP or IP SUPPLY CHAIN ANALYTICS IN PYTHON

  24. O v erall concept General Concept : Add random noise to ke y inp u ts y o u choose Sol v e the model repeatedl y Obser v e the distrib u tion SUPPLY CHAIN ANALYTICS IN PYTHON

  25. Wh y w e might tr y Wh y: Inp u ts are o � en estimates . There is a risk that the y are inacc u rate . Earlier Sensiti v it y Anal y sis onl y looked at changing one inp u t at a time . SUPPLY CHAIN ANALYTICS IN PYTHON

  26. Conte x t Conte x t - Glass Compan y - Reso u rce Planning : Reso u rce Prod . A Prod . B Prod . C Pro � t $ US $500 $450 $600 Constraints : There are demand , prod u ction capacit y, and w areho u se Capacit y constraints Risks : Estimates of pro � ts ma y be inacc u rate SUPPLY CHAIN ANALYTICS IN PYTHON

  27. # Initialize Class, & Define Variables model = LpProblem("Max Glass Co. Profits", LpMaximize) A = LpVariable('A', lowBound=0) B = LpVariable('B', lowBound=0) C = LpVariable('C', lowBound=0) # Define Objective Function model += 500 * A + 450 * B + 600 * C # Define Constraints & Solve model += 6 * A + 5 * B + 8 * C <= 60 model += 10.5 * A + 20 * B + 10 * C <= 150 model += A <= 8 model.solve() SUPPLY CHAIN ANALYTICS IN PYTHON

  28. Code e x ample - step 2 a, b, c = normalvariate(0,25), A = LpVariable('A', lowBound=0) normalvariate(0,25), B = LpVariable('B', lowBound=0) normalvariate(0,25) C = LpVariable('C', lowBound=0) a, b, c = normalvariate(0,25), normalvariate(0,25), # Define Objective Function normalvariate(0,25) model += (500+a)*A + (450+b)*B + (600+c)*C # Define Objective Function model += (500+a)*A + (450+b)*B + (600+c)*C # Initialize Class, & Define Variables model = LpProblem("Max Glass Co. Profits", # Define Constraints & Solve LpMaximize) model += 6 * A + 5 * B + 8 * C <= 60 model += 10.5 * A + 20 * B + 10 * C <= 150 model += A <= 8 model.solve() SUPPLY CHAIN ANALYTICS IN PYTHON

Recommend


More recommend