Académique Documents
Professionnel Documents
Culture Documents
Simplexe e Et Dualite PDF
Simplexe e Et Dualite PDF
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
Simplexe
Dualit
e
Recherche operationnelle
Tentative de definition
Ioan Todinca
Ioan.Todinca@univ-orleans.fr
t
el. 02 38 41 72 93
bureau : en bas `
a gauche
1/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
2/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Programmation lineaire
Broadcast de co
ut minimum dans un reseau
Mod
elisation dun probl`eme reel
resoudre
3/56
4/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
Simplexe
Plan du cours
De nombreux probl`
emes reels peuvent etre exprimes comme
2. Lalgorithme du simplexe
4. Dualite
5/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Dualit
e
Un exemple : le probl`eme
6/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
maximiser
contraintes
7/56
Pb xb + Pm xm
xb + xm H
xb 0
xm 0
Eb xb + Em xm E
Ib xb + Im xm I
8/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
Simplexe
Un autre exemple
Variables r
eelles :
x1 , x2 , . . . , xn
z = c1 x1 + c2 x2 + + cn xn
Contraintes lin
eaires (egalites ou inegalites) :
Introduction
M
ethode graphique
Dualit
e
Simplexe
Dualit
e
10/56
Introduction
M
ethode graphique
La methode graphique
Simplexe
Dualit
e
La methode graphique
Variables : x et y (ou x1 et x2 ).
Lensemble de points qui satisfont une
equation (egalite)
Exemple :
max
contraintes :
x1
2x1
x1
2x1
x1
+ x2
+ x2 14
2x2 8
x2 10
0
x2
0
demi-plan.
polygone convexe.
11/56
12/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
Simplexe
Questions
Variables : x1 , . . . , xn
solution.
optimale.
demi-espace.
Essayer de r
esoudre par la methode graphique le syst`eme
poly`edre convexe.
suivant :
objectif :
contraintes :
max 2x + y
x2 + y2 1
x 0, y 0
13/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Dualit
e
14/56
Introduction
Algorithme du simplexe
M
ethode graphique
Simplexe
Dualit
e
max
n
X
cj xj
j=1
Algorithme de r
esolution de programmes lineaires
Facile `
a comprendre et `a implanter
contraintes :
Efficace en pratique, m
eme pour un nombre important de
n
X
j=1
variables et de contraintes
aij xj bi
xj 0
Efficacit
e au pire cas : on en reparlera, voir aussi cours
dalgorithmique.
i = 1, 2, . . . , m
j = 1, 2, . . . , n
15/56
16/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
Simplexe : un exemple
Simplexe
Dualit
e
Variables decart
PL equivalent :
max
5x1
contraintes 2x1
4x1
3x1
x1 ,
+ 4x2
+ 3x2
+ x2
+ 4x2
x2 ,
+ 3x3
+ x3
+ 2x3
+ 2x3
x3
x4
x5
x6
z
5
11
8
0
= 5 2x1
= 11 4x1
= 8 3x1
=
5x1
3x2
x2
4x2
+ 4x2
x3
2x3
2x3
+ 3x3
17/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
18/56
Introduction
M
ethode graphique
Augmenter x1
Dualit
e
Nouveau dictionnaire
x1 =
x5 =
x6 =
1. De combien ?
x1 52 car x4 = 5 2x1 3x2 x3 0.
2. Nouvelle solution ?
x1 = 12 , x2 = x3 = x4 = 0, x5 = 1, x6 =
Simplexe
1
2
;z=
25
2 .
Augmenter qui?
x3
19/56
5
2
1 +
1
2 +
25
2
3
2 x2
5x2
1
2 x2
1
2 x3
7
2 x2
De combien?
x3 = 1 (x6 = . . . )
1
2 x3
+
+
1
2 x4
2x4
3
2 x4
1
2 x3
5
4 x4
Quobtient-on?
`a droite : x2 , x3 , x6
20/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
Simplexe
Dualit
e
max
x3
x1
x5
z
= 1
= 2
= 1
= 13
+ x2
2x2
+ 5x2
3x2
+ 3x4 2x6
2x4 + x6
+ 2x4
x4 x6
cj xj
j=1
contraintes :
n
X
aij xj bi
i = 1, 2, . . . , m
j=1
xj 0
Solution actuelle : x2 = x4 = x6 = 0, x1 = 2, x3 = 1, x5 = 1 ;
objectif : z = 13
j = 1, 2, . . . , n
On introduit m variables d
ecart :
n
X
aij xj
(i = 1 . . . , m)
j=1
La i`
eme contrainte devient xn+i 0.
21/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Premier dictionnaire
xn+i
z
= bi
=
n
X
n
X
aij xj
(i = 1, . . . , m)
M
ethode graphique
x4
x5
x6
z
cj xj
j=1
(k = 1, . . . n + m)
Simplexe
Dualit
e
= 5 2x1
= 11 4x1
= 8 3x1
=
5x1
3x2
x2
4x2
+ 4x2
x3
2x3
2x3
+ 3x3
n + m + 1 variables x1 , . . . , xn+m et z
toujours le cas
m
equations lineaires de type xk = . . .
tous les membres droits ont les m
emes n variables
xk 0
Introduction
j=1
22/56
(k = 1, . . . n + m)
23/56
24/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
= 5 2x1
= 11 4x1
= 8 3x1
=
5x1
3x2
x2
4x2
+ 4x2
M
ethode graphique
x3
2x3
2x3
+ 3x3
Simplexe
augmenter xk
25/56
Dualit
e
26/56
Introduction
M
ethode graphique
max
contraintes
5x1
x1
x1
2x1
2x1
x1 ,
+ 5x2 + 3x3
+ 3x2 + x3
+ 3x3
x2 + 2x3
+ 3x2 x3
x2 ,
x3
Dualit
e
Algorithme du simplexe
Introduction
Simplexe
Simplexe
Dualit
e
3
2
4
2
0
min z
P
P
max z
ai xP
i =b
P
ai xi b et
ai xi b
ai xP
i b
ai xi b
pas de contrainte x 0
27/56
28/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
Simplexe
Dualit
e
Iteration
29/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
30/56
Introduction
M
ethode graphique
Dictionnaires degeneres
Simplexe
Dualit
e
Terminaison
Lemme
Si deux dictionnaires ont les memes variables de base, ils sont
identiques.
Theor`eme
31/56
32/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
Simplexe
Dualit
e
Dans la pratique :
Le nombre dit
erations est proportionnel au nombre de
Croit tr`
es peu avec le nombre n de variables initiales.
En le r
esolvant, nous trouverons un dictionnaire faisable du
Minty 1972].
Nombre
de dictionnaires : autant que de bases possibles, donc
n+m
.
m
33/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
n
X
34/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Initialisation : exemple
cj xj
j=1
contraintes :
n
X
aij xj bi
j=1
xj 0
max
contraintes
i = 1, 2, . . . , m
j = 1, 2, . . . , n
devient :
min
contraintes :
x0
n
X
j=1
aij xj x0 bi
xj 0
x1
2x1
2x1
x1
x1 ,
x2
x2
3x2
+ x2
x2 ,
+ x3
+ 2x3
+ x3
2x3
x3
4
5
1
i = 1, 2, . . . , m
j = 0, 1, . . . , n
35/56
36/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
Simplexe
Dualit
e
Observer graphiquement l
evolution de lalgorithme du
x1
2x1
x1
2x1
x1 ,
+ x2
+ x2
+ 2x2
x2
x2
max
contraintes :
14
8
10
0
x1
2x1
x1
2x1
x1 ,
+ x2
+ x2
+ 2x2
x2
x2
14
8
10
0
Version tr`
es facilement implantable
Les d
eplacements dune solution `a la suivante se font le
37/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
0
1
0
0
0 14
0 8
1 10
0 0
2
1 1
1
2 0
2 1 0
1
1 0
0
1
0
0
0 14
0 8
1 10
0 0
Introduction
M
ethode graphique
Simplexe
Dualit
e
0
1
0
0
0 14
0 8
1 10
0 0
Li := Li ri Lpivot
2
1 1
12
1 0
2 1 0
1
1 0
Choix de la ligne pivot : celle qui minimise sri parmi toutes les
i
lignes avec ri positif (ri , resp. si sont les elements de la i`eme ligne
se trouvant sur la colonne pivot, resp. la derni`ere colonne.)
38/56
5
2
12
39/56
0
1
2 1
1
1
5
2
0 0 14
1
4
2 0
0 1 10
0 0 0
1 12 0 10
1
0
4
2 0
0
0 1 10
0
0 0 0
0 1 12
10
40/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
M
ethode graphique
... et on recommence
5
2
12
3
2
3
2
0
1
0
0
1 12
1
0
2
1
0
2
0 12
0 10
0
4
1 14
0 4
1 0
12 1
3
2 0
3
2 0
2
1
5 5
1
0
2
1
0
2
0 12
0
4
4
0
1 14
0 4
1 0
0 1
3
2 0
3
2 0
2
5
1
5
0
0
15
2
5
1
2
12
1
0
0
0
Introduction
2
0
5
1
1
5
0 53
0 35
51
2
5
1
5
51
dans le primal)
primal)
0
4
0
6
1
8
0 4
41/56
M
ethode graphique
max
Simplexe
Dualit
e
n
X
Introduction
M
ethode graphique
Preuve:
aij xj bi
xj 0
i = 1, 2, . . . , m
z
j = 1, 2, . . . , n
Dual :
min
bi y i
i=1
contraintes :
m
X
i=1
Dualit
e
cj xj
j=1
m
X
Simplexe
j=1
contraintes :
42/56
0
4
0
6
1
8
0 10
Primal :
n
X
Dualit
e
Dualite
0
4
0
6
1 14
0 4
2
1
1 0
5 5
1
2
0 1
5
5
3
1
0 0 5
5
3
0 12
2 0
Simplexe
aij yi cj
yi 0
j = 1, 2, . . . , n
i = 1, 2, . . . , m
n
X
j=1
n
X
cj xj
m
X
(
aij yi )xj
j=1 i=1
m X
n
X
i=1 j=1
m
X
bi yi
aij xj )yi
m
X
aij yi
i=1
commutativite, associativite
contraintes primal :
n
X
aij xj bi
j=1
objectif dual
i=1
= w
43/56
44/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Introduction
Dualite et applications
cj xj =
j=1
Dualit
e
Simplexe
Theor`eme (Dualite)
n
X
M
ethode graphique
bi yi .
i=1
son optimalite!
Interpr
etation economique : la solution optimale du dual nous
45/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
46/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Soit
z = z +
n
X
c j xi +
j=1
m
X
c n+i xn+i
z=
i=1
et dapr`es le dernier
z = z +
n
X
j=1
cj xj
j=1
2. satisfait
n
X
c j xj +
m
X
c n+i xn+i
i=1
bi yi = z ,
i=1
48/56
Introduction
M
ethode graphique
z=
=
n
X
c j xj +
j=1
= z +
= z +
n
X
j=1
n
X
c j xj
c j xj
= (z
=
m
X
i=1
m
X
Introduction
M
ethode graphique
yi xn+i
xn+i = bi
n
X
yi (bi
m
X
j=1
i=1
bi yi ) +
(z
yi = c n+i
c n+i xn+i
i=1
n
X
i=1
Dualit
e
dernier dico
i=1
j=1
m
X
n
X
m
X
Simplexe
n
X
m
X
bi yi ) +
i=1
m
X
comm., assoc.
aij yi )xj
i=1
j=1
En mettant xj := 0, j = 1, . . . , n on obtient
aij xj
bi yi = z ,
i=1
j=1
(c j +
Dualit
e
n
m
n
X
X
X
(c j +
aij yi )xj =
cj xj
j=1
j=1
aij xj )
Simplexe
donc
premier dico
w = z
cj xj
j=1
49/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
(c j +
m
X
aij yi )xj
i=1
n
X
Introduction
M
ethode graphique
Simplexe
Dualit
e
j=1
une solution
Soient x1 , . . . , xn une solution du primal et y1 , . . . , ym
du primal. Ces deux solutions sont simultanement optimales si et
seulement si
1. pour tout j = 1, . . . , n,
yi 0 ;
m
X
50/56
i=1
aij yi + c j = cj
2. et pour tout i = 1, . . . , m,
i=1
n
X
j=1
aij yi cj .
51/56
52/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
Rappel :
z
n
X
j=1
n
X
cj xj
aij xj )yi
i=1 j=1
m
X
n
X
si xj > 0 alors la j`
eme contrainte du dual est atteinte
m
X
(
aij yi = cj ) ;
aij xj bi
i=1
si la i`
eme contrainte du primal nest pas atteinte
objectif dual
m
X
(
aij xj < bi ) alors yi = 0.
i=1
= w
j=1
la j`
eme contrainte du dual est atteinte ou xj = 0 ;
la i`
eme contrainte du primal est atteinte ou yi = 0 ;
53/56
Introduction
M
ethode graphique
Simplexe
Dualit
e
max
Primal
n
X
cj xj
min
j=1
contr :
Dualit
e
j=1
bi yi
Simplexe
aij yi
commutativite, associativite
contraintes primal :
M
ethode graphique
i=1
m
X
(
aij yi )xj
j=1 i=1
m X
n
X
m
X
Introduction
n
X
j=1
contr :
M
ethode graphique
Dualit
e
aij yi cj
contr. :
i=1
yi 0
xj 0
pour tout i = 1, . . . , m et tout j = 1, . . . , n.
z : profit (en euros).
xj : quantite du produit j.
bi : quantite de la ressource i.
cj : euros/unite du produit j.
aij : unites de ressource i / unite de produit j.
yi : euros/unite de ressource i.
Simplexe
Theor`eme
Dual
m
X
bi yi
m
X
Introduction
i=1
aij xj bi
54/56
Pn
j=1 aij xj bi + ti
xj 0
i = 1, 2, . . . , m
j = 1, 2, . . . , n
m
X
yi ti
i=1
est une
o`
u
est la valeur optimale du PL initial et y1 , . . . , ym
solution optimale de son dual.
55/56
56/56