Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Lecture: Introduction to Linear Programming for Natural Resource Economists and Landscape Ecologists

980 views

Published on

The first hour lecture I give when introducing Linear Programming to MSc students studying 1) landscape ecology and 2) Economics and natural resource management. The second hour I give them hands on experience with Excel and its Solver. The final hour is taken up with real world application case-studies.
As a footnote what I notice is that my style of preparing presentation is evolving alongside my membership of Toastmasters International. These slides are far too wordy and simply list the words I want to say rather than illustrate the concept I am get across. Change required but power point slides still need to read well and be comprehensible for those students that don't show to hear me present.

Published in: Environment
  • Be the first to comment

  • Be the first to like this

Lecture: Introduction to Linear Programming for Natural Resource Economists and Landscape Ecologists

  1. 1. Linear Programming 11 December 2014 Daniel L Sandars, Research Fellow IEHRF, School of Applied Science Optimium 0 20 40 60 80 100 90 80 70 60 50 40 30 20 10 1000 Feasible region Profit contours Potatoes, ha £200,000-£250,000 £150,000-£200,000 £100,000-£150,000 £50,000-£100,000 £0-£50,000 Wheat, ha Land limit <= 100 ha Irrigation limit, <= 27.5 ha potatoes
  2. 2. Overall Structure 1. Introduction to Linear Programming (LP) 2. Sensitivity Analysis and Solution Interpretation 3. Hands-on practical Excel & Solver 4. Applications 5. Miscellaneous LP
  3. 3. 1) Introduction to Linear Programming • Introduction • A Simple Maximisation Problem • Graphical Solution Procedure • Extreme Points and the Optimal Solution • A Simple Minimisation Problem • Special Cases • General Linear Programming Notation
  4. 4. Introduction • Linear programming is an important case of a large set of mathematical programming techniques • They all seek to maximise or minimise (to optimise) a quantity subject to conditions or constriants • pro·gram·ming or pro·gram·ing n. • 1. The designing, scheduling, or planning of a program, as in broadcasting. • 2. The writing of a computer program.
  5. 5. LP Introduction • The production planning problem • Finite factors of production: land, labour and capital • A vast production possibilities set • How to deploy the resources with best efficiency? • What is the marginal value of a resource’s use?
  6. 6. Maximisation: make the most profit Classic example, Product mix Product A Product B Hours Machine 1 2 3 ≤ 3000 Machine 2 4 1 ≤ 3000 Machine 3 2 1.5 ≤ 1800 Profit £7 £4 = Max
  7. 7. Maximisation Graphical solution Constraint 1 3000 2500 2000 1500 1000 500 0 0 200 400 600 800 1000 1200 1400 Product A Product B Machine 1 <= 3000 hrs Take two extreme points, where first Product A=0 and then Product B=0. Draw the line that connects them
  8. 8. Maximisation Graphical solution Constraints 2 & 3 3000 2500 2000 1500 1000 500 0 0 200 400 600 800 1000 1200 1400 Product A Product B Machine 1 <= 3000 hrs Machine 2 <= 3000 hrs Machine 3 <=1800 hrs
  9. 9. Maximisation Graphical solution Identify the Feasible Region 3000 2500 2000 1500 1000 500 0 0 200 400 600 800 1000 1200 1400 Product A Product B Machine 1 <= 3000 hrs Machine 2 <= 3000 hrs Machine 3 <=1800 hrs Feasible Region
  10. 10. Maximisation Graphical solution Draw profit contours 3000 2500 2000 1500 1000 500 0 0 200 400 600 800 1000 1200 1400 Product A Product B Machine 1 <= 3000 hrs Machine 2 <= 3000 hrs Machine 3 <=1800 hrs Profit = £5000 Profit = £6000 Profit = £7000 Feasible Region
  11. 11. Solution Solution = Profit of £5925 = 675 units Product A & 300 units Product B 1000 800 600 400 200 0 0 200 400 600 800 Product A Product B Machine 1 <= 3000 hrs Machine 2 <= 3000 hrs Machine 3 <=1800 hrs Profit = £5000 Profit = £6000 Profit = £7000 Feasible Region
  12. 12. Solution and extreme points Extreme Points 1000 900 800 700 600 500 400 300 200 100 0 0 100 200 300 400 500 600 700 800 Product A Product B Machine 1 <= 3000 hrs Machine 2 <= 3000 hrs Machine 3 <=1800 hrs Profit = £5000 Profit = £6000 Profit = £7000 Feasible Region 0 1 2 3 4
  13. 13. Binding and slack constraints Hours Used Hours Available Slack Machine 1 2250 3000 750 Machine 2 3000 3000 0 Machine 3 1800 1800 0 Where the inequality is ≥ then a slack is a surplus
  14. 14. Maximisation and land use planning? Classic example – crops Product mix or optimise the production possibilities set for a given resource of land, labour and capital Crop A Crop B Available Plant 2 3 ≤ 3000 Harvest 4 1 ≤ 3000 Land 1 1 ≤ 1000 Profit 7 4 = Max
  15. 15. Classic example – feed The Diet Problem Feed A, kg Feed B, kg Minimisation Dry matter intake, kg 2 3 ≤ 3000 Energy, MJ 4 1 ≥ 3000 Protein, g CP 2 1.5 ≥ 1800 Cost £7 £4 = Min
  16. 16. Minimisation Minimisation 3000 2500 2000 1500 1000 500 0 0 200 400 600 800 1000 1200 1400 Feed A Feed B Dry matter <= 3000 kg Energy >= 3000 MJ Protein >= 1800 g CP Cost = £5000 Cost = £6000 Cost = £7000 Feasible Region
  17. 17. Minimisation Minimisation 3000 2500 2000 1500 1000 500 0 0 200 400 600 800 1000 1200 1400 Feed A Feed B Dry matter <= 3000 kg Energy >= 3000 MJ Protein >= 1800 g CP Cost = £5000 Cost = £6000 Cost = £7000 Feasible Region Solution is closest to origin
  18. 18. Special cases: Alternative Optima Alternative Optima 1500 1300 1100 900 700 500 300 100 -100 0 200 400 600 800 1000 Product A Product B Machine 1 = 3000 hrs Machine 2 = 3000 hrs Machine 3 =1800 hrs Profit = £7000 Profit = £6000 Profit = £5000 Feasible Region Two extreme points are equally optimal AND every solution between them (infinite)!
  19. 19. Special cases: Infeasibility Infeasible 3000 2500 2000 1500 1000 500 0 0 500 1000 1500 Feed A Feed B Dry matter <= 1000 kg Energy >= 3000 MJ Protein >= 1800 g CP
  20. 20. Special cases: Uboundedness 3000 2500 2000 1500 1000 500 0 Unboundedness - 500 1,000 1,500 Some axis AA Some Axis Z Profit = £7000 Profit = £6000 Profit = £5000
  21. 21. Special cases: Redundant Constraint Redundant Constraint 3000 2500 2000 1500 1000 500 0 0 500 1000 1500 Feed A Feed B Dry matter <= 3000 kg Energy >= 3000 MJ Protein >= 1800 g CP Salt <= 50g Cost = £5000 Cost = £6000 Cost = £7000 Feasible Region
  22. 22. 2) LP: Sensitivity analysis & Solution interpretation • Introduction to sensitivity analysis • Graphical sensitivity analysis • Dual and shadow prices
  23. 23. Sensitivity Analysis Two questions • How will a change in an objective function coefficient affect the optimal solution? For example, what if the price of wheat went up £1 • How will a change in the right-hand-side value of a constraint affect the optimal solution? For example, if the hours available for harvest increased by 1 hour • The answers are obtained after the optimal solution, i.e. this is post-optimality analysis.
  24. 24. Objective function sensitivity Objective function sensitivity 3000 2500 2000 1500 1000 500 0 The solution is stable if the slope of the objective function lies between the slope of the two binding constraints 0 500 1000 1500 Product A Product B Machine 1 = 3000 hrs Machine 2 = 3000 hrs Machine 3 =1800 hrs Profit = £5925 (A=£7,B=£4) Slope -4 Slope -1.75 Slope -1.33
  25. 25. Objective function sensitivity • Varying one coefficient at a time • £5.32 ≤ cx1 ≤ £16 • £1.75 ≤ cx2 ≤ £5.26 • At the limits you get alternative optima with the adjacent extreme points. Beyond that new solutions occur on those extreme points • Thus, if one varied a price through an extreme range the solution would be stable then lurch to a new optimum giving a response line with step-change discontinuities
  26. 26. Objective function sensitivity • Reduced Costs • These indicate how much an objective function coefficient would have to improve before that decision variable enters the solution. • For a decision variable that is already positive the reduced costs are zero This is often really useful information because it can help tell you what combination of price and performance a new crop or technology requires for it to be a potential commercial success
  27. 27. Constraint Sensitivity Constraint sensitivity 1750 1550 1350 1150 950 750 550 350 150 -50 0 200 400 600 800 1000 Product A Product B Machine 1 = 3000 hrs Machine 2 = 3000 hrs Machine 3 =1800 hrs Machine 3 =1900 hrs Profit = £7000 Profit = £6000 Profit = £5000 Feasible Region
  28. 28. Constraint Sensitivity • Original solution • 675 units of A, 300 units of B and profit £5,925 • 100 more hours of machine 3 • 600 units of A, 400 units of B and profit £6,150 • Each additional hour of machine 3 is worth £2.25 (£6,150-£5,925)/100hrs = £2.25 • This is known as the dual price and each binding constraint will have a non-zero value. • It is valid only over a limited range before another constraint becomes binding
  29. 29. Marginal cost behaviour £700,000 £600,000 £500,000 £400,000 £300,000 £200,000 £100,000 £0 0 2 4 6 8 10 12 14 Net Farm Profit (1250 ha) Maximum number of workers
  30. 30. Marginal cost behaviour £25,000 £20,000 £15,000 £10,000 £5,000 £0 £700,000 £600,000 £500,000 £400,000 £300,000 £200,000 £100,000 £0 Net Farm Profit (1250 ha) Tractor Dual Cost 0 2 4 6 8 10 12 14 Tractor Dual Cost Net Farm Profit (1250 ha) Maximum number of workers
  31. 31. Dual and shadow prices • These are often treated synonymously • Dual Price is the improvement in the value of the objective function per unit increase in a constraint's right-hand-side • Shadow price is the change in the value of the objective function per unit increase in a constraint’s right-hand-side. See also marginal value product • For maximisation problems they are identical, but for minimisation problems the shadow price is the negative of the dual price. (For a least cost problem a change of £10 is a -£10 improvement)
  32. 32. Examples • Transportation networks • Cost allocation in collaborative forest transportation • Estimating the costs of overlapping tenure constraints: a case study in Northern Alberta, Canada
  33. 33. Application: The Silsoe Whole Farm Model • Whole farm planning LPs have two subtly different roles; Prescriptive uses guide an individual farmer to better decisions whereas predictive uses help understand how farmers response to choice or change. For the policy maker we are still doing prescriptive OR!! • Profit maximisation has been effective for predicting the aggregate response of farmers to change. • …even though there might be evidence that this does not describe how individuals behave!
  34. 34. 7.00 6.00 5.00 4.00 3.00 2.00 1.00 0.00 0.1 1 10 100 1000 10000 100000 1000000 10000000 Arable area, ha Percentage abs relative error
  35. 35. Soils and Weather Workable hours Profitability (or loss) Crop and livestock outputs Environmental Impacts Possible crops, yields, maturity dates, sowing dates Silsoe Whole Farm Model Linear programme, important features timeliness penalties, rotational penalties, workability per task, uncertainty Machines and people Constraints and penalties
  36. 36. Heavy clay, 800 mm annual rainfall 250 200 150 100 50 0 7 Jan 7 Feb 7 Mar 7 Apr 7 May 7 Jun 7 Jul 7 Aug 7 Sep 7 Oct 7 Nov 7 Dec Hours Sandy loam, 500 mm annual rainfall 250 200 150 100 - 50 7 Jan 7 Feb 7 Mar 7 Apr 7 May 7 Jun 7 Jul 7 Aug 7 Sep 7 Oct 7 Nov 7 Dec Hours Workable hours v. tractor hours Period, fortnights Period, fortnights
  37. 37. Low gross margin crop £370/ha versus £600-750/ha (Sown spring, harvested September) WWheat WBarley SBarley WRape Crop X
  38. 38. Nitrate leaching scenarios on an arable sandy loam farm: crop areas; profit; N leaching and N use Base N < 100kg/ha Opt Profit + N leach Profit = £456/ha N leach = 56.4 kg/ha N use = 123.7 kg/ha £430/ha 55.7 kg/ha 100 kg/ha £433/ha 44.9 kg/ha 168.5 kg/ha • N restricting policy increases Nitrate leaching - more spring crops increasing over-winter leaching • To decrease N leaching, grow crops which use the N applied efficiently WW WB SB WR WBn RS Pots SBt Peas SR SBn More legumes. No Oilseed rape No legumes. No Oilseed rape
  39. 39. 4) LP: miscellaneous • Working with LPs using computers • Pointers to assumptions and limitations • Extensions that solve some of the limitations • Further reading
  40. 40. LP by computer • Modelling environment that generates the matrix this maybe supported by databases to quantify the bio-physical data • A solver which solves the matrix. The original method was the Simplex method although there are now interior point methods, which search through the interior of the simplex rather than the extreme points. • A report writer that interrogates and presents the solution
  41. 41. LP by computer • Modelling Environments: GAMS, AIMMS, AMPL • Solvers: XpressMP, CPLEX, Excel’s Solver Add-in (Frontline Systems Inc), LINDO • Programming Languages (to provide the user-interface and interaction with the solver), Visual Basic…etc
  42. 42. Assumptions & limitations Assumptions • Divisibility • Linearity • Additivity • Proportionality • Determinism • Limitations • Comparative static analysis • Data availability • Technical and economic assumptions • Handling risk and uncertainty This is just a stub. You need to develop this to have a critical appreciation of the assumption and limitations of LPS and quantitative methods in general in the context of the economic (bio-physical) problem that you are addressing
  43. 43. 6) LP: Extensions • Mixed Integer Linear Programming • Quadratic programming • Risk: variance co-variance matrix of activity returns • Stochastic programming • Multi-Criteria Decision Problems • Goal Programming • Multi-Objective Programming • Compromise Programming • Non-Linear Programming • Piecewise Approximation
  44. 44. The End • Thanks • daniel.sandars@cranfield.ac.uk

×