SlideShare a Scribd company logo
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
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
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
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.
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?
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
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
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
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
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
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
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
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
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
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
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
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
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)!
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
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
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
2) LP: Sensitivity analysis & 
Solution interpretation 
• Introduction to sensitivity analysis 
• Graphical sensitivity analysis 
• Dual and shadow prices
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.
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
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
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
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
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
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
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
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)
Examples 
• Transportation networks 
• Cost allocation in collaborative forest 
transportation 
• Estimating the costs of overlapping tenure 
constraints: a case study in Northern Alberta, 
Canada
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!
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
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
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
Lecture: Introduction to Linear Programming for Natural Resource Economists and Landscape Ecologists
Low gross margin crop 
£370/ha versus £600-750/ha 
(Sown spring, harvested 
September) 
WWheat 
WBarley 
SBarley 
WRape 
Crop X
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
Lecture: Introduction to Linear Programming for Natural Resource Economists and Landscape Ecologists
4) LP: miscellaneous 
• Working with LPs using computers 
• Pointers to assumptions and limitations 
• Extensions that solve some of the limitations 
• Further reading
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
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
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
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
The End 
• Thanks 
• daniel.sandars@cranfield.ac.uk

More Related Content

PPTX
Operations research
PPTX
LINEAR PROGRAMMING
PPS
Applications of linear programming
PPTX
Operations Research - Introduction
PPTX
Linear programming
PPTX
Chapter two
PPTX
Duality in Linear Programming
PPT
Linear Programming: The Construction Problem
Operations research
LINEAR PROGRAMMING
Applications of linear programming
Operations Research - Introduction
Linear programming
Chapter two
Duality in Linear Programming
Linear Programming: The Construction Problem

What's hot (20)

PPTX
Managerial economics linearprogramming
PPTX
How to set up a Graphical Method Linear Programming Problem - Introduction
PPT
Vcs slides on or 2014
DOCX
Linear programming
PPT
Mba i qt unit-1.3_linear programming in om
PPT
Linear Programming 1
PPT
Taylor introms10 ppt_02
PPT
Quantitative Techniques
PDF
Lecture27 linear programming
PPT
Linear programming
PPTX
Linear Programming Feasible Region
PPTX
Linear programming Cost Minimization
PPT
Operations Research
PPT
Mba i ot unit-1.1_linear programming
PPT
An Introduction to Linear Programming
DOCX
Formulation of lp problems
PPT
Taylor introms10 ppt_03
PPTX
Palash badal
PPT
Decision Making Process
PDF
Linear programming
Managerial economics linearprogramming
How to set up a Graphical Method Linear Programming Problem - Introduction
Vcs slides on or 2014
Linear programming
Mba i qt unit-1.3_linear programming in om
Linear Programming 1
Taylor introms10 ppt_02
Quantitative Techniques
Lecture27 linear programming
Linear programming
Linear Programming Feasible Region
Linear programming Cost Minimization
Operations Research
Mba i ot unit-1.1_linear programming
An Introduction to Linear Programming
Formulation of lp problems
Taylor introms10 ppt_03
Palash badal
Decision Making Process
Linear programming
Ad

Viewers also liked (6)

PPT
Linear programming in market application
PPT
Introduction to linear programming
PPSX
Linear programing
PPTX
Linear Programming
PPTX
Linear programming - Model formulation, Graphical Method
PPTX
MYP 5 Real Life linear programming
Linear programming in market application
Introduction to linear programming
Linear programing
Linear Programming
Linear programming - Model formulation, Graphical Method
MYP 5 Real Life linear programming
Ad

Similar to Lecture: Introduction to Linear Programming for Natural Resource Economists and Landscape Ecologists (20)

PPT
Intro week3 excel vba_114e
DOCX
Practice topic 9 - answers (1)
PDF
Lecture 3_EOQ Discount Model.pdf
PPT
Cost Behavior Analysis
PPTX
Product1 [4] capacity planning
PDF
Chap3 - Hanh vi nha SX.pdf
PPTX
AccountinginManagementtttttttttttt 2.pptx
PPTX
Management Accounting (PMA2043)
PPT
LPP Graphical.ppt
PPTX
Ch 7.pptx Linear Optimization for Finance
PPT
Lecture-4-Mathematical Optimization_This.ppt
PDF
Lp problem
PPT
Linear Programming.ppt
PPTX
20200830230320_PPT2-Applications and More Algebra.pptx
PDF
Michael Zhang.pdf
PPTX
Decision making
PPT
1.Operations Research.ppt
PDF
PGBM01 - MBA Financial Management And Control (2015-16 Trm1 A) Lecture 8 sho...
DOCX
Managerial_economics (3).docx
PPTX
qmb12ch08.pptx
Intro week3 excel vba_114e
Practice topic 9 - answers (1)
Lecture 3_EOQ Discount Model.pdf
Cost Behavior Analysis
Product1 [4] capacity planning
Chap3 - Hanh vi nha SX.pdf
AccountinginManagementtttttttttttt 2.pptx
Management Accounting (PMA2043)
LPP Graphical.ppt
Ch 7.pptx Linear Optimization for Finance
Lecture-4-Mathematical Optimization_This.ppt
Lp problem
Linear Programming.ppt
20200830230320_PPT2-Applications and More Algebra.pptx
Michael Zhang.pdf
Decision making
1.Operations Research.ppt
PGBM01 - MBA Financial Management And Control (2015-16 Trm1 A) Lecture 8 sho...
Managerial_economics (3).docx
qmb12ch08.pptx

More from Daniel Sandars (20)

PDF
2018-06-16 dot#1 pr slides and notes
PPTX
Sustainability Table Topics
PPTX
2017 02-22 university of essex speechcraft preparation_and_practice
PPTX
Speech Topics: Creating and Breaking the Paradox of Choice
PPTX
Cranfield Speakers Club: The Area Director's perspective
PPTX
Making Better Decisions: Operational Research
PDF
Know Your Message...Know Your Audience
PDF
A comparison of greenhouse gases emmisions from dairy farms using four system...
PPTX
A comparison of greenhouse gas (GHG) emissions from dairy farms by four syste...
PPSX
What I learned from managing Speechcraft
PPTX
A comparison of farm-scale models to estimate greenhouse gas emissions from d...
PPTX
Understanding Europe’s future ability to feed itself within an uncertain clim...
PPT
An agriculturalist's operational research career perspective
PDF
Synergies between mitigation and adaptation to Climate Change in grassland-ba...
PPSX
Lecture:Organic/Bio waste Life Cycle Assessment case studies
PPSX
Populations and sustainability :- Fisheries
PPTX
Poster "Agricultural systems modelling coupled with Environmental Life Cycle ...
PPT
Simulating Optimal future land use in the Nordic area
PPTX
Analysing the efficiency of energy use on farms using Data Envelopment Analys...
PPT
D sandars talk2
2018-06-16 dot#1 pr slides and notes
Sustainability Table Topics
2017 02-22 university of essex speechcraft preparation_and_practice
Speech Topics: Creating and Breaking the Paradox of Choice
Cranfield Speakers Club: The Area Director's perspective
Making Better Decisions: Operational Research
Know Your Message...Know Your Audience
A comparison of greenhouse gases emmisions from dairy farms using four system...
A comparison of greenhouse gas (GHG) emissions from dairy farms by four syste...
What I learned from managing Speechcraft
A comparison of farm-scale models to estimate greenhouse gas emissions from d...
Understanding Europe’s future ability to feed itself within an uncertain clim...
An agriculturalist's operational research career perspective
Synergies between mitigation and adaptation to Climate Change in grassland-ba...
Lecture:Organic/Bio waste Life Cycle Assessment case studies
Populations and sustainability :- Fisheries
Poster "Agricultural systems modelling coupled with Environmental Life Cycle ...
Simulating Optimal future land use in the Nordic area
Analysing the efficiency of energy use on farms using Data Envelopment Analys...
D sandars talk2

Recently uploaded (20)

PDF
PAKAM TECHNOLOGY LIMTED PITCH DECK pptx.pdf
PPT
Environmental pollution for educational study
PPTX
Environmental pollutants for natural res
PDF
Effects of rice-husk biochar and aluminum sulfate application on rice grain q...
PDF
Biomass cookstoves: A review of technical aspects
DOCX
Double Membrane Roofs for Bio-gas Tanks Reliable containment for biofuel gas....
PPTX
computer of health my name i d kussta lpaggyhsgd
PPTX
Importance of good air quality and different pollutants.
PPTX
Climate_Change_Renewable_and_Energy.pptx
DOCX
Double Membrane Roofs for Anaerobic Digesters Essential for capturing and sto...
DOCX
Double Membrane Roofs for Biogas Tanks Securely store produced biogas.docx
DOCX
Biogas Balloon for Bio CNG Plants An efficient solution for biogas storage..docx
PPTX
sustainable-development in tech-ppt[1].pptx
DOCX
Double Membrane Roofs for Digester Tank Wastewater Treatment Integral to biog...
PPTX
Plant Production 7.pptx in grade 7 students
PDF
Cave Diggers Simplified cave survey methods and mapping
DOCX
Double Membrane Roofs for Cassava Wastewater Treatment Captures biogas from i...
PPTX
Microbial-Pathogens-and-Parasites-Their-Impact-on-Plant-Health.pptx
PPTX
EME Aerospace.pptx basics of mechanical engineering
PPTX
Afro-Asia Literature.pptxmmmmmmmmmmmmmmm
PAKAM TECHNOLOGY LIMTED PITCH DECK pptx.pdf
Environmental pollution for educational study
Environmental pollutants for natural res
Effects of rice-husk biochar and aluminum sulfate application on rice grain q...
Biomass cookstoves: A review of technical aspects
Double Membrane Roofs for Bio-gas Tanks Reliable containment for biofuel gas....
computer of health my name i d kussta lpaggyhsgd
Importance of good air quality and different pollutants.
Climate_Change_Renewable_and_Energy.pptx
Double Membrane Roofs for Anaerobic Digesters Essential for capturing and sto...
Double Membrane Roofs for Biogas Tanks Securely store produced biogas.docx
Biogas Balloon for Bio CNG Plants An efficient solution for biogas storage..docx
sustainable-development in tech-ppt[1].pptx
Double Membrane Roofs for Digester Tank Wastewater Treatment Integral to biog...
Plant Production 7.pptx in grade 7 students
Cave Diggers Simplified cave survey methods and mapping
Double Membrane Roofs for Cassava Wastewater Treatment Captures biogas from i...
Microbial-Pathogens-and-Parasites-Their-Impact-on-Plant-Health.pptx
EME Aerospace.pptx basics of mechanical engineering
Afro-Asia Literature.pptxmmmmmmmmmmmmmmm

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

  • 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 2) LP: Sensitivity analysis & Solution interpretation • Introduction to sensitivity analysis • Graphical sensitivity analysis • Dual and shadow prices
  • 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. 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. 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. 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. 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. 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. 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. 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. 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. Examples • Transportation networks • Cost allocation in collaborative forest transportation • Estimating the costs of overlapping tenure constraints: a case study in Northern Alberta, Canada
  • 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. 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. 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. 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
  • 38. Low gross margin crop £370/ha versus £600-750/ha (Sown spring, harvested September) WWheat WBarley SBarley WRape Crop X
  • 39. 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
  • 41. 4) LP: miscellaneous • Working with LPs using computers • Pointers to assumptions and limitations • Extensions that solve some of the limitations • Further reading
  • 42. 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
  • 43. 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
  • 44. 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
  • 45. 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
  • 46. The End • Thanks • daniel.sandars@cranfield.ac.uk