58
Examples Graphical method Graphical simplex algorithm Chapitre 5 : Programmation linéaire, bases ENSIIE - Module de Recherche Opérationnelle Dimitri Watel ([email protected]) 2016-2017 Dimitri Watel MRO Chap 05 PL Bases

Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

Embed Size (px)

Citation preview

Page 1: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Chapitre 5 : Programmation linéaire, basesENSIIE - Module de Recherche Opérationnelle

Dimitri Watel ([email protected])

2016-2017

Dimitri Watel MRO Chap 05 PL Bases

Page 2: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Un exemple à l’école des sorciers

Hermione doit rater des cours pour sauver le monde. Plus elle enrate, plus ses chances d’aider Harry sont élevées. Mais :

Elle dort au moins 6h par jour.Un cours ou une séance de révision dure 2h. Rater un cours luiprend 3h de sa journée.Elle gagne 20 points pour Gryffondor quand elle révise ouassiste à un cours, mais en perd 50 si elle rate un cours. Ellene souhaite pas faire perdre plus de 150 points par jour à samaison.Pour éviter se faire renvoyer, elle ne peut rater plus de 5 courspar jour, et doit passer au moins 8h à réviser.

Combien de cours peut-elle rater ?

Dimitri Watel MRO Chap 05 PL Bases

Page 3: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Mise en équation

Maximiser ys.c. 20x − 50y ≥ −150 (1)

2x + 3y ≤ 18 (2)2x ≥ 8 (3)y ≤ 5 (4)

x , y ∈ N

Dimitri Watel MRO Chap 05 PL Bases

Page 4: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Mise en équation

Maximiser ys.c. 20x − 50y ≥ −150 (1)

2x + 3y ≤ 18 (2)2x ≥ 8 (3)y ≤ 5 (4)

x , y ∈ NComment le résoudre ?

Dimitri Watel MRO Chap 05 PL Bases

Page 5: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Comment le résoudre ?

x ≥ 4 (3)

2x + 3y ≤ 18 (2)⇒ 2 · 4 + 3y ≤ 18⇒ y ≤ 3.333⇒ y ≤ 3

Testons y = 3. Alors

2x + 3y ≤ 18 (2)⇒ x ≤ 9/2⇒ x ≤ 4

Or

x ≥ 4⇒ x = 4

x = 4 et y = 3 respectent toutes les contraintes. Inutile de chercherpour y plus petit car on veut maximiser y , on a une solution

optimale.Dimitri Watel MRO Chap 05 PL Bases

Page 6: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Et si Hermione pouvait...

... couper un cours en morceaux, ou faire des fautes peu graves ?Maximiser y

s.c. 20x − 50y ≥ −150 (1)2x + 3y ≤ 18 (2)

2x ≥ 8 (3)y ≤ 5 (4)

x , y ∈ R+

Dimitri Watel MRO Chap 05 PL Bases

Page 7: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Comment le résoudre ?

x ≥ 4 (3)

2x + 3y ≤ 18 (2)⇒ 2 · 4 + 3y ≤ 18⇒ y ≤ 10/3

Testons y = 10/3. Alors

2x + 3y ≤ 18 (2)⇒ x ≤ 4

Or

x ≥ 4⇒ x = 4

x = 4 et y = 10/3 respectent toutes les contraintes. Inutile dechercher pour y plus petit car on veut maximiser y , on a une

solution optimale.Dimitri Watel MRO Chap 05 PL Bases

Page 8: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Ce n’est pas toujours aussi simple !

Maximiser −x + 2ys.c. −x + y ≤ 1 (1)

x + y ≤ 3 (2)x , y ∈ N

Dimitri Watel MRO Chap 05 PL Bases

Page 9: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Ce n’est pas toujours aussi simple !

x ≥ 0, y ≥ 0

x + y ≤ 3 (2)⇒ x ≤ 3, y ≤ 3

Testons y = 3. Alors

x + y ≤ 3 (2)⇒ x ≤ 0

Or

x ≥ 0⇒ x = 0

Donc

−x + y = 3

Contradiction car −x + y ≤ 1(1)Puisqu’on veut maximiser −x + 2y , il n’est pas évident de savoir où

chercher : grand y ? petit x ? intérmédiaires ?Dimitri Watel MRO Chap 05 PL Bases

Page 10: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de programmes linéaires

Maximiser ys.c. 20x − 50y ≥ −150 (1)

2x + 3y ≤ 18 (2)2x ≥ 8 (3)y ≤ 5 (4)

x , y ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 11: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de programmes linéaires

Maximiser ys.c. 20x − 50y ≥ −150 (1)

2x + 3y ≤ 18 (2)2x ≥ 8 (3)y ≤ 5 (4)

x , y ∈ N

Dimitri Watel MRO Chap 05 PL Bases

Page 12: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de programmes linéaires

Maximiser ys.c. 20x − 50y ≥ −150 (1)

2x + 3y ≤ 18 (2)2x ≥ 8 (3)y ≤ 5 (4)x ∈ Qy ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 13: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de programmes linéaires

Minimiser 2x − 3ys.c. 20x − 50y ≥ −150 (1)

2x + 3y ≤ 18 (2)2x ≥ 8 (3)y ≤ 5 (4)x ∈ Qy ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 14: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de programmes linéaires

Minimiser 2x − 3yx ∈ Qy ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 15: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de programmes linéaires

Minimiser 2x − 3y + zs.c. x − z ≥ 1 (1)

2x + 3y + z ≤ 10 (2)x , z ∈ Qy ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 16: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de programmes linéaires

Minimiser −2x + 38zs.c. x = 1 + z (1)

2x + z = 10− 3y (2)x ∈ N

y , z ∈ D

Dimitri Watel MRO Chap 05 PL Bases

Page 17: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de programmes linéaires

Minimiser −2.3x + 0.3y + 38.7zs.c. πx − φz ≤ 1 (1)√

2x + exp(3)y + ln(12)z ≥ 1 (2)x ∈ N

y , z ∈ D

Dimitri Watel MRO Chap 05 PL Bases

Page 18: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de programmes linéaires

Minimiser xs.c. x ≤ 1 (1)

x ≥ 2 (2)x ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 19: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de non programmes linéaires

Minimiser exp(x)s.c. x + y ≤ 1 (1)

x − y ≥ 2 (2)x , y ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 20: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de non programmes linéaires

Minimiser xs.c. x + sin(y) ≤ 1 (1)

cos(x)− y ≥ 2 (2)x , y ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 21: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de non programmes linéaires

s.c. x + y ≤ 1 (1)x − y ≥ 2 (2)x , y ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 22: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemples de non programmes linéaires

Minimiser xs.c. x + y ≤ 1 (1)

x − y ≥ 2 (2)x + y ∈ N

Dimitri Watel MRO Chap 05 PL Bases

Page 23: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Généralisation

DéfinitionUn programme linéaire se définit par :

ses variables numériques et leurs ensembles de définitionsa fonction objective à optimiserses contraintes

Minimiser c1 · x1 + c2 · x2 + · · ·+ cn · xns.c. a11 · x1 + a12 · x2 + · · ·+ a1n · xn ≤ b1

a21 · x1 + a22 · x2 + · · ·+ a2n · xn ≥ b2...

am1 · x1 + am2 · x2 + · · ·+ amn · xn = bmx1, x2, . . . , xn ∈ R,N, [1, 34], . . .

Dimitri Watel MRO Chap 05 PL Bases

Page 24: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Généralisation

DéfinitionUn programme linéaire se définit par :

ses variables numériques et leurs ensembles de définitionsa fonction objective à optimiserses contraintes

Minimiser c1 · x1 + c2 · x2 + · · ·+ cn · xns.c. a11 · x1 + a12 · x2 + · · ·+ a1n · xn ≤ b1

a21 · x1 + a22 · x2 + · · ·+ a2n · xn ≥ b2...

am1 · x1 + am2 · x2 + · · ·+ amn · xn = bmx1, x2, . . . , xn ∈ R,N, [1, 34], . . .

Dimitri Watel MRO Chap 05 PL Bases

Page 25: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Généralisation

DéfinitionUn programme linéaire se définit par :

ses variables numériques et leurs ensembles de définitionsa fonction objective à optimiserses contraintes

Minimiser c1 · x1 + c2 · x2 + · · ·+ cn · xns.c. a11 · x1 + a12 · x2 + · · ·+ a1n · xn ≤ b1

a21 · x1 + a22 · x2 + · · ·+ a2n · xn ≥ b2...

am1 · x1 + am2 · x2 + · · ·+ amn · xn = bmx1, x2, . . . , xn ∈ R,N, [1, 34], . . .

Dimitri Watel MRO Chap 05 PL Bases

Page 26: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Généralisation

DéfinitionUn programme linéaire se définit par :

ses variables numériques et leurs ensembles de définitionsa fonction objective à optimiserses contraintes

Minimiser c1 · x1 + c2 · x2 + · · ·+ cn · xns.c. a11 · x1 + a12 · x2 + · · ·+ a1n · xn ≤ b1

a21 · x1 + a22 · x2 + · · ·+ a2n · xn ≥ b2...

am1 · x1 + am2 · x2 + · · ·+ amn · xn = bmx1, x2, . . . , xn ∈ R,N, [1, 34], . . .

Dimitri Watel MRO Chap 05 PL Bases

Page 27: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Écriture matricielle

Soient

c =(c1, c2, . . . , cn

)x =

(x1, x2, . . . , xn

)b =

(b1, b2, . . . , bm

) A =

a11, a12, . . . , a1na21, a22, . . . , a2n

...am1, am2, . . . , amn

Dimitri Watel MRO Chap 05 PL Bases

Page 28: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Écriture matricielle

Minimiser c1 · x1 + c2 · x2 + · · ·+ cn · xns.c. a11 · x1 + a12 · x2 + · · ·+ a1n · xn ≤ b1

a21 · x1 + a22 · x2 + · · ·+ a2n · xn ≤ b2...

am1 · x1 + am2 · x2 + · · ·+ amn · xn ≤ bmx1, x2, . . . , xn ∈ R

est équivalent à

Minimiser c · txs.c. A · tx ≤ b

x ∈ Rn

Dimitri Watel MRO Chap 05 PL Bases

Page 29: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Méthode de résolution graphique

Résolution graphiqueDans le cas d’un programme linéaire avec 2 variables, il estpossible de résoudre le problème graphiquement.

Remarque : on peut avec 3 variables, mais il faut être doué pourdessiner en 3D.Remarque : il n’est pas envisageable qu’un ordinateur utilise cetteméthode pour résoudre un tel problème ! ! ! C’est une méthode pourles humains, pour dessiner des exemples et bien comprendre laprogrammation linéaire.

Dimitri Watel MRO Chap 05 PL Bases

Page 30: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemple

Maximiser ys.c. 20x − 50y ≥ −150 (1)

2x + 3y ≤ 18 (2)2x ≥ 8 (3)y ≤ 5 (4)

x , y ∈ R+

Dimitri Watel MRO Chap 05 PL Bases

Page 31: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemple : tracer les axes

0 x

y

10

7

Dimitri Watel MRO Chap 05 PL Bases

Page 32: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemple : tracer les ensembles de définition

0 x

y

10

7

Dimitri Watel MRO Chap 05 PL Bases

Page 33: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemple : tracer les contraintes

0 x

y

10

720x − 50y = −150

2x + 3y = 18

y = 5

2x = 8

Dimitri Watel MRO Chap 05 PL Bases

Page 34: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemple : tracer l’ensemble réalisable

0 x

y

10

720x − 50y ≥ −150

2x + 3y ≤ 18

y ≤ 5

2x ≥ 8

Dimitri Watel MRO Chap 05 PL Bases

Page 35: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemple : tracer la fonction objectif

0 x

y

10

720x − 50y ≥ −150

2x + 3y ≤ 18

y ≤ 5

2x ≥ 8

y = 1

Dimitri Watel MRO Chap 05 PL Bases

Page 36: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemple : tracer la fonction objectif

0 x

y

10

720x − 50y ≥ −150

2x + 3y ≤ 18

y ≤ 5

2x ≥ 8

y = 2

Dimitri Watel MRO Chap 05 PL Bases

Page 37: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemple : tracer la fonction objectif

0 x

y

10

720x − 50y ≥ −150

2x + 3y ≤ 18

y ≤ 5

2x ≥ 8

y = 3

Dimitri Watel MRO Chap 05 PL Bases

Page 38: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemple : déduire la solution optimale

0 x

y

10

720x − 50y ≥ −150

2x + 3y ≤ 18

y ≤ 5

2x ≥ 8

y = 3.333

Dimitri Watel MRO Chap 05 PL Bases

Page 39: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Exemple : déduire la solution optimale

0 x

y

10

720x − 50y ≥ −150

2x + 3y ≤ 18

y ≤ 5

2x ≥ 8

y = 3.333

Optimal solution : (4,3.333)

Dimitri Watel MRO Chap 05 PL Bases

Page 40: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Autre exemple : 2e exemple simple

Minimiser 2x + ys.c. x + y ≤ 1 (1)

x + y ≥ −1 (2)x − y ≤ 1 (3)x − y ≥ −1 (4)x , y ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 41: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Autre exemple : Si la fonction objective est parallèle à unecontrainte.

Minimiser x + ys.c. x + y ≤ 1 (1)

x + y ≥ −1 (2)x − y ≤ 1 (3)x − y ≥ −1 (4)x , y ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 42: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Autre exemple : Si l’ensemble des solutions réalisables estvide.

Maximiser ys.c. x + y ≥ 1 (1)

x + y ≤ −1 (2)x − y ≤ 1 (3)x − y ≥ −1 (4)x , y ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 43: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Autre exemple : Si l’ensemble des solutions réalisables n’estpas borné.

Maximiser yx + y ≥ −1 (2)x − y ≤ 1 (3)x − y ≥ −1 (4)x , y ∈ R

Dimitri Watel MRO Chap 05 PL Bases

Page 44: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Autre exemple : Si une ou deux variables sont entières.

Maximiser 2x + ys.c. 2x + 2y ≤ 5 (1)

2x + 2y ≥ −5 (2)2x − 2y ≤ 5 (3)2x − 2y ≥ −5 (4)

x , y ∈ N

Dimitri Watel MRO Chap 05 PL Bases

Page 45: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

L’algorithme du simplexe

DéfinitionL’algorithme du simplexe est un algorithme de résolution deprogramme linéaire par descente de gradient.

On va voir comment il fonctionne graphiquement. Le prochainchapitre vous expliquera comment l’implémenter.

Dimitri Watel MRO Chap 05 PL Bases

Page 46: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Solution de base

0 x

y

Dimitri Watel MRO Chap 05 PL Bases

Page 47: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Solution de base

0 x

y

Solution de base

Dimitri Watel MRO Chap 05 PL Bases

Page 48: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Solution de base

0 x

y

Solution de base réalisables

Dimitri Watel MRO Chap 05 PL Bases

Page 49: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Solution de base

0 x

y

Fonction objective : max 2x + y

Dimitri Watel MRO Chap 05 PL Bases

Page 50: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Solution de base

0 x

y

Fonction objective : max 2x + y

0

3

8

11.33

9.75

Dimitri Watel MRO Chap 05 PL Bases

Page 51: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Solution de base

0 x

y

0

3

8

11.33

9.75Solution optimale

Dimitri Watel MRO Chap 05 PL Bases

Page 52: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Algorithme du simplexe : principe

0 x

y

1. Trouver une solution de base réa-lisable (n’importe laquelle, n’importecomment).

0

Dimitri Watel MRO Chap 05 PL Bases

Page 53: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Algorithme du simplexe : principe

0 x

y

~∆(f )

2. Calculer la dérivée de l’objectifvers les voisins.

Dimitri Watel MRO Chap 05 PL Bases

Page 54: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Algorithme du simplexe : principe

0 x

y

~∆(f )

2. Calculer la dérivée de l’objectifvers les voisins.

21

Dimitri Watel MRO Chap 05 PL Bases

Page 55: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Algorithme du simplexe : principe

0 x

y

2

3. Conserver la meilleure solution.

4

Dimitri Watel MRO Chap 05 PL Bases

Page 56: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Algorithme du simplexe : principe

0 x

y

~∆(f )

2-21

4. Recommencer.

Dimitri Watel MRO Chap 05 PL Bases

Page 57: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Algorithme du simplexe : principe

0 x

y

1

7.33

Dimitri Watel MRO Chap 05 PL Bases

Page 58: Chapitre 5 : Programmation linéaire, bases - ENSIIE ... · Examples Graphical method Graphical simplex algorithm Miseenéquation Maximiser y s.c. 20x 50y 150 (1) 2x + 3y 18 (2) 2x

ExamplesGraphical method

Graphical simplex algorithm

Algorithme du simplexe : principe

0 x

y

-1.1

-1

5. Si les deux directions déteriorentla solution, elle est optimale.

Dimitri Watel MRO Chap 05 PL Bases