Slide Cours Optimisation 2022
Slide Cours Optimisation 2022
Slide Cours Optimisation 2022
MTH8415
Boukedroun
S. Le Digabel, Polytechnique Montréal
H2020
M1 GLSD (v5)
2021/2022
Plan
1. Introduction et définitions
4. Extensions
Références
1. Introduction et définitions
4. Extensions
Références
Problème et solutions
◮ On cherche à résoudre
min {f (x) : x ∈ Ω}
x∈Rn
avec f : Rn → R différentiable et Ω ⊆ Rn
◮ Un point réalisable x∗ ∈ Ω est un minimum global de la
fonction f sur le domaine Ω si
f (x∗ ) ≤ f (x) pout tout x ∈ Ω
Dérivées
◮ Gradient de f en x = (x1 , x2 , . . . , xn ) ∈ Rn :
∂f (x) ∂f (x) ∂f (x)
∇f (x) = , ,..., ∈ Rn
∂x1 ∂x2 ∂xn
Direction de descente
◮ Indéfinie sinon
1. Introduction et définitions
4. Extensions
Références
⇒ d⊤ ∇2 f (x∗ )d ≥ 0
Si la matrice hessienne en un point critique est indéfinie, alors il
s’agit d’un point de selle
f : Rn → R est convexe si :
◮ pour tout x, y ∈ Rn et tout λ ∈ [0; 1],
f (λx + (1 − λ)y) ≤ λf (x) + (1 − λ)f (y)
◮ ou si sa matrice hessienne ∇2 f (x) est semi-définie positive
pour tout x ∈ Rn
[0] Initialisation
Point de départ : x0 ∈ Rn
k←0
[1] Itération k
Calculer dk = −∇f (xk ) (dir. de descente)
Si (dk = 0) : Stop (point critique)
Trouver αk ∈ arg min h(α) = f (xk + αdk )
α≥0
xk+1 ← xk + αk dk
k ←k+1
Aller en [1]
Méthode de Newton
◮ Soit le modèle quadratique de f autour de x :
1
m(d) = f (x) + d⊤ ∇f (x) + d⊤ ∇2 f (x)d
2
Méthode quasi-Newton
◮ La direction de Newton n’est pas définie si la matrice
hessienne n’est pas définie positive
◮ Calculer (et inverser) la matrice hessienne peut aussi être très
coûteux
◮ On peut considérer la direction quasi-Newton
d = −B(x)−1 ∇f (x)
1. Introduction et définitions
4. Extensions
Références
min {f (x) : x ∈ Ω}
x∈Rn
Théorème
Si Ω est fermé et borné et si f est continue sur Ω, alors il existe un
minimum global atteint en un point de Ω et un maximum global
atteint en un point de Ω
Avec Ω = {x ∈ Rn : c(x) = 0} ⊆ Rn :
CN1
Si x∗ est un minimum local de f dans Ω, et si ∇c(x∗ ) 6= 0, alors
c(x∗ ) = 0 et il existe λ ∈ R tel que
∇f (x∗ ) = λ∇c(x∗ )
Avec Ω = {x ∈ Rn : c(x) ≥ 0} ⊆ Rn :
CN1
Si x∗ est un minimum local de f dans Ω, alors il existe λ ≥ 0 tel
que ∇f (x∗ ) = λ∇c(x∗ ) et c(x∗ )λ = 0
Multiplicateurs de Lagrange
min {f (x) : x ∈ Ω}
x∈Rn
avec
c (x) = 0, i ∈ E
Ω= x ∈ Rn i ⊆ Rn
ci (x) ≥ 0, i ∈ I
et
|E| = m , |I| = p
A(x) = {i ∈ I : ci (x) = 0}
est 0
MTH8415: Optimisation non linéaire 26/46
Introduction Sans contraintes Avec contraintes Extensions Références
Cône tangent
◮ Définition géométrique :
◮ d ∈ Rn est un vecteur tangent à Ω en x ∈ Rn s’il existe une
suite {zk } de points réalisables avec zk → x et une suite de
réels positifs {tk } avec tk → 0 tels que
zk − x
lim =d
k→∞ tk
◮ L’ensemble des vecteurs tangents forme le cône tangent TΩ (x)
◮ Définitionalgébrique
:⊤
d ∇c (x) = 0 i∈E
TΩ (x) = d ∈ Rn ⊤ i
d ∇ci (x) ≥ 0 i ∈ A(x)
◮ Le cône tangent correspond aux directions réalisables de
premier ordre (i.e. lorsque tout est linéarisé)
MTH8415: Optimisation non linéaire 28/46
Introduction Sans contraintes Avec contraintes Extensions Références
Cône normal
◮ Définition algébrique :
X X λ ∈R i∈E
NΩ (x) = λi ∇ci (x) − λi ∇ci (x) i
λi ≥ 0 i ∈ A(x)
i∈E i∈A(x)
CN1
Si x∗ est un minimum local de f dans Ω, alors
✓✏
.. ... .. ..
...
.....2...........
... .. .. ..
6 1
.
. ........
. .. . ..
.
.. . .
.. . . . .. ..
. .
. .
. .. ....
... .. ..
✒✑....... .......
.
... .
.
. . . ..
........
. . ..
....
. . . . . . ..
........
.... .. .
. .. .
. .
. .
........
. . . . .... . . .
......
... .... ... .... ... .. ..
✫✪
......
.. . ... .... ........ .. ..
..
..
..
.... ...
...
.... ....
...
.... .........
..
...
.
..
..
..
..
... ...
. . . .
.........
. .. .. ..
. . .
. .. .. .... ... .... ... ...
.......... ........... .....................
... . .... .... ....
.... ..
.........
............. .....
......
..... ......
...... ......
.
. . ....
....
....
.......
. Ω
.....
....
.....
.
..
.
..
.......
.. ............. .
...
..
.
............................................................ .....
.. .. .
. .
. ...
..
.................................................................................. ..................
.. .. . . .
. .
. .... ..... .........
.... ....
.....
.....
...... .............
.......................................
... .....
.. ....
..... .. .....
.
...... ..... ...... ..................
..........
....... ..... ..... .............
........ ... . ... ... ..
...
.
... ...
................
........
. ..... . . . .
..........
.........................................
....
c1 (x)..........= 0 ...
..... ... .. .
..
.. .
.
. . .
.
.. . . .
.
. . . .. .
.
. .
. . . .
................. ........... ..........
...... ...... ..........
... ..
. .. ..
.......... ......
....... ...... ......... ..
...................
... .. . . .. .. .
.. ...
. .
...............................................
........................ .
...
..
..... ... .... . .
. . ... .
.....
...
.... ............................................................................................................................................................................................................
........
........ ...
......... ...
..........
..... ....... . ...... . ................ . .... ...
............
..
....... .......
.
................. .............. .................. .
...
.............. ........ ....... .............. ............ ..
................. ........ ....... ............ ...
............................. ........ ....... ...........
...
............. ........... .....
.............. ..
.....
.......... . ... .
........... ....... ......... ...
...
............ ....... ........ ....
.............. ...... ........
...... ........ .....
.......
........... ..
............. ...
..
..
..
..
..
..
..
..
...
..
..
..
..
..
..
..
..
..
..
..
. .
.............................................................
..
..
..
..
... .. ...............
........ ..............................
....... ..................
....... ..............
...........
.
..........
Attention : Les contraintes sont c1 ≤ 0 et c2 ≤ 0 (pas ≥ 0)
.......
✓✏
.. ... .. ..
...
.....2...........
... .. .. ..
6 1
.
. ........
. .. . ..
.
.. . .
.. . . . .. ..
. .
. .
. .. ....
... .. ..
✒✑
.
... .
.
. . . ..
........
. . ..
....
. . . . . . ..
........
.. . . . . .
• x ........ ........
.. . . . . . .
........
. . . . .... . . .
......
... .... ... .. ..
✫✪
...... a .... ....
... .... ........ .. ..
..
..
..
.... ...
...
.... ....
...
.... .........
..
...
.
..
..
..
..
... ...
. . . .
.........
. .. .. ..
. . .
. .. .. .... ... .... ... ...
.......... ........... .....................
... . .... .... ....
.... ..
.........
............. .....
......
..... ......
...... ......
.
. . ....
....
....
.......
. Ω
.....
....
.....
.
..
.
..
.......
.. ............. .
...
..
.
............................................................ .....
.. .. .
. .
. ...
..
.................................................................................. ..................
.. .. . . .
. .
. .... ..... .........
.... ....
.....
.....
...... .............
.......................................
... .....
.. ....
..... .. .....
.
...... ..... ...... ..................
..........
....... ..... ..... .............
........ ... . ... ... ..
...
.
... ...
................
........
. .....
. . . .
..........
.........................................
....
c1 (x)..........= 0 ...
..... ... .. .
..
.. .
.
. . .
.
.. . . .
.
. . . .. .
.
. .
. . . .
................. ........... ..........
...... ...... ..........
... ..
. .. ..
.......... ......
....... ...... ......... ..
...................
... .. . . .. .. .
.. ...
. .
...............................................
........................ .
...
..
..... ... .... . .
. . ... .
.....
...
.... ............................................................................................................................................................................................................
........
........ ...
......... ...
..........
..... ....... . ...... . ................ . .... ...
............
..
....... .......
.
................. .............. .................. .
...
.............. ........ ....... .............. ............ ..
................. ........ ....... ............ ...
............................. ........ ....... ...........
...
............. ........... .....
.............. ..
.....
.......... . ... .
........... ....... ......... ...
...
............ ....... ........ ....
.............. ...... ........
...... ........ .....
.......
........... ..
............. ...
..
..
..
..
..
..
..
..
...
..
..
..
..
..
..
..
..
..
..
..
. .
.............................................................
..
..
..
..
... .. ...............
........ ..............................
....... ..................
....... ..............
...........
.
..........
Attention : Les contraintes sont c1 ≤ 0 et c2 ≤ 0 (pas ≥ 0)
.......
✓✏
.. ... .. ..
...
.....2...........
... .. .. ..
6 1
.
. ........
. .. . ..
.
.. . .
.. . . . .. ..
. .
. .
. .. ....
... .. ..
✒✑
.
... .
.
. . . ..
........
. . ..
....
. . . . . . ..
........
.. . . . . .
• x ........ ........
.. . . . . . .
........
. . . . .... . . .
......
... .... ... .. ..
✫✪
...... a .... ....
... .... ........ .. ..
..
..
..
.... ...
...
.... ....
...
.... .........
..
...
.
..
..
..
..
... ...
. . . .
.........
. .. .. ..
. . .
...
∇f (x ..... a )=0
. .. .. .... .... ... ...
.......... ........... .....................
... . .... ....... ....
.... ..
.........
............. .....
......
...... ......
....
. . ....
....
....
.......
. Ω
.....
....
.....
.
..
.
..
.......
.. ............. .
...
..
.
............................................................ .....
.. .. .
. .
. ...
..
.................................................................................. ..................
.. .. . . .
. .
. .... ..... .........
.... ....
.....
.....
...... .............
.......................................
... .....
.. ....
..... .. .....
.
...... ..... ...... ..................
..........
....... ..... ..... .............
........ ... . ... ... ..
...
.
... ...
................
........
. .....
. . . .
..........
.........................................
....
c1 (x)..........= 0 ...
..... ... .. .
..
.. .
.
. . .
.
.. . . .
.
. . . .. .
.
. .
. . . .
................. ........... ..........
...... ...... ..........
... ..
. .. ..
.......... ......
....... ...... ......... ..
...................
... .. . . .. .. .
.. ...
. .
...............................................
........................ .
...
..
..... ... .... . .
. . ... .
.....
...
.... ............................................................................................................................................................................................................
........
........ ...
......... ...
..........
..... ....... . ...... . ................ . .... ...
............
..
....... .......
.
................. .............. .................. .
...
.............. ........ ....... .............. ............ ..
................. ........ ....... ............ ...
............................. ........ ....... ...........
...
............. ........... .....
.............. ..
.....
.......... . ... .
........... ....... ......... ...
...
............ ....... ........ ....
.............. ...... ........
...... ........ .....
.......
........... ..
............. ...
..
..
..
..
..
..
..
..
...
..
..
..
..
..
..
..
..
..
..
..
. .
.............................................................
..
..
..
..
... .. ...............
........ ..............................
....... ..................
....... ..............
...........
.
..........
Attention : Les contraintes sont c1 ≤ 0 et c2 ≤ 0 (pas ≥ 0)
.......
✓✏
.. ... .. ..
...
.....2...........
... .. .. ..
6 1
.
. ........
. .. . ..
.
.. . .
.. . . . .. ..
. .
. .. .. ....
... .. ..
✒✑....... .......
.
... .
.
. . . ..
........
. . ..
....
. . . . . . ..
........
.... .. .
. .. .. .. .
........
. . . . .... . . .
......
... .... ... .... ... .. ..
✫✪
......
.. . ... .... ........ .. ..
..
..
..
.... ...
...
.... ....
...
. . . . . ........ ....
.. ..
..
..
..
... ...
. . . .
.........
. .. . . ... . .
. .. .. .... ... .... ... ...
.......... ........... .....................
... . .... .... ....
.... ..
.........
............. .....
......
..... ......
...... ......
.
. . ....
....
....
.......
.
.....
....
Ω . . . . .
..
.
...
.......
.. .............
...
..
............................................................ .....
..
. ... .
. .
. ...
..
.................................................................................. ..................
.. .. . . .. .
. .... ..... .........
.... ....
.....
.....
...... .......................................
.............
... .....
.. ....
..... .. .....
.
...... ..... ...... ..................
..........
....... ..... ..... .............
........ . .. . ... ... . .
...
.
... ...
................
....... . . ..... . . . .
..........
.........................................
....
c1 (x)..........= 0 ...
... .. ... .. ..... .
.
. . .
.
.. . . .
.
. . . .. .
.
. .
. . . ...
............... ........... ..........
...... ...... ..........
... ..
. .. ..
........ ......
...... ...... ......... ..
...................
... .. . . .. ... ..
. ...
. .
....................................................
........................ .
...
..
..... ... .... . .. . ... .
.........
...................................................................................................
...
. ...
........
....... .....................................................................................................................................•
........ .. ...
.......... ... ...
.................
.......... .
..
..
..
. .............
.
........
..... .. ............
.......
............
.
.........
.............
..... .. .
....
.. ..
xb ..
..
.... .
...........................
........
.
...
.
..
...........................
...... ........
. ...... ....... ... ........... ...
......... ....... .......... .
....
......... ......... ....
........... ......
....... ......... ...
..
..
..
..
..
............
. ..
..
.. .
..
..
..
......... .
...
........... ...
......
.
........ .......
...... ........ .......
...... ........ ..............................................................................................................................
........ ...............................
.....
........ ..
..
..
..
..
..
...................
.. ..
...........
.........
.........
Attention : Les contraintes sont c1 ≤ 0 et c2 ≤ 0 (pas ≥ 0)
MTH8415: Optimisation non linéaire 32/46
Introduction Sans contraintes Avec contraintes Extensions Références
✓✏
.. ... .. ..
...
.....2...........
... .. .. ..
6 1
.
. ........
. .. . ..
.
.. . .
.. . . . .. ..
. .
. .. .. ....
... .. ..
✒✑....... .......
.
... .
.
. . . ..
........
. . ..
....
. . . . . . ..
........
.... .. .
. .. .. .. .
........
. . . . .... . . .
......
... .... ... .... ... .. ..
✫✪
......
.. . ... .... ........ .. ..
..
..
..
.... ...
...
.... ....
...
. . . . . ........ ....
.. ..
..
..
..
... ...
. . . .
.........
. .. . . ... . .
. .. .. .... ... .... ... ...
.......... ........... .....................
... . .... .... ....
.... ..
.........
............. .....
......
..... ......
...... ......
.
. . ....
....
....
.......
.
.....
....
Ω . . . . .
..
.
...
.......
.. .............
...
..
............................................................ .....
..
. ... .
. .
. ...
..
.................................................................................. ..................
.. .. . . .. .
. .... ..... .........
.... ....
.....
.....
...... .......................................
.............
... .....
.. ....
..... .. .....
.
...... ..... ...... ..................
..........
....... ..... ..... .............
........ . .. . ... ... . ...
.
....... ∇f (x )=−λ∇c (x )
.
... ...
................
....... . . ..... . . . ....
.........................................
....
c1 (x)..........= 0 b 1 b ...
... .. ... .. ..... .
.
. . .
.
.. . . .
.
. . . .. .
.
. .
. . . ...
............... ........... ..........
...... ...... ..........
... ..
. .. ..
........ ......
...... ...... ......... ..
...................
... .. . . .. ... ..
. ...
. .
....................................................
........................ .
...
..
..... ... .... . .. . ... .
.........
...................................................................................................
...
. ...
........
....... .....................................................................................................................................•
........ .. ...
.......... ... ...
.................
.......... .
..
..
..
. .............
.
........
..... .. ............
.......
............
.
.........
.............
..... .. .
....
.. ..
xb ..
..
.... .
...........................
........
.
...
.
..
...........................
...... ........
. ...... ....... ... ........... ...
......... ....... .......... .
....
......... ......... ....
........... ......
....... ......... ...
.
............
. .. .
......... .
∇c (x )
..
..
..
..
. ..
.. .
..
..
. .
..
........... ... .
........ .......
......
...... ........ 1 b .......
...... ........ ..............................................................................................................................
........ ...............................
.....
........ ..
..
..
..
..
..
...................
.. ..
...........
.........
.........
Attention : Les contraintes sont c1 ≤ 0 et c2 ≤ 0 (pas ≥ 0)
MTH8415: Optimisation non linéaire 32/46
Introduction Sans contraintes Avec contraintes Extensions Références
✓✏
.. ... .. ..
...
.....2...........
... .. .. ..
6 1
.
. ........
. .. . ..
.
.. . .
.. . . . .. ..
. .
. .
. .. ....
... .. ..
✒✑....... .......
.
... .
.
. . . ..
........
. . ..
....
. . . . . . ..
........
.... .. .
. .. .
. .
. .
........
. . . . .... . . .
......
... .... ... .... ... .. ..
✫✪
......
.. . ... .... ........ .. ..
..
..
..
.... ...
...
.... ....
...
.... .........
..
...
.
..
..
..
..
... ...
. . . .
.........
. .. .. ..
. . .
.. ...
........ xc
. .. .... .... ... ...
.......... ........... ............•
... . .... .... ....
.... ..
.........
............. .....
......
..... ......
...... ......
.
. . ....
....
....
.Ω
......
.
.....
....
.......
.......
.. .............
.
..
. ..
.
...
..
.
............................................................ ....... .
. .
. ... ..
.................................................................................. ..................
.. .. . . .
. . .
. .... ..... .........
.... ....
.....
.....
...... .............
.......................................
... .....
.. ....
..... .. .....
.
...... ..... ...... ..................
..........
....... ..... ..... .............
........ ... . ... ... ..
...
.
... ...
................
........
. ..... . . . .
..........
.........................................
....
c1 (x)..........= 0 ...
..... ... .. .
..
.. .
.
. . .
.
.. . . .
.
. . . .. .
.
. .
. . . .
................. ........... ..........
...... ...... ..........
... ..
. .. ..
.......... ......
....... ...... ......... ..
...................
... .. . . .. .. .
.. ...
. .
...............................................
........................ .
...
..
..... ... .... . .
. . ... .
.....
...
.... ............................................................................................................................................................................................................
........
........ ...
......... ...
..........
..... ....... . ...... . ................ . .... ...
............
..
....... .......
.
................. .............. .................. .
...
.............. ........ ....... .............. ............ ..
................. ........ ....... ............ ...
............................. ........ ....... ...........
...
............. ........... .....
.............. ..
.....
.......... . ... .
........... ....... ......... ...
...
............ ....... ........ ....
.............. ...... ........
...... ........ .....
.......
........... ..
............. ...
..
..
..
..
..
..
..
..
...
..
..
..
..
..
..
..
..
..
..
..
. .
.............................................................
..
..
..
..
... .. ...............
........ ..............................
....... ..................
....... ..............
...........
.
..........
Attention : Les contraintes sont c1 ≤ 0 et c2 ≤ 0 (pas ≥ 0)
.......
✓✏
.. ... .. ..
...
.....2...........
... .. .. ..
6 1
.
. ........
. .. . ..
.
.. . .
.. . . . .. ..
. .
. .
. .. ....
... .. ..
✒✑....... .......
.
... .
.
. . . ..
........
. . ..
....
. . . . . . ..
........
.. . . . . .
........ ∇f (xc )= −λ ... ∇c1 (xc )....
. .. .
. .
. .. .. .. .
. .
.
..
...... .. 1
.
... .... ... ....
✫✪
..
......
.. . ... .... ........ .. ∇c...... 2 (xc )
. ... 2 ∇c2 (xc .)
..
.... ...
...
.... ....
...
... ......... −λ
.
..
.. .
... ...
. . .
.........
. .. .. ..
. . .
.. ...
........ xc
. .. .... .... ... ...
.......... ........... ............•
... . .... .... ....
.... ..
.........
............. .....
......
..... ......
...... ......
.
. . ....
....
....
Ω .......
.
.....
....
.......
.......
.. .............
.
..
. ..
.
...
..
..
............................................................ .....
. .
. .
. ... ..
.................................................................................. ..................
.. .. . . .
. . .
. .... ..... .........
.... ....
.....
.....
...... .............
.......................................
... .....
.. ....
..... .. .....
.
...... ..... ...... ..................
..........
....... ..... ..... .............
........ ... . ... ... ..
...
.
... ...
................
........
. ..... . . . .
..........
.........................................
....
c1 (x)..........= 0 ...
..... ... .. .
..
.. .
.
. . .
.
.. . . .
.
. . . .. .
.
. .
. . . .
................. ........... ..........
...... ...... ..........
... ..
. .. ..
.......... ......
...... ...... ......... ..
... ∇c1 (xc )
.
...................
... .. . . .. .. .
.. ...
. .
...............................................
........................ .
...
..
..... ... .... . .
. . ... .
.....
.... ............................................................................................................................................................................................................
........
........ ...
......... ...
..........
..... ....... . ...... . ................ . .... ...
............
..
....... .......
.
................. .............. .................. .
...
.............. ........ ....... .............. ............ ..
................. ........ ....... ............ ...
............................. ........ ....... ...........
...
............. ........... .....
.............. ..
.....
.......... . ... .
........... ....... ......... ...
...
............ ....... ........ ....
.............. ...... ........
...... ........ .....
.......
........... ..
............. ...
..
..
..
..
..
..
..
..
...
..
..
..
..
..
..
..
..
..
..
..
. .
.............................................................
..
..
..
..
... .. ...............
........ ..............................
....... ..................
....... ..............
...........
.
..........
Attention : Les contraintes sont c1 ≤ 0 et c2 ≤ 0 (pas ≥ 0)
.......
Dualité
Fonction Lagrangienne (ou Lagrangien) :
X
L(x, λ) = f (x) − λi ci (x)
i∈E∪I
Cas de l’optimisation
linéaire (1/3)
Ax ≥ b
minn c⊤ x s.c. avec c ∈ Rn , b ∈ Rm , A ∈ Rm×n
x∈R x ≥0
avec λ, µ ≥ 0
∇x L(x, λ, µ) = c − λ − A⊤ µ =0
µi (A⊤
i x − bi ) =0 i ∈ {1, 2, . . . , m}
λj x j =0 j ∈ {1, 2, . . . , n}
Ax − b ≥0
x ≥0
λj ≥0 j ∈ {1, 2, . . . , n}
µi ≥0 i ∈ {1, 2, . . . , m}
max b⊤ µ
µ∈Rn
A⊤ µ
≤c
s.c.
µ ≥0
Méthodes de pénalités
Exemples de pénalités
◮ Pénalité quadratique :
µX 2 µX
f (x) + ci (x) + min{0, ci (x)}2
2 2
i∈E i∈I
◮ Avantage : Formulation lisse
◮ Inconvénients : Non exacte, mal conditionnée
◮ Pénalité ℓ1 :
X X
f (x) + µ |ci (x)| + µ | min{0, ci (x)}|
i∈E i∈I
1. Introduction et définitions
4. Extensions
Références
Extensions
◮ Optimisation globale
1. Introduction et définitions
4. Extensions
Références
Références I
Audet, C. (2011).
Notes de cours, MTH1101, Calcul I.
Gauvin, J. (1995).
Leçons de programmation mathématique.
Éditions de l’École Polytechnique de Montréal.
Orban, D. (2010).
Numerical Methods for Nonlinear Optimization and Optimal Control,
notes du cours MTH8408.