Leçon3 Méthode Tableaux VF 4 11 20
Leçon3 Méthode Tableaux VF 4 11 20
Leçon3 Méthode Tableaux VF 4 11 20
Polytechnique
Master 1 : TIUF
1- Introduction
La méthode algébrique de résolution des programmes linéaires,
devient compliquée et nécessite une très grande attention dès
que le nombre des variables et de contraintes est important.
Il est possible d’adopter une représentation sous forme de
tableaux qui facilite considérablement les calculs. On effectue
généralement les calculs sur le tableau des coefficients qui porte
le nom de Tableau Simplexe.
Mais il faut bien garder à l’esprit que ce tableau et les opérations
que l’on va y effectuer ne sont qu’une traduction des opérations
sur le système d’équations algébriques correspondantes.
Algorithme du simplexe
2- Illustration de l’algorithme
Contenu du programme
Nous décrirons le déroulement de la méthode du simplexe
en l’appliquant au programme linéaire suivant introduit au
chapitre 2.
1 Contenu
0 1 0 0du 4
programme
A= 0 2 0 1 0 b= 12
3 2 0 0 1 18
c= 300 500 0 0 0
Tableau initial
On construit un tableau initial du simplexe, qui se compose du
vecteur b, de la matrice A, et d’une ligne [0, c] situés sous les
précédents où 0 correspond à la valeur de z à l’origine (lorsque
x 1 = x 2 = 0) :
valeur de z vecteur c
Algorithme du simplexe
variable entrante
colonne pivot
Algorithme du simplexe
Variable entrante
Première itération
B b x1 x2 x3 x4 x5 B b x1 x2 x3 x4 x5
x3 4 1 0 1 0 0 x3 4 1 0 1 0 0
1 1
x4 6 0 1 0 0 x2 6 0 1 0 0
2 2
x5 18 3 2 0 0 1 x5 18 3 0 0 0 1
B b x2 xj
b a
x4 2 c
x3 4 1 0 1 0 0
1
x2 6 0 1 0 0
2
x5 6 3 0 0 -1 1
Deuxième itération
Le maximum de la fonction z est atteint lorsqu’il n’y a plus de
coefficients positifs dans la dernière ligne. On poursuit les
changements de base et les pivotages, conformément aux règles
exposées ci-dessus, jusqu’à ce qu’on y parvienne.
– Comme il ne reste plus comme coefficient positif (dans la
dernière ligne) que 300, on introduit x 1 dans la base. La
colonne de x1 devient la colonnepivot.
– La division de la colonne des seconds membres par la
colonne pivot révèle que le plus faible rapport correspond à
la ligne x5. C’est x5 qui quitte la base. Alors le nombre 3
devient le nouveau pivot
Algorithme du simplexe
B b x1 x2 x3 x4 x5
x3 4 0 0 1 0 0
1
x2 6 0 1 0 0
2
-1 1
x1 2 1 0 0 3 3
z −3000 0 0 0 −250 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5
1 1
x3 2 0 0 1 3 -3
1
x2 6 0 1 0 0
2
x1 - 1 1
2 1 0 0 3 3
z −3600 0 0 0 -150 -100
Algorithme du simplexe
𝑥2 deuxième itération
(2, 6)
(0, 6)
première itération
(4, 3)
(0, 0)
(4, 0) 𝑥1
le chemin suivi par l’algorithme du simplexe
... 0
. . . . . . . .
xn+m bm am1 am2 ... amn 0 0 ... 1
Étape 1 :
Dans le cas où toutes les contraintes initiales d’un programme
linéaire se présentent sous forme de contraintes d’inégalités du
type "inférieur ou égal" avec un membre de droite positif, on
réécrit d’abord le programme sous forme standard en ajoutant
des variables d’écart. Puis on met les variables de décisions
(variables originales) hors base et les variables d’écart en base.
Étape 2 :
Si les coefficients cj sont tous ≤ 0, alors STOP : la solution de
la base actuelle est optimale. Sinon, choisir la variable hors
base dont le coefficient dans la dernière ligne est positif et le
plus grand possible. Soit xr la variable entrante.
... 0
. . . . . . . . .
xn+m bm am1 . . . amr . . . amn 0 0 ... 1
z −zB c1 . . . cr . . . cn 0 0 ... 0
Algorithme du simplexe
Étape 3 :
Choisir comme variable sortante la première variable de base à
s’annuler. Pour cela, on calcule le minimum du rapport du
second membre bi sur le coefficient air de la variable entrante
dans la même ligne lorsque air > 0. Soit l la ligne où le minimum
se produit :
𝑏𝑙 𝑏𝑖
𝑎𝑙𝑟
= min 𝑎𝑖𝑟
: 𝑎𝑖𝑟 > 0
La variable sortante est celle qui correspond à la ligne où le
minimum se produit. Soit xs la variable sortante. On colore la
ligne correspondante qui est appelée ligne pivot. Il en résulte le
tableau suivant :
Algorithme du simplexe
z −zB c1 . . . cr . . . cn 0 0 ... 0
Étape 4 :
′
alors , 𝑎 la transformée de 𝑎 , s’obtient en retranchant de a le
produit b x c par le pivot 𝑎𝑠𝑟 :
𝑏×𝑐
𝑎′= 𝑎 - 𝑎𝑠𝑟
Remarque importante :
Toute ligne possédant un zéro dans la colonne du pivot reste
inchangée ; de même, toute colonne possédant un zéro dans la
ligne du pivot reste inchangée.
Algorithme du simplexe
Application
Algorithme du simplexe
Modélisation du problème
Formulation équivalente
B b x1 x2 x3 x4 x5 x6 x7
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
2 4 5 7 1 0 0
1 1 2 2 0 1 0
1 2 3 3 0 0 1
B b x1 x2 x3 x4 x5 x6 x7
2 4 5 7 1 0 0
1 1 2 2 0 1 0
1 2 3 3 0 0 1
7 9 18 17 0 0 0
B b x1 x2 x3 x4 x5 x6 x7
42 2 4 5 7 1 0 0
17 1 1 2 2 0 1 0
24 1 2 3 3 0 0 1
7 9 18 17 0 0 0
B b x1 x2 x3 x4 x5 x6 x7
42 2 4 5 7 1 0 0
17 1 1 2 2 0 1 0
24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 17 1 1 2 2 0 1 0
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
colonne pivot
Algorithme du simplexe
colonne pivot
Algorithme du simplexe
colonne pivot
Algorithme du simplexe
colonne pivot
colonne pivot
Pivot
Pivot
variable entrante
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 17 1 1 2 2 0 1 0
variable x7 24 1 2 3 3 0 0 1
sortante
0 7 9 18 17 0 0 0
Pivot
variable entrante
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 17 1 1 2 2 0 1 0
variable x7 24 1 2 3 3 0 0 1
sortante
0 7 9 18 17 0 0 0
0 7 9 18 17 0 0 0
Algorithme du simplexe
0 7 9 18 17 0 0 0
Algorithme du simplexe
0 7 9 0 17 0 0 0
Algorithme du simplexe
B b x3 xj
b a
x7 3 c
z
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 17 1 1 2 2 0 1 0
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0 Transformation
x6 17 1 1 2 2 0 1 0 de la ligne
x7 pivot
24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
x3 1 2 1
8 3 3 1 1 0 0 3
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0 Transformation
x6 17 1 1 2 2 0 1 0 de la colonne
x7 pivot
24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
0
0
x3 1 2 1
8 3 3 1 1 0 0 3
0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0 Colonne ayant
x6 17 1 1 2 2 0 1 0 un 0 dans la
x7 ligne pivot
24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
x5 0 1 0
x6 0 0 1
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 24 × 5
17 1 1 2 2 0 1 0 42 −
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
x5 2 0 1 0
x6 0 0 1
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 1×5
17 1 1 2 2 0 1 0 2−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
x5 1
2 3 0 1 0
x6 0 0 1
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 2×5
17 1 1 2 2 0 1 0 4−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
x5 1 2
2 3 3 0 1 0
x6 0 0 1
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 3×5
17 1 1 2 2 0 1 0 7−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
x5 1 2
2 3 3 0 2 1 0
x6 0 0 1
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 1×5
17 1 1 2 2 0 1 0 0−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
x6 0 0 1
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 24 × 2
17 1 1 2 2 0 1 0 17 −
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
x6 1 0 0 1
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 1×2
17 1 1 2 2 0 1 0 1−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
x6 1
1 3 0 0 1
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 2×2
17 1 1 2 2 0 1 0 1−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 1
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 3×2
17 1 1 2 2 0 1 0 2−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 0 1
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 1×2
17 1 1 2 2 0 1 0 0−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 0 1 − 23
x3 1 2 1
8 3 3 1 1 0 0 3
0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 24 × 18
17 1 1 2 2 0 1 0 0−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 0 1 − 23
x3 1 2 1
8 3 3 1 1 0 0 3
−144 0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 1 × 18
17 1 1 2 2 0 1 0 7−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 0 1 − 23
x3 1 2 1
8 3 3 1 1 0 0 3
−144 1 0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 2 × 18
17 1 1 2 2 0 1 0 9−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 0 1 − 23
x3 1 2 1
8 3 3 1 1 0 0 3
−144 1 −3 0 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 3 × 18
17 1 1 2 2 0 1 0 17 −
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 0 1 − 23
x3 1 2 1
8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 1 × 18
17 1 1 2 2 0 1 0 0−
3
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 0 1 − 23
x3 1 2 1
8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
x5 42 2 4 5 7 1 0 0
x6 17 1 1 2 2 0 1 0 OK
x7 24 1 2 3 3 0 0 1
0 7 9 18 17 0 0 0
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 0 1 − 23
x3 1 2 1
8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 0 1 − 23
x3 1 2 1
8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
Transformation
1
x6 1 3 − 13 0 0 0 1 − 23 de la ligne
x3 1 2 1 pivot
8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x1 3 1 −1 0 0 0 3 −2
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
Transformation
1
x6 1 3 − 13 0 0 0 1 − 23 de la colonne
x3 1 2 1 pivot
8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
0
x1 3 1 −1 0 0 0 3 −2
0
0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
Colonne ayant
1
x6 1 3 − 13 0 0 0 1 − 23 un 0 dans la
x3 1 2 1 ligne pivot
8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x5 0 0 2 1
x1 3 1 −1 0 0 0 3 −2
x3 0 1 1 0
0 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1
1 1× 3
x6 1 3 − 13 0 0 0 1 − 23 2− 1
1 2 1 3
x3 8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x5 1 0 0 2 1
x1 3 1 −1 0 0 0 3 −2
x3 0 1 1 0
0 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1 2 − 13 × 1
3
x6 1 3 − 13 0 0 0 1 − 23 3 − 1
1 2 1 3
x3 8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1
x1 3 1 −1 0 0 0 3 −2
x3 0 1 1 0
0 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1
1 1× 3
x6 1 3 − 13 0 0 0 1 − 23 0− 1
1 2 1 3
x3 8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1
x1 3 1 −1 0 0 0 3 −2
x3 0 1 1 0
0 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
− 23 × 1
x6 1 1
3 − 13 0 0 0 1 − 23 − 53 − 1
3
1 2 1 3
x3 8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1 −1
x1 3 1 −1 0 0 0 3 −2
x3 0 1 1 0
0 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1
1 1× 3
x6 1 3 − 13 0 0 0 1 − 23 8− 1
1 2 1 3
x3 8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1 −1
x1 3 1 −1 0 0 0 3 −2
x3 7 0 1 1 0
0 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1 2 − 13 × 1
3
x6 1 3 − 13 0 0 0 1 − 23 3 − 1
1 2 1 3
x3 8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1 −1
x1 3 1 −1 0 0 0 3 −2
x3 7 0 1 1 1 0
0 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1
1 1× 3
x6 1 3 − 13 0 0 0 1 − 23 0− 1
1 2 1 3
x3 8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1 −1
x1 3 1 −1 0 0 0 3 −2
x3 7 0 1 1 1 0 −1
0 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1 1 − 23 × 1
3
x6 1 3 − 13 0 0 0 1 − 23 3 − 1
1 2 1 3
x3 8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1 −1
x1 3 1 −1 0 0 0 3 −2
x3 7 0 1 1 1 0 −1 1
0 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1×1
x6 1 1
− 13 0 0 0 1 − 23 −144 − 1
3
3
x3 1 2 1
8 3 3 1 1 0 0 3
−144 113 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1 −1
x1 3 1 −1 0 0 0 3 −2
x3 73 0 1 1 1 0 −1 1
−147 0 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1 − 13 × 1
x6 1 3 − 13 0 0 0 1 − 23 −3 − 1
1 2 1 3
x3 8 3 3 1 1 0 0 3
−144 113 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1 −1
x1 3 1 −1 0 0 0 3 −2
x3 7 0 −1
1 1 1 0 −1 1
−147 0 −2 0 −1 0
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1×1
x6 1 1
− 13 0 0 0 1 − 23 0− 1
3
3
x3 1 2 1
8 3 3 1 1 0 0 3
−144 113 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1 −1
x1 3 1 −1 0 0 0 3 −2
x3 7 0 1 1 1 0 −1
3 1
−147 0 −2 0 −1 0 −3
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1 − 23 × 1
x6 1 3 − 13 0 0 0 1 − 23 −6 − 1
1 2 1 3
x3 8 3 3 1 1 0 0 3
−144 113 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1 −1
x1 3 1 −1 0 0 0 3 −2
x3 7 0 1 1 1 0 −1 −2
1
−147 0 −2 0 −1 0 −3 −4
Algorithme du simplexe
B b x1 x2 x3 x4 x5 x6 x7
1 2
x5 2 3 3 0 2 1 0 − 53
1
x6 1 3 − 13 0 0 0 1 − 23 OK
x3 1 2 1
8 3 3 1 1 0 0 3
−144 1 −3 0 −1 0 0 −6
x5 1 0 1 0 2 1 −1 −1
x1 3 1 −1 0 0 0 3 −2
x3 7 0 1 1 1 0 −1 1
−147 0 −2 0 −1 0 −3 −4