\( %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Mes commandes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\multirows}[3]{\multirow{#1}{#2}{$#3$}}%pour rester en mode math \renewcommand{\arraystretch}{1.3}%pour augmenter la taille des case \newcommand{\point}[1]{\marginnote{\small\vspace*{-1em} #1}}%pour indiquer les points ou le temps \newcommand{\dpl}[1]{\displaystyle{#1}}%megamode \newcommand{\A}{\mathscr{A}} \newcommand{\LN}{\mathscr{N}} \newcommand{\LL}{\mathscr{L}} \newcommand{\K}{\mathbb{K}} \newcommand{\N}{\mathbb{N}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\R}{\mathbb{R}} \newcommand{\C}{\mathbb{C}} \newcommand{\M}{\mathcal{M}} \newcommand{\D}{\mathbb{D}} \newcommand{\E}{\mathcal{E}} \renewcommand{\P}{\mathcal{P}} \newcommand{\G}{\mathcal{G}} \newcommand{\Kk}{\mathcal{K}} \newcommand{\Cc}{\mathcal{C}} \newcommand{\Zz}{\mathcal{Z}} \newcommand{\Ss}{\mathcal{S}} \newcommand{\B}{\mathbb{B}} \newcommand{\inde}{\bot\!\!\!\bot} \newcommand{\Proba}{\mathbb{P}} \newcommand{\Esp}[1]{\dpl{\mathbb{E}\left(#1\right)}} \newcommand{\Var}[1]{\dpl{\mathbb{V}\left(#1\right)}} \newcommand{\Cov}[1]{\dpl{Cov\left(#1\right)}} \newcommand{\base}{\mathcal{B}} \newcommand{\Som}{\textbf{Som}} \newcommand{\Chain}{\textbf{Chain}} \newcommand{\Ar}{\textbf{Ar}} \newcommand{\Arc}{\textbf{Arc}} \newcommand{\Min}{\text{Min}} \newcommand{\Max}{\text{Max}} \newcommand{\Ker}{\text{Ker}} \renewcommand{\Im}{\text{Im}} \newcommand{\Sup}{\text{Sup}} \newcommand{\Inf}{\text{Inf}} \renewcommand{\det}{\texttt{det}} \newcommand{\GL}{\text{GL}} \newcommand{\crossmark}{\text{\ding{55}}} \renewcommand{\checkmark}{\text{\ding{51}}} \newcommand{\Card}{\sharp} \newcommand{\Surligne}[2]{\text{\colorbox{#1}{ #2 }}} \newcommand{\SurligneMM}[2]{\text{\colorbox{#1}{ #2 }}} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \renewcommand{\lim}[1]{\underset{#1}{lim}\,} \newcommand{\nonor}[1]{\left|#1\right|} \newcommand{\Un}{1\!\!1} \newcommand{\sepon}{\setlength{\columnseprule}{0.5pt}} \newcommand{\sepoff}{\setlength{\columnseprule}{0pt}} \newcommand{\flux}{Flux} \newcommand{\Cpp}{\texttt{C++\ }} \newcommand{\Python}{\texttt{Python\ }} %\newcommand{\comb}[2]{\begin{pmatrix} #1\\ #2\end{pmatrix}} \newcommand{\comb}[2]{C_{#1}^{#2}} \newcommand{\arrang}[2]{A_{#1}^{#2}} \newcommand{\supp}[1]{Supp\left(#1\right)} \newcommand{\BB}{\mathcal{B}} \newcommand{\arc}[1]{\overset{\rotatebox{90}{)}}{#1}} \newcommand{\modpi}{\equiv_{2\pi}} \renewcommand{\Re}{Re} \renewcommand{\Im}{Im} \renewcommand{\bar}[1]{\overline{#1}} \newcommand{\mat}{\mathcal{M}} \newcommand{\und}[1]{{\mathbf{\color{red}\underline{#1}}}} \newcommand{\rdots}{\text{\reflectbox{$\ddots$}}} \newcommand{\Compa}{Compa} \newcommand{\dint}{\dpl{\int}} \newcommand{\intEFF}[2]{\left[\!\left[#1 ; #2\right]\!\right]} \newcommand{\intEFO}[2]{\left[\!\left[#1 ; #2\right[\!\right[} \newcommand{\intEOF}[2]{\left]\!\left]#1 ; #2\right]\!\right]} \newcommand{\intEOO}[2]{\left]\!\left]#1 ; #2\right[\!\right[} \newcommand{\ou}{\vee} \newcommand{\et}{\wedge} \newcommand{\non}{\neg} \newcommand{\implique}{\Rightarrow} \newcommand{\equivalent}{\Leftrightarrow} \newcommand{\Ab}{\overline{A}} \newcommand{\Bb}{\overline{B}} \newcommand{\Cb}{\overline{C}} \newcommand{\Cl}{\texttt{Cl}} \newcommand{\ab}{\overline{a}} \newcommand{\bb}{\overline{b}} \newcommand{\cb}{\overline{c}} \newcommand{\Rel}{\mathcal{R}} \newcommand{\superepsilon}{\varepsilon\!\!\varepsilon} \newcommand{\supere}{e\!\!e} \makeatletter \newenvironment{console}{\noindent\color{white}\begin{lrbox}{\@tempboxa}\begin{minipage}{\columnwidth} \ttfamily \bfseries\vspace*{0.5cm}} {\vspace*{0.5cm}\end{minipage}\end{lrbox}\colorbox{black}{\usebox{\@tempboxa}} } \makeatother \def\ie{\textit{i.e. }} \def\cf{\textit{c.f. }} \def\vide{ { $ {\text{ }} $ } } %Commande pour les vecteurs \newcommand{\grad}{\overrightarrow{Grad}} \newcommand{\Vv}{\overrightarrow{v}} \newcommand{\Vu}{\overrightarrow{u}} \newcommand{\Vw}{\overrightarrow{w}} \newcommand{\Vup}{\overrightarrow{u'}} \newcommand{\Zero}{\overrightarrow{0}} \newcommand{\Vx}{\overrightarrow{x}} \newcommand{\Vy}{\overrightarrow{y}} \newcommand{\Vz}{\overrightarrow{z}} \newcommand{\Vt}{\overrightarrow{t}} \newcommand{\Va}{\overrightarrow{a}} \newcommand{\Vb}{\overrightarrow{b}} \newcommand{\Vc}{\overrightarrow{c}} \newcommand{\Vd}{\overrightarrow{d}} \newcommand{\Ve}[1]{\overrightarrow{e_{#1}}} \newcommand{\Vf}[1]{\overrightarrow{f_{#1}}} \newcommand{\Vn}{\overrightarrow{0}} \newcommand{\Mat}{Mat} \newcommand{\Pass}{Pass} \newcommand{\mkF}{\mathfrak{F}} \renewcommand{\sp}{Sp} \newcommand{\Co}{Co} \newcommand{\vect}[1]{\texttt{Vect}\dpl{\left( #1\right)}} \newcommand{\prodscal}[2]{\dpl{\left\langle #1\left|\vphantom{#1 #2}\right. #2\right\rangle}} \newcommand{\trans}[1]{{\vphantom{#1}}^{t}{#1}} \newcommand{\ortho}[1]{{#1}^{\bot}} \newcommand{\oplusbot}{\overset{\bot}{\oplus}} \SelectTips{cm}{12}%Change le bout des flèches dans un xymatrix \newcommand{\pourDES}[8]{ \begin{itemize} \item Pour la ligne : le premier et dernier caractère forment $#1#2$ soit $#4$ en base 10. \item Pour la colonne : les autres caractères du bloc forment $#3$ soit $#5$ en base 10. \item A l'intersection de la ligne $#4+1$ et de la colonne $#5+1$ de $S_{#8}$ se trouve l'entier $#6$ qui, codé sur $4$ bits, est \textbf{\texttt{$#7$}}. \end{itemize} } \)

La méthode du simplexe

Lorsque le problème fait apparaitre plus de 2 variables le principe reste le même est est basé sur le théorème stipulant que si la solution existe elle est sur une frontière du simplexe. On se place donc sur un sommet, et on calcule la valeur de la fonction objectif. On va ensuite regarder les sommets adjacents et observer si la fonction objectif peut prendre une valeur supérieur ou pas. Si c'est le cas, on se déplace sur ce nouveau sommet et on recommence l'étude sinon on s'arrête et le maximum est trouvé. Nous ne nous intéresserons pas aux problèmes de convergence mais signalons tout de même que l'algorithme à ses limites :
\( \bullet\)
Si le maximum n'est jamais atteint.

\( \bullet\)
Si deux sommets adjacents maximise l'objectif, l'algorithme va boucler à l'infini.

\( \bullet\)
Si on ne trouve pas de solution initiale.

\( \bullet\)
Si la matrice des contraintes n'est pas de rang maximal (cas dégénéré qui arrive en général lorsqu'une des contraintes est une égalité au lieu d'une inégalité).
Détaillons à présent la méthode du simplexe pour n'importe quelle nombre de variables.

Définition


Soient \( n\) et \( p\) deux entiers strictement positifs, \( A\in\M_{(p,n)}(\R)\) , \( B\in \M_{(p,1)}(\R)\) , \( C\in\M_{(1,n)}(\R)\) et \( X={}^t(X_i)_{i\in[\![1 ; n]\!]}\) le vecteur colonne des indéterminées. Un problème de la forme\( \left\{\begin{array}{c} A.X = B\\ X\geqslant 0\\ Max(C.X) \end{array} \right.\) est un programme linéaire sous forme standard.
La première étape de la méthode du simplexe, consiste à transformer un problème linéaire sous forme normale en un problème linéaire sous forme standard en ajoutant des variables.

Proposition


Tout problème linéaire sous forme normale peut se mettre sous forme standard quitte à ajouter des variables, appelées variables d'écarts.

Démonstration

Reprenons le notations précédentes et considérons \( \left\{\begin{array}{c} A.X \leqslant B\\ X\geqslant 0\\ Max(C.X) \end{array} \right.\) un problème linéaire sous forme normale. Considérons \[E_k=b_k-\sum_{i=1}^nA_{k,i}X_i\] les variables d'écarts (toutes positives ou nulles). Le problème linéaire se transforme en un problème linéaire standard de la forme : \( \left\{\begin{array}{c} A'.X' = B\\ X'\geqslant 0\\ Max(C.X) \end{array} \right.\) où \[ A'= \begin{pmatrix} A_{1,1} &\cdots &A_{1,n} & 1 & 0 & 0 &\cdots &0\\ \vdots & & \vdots &0 & 1 & 0 &\cdots &0\\ \vdots & & \vdots &\vdots & &\ddots & &\vdots\\ A_{p,1} & \cdots &A_{p,n} &0 & 0 &\cdots & &1 \end{pmatrix} \] est la matrice \( A\) juxtaposée avec la matrice \( Id_{\M_{(p,p)}(\R)}\) et où \( X'={}^t(X_1,\dots,X_n,E_1,\dots,E_p)\) .
Bien sur, s'il s'agit d'une problème résoluble, il y a une infinité de solution puisqu'il y a plus d'inconnues que d'équations. Il faut choisir celle qui maximisera la fonction objectif. On va donc rajouter à la dernière ligne du système \( A'X'=B\) la fonction objectif : \[\left\{ \begin{array}{cccccccccc} A_{1,1}X_1 +& \cdots &+ A_{1,n}X_n & +E_1 &+0 & +0 &\cdots &+0&=&B_1\\ \vdots & & \vdots &+0 & +E_2 &+ 0 &\cdots &+0&=&B_2\\ \vdots & & \vdots &\vdots & &\ddots & &\vdots&=&\vdots\\ A_{p,1}X_1 +& \cdots &+A_{p,n}X_n &+0 & +0 &\cdots & &+E_p&=&B_p\\ C_1X_1 +& \cdots &+C_nX_n &+0 & & \cdots & & +0 &=&-val \end{array} \right. \] où \( val\) est la valeur de la fonction objectif à l'origine du repère. Pour déterminer la colonne du pivot, on va choisir celle qui a le plus grand coefficient strictement positif \( C_i\) ; notons \( r\) cet indice. Pour déterminer la ligne du pivot, on va choisir la ligne du plus petit coefficient strictement positif de la colonne des \( B_i/A_{i,r}\) . On applique ensuite le pivot et on recommence jusqu'à ce qu'une des conditions de strict positivité dans le choix du pivot ne soit pas satisfaite.
§ Algorithme du simplexe
\( \bullet\)
On cherche la ligne du pivot (on parle de variable entrante) :
1
Si tous les coefficients de la dernière ligne sont négatifs ou nuls : STOP.

2
Sinon on choisit l'indice \( r\) du coefficient \( C_i\) strictement positif le plus grand.

\( \bullet\)
On cherche la colonne du pivot (on parle de variable sortante) :
1
Si tous les \( B_i/A_{i,r}\) sont strictement négatifs ou infini : STOP.

2
Sinon on choisit l'indice \( s\) du \( B_i/A_{i,r}\) positif ou nul le plus petit.

\( \bullet\)
Le pivot est \( A_{s,r}\) . On applique le protocole de Gauss.

\( \bullet\)
On réitère le processus.
Une condition nécessaire pour que cet algorithme permette d'arriver à une solution est que le point de départ, implicite dans la formulation, est l'origine du repère.