SlideShare a Scribd company logo
1 of 33
Download to read offline
Linear Programming: Introduction
Frédéric Giroire
F. Giroire LP - Introduction 1/28
Course Schedule
• Session 1: Introduction to optimization.
Modelling and Solving simple problems.
Modelling combinatorial problems.
• Session 2: Duality or Assessing the quality of a solution.
• Session 3: Solving problems in practice or using solvers (Glpk or
Cplex).
F. Giroire LP - Introduction 2/28
Motivation
Why linear programming is a very important topic?
• A lot of problems can be formulated as linear programmes, and
• There exist efficient methods to solve them
• or at least give good approximations.
• Solve difficult problems: e.g. original example given by the
inventor of the theory, Dantzig. Best assignment of 70 people to
70 tasks.
→ Magic algorithmic box.
F. Giroire LP - Introduction 3/28
What is a linear programme?
• Optimization problem consisting in
• maximizing (or minimizing) a linear objective function
• of n decision variables
• subject to a set of constraints expressed by linear equations or
inequalities.
• Originally, military context: "programme"="resource planning".
Now "programme"="problem"
• Terminology due to George B. Dantzig, inventor of the Simplex
Algorithm (1947)
F. Giroire LP - Introduction 4/28
Terminology
max 350x1 +300x2
subject to
x1 +x2 ≤ 200
9x1 +6x2 ≤ 1566
12x1 +16x2 ≤ 2880
x1,x2 ≥ 0
x1,x2 : Decision variables
Objective function
Constraints
F. Giroire LP - Introduction 5/28
Terminology
max 350x1 +300x2
subject to
x1 +x2 ≤ 200
9x1 +6x2 ≤ 1566
12x1 +16x2 ≤ 2880
x1,x2 ≥ 0
x1,x2 : Decision variables
Objective function
Constraints
In linear programme: objective function + constraints are all linear
Typically (not always): variables are non-negative
If variables are integer: system called Integer Programme (IP)
F. Giroire LP - Introduction 6/28
Terminology
Linear programmes can be written under the standard form:
Maximize ∑n
j=1 cj xj
Subject to: ∑n
j=1 aij xj ≤ bi for all 1 ≤ i ≤ m
xj ≥ 0 for all 1 ≤ j ≤ n.
(1)
• the problem is a maximization;
• all constraints are inequalities (and not equations);
• all variables are non-negative.
F. Giroire LP - Introduction 7/28
Example 1: a resource allocation problem
A company produces copper cable of 5 and 10 mm of diameter on a
single production line with the following constraints:
• The available copper allows to produces 21000 meters of cable of
5 mm diameter per week.
• A meter of 10 mm diameter copper consumes 4 times more
copper than a meter of 5 mm diameter copper.
Due to demand, the weekly production of 5 mm cable is limited to
15000 meters and the production of 10 mm cable should not exceed
40% of the total production. Cable are respectively sold 50 and 200
euros the meter.
What should the company produce in order to maximize its weekly
revenue?
F. Giroire LP - Introduction 8/28
Example 1: a resource allocation problem
A company produces copper cable of 5 and 10 mm of diameter on a
single production line with the following constraints:
• The available copper allows to produces 21000 meters of cable of
5 mm diameter per week.
• A meter of 10 mm diameter copper consumes 4 times more
copper than a meter of 5 mm diameter copper.
Due to demand, the weekly production of 5 mm cable is limited to
15000 meters and the production of 10 mm cable should not exceed
40% of the total production. Cable are respectively sold 50 and 200
euros the meter.
What should the company produce in order to maximize its weekly
revenue?
F. Giroire LP - Introduction 8/28
Example 1: a resource allocation problem
Define two decision variables:
• x1: the number of thousands of meters of 5 mm cables produced
every week
• x2: the number of thousands meters of 10 mm cables produced
every week
The revenue associated to a production (x1,x2) is
z = 50x1 +200x2.
The capacity of production cannot be exceeded
x1 +4x2 ≤ 21.
F. Giroire LP - Introduction 9/28
Example 1: a resource allocation problem
The demand constraints have to be satisfied
x2 ≤
4
10
(x1 +x2)
x1 ≤ 15
Negative quantities cannot be produced
x1 ≥ 0,x2 ≥ 0.
F. Giroire LP - Introduction 10/28
Example 1: a resource allocation problem
The model: To maximize the sell revenue, determine the solutions of
the following linear programme x1 and x2:
max z = 50x1 +20x2
subject to
x1 +4x2 ≤ 21
−4x1 +6x2 ≤ 0
x1 ≤ 15
x1,x2 ≥ 0
F. Giroire LP - Introduction 11/28
Example 2: Scheduling
• m = 3 machines
• n = 8 tasks
• Each task lasts x units of
time
Objective: affect the tasks to the machines in order to minimize the
duration
• Here, the 8 tasks are finished after 7 units of times on 3
machines.
F. Giroire LP - Introduction 12/28
Example 2: Scheduling
• m = 3 machines
• n = 8 tasks
• Each task lasts x units of
time
Objective: affect the tasks to the machines in order to minimize the
duration
• Now, the 8 tasks are accomplished after 6.5 units of time: OPT?
• mn
possibilities! (Here 38
= 6561)
F. Giroire LP - Introduction 12/28
Example 2: Scheduling
• m = 3 machines
• n = 8 tasks
• Each task lasts x units of
time
Solution: LP model.
min t
subject to
∑1≤i≤n ti x
j
i ≤ t (∀j,1 ≤ j ≤ m)
∑1≤j≤m x
j
i = 1 (∀i,1 ≤ i ≤ n)
with x
j
i = 1 if task i is affected to machine j.
F. Giroire LP - Introduction 12/28
Solving Difficult Problems
• Difficulty: Large number of solutions.
• Choose the best solution among 2n
or n! possibilities: all solutions
cannot be enumerated.
• Complexity of studied problems: often NP-complete.
• Solving methods:
• Optimal solutions:
• Graphical method (2 variables only).
• Simplex method.
• Approximations:
• Theory of duality (assert the quality of a solution).
• Approximation algorithms.
F. Giroire LP - Introduction 13/28
Graphical Method
• The constraints of a linear programme define a zone of solutions.
• The best point of the zone corresponds to the optimal solution.
• For problem with 2 variables, easy to draw the zone of solutions
and to find the optimal solution graphically.
F. Giroire LP - Introduction 14/28
Graphical Method
Example:
max 350x1 +300x2
subject to
x1 +x2 ≤ 200
9x1 +6x2 ≤ 1566
12x1 +16x2 ≤ 2880
x1,x2 ≥ 0
F. Giroire LP - Introduction 15/28
Graphical Method
F. Giroire LP - Introduction 16/28
Graphical Method
F. Giroire LP - Introduction 17/28
Graphical Method
F. Giroire LP - Introduction 18/28
Graphical Method
F. Giroire LP - Introduction 19/28
Graphical Method
F. Giroire LP - Introduction 20/28
Graphical Method
F. Giroire LP - Introduction 21/28
Computation of the optimal solution
The optimal solution is at the intersection of the constraints:
x1 +x2 = 200 (2)
9x1 +6x2 = 1566 (3)
We get:
x1 = 122
x2 = 78
Objective = 66100.
F. Giroire LP - Introduction 22/28
Optimal Solutions: Different Cases
F. Giroire LP - Introduction 23/28
Optimal Solutions: Different Cases
Three different possible cases:
• a single optimal solution,
• an infinite number of optimal solutions, or
• no optimal solutions.
F. Giroire LP - Introduction 23/28
Optimal Solutions: Different Cases
Three different possible cases:
• a single optimal solution,
• an infinite number of optimal solutions, or
• no optimal solutions.
If an optimal solution exists, there is always a corner point optimal
solution!
F. Giroire LP - Introduction 23/28
Solving Linear Programmes
F. Giroire LP - Introduction 24/28
Solving Linear Programmes
• The constraints of an LP give rise to a geometrical shape: a
polyhedron.
• If we can determine all the corner points of the polyhedron, then
we calculate the objective function at these points and take the
best one as our optimal solution.
• The Simplex Method intelligently moves from corner to corner
until it can prove that it has found the optimal solution.
F. Giroire LP - Introduction 25/28
Solving Linear Programmes
• Geometric method impossible in higher dimensions
• Algebraical methods:
• Simplex method (George B. Dantzig 1949): skim through the
feasible solution polytope.
Similar to a "Gaussian elimination".
Very good in practice, but can take an exponential time.
• Polynomial methods exist:
• Leonid Khachiyan 1979: ellipsoid method. But more theoretical
than practical.
• Narendra Karmarkar 1984: a new interior method. Can be used in
practice.
F. Giroire LP - Introduction 26/28
But Integer Programming (IP) is different!
• Feasible region: a set of
discrete points.
• Corner point solution not
assured.
• No "efficient" way to solve
an IP.
• Solving it as an LP provides
a relaxation and a bound on
the solution.
F. Giroire LP - Introduction 27/28
Summary: To be remembered
• What is a linear programme.
• The graphical method of resolution.
• Linear programs can be solved efficiently (polynomial).
• Integer programs are a lot harder (in general no polynomial
algorithms).
In this case, we look for approximate solutions.
F. Giroire LP - Introduction 28/28

More Related Content

Similar to slides-linear-programming-introduction.pdf

C users_mpk7_app_data_local_temp_plugtmp_plugin-week3recursive
C  users_mpk7_app_data_local_temp_plugtmp_plugin-week3recursiveC  users_mpk7_app_data_local_temp_plugtmp_plugin-week3recursive
C users_mpk7_app_data_local_temp_plugtmp_plugin-week3recursive
rokiah64
 
Linear Programming 1
Linear Programming 1Linear Programming 1
Linear Programming 1
irsa javed
 

Similar to slides-linear-programming-introduction.pdf (20)

QA CHAPTER II.pptx
QA CHAPTER II.pptxQA CHAPTER II.pptx
QA CHAPTER II.pptx
 
linear programming
linear programming linear programming
linear programming
 
C users_mpk7_app_data_local_temp_plugtmp_plugin-week3recursive
C  users_mpk7_app_data_local_temp_plugtmp_plugin-week3recursiveC  users_mpk7_app_data_local_temp_plugtmp_plugin-week3recursive
C users_mpk7_app_data_local_temp_plugtmp_plugin-week3recursive
 
Integer Linear Programming
Integer Linear ProgrammingInteger Linear Programming
Integer Linear Programming
 
CH1.ppt
CH1.pptCH1.ppt
CH1.ppt
 
bv_cvxslides (1).pdf
bv_cvxslides (1).pdfbv_cvxslides (1).pdf
bv_cvxslides (1).pdf
 
Introduction to optimization Problems
Introduction to optimization ProblemsIntroduction to optimization Problems
Introduction to optimization Problems
 
LPP FORMULATION 21 -22.pptx
LPP FORMULATION  21 -22.pptxLPP FORMULATION  21 -22.pptx
LPP FORMULATION 21 -22.pptx
 
Unit.2. linear programming
Unit.2. linear programmingUnit.2. linear programming
Unit.2. linear programming
 
Bagian 3 PTI
Bagian 3 PTIBagian 3 PTI
Bagian 3 PTI
 
Linear Programming 1
Linear Programming 1Linear Programming 1
Linear Programming 1
 
ManScie_Chapter1_Introduction (4).pdf
ManScie_Chapter1_Introduction (4).pdfManScie_Chapter1_Introduction (4).pdf
ManScie_Chapter1_Introduction (4).pdf
 
04-Unit Four - OR.pptx
04-Unit Four - OR.pptx04-Unit Four - OR.pptx
04-Unit Four - OR.pptx
 
Linear Programming (graphical method)
Linear Programming (graphical method)Linear Programming (graphical method)
Linear Programming (graphical method)
 
098A_exponents_factoring.ppt
098A_exponents_factoring.ppt098A_exponents_factoring.ppt
098A_exponents_factoring.ppt
 
098A_exponents_factoring.ppt
098A_exponents_factoring.ppt098A_exponents_factoring.ppt
098A_exponents_factoring.ppt
 
Integer Programming PPt.ernxzamnbmbmspdf
Integer Programming PPt.ernxzamnbmbmspdfInteger Programming PPt.ernxzamnbmbmspdf
Integer Programming PPt.ernxzamnbmbmspdf
 
LPP, Duality and Game Theory
LPP, Duality and Game TheoryLPP, Duality and Game Theory
LPP, Duality and Game Theory
 
LINEAR PROGRAMMING
LINEAR PROGRAMMINGLINEAR PROGRAMMING
LINEAR PROGRAMMING
 
LP.ppt
LP.pptLP.ppt
LP.ppt
 

More from SantiagoGarridoBulln

Optimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methodsOptimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methods
SantiagoGarridoBulln
 
Optimum Engineering Design - Day 4 - Clasical methods of optimization
Optimum Engineering Design - Day 4 - Clasical methods of optimizationOptimum Engineering Design - Day 4 - Clasical methods of optimization
Optimum Engineering Design - Day 4 - Clasical methods of optimization
SantiagoGarridoBulln
 

More from SantiagoGarridoBulln (16)

Genetic Algorithms. Algoritmos Genéticos y cómo funcionan.
Genetic Algorithms. Algoritmos Genéticos y cómo funcionan.Genetic Algorithms. Algoritmos Genéticos y cómo funcionan.
Genetic Algorithms. Algoritmos Genéticos y cómo funcionan.
 
Optimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsOptimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methods
 
Optimum engineering design - Day 6. Classical optimization methods
Optimum engineering design - Day 6. Classical optimization methodsOptimum engineering design - Day 6. Classical optimization methods
Optimum engineering design - Day 6. Classical optimization methods
 
Optimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methodsOptimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methods
 
Optimum Engineering Design - Day 4 - Clasical methods of optimization
Optimum Engineering Design - Day 4 - Clasical methods of optimizationOptimum Engineering Design - Day 4 - Clasical methods of optimization
Optimum Engineering Design - Day 4 - Clasical methods of optimization
 
OptimumEngineeringDesign-Day2a.pdf
OptimumEngineeringDesign-Day2a.pdfOptimumEngineeringDesign-Day2a.pdf
OptimumEngineeringDesign-Day2a.pdf
 
OptimumEngineeringDesign-Day-1.pdf
OptimumEngineeringDesign-Day-1.pdfOptimumEngineeringDesign-Day-1.pdf
OptimumEngineeringDesign-Day-1.pdf
 
CI_L01_Optimization.pdf
CI_L01_Optimization.pdfCI_L01_Optimization.pdf
CI_L01_Optimization.pdf
 
CI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdfCI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdf
 
Lecture_Slides_Mathematics_06_Optimization.pdf
Lecture_Slides_Mathematics_06_Optimization.pdfLecture_Slides_Mathematics_06_Optimization.pdf
Lecture_Slides_Mathematics_06_Optimization.pdf
 
OptimumEngineeringDesign-Day7.pdf
OptimumEngineeringDesign-Day7.pdfOptimumEngineeringDesign-Day7.pdf
OptimumEngineeringDesign-Day7.pdf
 
CI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptxCI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptx
 
CI L11 Optimization 3 GlobalOptimization.pdf
CI L11 Optimization 3 GlobalOptimization.pdfCI L11 Optimization 3 GlobalOptimization.pdf
CI L11 Optimization 3 GlobalOptimization.pdf
 
optmizationtechniques.pdf
optmizationtechniques.pdfoptmizationtechniques.pdf
optmizationtechniques.pdf
 
complete-manual-of-multivariable-optimization.pdf
complete-manual-of-multivariable-optimization.pdfcomplete-manual-of-multivariable-optimization.pdf
complete-manual-of-multivariable-optimization.pdf
 
Optim_methods.pdf
Optim_methods.pdfOptim_methods.pdf
Optim_methods.pdf
 

Recently uploaded

Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 

Recently uploaded (20)

Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 

slides-linear-programming-introduction.pdf

  • 1. Linear Programming: Introduction Frédéric Giroire F. Giroire LP - Introduction 1/28
  • 2. Course Schedule • Session 1: Introduction to optimization. Modelling and Solving simple problems. Modelling combinatorial problems. • Session 2: Duality or Assessing the quality of a solution. • Session 3: Solving problems in practice or using solvers (Glpk or Cplex). F. Giroire LP - Introduction 2/28
  • 3. Motivation Why linear programming is a very important topic? • A lot of problems can be formulated as linear programmes, and • There exist efficient methods to solve them • or at least give good approximations. • Solve difficult problems: e.g. original example given by the inventor of the theory, Dantzig. Best assignment of 70 people to 70 tasks. → Magic algorithmic box. F. Giroire LP - Introduction 3/28
  • 4. What is a linear programme? • Optimization problem consisting in • maximizing (or minimizing) a linear objective function • of n decision variables • subject to a set of constraints expressed by linear equations or inequalities. • Originally, military context: "programme"="resource planning". Now "programme"="problem" • Terminology due to George B. Dantzig, inventor of the Simplex Algorithm (1947) F. Giroire LP - Introduction 4/28
  • 5. Terminology max 350x1 +300x2 subject to x1 +x2 ≤ 200 9x1 +6x2 ≤ 1566 12x1 +16x2 ≤ 2880 x1,x2 ≥ 0 x1,x2 : Decision variables Objective function Constraints F. Giroire LP - Introduction 5/28
  • 6. Terminology max 350x1 +300x2 subject to x1 +x2 ≤ 200 9x1 +6x2 ≤ 1566 12x1 +16x2 ≤ 2880 x1,x2 ≥ 0 x1,x2 : Decision variables Objective function Constraints In linear programme: objective function + constraints are all linear Typically (not always): variables are non-negative If variables are integer: system called Integer Programme (IP) F. Giroire LP - Introduction 6/28
  • 7. Terminology Linear programmes can be written under the standard form: Maximize ∑n j=1 cj xj Subject to: ∑n j=1 aij xj ≤ bi for all 1 ≤ i ≤ m xj ≥ 0 for all 1 ≤ j ≤ n. (1) • the problem is a maximization; • all constraints are inequalities (and not equations); • all variables are non-negative. F. Giroire LP - Introduction 7/28
  • 8. Example 1: a resource allocation problem A company produces copper cable of 5 and 10 mm of diameter on a single production line with the following constraints: • The available copper allows to produces 21000 meters of cable of 5 mm diameter per week. • A meter of 10 mm diameter copper consumes 4 times more copper than a meter of 5 mm diameter copper. Due to demand, the weekly production of 5 mm cable is limited to 15000 meters and the production of 10 mm cable should not exceed 40% of the total production. Cable are respectively sold 50 and 200 euros the meter. What should the company produce in order to maximize its weekly revenue? F. Giroire LP - Introduction 8/28
  • 9. Example 1: a resource allocation problem A company produces copper cable of 5 and 10 mm of diameter on a single production line with the following constraints: • The available copper allows to produces 21000 meters of cable of 5 mm diameter per week. • A meter of 10 mm diameter copper consumes 4 times more copper than a meter of 5 mm diameter copper. Due to demand, the weekly production of 5 mm cable is limited to 15000 meters and the production of 10 mm cable should not exceed 40% of the total production. Cable are respectively sold 50 and 200 euros the meter. What should the company produce in order to maximize its weekly revenue? F. Giroire LP - Introduction 8/28
  • 10. Example 1: a resource allocation problem Define two decision variables: • x1: the number of thousands of meters of 5 mm cables produced every week • x2: the number of thousands meters of 10 mm cables produced every week The revenue associated to a production (x1,x2) is z = 50x1 +200x2. The capacity of production cannot be exceeded x1 +4x2 ≤ 21. F. Giroire LP - Introduction 9/28
  • 11. Example 1: a resource allocation problem The demand constraints have to be satisfied x2 ≤ 4 10 (x1 +x2) x1 ≤ 15 Negative quantities cannot be produced x1 ≥ 0,x2 ≥ 0. F. Giroire LP - Introduction 10/28
  • 12. Example 1: a resource allocation problem The model: To maximize the sell revenue, determine the solutions of the following linear programme x1 and x2: max z = 50x1 +20x2 subject to x1 +4x2 ≤ 21 −4x1 +6x2 ≤ 0 x1 ≤ 15 x1,x2 ≥ 0 F. Giroire LP - Introduction 11/28
  • 13. Example 2: Scheduling • m = 3 machines • n = 8 tasks • Each task lasts x units of time Objective: affect the tasks to the machines in order to minimize the duration • Here, the 8 tasks are finished after 7 units of times on 3 machines. F. Giroire LP - Introduction 12/28
  • 14. Example 2: Scheduling • m = 3 machines • n = 8 tasks • Each task lasts x units of time Objective: affect the tasks to the machines in order to minimize the duration • Now, the 8 tasks are accomplished after 6.5 units of time: OPT? • mn possibilities! (Here 38 = 6561) F. Giroire LP - Introduction 12/28
  • 15. Example 2: Scheduling • m = 3 machines • n = 8 tasks • Each task lasts x units of time Solution: LP model. min t subject to ∑1≤i≤n ti x j i ≤ t (∀j,1 ≤ j ≤ m) ∑1≤j≤m x j i = 1 (∀i,1 ≤ i ≤ n) with x j i = 1 if task i is affected to machine j. F. Giroire LP - Introduction 12/28
  • 16. Solving Difficult Problems • Difficulty: Large number of solutions. • Choose the best solution among 2n or n! possibilities: all solutions cannot be enumerated. • Complexity of studied problems: often NP-complete. • Solving methods: • Optimal solutions: • Graphical method (2 variables only). • Simplex method. • Approximations: • Theory of duality (assert the quality of a solution). • Approximation algorithms. F. Giroire LP - Introduction 13/28
  • 17. Graphical Method • The constraints of a linear programme define a zone of solutions. • The best point of the zone corresponds to the optimal solution. • For problem with 2 variables, easy to draw the zone of solutions and to find the optimal solution graphically. F. Giroire LP - Introduction 14/28
  • 18. Graphical Method Example: max 350x1 +300x2 subject to x1 +x2 ≤ 200 9x1 +6x2 ≤ 1566 12x1 +16x2 ≤ 2880 x1,x2 ≥ 0 F. Giroire LP - Introduction 15/28
  • 19. Graphical Method F. Giroire LP - Introduction 16/28
  • 20. Graphical Method F. Giroire LP - Introduction 17/28
  • 21. Graphical Method F. Giroire LP - Introduction 18/28
  • 22. Graphical Method F. Giroire LP - Introduction 19/28
  • 23. Graphical Method F. Giroire LP - Introduction 20/28
  • 24. Graphical Method F. Giroire LP - Introduction 21/28
  • 25. Computation of the optimal solution The optimal solution is at the intersection of the constraints: x1 +x2 = 200 (2) 9x1 +6x2 = 1566 (3) We get: x1 = 122 x2 = 78 Objective = 66100. F. Giroire LP - Introduction 22/28
  • 26. Optimal Solutions: Different Cases F. Giroire LP - Introduction 23/28
  • 27. Optimal Solutions: Different Cases Three different possible cases: • a single optimal solution, • an infinite number of optimal solutions, or • no optimal solutions. F. Giroire LP - Introduction 23/28
  • 28. Optimal Solutions: Different Cases Three different possible cases: • a single optimal solution, • an infinite number of optimal solutions, or • no optimal solutions. If an optimal solution exists, there is always a corner point optimal solution! F. Giroire LP - Introduction 23/28
  • 29. Solving Linear Programmes F. Giroire LP - Introduction 24/28
  • 30. Solving Linear Programmes • The constraints of an LP give rise to a geometrical shape: a polyhedron. • If we can determine all the corner points of the polyhedron, then we calculate the objective function at these points and take the best one as our optimal solution. • The Simplex Method intelligently moves from corner to corner until it can prove that it has found the optimal solution. F. Giroire LP - Introduction 25/28
  • 31. Solving Linear Programmes • Geometric method impossible in higher dimensions • Algebraical methods: • Simplex method (George B. Dantzig 1949): skim through the feasible solution polytope. Similar to a "Gaussian elimination". Very good in practice, but can take an exponential time. • Polynomial methods exist: • Leonid Khachiyan 1979: ellipsoid method. But more theoretical than practical. • Narendra Karmarkar 1984: a new interior method. Can be used in practice. F. Giroire LP - Introduction 26/28
  • 32. But Integer Programming (IP) is different! • Feasible region: a set of discrete points. • Corner point solution not assured. • No "efficient" way to solve an IP. • Solving it as an LP provides a relaxation and a bound on the solution. F. Giroire LP - Introduction 27/28
  • 33. Summary: To be remembered • What is a linear programme. • The graphical method of resolution. • Linear programs can be solved efficiently (polynomial). • Integer programs are a lot harder (in general no polynomial algorithms). In this case, we look for approximate solutions. F. Giroire LP - Introduction 28/28