OPTIMIZATION Lecture
OPTIMIZATION Lecture
1. Introduction
Optimization is the act of obtaining the best result under given circumstances.
Optimization can be defined as the process of finding the conditions that give
the maximum or minimum of a function.
Historical development
Historical development
Historical development
Historical development
• Objective function
• Variables
• Constraints
7
1. Introduction
• f0 : Rn R: objective function
• x=(x1,…..,xn): design variables (unknowns of the problem,
they must be linearly independent)
• gi : Rn R: (i=1,…,m): inequality constraints
• The problem is a constrained optimization problem
8
1. Introduction
• If a point x* corresponds to the minimum value of the function f (x), the
same point also corresponds to the maximum value of the negative of
the function, -f (x). Thus optimization can be taken to mean
minimization since the maximum of a function can be found by seeking
the minimum of the negative of the same function.
9
Examples
10
Example
Minimum Costs
Supply locations Demand locations
(Origins) (Destinations)
Example
Different Kinds of Optimization
Local minima
• A point x* is called a relative or local
maximum if f (x*) ≥ f (x*+h) for all values
of h sufficiently close to zero.
23
2. Classicial optimization techniques
Single variable optimization
• A function f (x) is said to have a global or absolute minimum at x* if f (x*) ≤ f (x)
for all x, and not just for all x close to x*, in the domain over which f (x) is defined.
• Similarly, a point x* will be a global maximum of f (x) if f (x*) ≥ f (x) for all x in
the domain.
24
Necessary condition
25
Necessary condition
FIGURE 2.2 SAYFA 67
• The theorem does not say what happens if a
minimum or a maximum occurs at a point x* where
the derivative fails to exist. For example, in the
figure
f ( x * h) f ( x*)
lim
h0
m (positive) or m - (negative)
h
26
Sufficient condition
27
Example
Determine the maximum and minimum values of the function:
f ( x) 12 x 5 45 x 4 40 x 3 5
Solution: Since f’(x)=60(x4-3x3+2x2)=60x2(x-1)(x-2), At x=0, f’’(x)=0 and hence we must investigate the
f’(x)=0 at x=0,x=1, and x=2. next derivative.
28
2. Classicial optimization techniques
Multivariable optimization with no constraints
• Necessary condition
If f(X) has an extreme point (maximum or minimum) at
X=X* and if the first partial derivatives of f (X) exist at
X*, then
f f f
( X*) ( X*) ( X*) 0
x1 x2 xn
• Sufficient condition
A sufficient condition for a stationary point X* to be an
extreme point is that the matrix of second partial
derivatives (Hessian matrix) of f (X*) evaluated at X* is
• Positive definite when X* is a relative minimum point
• Negative definite when X* is a relative maximum point
29
Note: Given a multivariable function f. We denote :
Where, the Hessian matrix is defined:
The gradient f : is the vector of its first partial
derivatives
𝑥 𝑇 𝐴𝑥
A I 0
should be positive. Similarly, the matrix A will be negative
definite if its eigenvalues are negative.
35
Review of mathematics
Negative definiteness
36
Example 4:
Example 3:
• The matrix A will be positive definite if and only if all the values A1, A2,
A3,An are positive
• The matrix A will be negative definite if and only if the sign of Aj is (-1)j
for j=1,2,,n
• If some of the Aj are positive and the remaining Aj are zero, the matrix A
will be positive semidefinite
38
Example 5:
A???
Example 6:
44
Concave function
• Convex and concave functions in two variables
45
First and second order characterizations of convex functions
https://www.princeton.edu/~aaa/Public/Teaching/ORF523/S16/ORF523_S16_Lec7_gh.pdf
Convex functions
• A function f(x) is convex if for any two points x and y, we have
f(y) f(x) f T (x)(y x)
H(X) 2 f ( X) / xi x j
is positive semidefinite.
Solution:
2 f 2 f
x 2 x1x2 12 x1 0
H ( X) 12
f f 0
2
12
x1x2 x22
Here
2 f
12 x1 0 for x1 0
x12
0 for x1 0
H2 144 x1 0 for x1 0
0 for x1 0
Hence H(X) will be negative semidefinite and f(X) is concave for x1 ≤ 0 52
Example
1) Determine whether the following function is convex or concave.
2) Find the global minimum/maximum of the given f
53
Quadratic functions:
f(𝑥1 , 𝑥2 , 𝑥3 )=(6𝑥1 +4𝑥2 + 2𝑥3 − 1, 4𝑥1 +6𝑥2 + 2𝑥3 − 2, 2𝑥1 +2𝑥2 + 8𝑥3 -3)
3− 2 1
• |A − 𝐼|= 2 3− 1 =( − 1)(−2 +9-18)
1 1 4−
|A − 𝐼|=0 ( − 1)(−2 +9-18)=0 =1; =3; =6
Becase of all the eigen-values are positive, therefore A is possive definite.
f(X) is strictly convex function f has a unique global minimum,
f(𝑥1 , 𝑥2 , 𝑥3 )=2Ax+b
f(𝑥1 , 𝑥2 , 𝑥3 )=(6𝑥1 +4𝑥2 + 2𝑥3 − 1, 4𝑥1 +6𝑥2 + 2𝑥3 − 2, 2𝑥1 +2𝑥2 + 8𝑥3 -3)
1 1 1
Min f = f(− 6 , 3, 3)
Optimization in 1-D
(xleft, f(xleft))
(xright, f(xright))
(xleft, f(xleft))
(xright, f(xright))
(xnew, f(xnew))
(xmid, f(xmid))
Optimization in 1-D
(xleft, f(xleft))
(xright, f(xright))
(xnew, f(xnew))
(xmid, f(xmid))
Optimization in 1-D
(xleft, f(xleft))
(xright, f(xright))
• At each step:
f ( xk )
xk 1 xk
f ( xk )
g k 1 ( g k 1 g k )
T
k T
g gk
k
Conjugate Gradient Methods
f ( x e1 ) f ( x )
ef
1
ef f ( x e2 ) f ( x )
f ( x) f2 f ( x e3 ) f ( x )
e3
Generic Optimization Strategies
• Uniform sampling:
– Cost rises exponentially with # of dimensions
• Simulated annealing:
– Search in random directions
– Start with large steps, gradually decrease
– “Annealing schedule” – how fast to cool?
Downhill Simplex Method (Nelder-Mead)
location probed by
reflection step
worst point
(highest function value)
Downhill Simplex Method (Nelder-Mead)
location probed by
expansion step
location probed by
contration step
Downhill Simplex Method (Nelder-Mead)