Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ &...

679
Course Notes for MS4327 Optimisation J. Kinsella March 13, 2020 0-0

Transcript of Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ &...

Page 1: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

Course Notes

for

MS4327 Optimisation

J. Kinsella

March 13, 2020

0-0

Page 2: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 1'

&

$

%

1 Organisation of Course

Page 3: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 2'

&

$

%

• Lectures will be held

– on Tuesdays from 09:00 to 11:00.

• From Week 2 on we’ll use the Tuesday 17:00 class as a tutorial

class reviewing the work of the previous week.

• All classes will be held in C2-062.

• Office Hours: (starting Week 3)

– 15:00–17:00 Mondays,

in B3-043.

Page 4: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 3'

&

$

%

• These Notes are available at

http://jkcray.maths.ul.ie/ms4327/Slides.pdf

• The Appendices contain the solutions to many of the

Exercises and also some advanced material included

for reference.

• Much of the material in the Notes will not be used in

class or examined at the end of the Semester.

• Other material for the course available at

http://jkcray.maths.ul.ie/ms4327.html

Page 5: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 4'

&

$

%

• Attendance at lectures and tutorials will be recorded.

• The course will be assessed with an end of semester written

exam for 80%.

• A Matlab-based project will be assigned for 20% during the

semester.

• You should review the work done in a particular week and

attempt the problems assigned before the Tuesday 17:00

tutorial.

• Matlab will be the language used for programming examples.

• See http://jkcray.maths.ul.ie/ms4327.html for an

introduction to Matlab.

• The main reference text for the course is the excellent book

“Numerical Optimization” by Nocedal & Wright — widely

available to buy online.

Page 6: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 5'

&

$

%

2 Introduction

The word “optimisation ” (often spelled “optimization”) means

“selecting the best option from a range of choices”.

• Chemists try to find the best choice of inputs to a production

plant to meet demand at minimal cost.

• Airlines organise their crew & aircraft schedules to minimise

costs.

• Investors seek to create portfolios that maximise the rate of

return while avoiding excessive risk. (See Example 9.1.)

• The Electricity Regulator adjusts prices paid to electricity

generators so as to minimise the magnitude of the adjustment

subject to the constraint that the generators’ costs are met.

(See Example 9.2.)

Page 7: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 6'

&

$

%

The same is true in Nature.

• Physical systems tend to a state of minimum energy.

• Rays of light follow paths that minimise their travel time.

Optimisation is an important tool in management science, the

mathematics of finance & in physical mathematics. The procedure

consists of first identifying some objective — a quantitative

measure of the performance of the system under study — for

example the profit from an investment or the potential energy of a

physical system. The objective depends on certain characteristics

of the system, the variables or unknowns. Our goal is to find

values of the variables which optimise (maximise or minimise) the

objective. Often the variables are restricted or constrained in

some way.

Page 8: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 7'

&

$

%

Once the physical (or financial) description of the problem has been

translated into mathematical notation — a mathematical model

— an optimisation algorithm can be used to find a solution. For

all but the simplest problems, an exact solution cannot be

calculated directly. Instead a suitable algorithm must be chosen

which will approximate the solution as closely as required. Often a

set of optimality conditions can be applied to the final values

returned by the algorithm to check that they yield a solution to

the problem.

Page 9: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 8'

&

$

%

2.1 Mathematical Formulation

Mathematically speaking, optimisation is the maximisation or

minimisation of a function subject to constraints on its variables. I

use the following notation:

• x is the vector of variables: x ∈ Rn.

• f is the objective function , a real-valued function of x that I

want to maximise or minimise: f : Rn → R.

• c is the vector of constraints that the unknowns must satisfy.

This is a vector-valued function of the variables x. The number

of components in c is the number of individual restrictions that

I place on the variables: ci : Rn → R where i is an index

labelling each constraint.

Page 10: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 9'

&

$

%

• The general optimisation problem can then be written as:

minx∈Rn

f(x) subject to

ci(x) = 0, i ∈ E ,ci(x) ≥ 0, i ∈ I.

(2.1)

• Here f and each ci are real-valued functions of the variables x.

The sets E , I are “index sets” — E and I contain the indices of

the equality constraints and inequality constraints respectively.

Page 11: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 10'

&

$

%

Example 2.1 Consider the problem:

Minimise (x1 − 2)2 + (x2 − 1)

2subject to

x21 − x2 ≤ 0,x1 + x2 ≤ 2.

We can write this problem in the form 2.1 by defining

f(x) = (x1 − 2)2 + (x2 − 1)

2, x =

x1x2

,c(x) =

c1(x)c2(x)

=

−x21 + x2

−x1 − x2 + 2

, I = 1, 2, E =

Page 12: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 11'

&

$

%

c1

contours of f

x1

x2

Feasible Region

c2

x∗

Figure 1: Geometrical representation of Example 2.1

Page 13: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 12'

&

$

%

• Figure 1 shows the contours of the objective function, the set

of points for which f(x) has a constant value.

• In two dimensions (n = 2) these are curves in the plane — in

general I refer to level surfaces in Rn.

• For the record;

Definition 2.1 (Level Surface) Given a real-valued function

f on Rn, a point x0 ∈ Rn defines a level surface

L = x ∈ Rn|f(x) = f(x0).

• I can also define a level set:

Definition 2.2 (Level Set ) Given a real-valued function f

on Rn, a point x0 ∈ Rn defines a level set

L = x ∈ Rn|f(x) ≤ f(x0).

• Figure 1 also shows the feasible region — the set of points

satisfying all the constraints — and the optimal point x∗, the

solution of the problem.

Page 14: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 13'

&

$

%

• Clearly the problem could be transformed into a

maximisation problem by simply replacing f by −f.

Page 15: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 14'

&

$

%

2.2 Some Definitions

Most of the following definitions are obvious and/or familiar and

are listed here for convenience. I’ll state them as either/ors..

2.2.1 Linear vs. NonLinear Optimisation

• Most students are familiar with Linear Programming (LP)

where the objective function and constraints are all linear

functions of x; f(x) = cTx and ci(x) = aTi x− bi, i ∈ I ∪ E .

• A particular Linear Programming problem is called a Linear

Program (also abbreviated to LP!).

• LP’s are studied in Ch. 8.

Page 16: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 15'

&

$

%

• On the other hand Nonlinear Optimisation (often called Non

Linear Programming — NLP) allows for the objective function

and the constraints (if any) to be general non-linear functions

of x as in Example 2.1 above.

• A particular Non Linear Programming problem is called a Non

Linear Program (also abbreviated to NLP).

• If the objective function is quadratic and the constraints are

linear then the NLP reduces to a Quadratic Program; studied

in Ch. 9 and abbreviated to QP.

Page 17: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 16'

&

$

%

2.2.2 Continuous vs. Discrete Optimisation

• In some problems the variables make sense only if they take on

integer values — e.g. the problem of scheduling U.L.’s

timetable could be stated as “Minimise the number of clashes

subject to the rule set”.

• The rule set might include rules such as “a student may have a

maximum of three classes in succession”.

• A clash might be defined as a physical impossibility such as a

student (or lecturer) having two classes in different places at

the same time.

• Discrete Optimisation is referred to as Integer Programming,

usually restricted to the Linear case.

• In this course I focus on Continuous Optimisation problems.

Page 18: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 17'

&

$

%

2.2.3 Constrained vs. Unconstrained Optimisation

• Problems with the general form 2.1 can be classified according

to the nature of the objective function and constraints (linear,

non-linear, convex), the number of variables (large or small),

the smoothness of the functions (differentiable or

non-differentiable).

• The most important distinction is between problems with

constraints on the variables and those which do not.

• Unconstrained problems are much easier to solve.

• Most of this course will be devoted to developing

algorithms for solving unconstrained problems.

Page 19: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 18'

&

$

%

• Constrained problems are solved using either

– using special techniques (discussed in Ch. 9 at the end of

this course in the context of QP’s)

– or sometimes by restating them (Def. 7.4) as unconstrained

problems with penalty terms in the objective function which

discourage constraint violation.

Page 20: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 19'

&

$

%

2.2.4 Global vs. Local Optimisation

• Most optimisation algorithms find only a local solution, a

point where the objective function is smaller than at all other

feasible points in its vicinity.

• They will rarely find the best of all such minima, the global

solution.

• In this course I will concentrate on searching for local solutions.

Page 21: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 20'

&

$

%

2.2.5 Convex vs. NonConvex Problems

The term convex is defined in App. A.7.

Exercise 2.1 Read App. A.7!

• Informally, convexity is roughly equivalent to the function

having a non-negative second derivative or, if multivariate, a

positive semi-definite Hessian.

• Again informally, the problem of minimising a convex function

is usually easier.

• The problem will always have a unique global minimum.

• Problems often are non-convex.

Page 22: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 21'

&

$

%

2.3 Exercises

1. Which of the following real-valued functions are

convex/concave/neither?

(a) f(x) = 3x+ 4

(b) f(x) = x2 − 2x

(c) f(x) = −x1/2 if x ≥ 0(d)

f(x) =

−x− 1, x ≤ −1

0, −1 ≤ x ≤ 1x− 1, x ≥ 1

(e) f(x) = |x+ 3|

Page 23: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 22'

&

$

%

3 Fundamentals of Unconstrained

Optimisation

• In unconstrained optimisation, I minimise an objective

function which depends on real variables — with no restriction

on the values of these variables.

• The generic problem is simply:

minx∈Rn

f(x) (3.1)

• When n = 1, I can plot the function and approximately locate

the minima before “setting dy/dx = 0 and solving for x”..

• When n = 2, I can (using a program like matlab or octave)

draw a contour plot or a 3D surface plot z = f(x, y). Again,

examining the plot will often allow me find the approximate

location of minima.

Page 24: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 23'

&

$

%

• In non-trivial problems I usually won’t be able to visualise the

problem.

– For n > 1, I do not have an x–y graph.

– For n > 2, I do not have a contour plot.

– For n = 3: Try to visualise the air temperature in a room as

indicated by colours shading from red (hot) to blue (cold).

– For n > 3: ???

• In general I will have no “road map”, just a “compass” — the

ability to calculate the values of f and perhaps its derivatives

at any points required.

• Whatever algorithm I use should choose these points so as to

move rapidly towards the minimum — I’ll show you that the

derivative (gradient) vector plays the role of a “compass

needle” that points towards the minimum.

Page 25: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 24'

&

$

%

Example 3.1 (Rosenbrock’s Function:) This function

f(x) = (x1 − 1)2 + (x2 − x

21)2 (3.2)

is often used in optimisation to test algorithms as while it should be

obvious that the (global) minimum is the point x∗ = (1, 1) with

f(x∗) = 0, simplistic optimisation algorithms will often fail on this

problem.

Exercise 3.1 Use Matlab to sketch the contours of Rosenbrock’s

function. See Section 4.1.6.

Is f convex? Are the regions defined by its contours convex sets?

(See Exercise A.1 in Appendix A.7.)

Exercise 3.2 Rosenbrock’s Function on Rn:

f(x) =

n−1∑i=0

(xi+1 − x2i )2. (Set x0 ≡ 1.) What point in Rnminimises

f(x)?

Page 26: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 25'

&

$

%

3.1 Solutions

• In an ideal world, I would like to find a global minimiser of

f, a point where the function attains its least value.

• Formally:

Definition 3.1 A point x∗ is a global minimiser if

f(x∗) ≤ f(x) for all x ∈ Rn — i.e. f(x) at x∗ is lower than at

any other point.

• The global minimiser is difficult to find in general — we usually

only have information from the points where the function has

been evaluated (hopefully a small number) and the function

could dip dramatically in a region as yet unsampled.

• If — on the other hand — I know that the objective function is

convex, then I may be able to make global statements, see

Theorem 3.8 below.

Page 27: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 26'

&

$

%

• Most algorithms can only find a local minimiser.

• I’ll define the term “neighbourhood” by:

Definition 3.2 A neighbourhood Nδ(x∗) is just an open ball

radius δ centred at x∗ :

Nδ(x∗) = x ∈ Rn s.t. ‖x− x∗‖ < δ.

so the boundary of the ball is excluded.

• The standard & more general definition is http:

//en.wikipedia.org/wiki/Neighbourhood_(mathematics).

• So on R, for any δ > 0, Nδ(x∗) = (x∗ − δ, x∗ + δ), the open

interval of “radius” δ centred at x∗ — i.e. the points strictly

greater than x∗ − δ and strictly less than x∗ + δ.

• On R2, Nδ(x∗) = (x, y) ∈ R2|(x− a)2 + (y− b)2 < δ (writing

the point x∗ as x∗ = (a, b)) — all the points inside a circle

radius δ centred at x∗ (again for any δ > 0).

Page 28: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 27'

&

$

%

Now I can define a local minimiser point;

Definition 3.3 A point x∗ is a local minimiser if, for some

δ > 0, there is a neighbourhood Nδ(x∗) of x∗ such that

f(x∗) ≤ f(x) for all x ∈ Nδ(x∗).

• A sloppy version of the definition is that x∗ is a local minimum

for a function f if f(x) is no smaller at any “nearby” point x

than it is at x∗ .

• Draw some pictures!

Page 29: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 28'

&

$

%

3.2 Important Ideas From Vector Analysis

• First some notation:

Definition 3.4 The gradient of f is the vector of partial

derivatives — written ∇f(x) or often g(x) for short;

g(x) ≡∇f(x) =

∂f(x)∂x1

...∂f(x)∂xn

(3.3)

Page 30: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 29'

&

$

%

• In matlab , a vector is input as a list:

>> a = [1 2 3]

a = 1 2 3

a row vector. To input a column vector in matlab , use

>> a = [1; 2; 3]

a =

1

2

3

Page 31: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 30'

&

$

%

• So matlab ’s default vector format is a row vector.

• In mathematics and physics, on the other hand, the convention

is that vector quantities like the gradient are represented by

column vectors, as above. To save space, I will often write

column vectors as row vectors transposed — so

∇f(x) ≡ g(x) =[∂f(x)∂x1

, . . . ,∂f(x)∂xn

]T(3.4)

Page 32: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 31'

&

$

%

Definition 3.5 The Hessian of f is the n× n matrix of

second partial derivatives;

∇2f(x) =

∂2f(x)

∂x21

. . .∂2f(x)∂x1∂xn

∂2f(x)∂x2∂x1

. . .∂2f(x)∂x2∂xn

... . . ....

∂2f(x)∂xn∂x1

. . .∂2f(x)∂x2n

(3.5)

Example 3.2 For Rosenbrock’s function (3.2), the gradient is

∇f(x) ≡ g(x) =[2(x− 1) − 4x(y− x2), 2(y− x2)

]Tand the Hessian is (the lines are for readability and are not

normally used)

∇2f(x) =

2+ 12x2 − 4y −4x

−4x 2

Page 33: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 32'

&

$

%

The Hessian of Rosenbrock’s function is not positive definite

everywhere in R2.

Exercise 3.3 Show that after some algebra, (letting

∆ = 3x2 − y) the eigenvalues of the Hessian are:

λ =1

2

[1+ ∆±

√∆2 + 4x2

](3.6)

Exercise 3.4 Show that the arithmetically larger eigenvalue is

positive for all x ∈ R2 and that both are positive for y < x2 + 12

.

So “near” the minimum at (1, 1), Rosenbrock’s function has a

positive definite Hessian.

Page 34: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 33'

&

$

%

• It is worth noting that the Hessian matrix is always symmetric

(as the order of the partial derivatives makes no difference

when the function is C2).

• It is also (for all problems of interest) a real matrix.

• Real symmetric matrices have two nice properties:

– eigenvectors corresponding to distinct eigenvalues are

orthogonal (perpendicular)

∗ (the eigenvectors may be taken to be real)

– their eigenvalues are real.

• Both properties are important as I will explain later.

Exercise 3.5 What are the gradient and Hessian of the

n–dimensional version of Rosenbrock’s function?

Page 35: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 34'

&

$

%

3.2.1 Parametric equation of a Line in Rn

An important idea (you’ve probably seen it before):

if x is a fixed point in Rn and p is any vector in Rn then any

point y on the line segment from x to x+ p can be written

y = x+ αp for α between 0 and 1.

(Strictly speaking, here x and y are position vectors for the

points x & y but it is convenient to ignore the distinction.)

• Maybe the easiest way to see this is to write y− x = αp or in

other words the vector from the point x to the point y is αp, a

multiple of p.

• As the parameter α increases from 0 to 1, the point y “moves”

along the line segment from x to x+ p.

• Draw a diagram!

Page 36: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 35'

&

$

%

• From an algebraic viewpoint, y(α) = x+ αp is a

vector-valued function from R to Rn;

y : R→ Rn : y(α) = x+ αp.

• I’ll need this idea again shortly.

Page 37: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 36'

&

$

%

3.2.2 The Chain Rule

A key result is the Chain Rule. I’ll state it here in the form in

which I will use it — without proof.

Theorem 3.1 (Chain Rule) Let f be a function from Rn to R.

And let g be a function from R to Rn. Then the derivative wrt α of

the function f g (the composition of f and g) at α, ddαf(g(α)), is

the inner product of the gradient of f at g(α) with the derivative

wrt α of the vector function g(α) wrt α.

d

dαf(g(α)) = ∇f(g(α))T d

dαg(α). (3.7)

• Because g(α) is a vector in Rn, so is ddαg(α).

Page 38: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 37'

&

$

%

• You can see that this is a natural extension of the 1-D version:

d

dtf(g(t)) = f ′(g(t)) · g ′(t).

• Now consider the special case where the “vector-valued

function” g(α) is a point on the line from x to x+ p, i.e.

g(α) = x+ αp.

• Now ddαg(α) = p.

Page 39: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 38'

&

$

%

• So I have the important special case of the Chain Rule, the

Directional Derivative:

Definition 3.6 (Directional Derivative)

d

dαf(x+ αp) = ∇f(x+ αp)Tp ≡ pT∇f(x+ αp). (3.8)

• In particular, the rate of change of f(x+ αp) at α = 0 is just

d

dαf(x+ αp) |α=0 = ∇f(x)Tp ≡ pT∇f(x).

• The meaning is clear: the rate of change of the function f at

the point x wrt α “as I move away from x along p” is the inner

product of the gradient of f at x with the vector p.

• And if the direction p is ⊥ to ∇f(x)?

Page 40: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 39'

&

$

%

• An extension of (3.8) is that

Theorem 3.2

d2

dα2f(x+ αp) = pT∇2f(x+ αp)p (3.9)

For a proof, see App. A.5

Page 41: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 40'

&

$

%

3.3 Optimality Conditions

• In principle, to confirm that x∗ is a local minimum, I need to

check all the neighbouring points — obviously an impossible

task.

• Fortunately, when a function is smooth, knowing the function

and its derivatives at a point allows us to deduce its shape

near the point.

• Taylor’s Theorem (Thm. 3.3) is exactly what I need.

Page 42: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 41'

&

$

%

Theorem 3.3 (Taylor’s) Suppose that f : Rn → R is continuously

differentiable (C1) and that p ∈ Rn.

Then I can prove the following results:

• f(x+ p) can be approximated by f(x) plus an error term that

depends on the gradient:

f(x+ p) = f(x) + pT∇f(x+ ξp), (3.10)

for some unknown ξ ∈ (0, 1).

• In addition, if f is C2, then the gradient at x+ p can be

approximated by the gradient at x plus an error term that

depends on the Hessian:

∇f(x+ p) = ∇f(x) +∫10

∇2f(x + tp)p dt. (3.11)

(Easily checked as blue material is just

∫10

d

dt∇f(x+ tp)dt.)

Page 43: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 42'

&

$

%

(Usually I cannot evaluate the integral over t in the error term

but I may be able to find an upper bound for its norm.)

• Finally, again if f is C2, f(x+ p) can be approximated by f(x)

plus a “gradient” or “first-order” term evaluated at x plus an

error term that depends on the Hessian:

f(x+ p) = f(x) + pT∇f(x) + 1

2pT∇2f(x+ ξp)p, (3.12)

for some unknown ξ ∈ (0, 1).

Proof: See any multivariate calculus text.

Page 44: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 43'

&

$

%

• I can derive necessary conditions for optimality by assuming

that x∗ is a local minimiser and then proving facts about

∇f(x∗) and ∇2f(x∗) — in other words what conditions must

the derivatives satisfy if x∗ is a local minimiser?

• The term first-order below refers to the order of the

derivative — similarly second-order conditions refer to

properties of the Hessian matrix.

Theorem 3.4 (First-order Necessary Conditions) If

x∗ is a local minimiser and f is C1 in an open neighbourhood of

x∗ , then ∇f(x∗) = 0.

Page 45: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 44'

&

$

%

• Note: A stronger — i.e. dropping the assumption that the

gradient of f is continuous — version of this result is given in

Appendix A.11.

• I make the assumption that f is C1 as it will always be true in

this course as all our algorithms require it.

• In addition the proof below is more “geometrical” than that in

the Appendix.

• Note: “A is necessary for B” is equivalent to “B⇒ A”.

• So the Theorem is stating that “For x∗ to be a local minimiser

it is necessary that ∇f(x∗) = 0.”Proof: See App. A.1 for a proof.

Page 46: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 45'

&

$

%

• I call x∗ a stationary point if g(x∗) = 0.

• So, by Theorem 3.4, any local minimiser is a stationary point.

Page 47: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 46'

&

$

%

• Before deriving second-order necessary conditions, I need the

following definition:

Definition 3.7 (Positive (Semi)Definite) An n× n matrix

B is positive definite if pTBp > 0 for all p ∈ Rn,p 6= 0 and

positive semidefinite if pTBp ≥ 0 for all p ∈ Rn.

• The following Theorem relates this important property of a

matrix to whether its eigenvalues are positive/zero/negative.

Theorem 3.5 For a real symmetric matrix M with

eigenvalues λ1, λ2, . . . , λn;

– M is positive definite ⇔ λi > 0 for i = 1, . . . , n.

– M is positive semidefinite ⇔ λi ≥ 0 for i = 1, . . . , n.

Page 48: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 47'

&

$

%

Proof: See App. A.2 for a proof.

Exercise 3.6 Check that the corresponding result holds if M is

positive semidefinite.

Page 49: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 48'

&

$

%

Theorem 3.6 (Second-Order Necessary Conditions) If

x∗ is a local minimiser of f and ∇2f is continuous in an open

neighbourhood of x∗ , then g(x∗) = 0 and ∇2f(x∗) is positive

semidefinite .

Note: again, it is not necessary to assume that f ∈ C2(x∗).See Appendix A.12 for an alternative proof.

Proof: See App. A.3 for a standard proof.

Page 50: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 49'

&

$

%

• I now give sufficient conditions — guaranteeing that x∗ is a

local minimum.

Theorem 3.7 (Second-Order Sufficient Conditions)

Provided that ∇2f is continuous in an open neighbourhood of

x∗ ;

if

– g(x∗) = 0 and

– ∇2f(x∗) is positive definite

then x∗ is a strict local minimiser of f.

(A strict minimiser is a point x∗ where the function takes a

value strictly less than at neighbouring points.)

Proof: See App. A.4 for a proof.

Page 51: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 50'

&

$

%

• Note that the second-order sufficient conditions of Theorem 3.7

are not necessary.

• A point x∗ may be a strict local minimiser and yet fail to

satisfy the sufficient conditions.

Example 3.3 Consider f(x) = x4. The point x∗ = 0 is a strict

local minimiser at which the Hessian matrix ∇2f(x) = 12x2

vanishes and so is not positive definite.

Stopped here Lecture 1&2, Week 1

Page 52: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 51'

&

$

%

• I can easily show that, when the objective function is convex,

local minimum points are global minimum points.

Theorem 3.8 When f is convex, any local minimiser x∗ is a

global minimiser of f. If in addition f is differentiable, then any

stationary point x∗ is a global minimiser of f.

Proof: See App. A.6 for a proof.

Page 53: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 52'

&

$

%

• These results provide the foundations for unconstrained

optimisation algorithms.

• All algorithms seek a point x where g(x) vanishes and some

try to ensure that the Hessian is positive semidefinite.

Page 54: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 53'

&

$

%

3.4 Rates of Convergence

• One of the key measures of performance of an algorithm is its

rate of convergence.

• I now define the key terms which I will use in later work.

• The prefix Q is often used — as in Q–linear, Q–superlinear,

etc. I won’t use it in these Notes.

Definition 3.8 (Linear Convergence) Let xk be a sequence in

Rn that converges to x∗ . I say that the convergence is linear if

there is a constant r with 0 < r < 1 such that

‖xk+1 − x∗‖‖xk − x∗‖

≤ r, for all k sufficiently large. (3.13)

This means that the error (the distance to the solution x∗ )

decreases at each iteration by at least a constant factor.

Example 3.4 The sequence 1+ (0.5)k converges linearly to 1.

Page 55: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 54'

&

$

%

Definition 3.9 (Superlinear Convergence) The convergence is

superlinear if

limk→∞

‖xk+1 − x∗‖‖xk − x∗‖

= 0. (3.14)

Exercise 3.7 Show that the sequence 1+ k−k converges

superlinearly to 1.

Definition 3.10 (Quadratic Convergence) The convergence is

quadratic if

‖xk+1 − x∗‖‖xk − x∗‖2

≤M, for all k sufficiently large. (3.15)

(M is a positive constant, not necessarily less than 1.)

Exercise 3.8 Can you show that quadratic convergence implies

that the error εk ≡ ‖xk − x∗‖ is less than or equal to 1M

(Mε0)2k

where ε0 is the starting value of the error?

So if M < 1/ε0 what can I say?

Page 56: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 55'

&

$

%

• I will show later that

– Steepest Descent Methods converge linearly

– Quasi-Newton Methods converge super-linearly

– Newton’s Method converges quadratically.

Page 57: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 56'

&

$

%

3.4.1 Order Notation

For convenience, I summarise so-called “big-oh” and “little-oh”

notation here. Given two non-negative infinite sequences of scalars

ηk and νk, I write:

Definition 3.11 (“Big Oh”)

ηk = O(νk)

if there is a positive constant C such that ηk ≤ Cνk for all k

suficiently large.

Definition 3.12 (“Little Oh”)

ηk = o(νk)

if the sequence of ratios ηk/νk goes to zero, that is, if:

limk→∞

ηk

νk= 0.

Page 58: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 57'

&

$

%

3.5 Overview of Algorithms

• In this section I preview the algorithms to be studied in more

detail in later Chapters.

• I will not go into detail at this stage.

• There are two fundamental strategies for updating the current

estimate xk to a new estimate xk+1:

Page 59: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 58'

&

$

%

1. Search Direction Methods:

– In the Search Direction strategy, the algorithm

chooses a search direction pk then performs a line

search; i.e. searches along this direction from the current

point for a new point with a lower function value.

– The distance to move along pk can be found by solving

the following one-dimensional minimisation problem to

find a step length αk:

minα>0

f(xk + αpk) (3.16)

– In practice I try to find an approximate solution to 3.16

that is “good enough” — this topic, Line Search, is

discussed in Sec. 4.2.

– Go to Sec. 4.1 to read an introduction to the four most

important Search Direction Methods.

Page 60: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 59'

&

$

%

2. Trust Region Methods: see App. A.13 for a few more detailsbut I won’t cover this material in the course.– Trust Region Methods are very different to Search Direction Methods — I search

a region rather than searching along a certain direction.

∗ The strategy uses information available about f to construct a model function

mk whose behaviour near the current point xk is similar to that of the actual

objective function f.

∗ Because the (often quadratic) model mk may not be a good approximation to f

far from xk, I restrict the search for a minimiser of mk to some region (the

trust region).

Page 61: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 60'

&

$

%

3.6 Exercises

1. Which of the following multivariate functions are

convex/concave/neither? (You’ll need to refer to Defs. 3.5 and

3.7.)

(a) f(x) = ‖x‖(b) f(x) = x21 + 3x

22?

(c) f(x) = x21 + 2x1x2 − x22?

(d) f(x1, x2) = 2x21 + x

22 − 2x1x2

(e) f(x1, x2, x3) = x41 + 2x

22 + 3x

23 − 4x1 − 4x1x2

(f) f(x, y) = (x− 1)2 + 4(x+ y)4

2. Show that the sequence xk = 1/k is not linearly convergent,

though it does converge to zero.

3. Show that the sequence xk = 1+ (0.5)2k

is quadratically

convergent to 1.

Page 62: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 61'

&

$

%

4. Show that the sequence x0 +Abk converges superlinearly to x0

if 0 < A < 1 and 1 < b < 2.

5. Show that the sequence x0 +Abk converges quadratically to x0

if 0 < A < 1 and b = 2.

6. What happens if b > 2?

7. Does the sequence 1/(k!) converge superlinearly or

quadratically?

8. Compute the gradient & Hessian of Rosenbrock’s function

f(x) = (x1 − 1)2 + 10(x2 − x

21)2. (3.17)

Show that x∗ = (1, 1)T is the only minimiser and that the

Hessian H(x, y) is positive definite there.

9. Can you say for which points H(x, y) is positive definite & for

which it is not?

Page 63: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 62'

&

$

%

10. As Figure 3 illustrates, the steepest descent direction p = −∇fis perpendicular to the contours of the function — can you

explain why? (Click A.14 ← here for an answer.)

Page 64: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 63'

&

$

%

11. Show that f(x) = 8x1 + 12x2 + x21 − 2x

22 has only one stationary

point and that it is neither a maximum nor a minimum but is a

saddle point. Sketch (or use Maple/Matlab to sketch) the

contours of f.

12. Let a be a fixed vector in Rnand let A be a fixed n× n real

symmetric matrix. Compute the gradient & Hessian of

f(x) = aTx+ 12xTAx.

13. Consider the function f(x1, x2) = (x1 + x22)2. At the point

xT = (1, 0) let the search direction be pT = (−1, 1). Show that

p is a descent direction and find all minimisers of 3.16.

Page 65: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 64'

&

$

%

14. I’ll say that a function f is poorly scaled if changes to x in a

certain direction produce much larger variations in the value of

f than do changes to x in another direction. An example would

be f(x) = 109x21 + x22. Suppose that a function f of two real

variables is poorly scaled at the solution x∗ . Write two Taylor

expansions of f around x∗ — one along each coordinate

direction — and use them to show that the Hessian ∇2f(x∗) is

ill-conditioned.

Page 66: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 65'

&

$

%

4 Search Direction Methods

4.1 Introduction to Search Direction Methods

In this Section I’ll introduce some methods for choosing the search

direction. The following four methods are introduced below;

• The Steepest Descent Method — Sec. 4.1.2

• Newton’s Method — Sec. 4.1.3

• Quasi-Newton Methods — Sec. 4.1.4

• The Conjugate Gradient Method — Sec. 4.1.5

The last two methods are discussed in much greater detail in

Chapters 5 and 6.

Page 67: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 66'

&

$

%

4.1.1 General Comments on Search Direction Methods

First, a very important Definition.

Definition 4.1 (Descent Direction) Given a function f on

Rn that is differentiable at a point x then any vector p that satisfies

pT∇f(x) < 0 is called a descent direction for f at x. Equivalently,

a descent direction p makes an acute angle with −g(x) ≡ −∇f(x).

• Line search methods may use search directions other than the

steepest descent direction.

• But line search methods always search along descent

directions.

• In general, any descent direction is guaranteed to produce a

decrease in f, provided

– that the step length is sufficiently short

– and that ∇2f is bounded in norm near x.

Page 68: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 67'

&

$

%

• See Figure 2 below.

• I can verify this claim by using Taylor’s Theorem.

• From Eq. 3.12 I have that

f(xk + εpk) = f(xk) + εpkTgk +O(ε2).

• (See Section 3.4.1 for a summary of “big-oh” notation.)

• When pk is a descent direction, the angle θk between pk and

−gk has cos θk > 0 and so

pkTgk = (−1)pk

T (−gk ) = (−1)‖pk‖ ‖gk ‖ cos θk < 0

and so f(xk + εpk) < f(xk) provided ε is sufficiently small &

positive — so that the second derivative term cannot affect the

sign of the change in f.

Page 69: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 68'

&

$

%

−gk

x∗

xk

pk

Figure 2: A descent direction pk

Page 70: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 69'

&

$

%

4.1.2 Steepest Descent Method

• The steepest-descent direction p = −gk is the obvious

choice of search direction for a Search Direction method as it is

the direction along which f decreases most rapidly — at least

for small steps from the start point.

• Surprisingly, it turns out not to be the best choice — as I will

show.

• Let’s derive the method first.

• I use Taylor’s Theorem (Theorem 3.3) to write (see Eq. 3.12):

f(xk + αp) = f(xk) + αpTgk +

1

2α2pT∇2f(xk + ξp),

for some ξ ∈ (0, α) (4.1)

Page 71: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 70'

&

$

%

• If I ignore the quadratic remainder term, the rate of change in

f along the direction p at xk is simply the coefficient of α,

namely pTgk .

• It follows that the unit vector p along which f decreases fastest

is the solution to the problem

minppTgk , subject to ‖p‖ = 1. (4.2)

• Since pTgk = ‖p‖ ‖gk ‖ cos θ, where θ is the angle between p

and gk , I have (as ‖p‖ = 1) that pTgk = ‖gk ‖ cos θ, so the

objective in Eq. 4.2 is minimised when cos θ takes its minimum

value of −1 at θ = π radians.

• So, the solution to Eq. 4.2 is

p = −gk /‖gk ‖.

Page 72: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 71'

&

$

%

pk

x∗

xk

Figure 3: Steepest descent direction in 2D.

Page 73: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 72'

&

$

%

• As Figure 3 illustrates, this direction p is perpendicular to the

tangent to the contour (or in Rn, the level surface— see

Def 2.1) of the function that passes through the current point

— can you explain why?

Exercise 4.1 Think about it then click A.14 ← here for an

answer.

• The steepest descent method is a Search Direction method that

moves along pk = −gk at every step. I will show in Section 4.2

that the steepest descent method is usually so slow at each step

that it is useless in practice!

• In Section 4.2 I will show how to choose the step length αk.

Page 74: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 73'

&

$

%

4.1.3 Newton’s Method

• Another important search direction — the one to which others

are often compared — is the Newton direction.

• This is derived from the second-order Taylor Series

approximation to f(xk + p), which is:

f(xk + p) ≈ fk + pTgk +1

2pT∇2fk p ≡ mk(p) say. (4.3)

• Assuming for the moment that ∇2fk is positive definite (and

therefore invertible), I get the Newton direction by finding the

vector p that minimises mk(p).

• By setting the gradient of mk(p) with respect to p equal to

zero, I find the formula

pNk = −(∇2fk )−1gk . (4.4)

Page 75: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 74'

&

$

%

• The Newton direction pNk can be used in a Search Direction

method when ∇2fk is positive definite as in this case I have

gkTpNk = −gk

T (∇2fk )−1 gk ≤ −σk‖gk ‖2

for some positive σk.

Exercise 4.2 Can you say what σk is?

• Unless the gradient gk (and therefore the Newton step pNk ) is

zero, I have that pNk gkT < 0, so the Newton direction is a

descent direction.

• It is interesting to note that (unlike the steepest descent

method ) there is a natural step length of 1 associated with the

Newton direction.

• Implementations of Newton’s method use the step α = 1 when

possible — reducing it only if necessary.

Page 76: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 75'

&

$

%

• When ∇2fk is not positive definite, the Newton direction may

not be defined.

• Even if it is, pNk may not be a descent direction.

• One way around this is to change ∇2fk to make it positive

definite.

• For example: at every iteration, replace ∇2fk by (∇2fk + αI),

for some α ∈ (−λ−,−2λ−), where λ− is the most negative

eigenvalue of ∇2fk .

• This choice of α ensures that ∇2fk + αI is positive definite.

• More efficient approaches estimate the most negative

eigenvalue of ∇2fk rather than computing them all.

Page 77: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 76'

&

$

%

• Methods based on the Newton direction have a fast rate of

convergence — typically quadratic (see Def. 3.10).

• The main drawback of such methods is the necessity of

computing the Hessian ∇2fk , which is usually

computationally expensive (n(n+1)2

entries to be evaluated).

Page 78: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 77'

&

$

%

4.1.4 Quasi-Newton Methods

• Quasi-Newton search directions (to be studied in Chapter 6)

provide a useful alternative to Newton’s method in that they

do not require computation of the Hessian and yet attain a

superlinear convergence rate.

• In place of the true Hessian, ∇2fk , they use an approximation

Bk, which is updated after each step to take account of the

additional information gained at each step.

• The updates make use of the fact that changes in the gradient

gk = ∇fk provide information about the second derivative of f

along the search direction .

Page 79: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 78'

&

$

%

• If I define

sk = xk+1 − xk, yk = gk+1 − gk .

then I will show in Chapter 6 that successive “approximate

Hessians” can be computed using the BFGS formula (named

after its inventors Broyden, Fletcher, Goldfarb & Shanno),

defined by

Bk+1 = Bk −Bksks

TkBk

sTkBksk+yky

Tk

yTksk. (4.5)

• This update rule preserves the symmetry of the approximation.

• I will show in Chapter 6 that the BFGS rule generates positive

definite updates provided the initial approximation B0 is

positive definite and sTkyk > 0 at each iteration.

Page 80: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 79'

&

$

%

• The quasi-Newton search direction is found by using Bk in

place of the exact Hessian in Eq. 4.4., that is;

pk = −B−1K gk . (4.6)

• To avoid having to solve the linear system Eq. 4.6, I will show

in Chapter 6 that (using a clever transformation), an update

formula can be found for the inverse approximation Hk ≡ B−1k ,

Hk+1 =(I− γksky

Tk

)Hk(I− γkyks

Tk

)+γksks

Tk , γk =

1

yTksk.

(4.7)

• Now the quasi-Newton direction pk can be calculated using the

formula pk = −Hkgk .

Page 81: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 80'

&

$

%

4.1.5 Non-Linear Conjugate Gradient Methods

• The last search direction method in this course (to be studied

in Chapter 5) is the class of non-linear conjugate gradient

methods.

• They take the form

pk = −gk + βkpk−1,

where βk is a scalar that ensures that pk is a descent direction.

• These methods are much better than steepest descent methods

& almost as easy to compute.

• They are not as fast as Newton or quasi-Newton methods but

do not need the exact or approximate Hessian matrix to be

stored — a major consideration for large problems.

Page 82: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 81'

&

$

%

• As I have mentioned, each step of a search direction

method computes a search direction pk and then decides how

far to move along that direction.

• The iteration is given by

xk+1 = xk + αkpk, (4.8)

where the positive scalar αk is called the step length.

• All line search algorithms require that pk be a descent

direction (pkTgk < 0).

Page 83: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 82'

&

$

%

• The search direction often (but not always, see the Conjugate

Gradient Method in Chapter 5) takes the form

pk = −B−1k gk , (4.9)

where Bk is symmetric and non-singular — Bk is usually either

the Hessian or an approximation to the Hessian.

• When pk is defined by 4.9 and Bk is positive definite, then it

is easy to check that pk is a descent direction.

• So the steepest descent method is equivalent to taking Bk = I.

Page 84: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 83'

&

$

%

• In this Section I first discuss in Section 4.2 a set of conditions,

the Wolfe conditions, that allow us to decide how far to step

along a search direction.

• Next I show in Section 4.3 that any method satisfying a set of

conditions (based on the Wolfe conditions) will converge to a

stationary point (zero gradient).

• Then in Section 4.4 I try to measure the rate of convergence of

some commonly used line search methods.

• In Section 4.5 I look at the tricky question of when to stop

generating new search directions.

Page 85: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 84'

&

$

%

4.1.6 Matlab Tools

Having a look at some/all of the following will give you useful

insights into the methods that I will examine later.

• In http://jkcray.maths.ul.ie/ms4327/m-files/ you will

find a simple contour utility and a (two-dim, obviously) version

of Rosenbrock’s function to try it out on.

• (An alternative way to generate contour plots in the Matlab

built-in function ezcontour.)

• See the Matlab demo files in http://jkcray.maths.ul.ie/

ms4327/m-files/SimpleLineSearch/.

• You should read the file http://jkcray.maths.ul.ie/

ms4327/m-files/SimpleLineSearch/Readme.txt first!

Page 86: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 85'

&

$

%

• The file http://jkcray.maths.ul.ie/ms4327/m-files/

SimpleLineSearch/sls.m is a simple Matlab implementation

of the backtracking line search algorithm given on Slide 107

below.

Page 87: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 86'

&

$

%

4.2 Line Searches — How Far Should I Go

Along The Search Direction?

• Suppose that I have selected a search direction p (say using

Newton’s Method or a Quasi-Newton Method).

• So I could “move”(i.e. update x) to x+ p?

• But I may have “overshot” the lowest (smallest f–value) point

along the direction p. Draw a sketch!

• Could I do better to update x to x+ αp for a “good” choice of

the step-size α?

• The “obvious” way to choose α is to seek the global minimiser

of the one-dimensional function φ(·) defined by

φ(α) = f(x+ αp), α > 0, (4.10)

but this is usually too computationally expensive.

Page 88: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 87'

&

$

%

• Instead I use an inexact line search which systematically

generates a sequence of candidate values for α, stopping to

accept one of them when a set of conditions is satisfied.

• In the following I will work with φ and its derivative φ ′.

• Note that φ ′(α) is just the directional derivative at xk + αpk,

i.e. (using the Chain Rule from Sec. 3.2.2)

φ ′(α) = pkT∇f(xk + αpk) ≡ pkTg(xk + αpk) (4.11)

and so

φ ′(0) = pkT∇f(xk) ≡ pkTg(xk). (4.12)

• The line search is often done in two stages; first a bracketing

phase finds an interval containing suitable step lengths, then a

refinement phase which computes a good step length within

this interval.

Page 89: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 88'

&

$

%

• First, I consider appropriate stopping conditions for the line

search algorithm.

• A simple (and reasonable) condition on α is that φ(α) < φ(0).

• This is certainly necessary but does not ensure satisfactory

progress.

• I need to ensure sufficient reduction in φ(α) — or

equivalently in f(xk + αpk) along pk.

Read to here for Lecture 1, Week 2

Page 90: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 89'

&

$

%

4.2.1 The Wolfe Conditions

• One widely used inexact line search condition requires that

αk should give sufficient reduction in f, as measured by:

φ(α) ≤ φ(0) + c1αφ ′(0), (4.13)

for some constant c1 ∈ (0, 1).

• This “sufficient decrease condition” is illustrated in Fig. 4.

Page 91: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 90'

&

$

%

α

φ(α) = f(xk + αpk)

l(α) = φ(0) + c1αφ′(0)

First-order approximation at α = 0

Acceptable step length

Figure 4: The sufficient decrease condition

Page 92: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 91'

&

$

%

• The right-hand-side of Eq. 4.13 which is linear in α, is denoted

l(α).

• The function l has negative slope as pk is a descent direction ,

but because c1 ∈ (0, 1), it lies above the graph of φ for small

positive α.

• The condition simply requires that φ(α) ≤ l(α).

• In practice, c1 is often chosen quite small, say c1 = 10−4, so

even a small reduction in φ will do.

• Unfortunately this rule on its own is no good as it is always

satisfied by α = 0!

Page 93: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 92'

&

$

%

• To rule out unacceptably short steps (or no step at all), I

introduce a second requirement — the curvature condition

— which requires that αk satisfies:

φ ′(α) ≥ c2φ ′(0) (4.14)

for some constant c2 ∈ (c1, 1)

or equivalently

pkT∇f(xk + αpk) ≥ c2pkTgk . (4.15)

• The curvature condition simply ensures that the slope of φ at

αk is greater than c2 times the slope of φ at α = 0.

• As the slope of φ is initially negative, this simply means that

the graph has “flattened out sufficiently” (or has started to

increase).

• This condition is illustrated in Fig. 5.

Page 94: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 93'

&

$

%

α

φ(α) = f(xk + αpk)

Acceptable step length

First-order approximation at α = 0Desired slope: c2φ

′(0)

Figure 5: The curvature condition

Page 95: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 94'

&

$

%

• Typical values of c2 are 0.9 when a Newton-type method is

used and 0.1 when a non-linear conjugate gradient method is

used to calculate pk .

Exercise 4.3 Which choice of c2 is more likely to produce an

α value close to a minimum?

• These two conditions are known collectively as the Wolfe

conditions.

For reference:

φ(α) ≤ φ(0) + c1αφ′(0), (4.16a)

φ ′(α) ≥ c2φ′(0). (4.16b)

with 0 < c1 < c2 < 1.

• They are illustrated in combination in Fig. 6.

Page 96: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 95'

&

$

%

• Note that the combined conditions (for this example at least)

produce an interval which brackets a minimum point of φ(α)

— i.e. a minimum of f(x) along the search direction pk .

α

φ(α) = f(xk + αpk)

First-order approximation at α = 0

l(α) = φ(0) + c1αφ′(0)

Desired slope: c2φ′(0)

Acceptable step length

Figure 6: The combined Wolfe conditions

Page 97: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 96'

&

$

%

• A more stringent version of the Wolfe conditions, the

strong Wolfe conditions require αk to satisfy:

φ(α) ≤ φ(0) + c1αφ′(0), (4.17a)

|φ ′(α)| ≤ c2|φ′(0)| ≡ −c2φ

′(0) (4.17b)

with 0 < c1 < c2 < 1.

• The second condition (4.17b) can be written

c2φ′(0) ≤ φ ′(α) ≤ −c2φ

′(0) (4.18)

— the original (4.16b) with the addition of

φ ′(α) ≤ −c2φ′(0) (4.19)

which ensures that φ ′(α) cannot become too positive, so we

exclude points that are far from stationary points of f.

Page 98: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 97'

&

$

%

• I will prove in Thm. 4.1 that there always exist step lengths

satisfying the (strong) Wolfe conditions provided f is smooth &

bounded below.

α

φ(α) = f(xk + αpk)

First-order approximation at α = 0

Acceptable step length

Minimum slope: c2φ′(0)

Maximum slope: −c2φ′(0)

Figure 7: The strong Second Wolfe condition

Page 99: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 98'

&

$

%

Example 4.1 Suppose that φ(α) = e−α. It is easy to calculate

the range of α–values that satisfy the various Wolfe conditions.

– First Wolfe Condition:

φ(α) ≤ φ(0) + c1αφ ′(0)

e−α ≤ 1− c1α holds for 0 ≤ α ≤ α ≈ 1

c1provided c1 1.

( Can you justify this result? What if c1 is close to 1?)

– Second Wolfe Condition (weak):

φ ′(α) ≥ c2φ ′(0)

−e−α ≥ −c2

e−α ≤ c2

α ≥ ln1

c2> 0.

Page 100: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 99'

&

$

%

– Second Wolfe Condition (strong):

|φ ′(α)| ≤ −c2φ′(0)

c2φ′(0) ≤ φ ′(α) ≤ −c2φ

′(0)

−c2≤ e−α ≤ c2 The blue inequality holds as c2 > 0.

α ≥ ln1

c2The same as the “weak” WC2.

– So Weak/Strong Wolfe Conditions satisfied if

ln 1c2≤ α ≤ α ≈ 1

c1when c1 1. Check that the result is

(approximately) ln 1c2≤ α ≤ α ≈ 2(1− c1) when c1 ≈ 1.

(You can get a good approximation for intermediate values

of c1 by interpolating: α ≈ (1− c1)/c1 + 2c1(1− c1).)

Exercise 4.4 Check this all makes sense by plotting for

(say) c1 = 0.1, c1 = 0.5 and c1 = 0.9.

Page 101: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 100'

&

$

%

• That was a pretty simple example — e−α is monotone

decreasing.

• The next example is still easy to sketch but it is not as easy to

calculate the range of α–values.

• Of course in practice I don’t try to calculate the range of

α–values that satisfy the Wolfe conditions — I use a search

method to try to find some α–value that satisfies them.

Page 102: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 101'

&

$

%

Example 4.2 Let φ(α) = 1− sinα. Then (just looking for the

first interval where the conditions hold)

– WC1: 1− sinα ≤ 1− c1α or sinα ≥ c1α. There is no

“formula” for the α–range but when c1 < 2/π, this holds at

least in the interval [0, π/2]. As c1 decreases, the interval

widens approaching [0, π] as c1 → 0 — draw a sketch.

– WC2 (weak): − cosα ≥ −c2 or cosα ≤ c2 which holds when

α ≥ arccos c2.

– WC2 (strong): −c2 ≤ − cosα ≤ c2 or −c2 ≤ cosα ≤ c2which holds when arccos c2 ≤ α ≤ π− arccos c2.

So if α ∈ [arccos c2,min(π/2, π− arccos c2)] then the strong

Wolfe conditions hold.

Page 103: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 102'

&

$

%

Exercise 4.5 Download

http: // jkcray. maths. ul. ie/ ms4327/ m-files/ wolfe. m

and experiment with the effects of changing c1 and c2.

Exercise 4.6 Download http:

// jkcray. maths. ul. ie/ ms4327/ m-files/ WolfeGen. m and

http:

// jkcray. maths. ul. ie/ ms4327/ m-files/ TestFun. m .

Now experiment with the effects of changing c1 and c2. Edit

TestFun to change φ(α).

See Exercise 10 for some trickier examples.

Page 104: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 103'

&

$

%

• A nice result which I will now prove is that, provided that p is

a descent direction, there are always α–values that satisfy the

Wolfe conditions.

• (Of course, I still have to find them.)

Theorem 4.1 Suppose that f : Rn → R is C1. Let pk be a

descent direction at xk and assume that f is bounded below

along the ray xk + αpk|α > 0. Then if 0 < c1 < c2 < 1 there

exists at least one interval of step lengths satisfying the Wolfe

conditions Eqs. 4.16a and 4.16b.

Proof: (You will find that a sketch graph makes the proof

easy to follow.)

Since φ(α) = f(xk + αpk) is bounded below for all α > 0 and

since 0 < c1 < 1, the line l(α) = φ(0) + c1αφ′(0) must

intersect the graph of φ at least once (as l(α) decreases

without limit and φ does not).

Page 105: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 104'

&

$

%

Let α ′ > 0 be the first intersecting value of α, i.e.

φ(α ′) = φ(0) + α ′c1φ′(0). (4.20)

The sufficient decrease condition Eq. 4.16a must hold for all

smaller step lengths α < α ′ — as, for small α, φ(α) < l(α) as

φ initially decreases more rapidly than l.

By the Mean Value Theorem, there exists α ′′ ∈ (0, α ′) such

that

φ(α ′) − φ(0) = (α ′ − 0)φ ′(α ′′) ≡ α ′φ ′(α ′′) (4.21)

Combining Eqs. 4.20 and 4.21, I have

φ ′(α ′′) = c1φ′(0) > c2φ

′(0), (4.22)

since c2 > c1 > 0 and φ ′(0) < 0.

Page 106: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 105'

&

$

%

Therefore α ′′ satisfies the Wolfe conditions Eqs. 4.16a and

4.16b.

By the smoothness assumption on f, there is an interval around

α ′′ for which the Wolfe conditions hold.

Finally, as the term in the left hand side of Eq. 4.22 is negative,

the strong Wolfe conditions Eqs. 4.17a and 4.17b hold in the

same interval.

Page 107: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 106'

&

$

%

4.2.2 Sufficient Decrease & Backtracking

• I have shown that the sufficient decrease condition Eq. 4.16a

alone is not sufficient to ensure that the algorithm makes

reasonable progress along the given search direction.

• However, if the line search algorithm chooses its candidate step

lengths appropriately, by using a backtracking approach, I

can dispense with Eq. 4.16b and use just the sufficient decrease

condition to terminate the line search procedure.

• In its simplest form, backtracking takes the form:

Page 108: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 107'

&

$

%

Algorithm 4.1 (Backtracking Line Search)

Choose α > 0 and ρ, c ∈ (0, 1)

α = α

while φ(α) ≥ φ(0) + cαφ ′(0) do

α := ρα

end while

αk = α

Page 109: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 108'

&

$

%

• In this algorithm, the initial step length α is chosen to be 1 in

Newton-type methods but may be smaller in algorithms such

as steepest descent or nonlinear conjugate gradient methods .

• An acceptable step length will be found after a finite number

of trials as αk will eventually become small enough that the

sufficient decrease condition will hold.

• The backtracking approach ensures that either the selected

step length αk is some fixed value (the initial choice α) or else

that it is short enough to satisfy the sufficient decrease

condition — but not too short.

• The latter follows as the accepted value αk is close to the

previous value which was rejected for being too long!

Page 110: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 109'

&

$

%

• A nice feature of this simple algorithm is that it is guaranteed

to produce an interval which satisfies the Wolfe conditions.

• To make it clear what is going on; a Theorem:

Theorem 4.2 Provided at least one iteration takes place, then

for ρ sufficiently close to 1 (i.e. provided the backtracking is

sufficiently slow) the algorithm Alg 4.1 will produce an interval

I = [α1, α2] such that the Wolfe conditions Eqs. 4.16a and

4.16b are satisfied for all α ∈ I with c1 = c and for some

c2 > c1.

Proof: See Appendix A.16.

• Obviously I don’t know in advance how close to 1 the constant

ρ needs to be — so this simple algorithm isn’t as bulletproof as

it appears.

Stopped here Lecture 1 & 2 , Week 2 Read to here

Page 111: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 110'

&

$

%

for Lecture 2, Week 2

Page 112: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 111'

&

$

%

4.2.3 Do Not Read This!

• For the interested student, detailed material on practical line search algorithms may be

found in Appendices A.20 and A.21.

• In Appendix A.20 I first discuss some preliminary material then present a step length

selection method that will converge under very general conditions.

• Appendix A.21 also includes proofs that the algorithm converges to step lengths that

satisfy the Wolfe conditions.

Page 113: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 112'

&

$

%

4.3 Are Search Direction Methods Guaranteed

To Converge?

• To ensure that an algorithm converges to a point x where

∇f(x) = 0, I need not only well-chosen step lengths but also

well-chosen search directions pk .

• To improve readability I will write ∇fk as gk from now on.

• I focus in this section on a key parameter, the angle θk

between pk and the steepest descent direction −gk ≡ −∇f(xk)defined by

cos θk =−pk

Tgk‖gk‖ ‖pk‖

. (4.23)

• It turns out that when the Wolfe conditions hold I can prove

convergence for almost any line search method — irrespective

of the details of the algorithm.

Page 114: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 113'

&

$

%

• I need a Theorem that gives sufficient conditions for

convergence.

• First a technical definition:

Definition 4.2 (Lipschitz Continuity) A function

f : Rn → R is Lipschitz continuous on an open set N if

there exists a positive constant L such that

|f(x) − f(y)| ≤ L‖x− y‖, for all x, y ∈ N . (4.24)

A Lipschitz continuous function is certainly continuous.

• Loosely speaking, this means that the function f cannot have a

rate of change greater than the constant L —- in other words,

the directional derivative (when defined) along any direction

from a given point is bounded between −L and L.

• On R, the slope (at any point where it is defined) can never be

greater than L or less than −L.

Page 115: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 114'

&

$

%

• If the gradient g(x) = ∇f(x) is Lipschitz continuous on an

open set N then the function f is certainly C1 on N .

• I use the change in the norm of the gradient ‖g(x) − g(y)‖ in

the definition above in this case.

• In addition if the gradient vector g(x) is Lipschitz continuous

then g(x) cannot change faster than the constant L.

• Exercise 4.7 Make a sketch to illustrate Lipschitz continuity.

Page 116: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 115'

&

$

%

• If the Hessian of f has eigenvalues bounded in magnitude, in

particular if

‖∇2f(x)‖ ≤M, ∀x ∈ N , (4.25)

(the 2-norm of a symmetric matrix is the magnitude of its

largest eigenvalue) then I can use Taylor’s Thm. 3.11 to show

that the gradient ∇f is Lipschitz continuous.

• So Lipschitz continuity of the gradient is a weaker condition

than (4.25) — I am not asking so much of the function f.

• See App. A.15 for the details.

Page 117: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 116'

&

$

%

Theorem 4.3 (Zoutendijk) Consider any iteration of the

form 4.8, where

– pk is a descent direction

– αk satisfies the Wolfe conditions Eqs. 4.16a and 4.16b

– f is bounded below in Rn

– that the gradient g ≡∇f is Lipschitz continuous in an

open set N containing the “level set” L ≡ x : f(x) ≤ f(x0),where x0 is the starting point.

Then∑k≥0

cos2 θk ‖gk ‖2 <∞ (The sum converges.) (4.26)

Page 118: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 117'

&

$

%

• Before proving the Theorem — let’s see why it is so important.

• The inequality Eq. 4.26, referred to as the Zoutendijk

condition, implies that

cos2 θk ‖gk ‖2 → 0. (4.27)

• This limit implies global convergence for the various line

search algorithms, provided that my method for choosing the

search direction pk at each iteration ensures that cos2 θk does

not converge to zero — or equivalently that the angle θk

defined in 4.23 is bounded away from 90.

• This follows because if there is a positive constant δ such that

cos θk ≥ δ > 0 for all k, then Eq. 4.27 immediately implies that

limk→∞ ‖gk ‖ = 0. (4.28)

Page 119: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 118'

&

$

%

• So I know that the gradient norms converge to zero, provided

that the search directions are never too close to being

perpendicular to the gradient.

• In particular, the steepest descent method is guaranteed to

produce a sequence of gradients which converge to zero,

provided that the line search satisfies the Wolfe

conditions.

• This shows the importance of the Wolfe conditions.

Page 120: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 119'

&

$

%

• Finally; the assumptions in the Theorem are not overly

restrictive.

– If f were not bounded below, the problem would not have a

solution.

– As discussed above, the Lipschitz condition 4.24 on the

gradient (essentially a smoothness assumption about f)

holds — for example — if f is C2 and the Hessian is

uniformly bounded in norm (so that the maximum

eigenvalue is less than some constant).

Page 121: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 120'

&

$

%

• I now present the proof of Theorem 4.3, ( Zoutendijk’s).

Proof: From the Second Wolfe condition Eq. 4.16b and

from the update rule 4.8,I have that

(gk+1 − gk )Tpk ≥ (c2 − 1)gk

Tpk,

while the Lipschitz condition 4.24 implies that

(gk+1 − gk )Tpk ≤ αkL‖pk‖2.

Combining these two inequalities, I find that

αk ≥c2 − 1

L

gkTpk

‖pk‖2.

Page 122: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 121'

&

$

%

Substituting this inequality into the first Wolfe condition

Eq. 4.16a, I have

fk+1 ≤ fk − c11− c2L

(gk

Tpk)2

‖pk‖2.

Page 123: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 122'

&

$

%

From the definition 4.23 of θ I write this relation as

fk+1 ≤ fk − c cos2 θk‖gk ‖2,

where c = c1(1− c2)/L. By summing this expression over all

indices less than or equal to k, I have

fk+1 ≤ f0 − ck∑j=0

cos2 θj‖gj‖2. (4.29)

As f is bounded below, I know that f0 − fk+1 is less than some

positive constant, for all k.

So the sum from 0 to k is bounded above for all k.

Page 124: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 123'

&

$

%

But if a sequence is bounded above and is non-decreasing then

it has a limit. So, taking the limit as k→∞ in 4.29, I have

∞∑j=0

cos2 θj ‖gj‖2 <∞.

Page 125: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 124'

&

$

%

• I use the term globally convergent to refer to algorithms for

which the property 4.28 holds.

• In other words, globally convergent algorithms are ones which

converge to a stationary point.

• Unfortunately, instead of a minimum point I could converge to

a maximum point which is also a stationary point!

• To ensure that this does not happen I need “second-order”

restrictions on the search direction pk .

• Remember that a necessary condition for x∗ to be a minimum

point is that the Hessian ∇2f(x∗) be positive

semidefinite (Thm. 3.6).

Page 126: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 125'

&

$

%

4.3.1 A Class of Methods Which Satisfy the

Requirements for Zoutendijk’s Thm.

• Consider the Newton-like method (4.8, 4.9) . Assume that the

matrices Bk are positive definite with a uniformly bounded

condition number, i.e. that

‖Bk‖ ‖B−1k ‖ ≤M, for all k.

• This is a desirable property in any case as it ensures that the

errors that result from solving the Newton equation Bp = −g

are also bounded.

• In Appendix A.23 I give the definition of the standard

Euclidean norm of a square matrix B and show that it reduces

to ‖B‖ = maxi=1,...,n

√Λi where Λi are the eigenvalues of the

symmetric positive semidefinite matrix BTB.

Page 127: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 126'

&

$

%

• In fact, when B = BT (B is symmetric) as the Hessian is, the

formula simplifies to ‖B‖ = maxi=1,...,n

|λi| — the largest of the

eigenvalues of B in absolute value.

• So

‖Bk‖ ‖B−1k ‖ ≤M, for all k.

is equivalent to|λmax|

|λmin|≤M, for all k.

• Which means that the largest eigenvalue never gets too big and

the smallest eigenvalue never gets too small.

Page 128: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 127'

&

$

%

• Then it is easy to check that (see Exercise 4 on Slide 155 at the

end of this Section):

cos θk ≥ 1/M. (4.30)

• Combining this bound with 4.27 I again find that

limk→∞ ‖gk ‖ = 0.

• For conjugate gradient methods (see Ch. 5), obviously the

result (4.30) above may not hold as information about the

Hessian is not usually available.

• A weaker result can be proved; namely that a subsequence of

the gradient norms converges to zero.

• In practice this is good enough — why?

Page 129: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 128'

&

$

%

4.4 How Quickly Do Search Direction Methods

Converge?

• The conclusion from the previous Section is that to ensure

convergence I need to choose my search directions so that the

angles θk do not converge to π/2 as k→∞.

• However, this is no guarantee of the speed or rate of

convergence — I want an algorithm that converges to a

stationary point (where g = 0) as fast as possible.

Page 130: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 129'

&

$

%

4.4.1 Convergence Rate for Steepest Descent Method

• The special case of the steepest descent method for a quadratic

problem with exact line searches turns out to be instructive.

• Let the quadratic objective f(x) be given by:

f(x) =1

2xTQx− bTx, (4.31)

where Q is symmetric and positive definite.

• The gradient is just g(x) = Qx− b and the minimiser x∗ is the

unique solution of the linear system Qx = b.

Page 131: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 130'

&

$

%

• The step length that exactly minimises f(xk − αgk ) must

satisfyd

dαf(x− αgk ) = 0.

• Using the Chain Rule it is easy to see that

gkTg(xk − αgk ) = 0 (4.32)

and so, using g(x) = Qx− b, I have

0 = gkT

(Q(xk − αgk ) − b

)0 = gk

T

(gk − αQgk

).

• So I can solve for α, giving

αk =gk

Tgkgk

TQgk. (4.33)

Page 132: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 131'

&

$

%

• If I use this exact minimiser αk , the steepest descent iteration

for 4.31 is

xk+1 = xk −

(gk

Tgkgk

TQgk

)gk . (4.34)

• Note that gkTgk+1 = 0 so successive search

directions (gradients) are perpendicular.

• This causes the characteristic “zig-zag” behaviour of the

steepest descent method — see Figure 8.

• The objective will usually be “approximately quadratic” at

least locally and the step length may be close to the exact

minimiser αk — so often gkTgk+1 ≈ 0 even for a general

non-quadratic problem.

Read to here for Lecture 1, Week 3

Page 133: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 132'

&

$

%

xk

xk+1

xk+2

x∗pk

Figure 8: Typical Steepest Descent steps

Page 134: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 133'

&

$

%

• To quantify the rate of convergence I introduce the weighted

norm ‖x‖2Q ≡ xTQx.

• Using the equation Qx∗ = b, you should check (by expanding

each side) that for any x we have

f(x) − f(x∗) =1

2‖x− x∗‖2Q (4.35)

• Using 4.34 and noting that gk = Qxk − b ≡ Q(xk − x∗), I can

show that (see Ex. 5 on Slide 155):

‖xk+1 − x∗‖2Q =

1−

(gkTgk )

2

(gkTQgk )(gk

TQ−1gk )

‖xk − x∗‖2Q

(4.36)

• It is easier to interpret this result if I bound it in terms of the

condition number κ =λmax

λmin.

Page 135: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 134'

&

$

%

Theorem 4.4 When the steepest descent method with exact

line searches is applied to the (convex) quadratic function 4.31,

the error norm 4.35 satisfies

‖xk+1 − x∗‖2Q ≤(κ− 1

κ+ 1

)2‖xk − x∗‖2Q. (4.37)

Proof: See Ex. 7 on Slide 156 or see Ex. 8 for a neater proof.

• It follows that the function values fk converge to the minimum

f∗ at a linear rate.

• If the condition number κ(Q) = λmax/λmin is large, then the

contours become stretched, the zig-zagging gets worse and the

constant factor in Eq. 4.37 → 1 so the convergence slows.

Page 136: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 135'

&

$

%

• It can be shown that essentially the same result holds for

general objective functions:

Theorem 4.5 Suppose that f : Rn → R is C2 and that the

iterates generated by the steepest descent method with exact line

searches converge to a point x∗ where the Hessian matrix

∇2f(x∗) is positive definite. Then

f(xk+1) − f(x∗) ≤

(κ− 1

κ+ 1

)(f(xk) − f(x

∗)

). (4.38)

Proof: Not given.

Page 137: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 136'

&

$

%

• If the rate of convergence is poor with an exact line search then

it isn’t going to be any better when an inexact line search is

used.

• So the Theorem shows that the steepest descent method can be

unacceptably slow, even when the Hessian is reasonably

well-conditioned.

Exercise 4.8 If κ(Q) = 800, f(x1) = 1 and f(x∗) = 0, check

that the function value could be still as large as 0.08 — a

reduction by a factor of only about 12 — after a thousand

iterations of the steepest descent method !

And a condition number κ = 800 is not particularly extreme.

Page 138: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 137'

&

$

%

4.4.2 Convergence for Newton’s Method

• Consider the Newton iteration where the search direction is

given by

pNk = −∇2fk−1gk . (4.39)

• I restrict myselves to the case where the Hessian ∇2fk is

positive definite — this is a sufficient condition for pk to be a

descent direction.

• In this case I can achieve quadratic convergence — as good as

it gets.

• This result is stated and proved in the following Theorem.

• For readability I’ll refer to the gradient ∇f(x) as g(x) and the

Hessian ∇2f(x) as H(x) in the following.

Page 139: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 138'

&

$

%

Theorem 4.6 Let f : Rn → R be C3.

• Let x∗ be such that g(x∗) = 0 (x∗ a stationary point) and H(x∗)

is positive definite (so x∗ is a local minimum point).

• Let R = ‖x0− x∗‖ be the distance from the start point x0 to x∗.

• Assume that R is small enough for the condition R < 1k1k2

to

hold for some k1, k2 > 0 defined by the two conditions:

1. the inverse Hessian is bounded in norm: ‖H(x)−1‖ ≤ k12. the remainder term in a second-order Taylor expansion of

g(x∗) centred at x is uniformly bounded:

‖g(x∗) − g(x) −H(x)(x∗ − x)‖ ≤ k2‖x∗ − x‖2

for each x inside the ball B = ‖x− x∗‖ ≤ R.

Page 140: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 139'

&

$

%

• Condition 1 is equivalent to |λmin| ≥ 1/k1, so |λmin| may be

small when k1 large.

– If k1 1, H(x) may be close to singular for some x values.

• If k2 1 then a quadratic approximation to g(x∗) is poor.

• Note that if k1 and k2 are large then the start point x0 has to

be very close to x∗ (‖x0 − x∗‖ = R < 1/k1k2) for the Theorem

to apply.

Then the algorithm converges to x∗ with quadratic convergence.

Page 141: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 140'

&

$

%

Proof:

• I have B = x : ‖x− x∗‖ ≤ R = ‖x0 − x∗‖ — the ball centred at

x∗ with x0 on the boundary.

• I need to show that if x ∈ B then the new point x ′ = x+ p

where p satisfies H(x)p = −g(x) is closer to the centre of the

ball than x is.

• Now (assuming x 6= x∗) the path from x∗ to the new point x ′ is

x ′ − x∗ = (x− x∗) −H−1(x)

(g(x) − g(x∗)

)

= H−1(x)

(g(x∗) − g(x) −H(x)(x∗ − x)

)since g(x∗) = 0.

Page 142: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 141'

&

$

%

• So, using the assumptions stated in the Theorem, I have

‖x ′ − x∗‖ =

∥∥∥∥∥H(x)−1(g(x∗) − g(x) −H(x)(x∗ − x)

)∥∥∥∥∥≤ ‖H(x)−1‖

∥∥∥∥∥g(x∗) − g(x) −H(x)(x∗ − x)∥∥∥∥∥

≤ k1k2‖x− x∗‖2 ≤ k1k2‖x0 − x∗‖‖x− x∗‖

< ‖x− x∗‖.

This shows that the new point is always “better” than the old —

closer to x∗ .

Page 143: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 142'

&

$

%

Finally, I have that for any xk ∈ B, the new point xk+1 produced

by Newton’s method satisfies ‖xk+1 − x∗‖ ≤ k1k2‖xk − x∗‖2 from

the above discussion. Since xk → x∗ I have at least quadratic

convergence.

Page 144: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 143'

&

$

%

4.4.3 Convergence for Quasi-Newton Methods

Finally suppose that the search direction pk is defined by 4.9

where the symmetric and positive definite matrixx1 Bk is updated

at each iteration by a quasi-Newton update formula (such as

BFGS). I will assume that the step length αk will be computed by

an inexact line search that satisfies the Wolfe or strong Wolfe

conditions with the addition that the step length α = 1 will always

be tried first and accepted if it satisfies the Wolfe conditions.

It can be shown that if the search direction of a quasi-Newton

method approximates the Newton direction well enough, then the

unit step length will satisfy the Wolfe condition as the iterates

converge to the solution. I will also state a result which gives a

condition that the search direction must satisfy in order to give

rise to superlinear convergence.

Page 145: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 144'

&

$

%

Theorem 4.7 Suppose that f : Rn → R is C3. Consider the

iteration xk+1 = xk + αkpk, where pk is a descent direction and

αk satisfies the Wolfe conditions with c1 <12

. If the sequence xk

converge to a point x∗ such that g(x∗) = 0 and ∇2f(x∗) is positive

definite and if the search direction satisfies

limk→∞

‖gk +∇2fkpk‖‖pk‖

= 0, (4.40)

then

(i) the step length αk = 1 is admissable for all k greater than

some k0 and

(ii) if αk = 1 for all k > k0 then xk converges to

x∗ superlinearly.

Page 146: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 145'

&

$

%

If pk is a quasi-Newton method search direction then 4.40 is

equivalent to

limk→∞

‖(Bk −∇2fk)pk‖‖pk‖

= 0, (4.41)

so superlinear convergence can be achieved provided that the

sequence of Bk become increasingly accurate approximations to

∇2fk along the direction pk .

Proof: Not given.

For Newton’s method , the limit 4.40 is automatically satisfied (the

ratio is zero for all k) and Theorem 4.7 shows that the Wolfe

conditions will accept the step length αk for all large k. So when

Newton’s method is implemented using these conditions and when

the line search always tries the unit step length first; the

algorithm will set αk = 1 for all large k and attain a quadratic

rate of convergence.

Page 147: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 146'

&

$

%

4.5 When To Stop

• The question of when to accept an approximate solution to a

minimisation problem at first seems easy to answer: I stop

when the gradient is zero — or in practice when ‖g(x)‖ is

sufficiently small.

• This guarantees that I am at or near a stationary point.

• If the Hessian is positive definite I know that I am at or near a

local minimum.

• But: should I monitor ‖∆x‖, the change in x from iteration to

iteration too? (After all if x is not changing appreciably then

no progress is being made.)

• And what about |∆f|, the change in the objective function?

(Again, if f(x) is “stuck” then I might as well stop?)

Page 148: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 147'

&

$

%

• I need to sort out the relationship between |∆f|, ‖∆x‖ and

‖g(x)‖.

• The following Theorem clarifies this relationship.

• For readability I again refer to the gradient ∇f(x) as g(x) and

the Hessian ∇2f(x) as H(x) in the following.

Page 149: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 148'

&

$

%

Theorem 4.8 Let f ∈ C2(R). Let x∗ be a local minimum for f on

for an open ball B(x∗) centred at x∗ (of radius R, say).

Suppose that there is a number m > 0 such that for all x in the ball

B(x∗)m‖d‖2 ≤ dTH(x)d, ∀d ∈ Rn.

(In words, the inverse of the Hessian f has uniformly bounded

2-norm on B(x∗) — can you see why?)

Then, ∀x ∈ B,

‖x− x∗‖ ≤ ‖g(x) ‖m

(4.42)

f(x) − f(x∗) ≤ ‖g(x) ‖2

m. (4.43)

Page 150: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 149'

&

$

%

Informally:

• If ‖g(x)‖ is small then x is close to x∗.

• If ‖g(x)‖ is small then f(x) is really close to f(x∗)!

Page 151: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 150'

&

$

%

Proof:

• Taylor’s Thm. 3.11 gives:

g(x) − g(x∗) =

∫10

H (x∗ + t(x− x∗)) (x− x∗)dt.

• As g(x∗) ≡ 0, I have that for any x ∈ B,

(x− x∗)Tg(x) =

∫10

(x− x∗)TH (x∗ + t(x− x∗)) (x− x∗)dt

≥ m∫10

‖x− x∗‖2dt

= m‖x− x∗‖2.

• Using the Cauchy-Schwartz Inequality;

(x− x∗)Tg(x) ≤ ‖x− x∗‖‖g(x) ‖,

and so m‖(x− x∗)‖2 ≤ ‖(x− x∗)‖‖g(x) ‖ which proves (4.42).

Page 152: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 151'

&

$

%

• Now define F(t) = f(x∗ + t(x− x∗)) for t ∈ [0, 1].

• Then F ′(t) = (x− x∗)Tg(x∗ + t(x− x∗)) and

F ′′(t) = (x− x∗)TH(x∗+ t(x− x∗))(x− x∗) ≥ m‖(x− x∗)‖2 ≥ 0.

• So F ′(t) is a non-decreasing function of t and so F ′(1) ≥ F ′(t)for all t ∈ [0, 1].

• Obviously∫10F ′(t)dt ≡ F(1) − F(0) ≡ f(x) − f(x∗) for t ∈ [0, 1].

• But the integral is bounded above by

F ′(1) ≡ (x− x∗)Tg(x) ≤ ‖x− x∗‖‖g(x) ‖ (again by the C-S

inequality).

• The result (4.43) follows using (4.42) to eliminate ‖x− x∗‖ .

Read to here for Lecture 2, Week 3

Page 153: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 152'

&

$

%

The significance of the Theorem is easy to extract.

• If I place a bound on ‖g(x) ‖ as a stopping criterion, then I

have implicitly stated (at least approximately) stopping criteria

for ‖∆x‖ and |∆f(x)|.

• In detail, if my stopping criterion is ‖g(x) ‖ ≤ ε for some small

quantity ε, then (if x ′ is the current estimate and x the

previous one) by the triangle inequality

‖x− x ′‖ ≤ ‖x− x∗‖+ ‖x ′ − x∗‖.

• The Theorem tells us that if the stopping criterion on the

gradient held at x and x ′ then

‖∆x‖ ≡ ‖x− x ′‖ ≤ 2εm

(4.44)

• Similarly,

|∆f| ≡ |f(x) − f(x ′)| ≤ 2ε2

m. (4.45)

Page 154: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 153'

&

$

%

• Or, to turn things around, the most demanding stopping

criterion that I can reasonably impose for |∆f| is |∆f| ≤ Kε(where K is some constant such as 10 or |f(x0)| and ε = εM —

machine epsilon, about 10−16).

• It follows that it only makes sense to bound ‖∇f‖ and ‖∆x‖ by

multiples of√ε, about 10−8.

• Finally, the above can be easily extended to apply to ∆φ, ∆α

and |φ ′|

Stopped here Lectures 1&2, Week 3

Page 155: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 154'

&

$

%

4.6 Exercises

1. Use Matlab (or Octave) to program the steepest descent

method and Newton’s method algorithms using the

backtracking line search , Algorithm 4.1. Use them to minimise

the Rosenbrock function 3.17 on Slide 61. Set the initial step

length α0 = 1 and print the step length used by each method

at each iteration. First try the initial point x0 = (1.2, 1.2) and

then the more difficult point x0 = (−1.2, 1).

2. Show that if c1 >1

2, a line search would exclude the minimiser

of a quadratic so the restriction c1 ≤1

2is reasonable. Hint:

write φ(α) = φ0 +αφ′0 +

12α2φ ′′0 , find the α–range specified and

compare with α∗, the α–value that minimises φ(α).

Page 156: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 155'

&

$

%

3. Show that the one-dimensional minimiser of a strongly convex

quadratic function is given by αk = −gk

TpkpkTQpk

. Hint: now write

φ(α) = fk + pTgk +

12pTQp and substitute the values of φ0, φ

′0

and φ ′′0 into α∗ found in the previous question.

4. Derive Eq. 4.30 on Slide 127. Hint: use the fact that as

‖B‖ = |λmax| I can write ‖B−1‖ = 1|λmin|

. (See Appendix A.17 for

a solution.)

5. Prove the result Eq. 4.36 on Slide 133. See

http://jkcray.maths.ul.ie/ms4327/Pic1.jpg and

http://jkcray.maths.ul.ie/ms4327/Pic2.jpg for a solution.

6. Let Q be a positive definite symmetric matrix. Prove that for

any vector x,

(xTx)2

(xTQx)(xTQ−1x)≥ 4λmaxλmin

(λmax + λmin)2.

Page 157: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 156'

&

$

%

(This relation is called the Kantorovitch inequality and a proof

is given in Appendix A.18.)

7. Use the Kantorovitch inequality to deduce Eq. 4.37 from

Eq. 4.36.

8. By looking at the special case where f(x) = 12xTQx (no linear

term), prove Eq. 4.37 without using the Kantorovitch inequality.

See Appendix A.19 for details.

9. Program the BFGS algorithm using the line search algorithm

described in this Chapter which implements the strong Wolfe

conditions . Use your program to re-solve the problem at the

end of Exercise 1.

10. Find the range of α–values that satisfy the strong Wolfe

Page 158: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 157'

&

$

%

conditions for the following functions:

(i) cosα (ii)1− sinα/10

(iii)(α− 1)2 (iv)α3 + α2 − α+ 1

(Use the Matlab function m-file

http://jkcray.maths.ul.ie/ms4327/m-files/WolfeGen.m to

plot and solve the problem before trying an algebraic solution.)

Page 159: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 158'

&

$

%

5 Conjugate Gradient Methods

The conjugate gradient method can be viewed in two ways; it is a

very effective method for solving large linear systems of equations

and it can (as I will show) be adapted to solve (in particular very

large) nonlinear optimisation problems.

In this course I have no interest in algorithms for solving linear

systems.

Page 160: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 159'

&

$

%

Despite this, because of:

1. the historical development of conjugate gradient methods

2. and the fact that the nonlinear conjugate gradient

method follows naturally from the older “linear” version

designed for the solution of linear systems,

the Chapter is divided into two Sections, the linear conjugate

gradient method and the nonlinear conjugate gradient method. In

the first Section the linear conjugate gradient method & its

properties are examined. I will move quickly though the Section

noting the results without examining the proofs.

This material is for reference only.

Section 2, on the nonlinear conjugate gradient method will examine

the extensions of the linear conjugate gradient method to

non-linear problems, my real objective.

Page 161: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 160'

&

$

%

5.1 Linear Conjugate Gradient Method

In the following I will often drop the word “linear” for brevity. The

conjugate gradient method is an iterative method for solving a

system of linear equations

Ax = b, (5.1)

where A is n× n, symmetric & positive definite. The problem can

be restated as the following minimisation problem:

minφ(x) =1

2xTAx− bTx (5.2)

Note that the gradient of φ is the residual or error r(x) of the

linear system:

∇φ(x) = Ax− b ≡ r(x) ≡ g(x). (5.3)

and that the Hessian of φ is just the constant matrix A.

Page 162: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 161'

&

$

%

• The Steepest Descent direction is the obvious choice for the

starting search direction p0 = −∇f(x0).

• As the residual r(x) ≡ the gradient g(x) for the linear CGM,

I’ll use the familiar g(x) from now on.

• I have skipped the ingenious derivation of the Linear Conjugate

Gradient Method.

• The method generates a succession of search direction

(so-called “conjugate directions”) pk+1 which are formed from

the previous search direction pk and the gradient gk+1.

• These search directions are descent directions and have other

useful properties — when I am solving a linear system.

• But in this course these properties are not important.

Page 163: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 162'

&

$

%

I can summarise the algorithm as follows:

Algorithm 5.1 (linear CGM) Given x0.

g0 ← Ax0 − b,p0 ← −g0, k← 0

while gk 6= 0 do

αk ← gkTgk

pTkApk

≡ ‖gk‖2

pTkApk

;

xk+1 ← xk + αkpk;

gk+1 ← gk + αkApk

βk+1 ← gTk+1gk+1gkTgk

≡ ‖gk+1‖2

‖gk‖2;

pk+1 ← −gk+1 + βk+1pk;

k← k+ 1

end while

Page 164: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 163'

&

$

%

I won’t explain the algorithm in detail but:

• the formula for the step length α in Line 4 comes from the

formula for the exact minimum of a quadratic function found in

Ex. 3 in Exercises 4.6, using the (non-obvious) fact that for the

linear conjugate gradient method, gk ⊥ pi, i = 0, . . . , k− 1.

• The formulas in Lines (7) and (8) for the new search direction

pk+1 are crucial to the conjugate gradient method. — they are

designed to ensure that pTj Apk = 0, for j 6= k, the so-called

“conjugacy” property.

• This property will only hold approximately if at all for a

general non-linear minimisation (see Section 5.2).

Page 165: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 164'

&

$

%

At any given point, I never need to know the vectors x, g and p for

more than two iterations.

Before moving on to the major topic of this Chapter, the nonlinear

conjugate gradient method , I’ll mention the convergence properties

of the linear conjugate gradient method – the reasoning being: I

cannot hope that the conjugate gradient method will perform

better on general non-linear problems than on the simple quadratic

problem so the results below provide us with an “upper bound” on

the convergence for general nonlinear problems.

The crucial result is Thm 5.1 — essentially nonlinear conjugate

gradient method converges linearly like the steepest descent

method – but with a smaller “constant factor”.

Page 166: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 165'

&

$

%

If the condition number κ =λn

λ1is available then a convergence

result can be proved for the linear Conjugate Gradient Method.

Notice that while it is similar to (4.37) on Slide 134 for the

Steepest Descent Method, the presence of the square roots means

the constant factor is smaller (check) so that the conjugate gradient

method will converge faster.

Theorem 5.1 If A has non-negative eigenvalues

0 < λ1 ≤ λ2 ≤ · · · ≤ λn, I have for any k < n that

‖xk+1 − x∗‖ ≤(√

κ− 1√κ+ 1

)‖xk − x∗‖. (5.4)

As noted above, this result is the best that I can hope for when

using the nonlinear conjugate gradient method — in the next

Section.

Page 167: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 166'

&

$

%

5.2 Nonlinear Conjugate Gradient Methods

I’ll now extend the linear conjugate gradient method to nonlinear

optimisation problems.

5.2.1 Fletcher-Reeves Method

Fletcher & Reeves showed that an extension of this kind is possible

if I make two simple changes in Alg. (5.1). First, I need to replace

the expression for αk by a line search along pk . Second, the

residual rk (or equivalently gk, the gradient of φ as in (5.3) for

linear problems) must be replaced by the gradient of the nonlinear

objective function f.

• There is no guarantee that this simple substitution will work

unless the problem is quadratic.

• Remarkably, it does work and I will prove it!

Page 168: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 167'

&

$

%

Algorithm 5.2 (FR–CGM) Given x0.

g0 ←∇f0,p0 ← −g0, k← 0

while gk 6= 0 do

αk ← Result of line search along pkxk+1 ← xk + αkpkgk+1 ←∇fk+1βFRk+1 ← gTk+1gk+1

gTkgk

≡ ‖gk+1‖2

‖gk‖2

pk+1 ← −gk+1 + βFRk+1pk

k← k+ 1;

end while

Page 169: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 168'

&

$

%

Fletcher-Reeves Method – Descent Directions Of course if

f is a quadratic function with positive definite Hessian, then (if I

take αk to be the exact line minimiser) Alg. (5.2) reduces to

Alg. (5.1).

I need to be more specific about the choice of αk . Because of the

second term in Line (8), the search direction pk could fail to be a

descent direction. Taking the inner product (with k replacing k+ 1)

with the gradient gk , I get

gTk pk = −‖gk ‖2 + βFRk gTk pk−1. (5.5)

If the line search is exact then the second term vanishes and pk is a

descent direction.

Page 170: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 169'

&

$

%

Otherwise I need to appeal to the strong Wolfe conditions

Eqs. (4.17a) and (4.17b) studied in Ch. 4.2.

I will show in Theorem 5.2 below that the strong second Wolfe

condition (4.17b) implies that (5.5) is negative and so pk is a

descent direction.

The following result gives conditions on the line search that

guarantee that all search directions generated by the conjugate

gradient method are descent directions . It assumes that the set

L = x : f(x) ≤ f(x0) is bounded and that f is C2.

Theorem 5.2 Suppose that Alg. 5.2 is implemented with a step

length αk that satisfies the strong Wolfe conditions with

0 < c2 <12

. Then the method generates descent directions pk that

satisfy the following inequalities:

−1

1− c2≤ pTkgk‖gk‖2

≤ 2c2 − 11− c2

, for all k = 0, 1, . . . . (5.6)

Page 171: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 170'

&

$

%

Proof:

It is easy to check that if 0 < c2 <12

, I have

− 1 ≤ 2c2 − 11− c2

< 0. (5.7)

(The descent direction condition will follow immediately once I

prove (5.6)).

I now prove (5.6)) by induction.

[Base Step] For k = 0, the middle term in (5.6) is −1 as

p0 ≡ −∇f0 ≡ −g0 so by using (5.7) both inequalities in (5.6)

are satisfied.

Page 172: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 171'

&

$

%

[Inductive Step] Assume that (5.6) holds for some k ≥ 1. First I

note that if a vector pk is a descent direction then by Lemma

(4.1) there exists a step length αk that satisfies the strong

Wolfe conditions . The direction pk is a descent direction by

the inductive hypothesis , so I conclude that a step length αk

can be found which satisfies the strong Wolfe

conditions . Then use this αk to compute xk+1 ≡ xk + αkpk& so calculate pk+1 and gk+1.

From lines (8) and (7) in the FR-CGM algorithm, we have

gTk+1pk+1‖gk+1‖2

= −1+ βk+1gTk+1pk‖gk+1‖2

= −1+gTk+1pk‖gk‖2

. (5.8)

The strong Wolfe conditions give

|gTk+1pk| ≤ −c2gTkpk

Page 173: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 172'

&

$

%

so, combining with (5.8), I have

−1+ c2gTkpk‖gk‖2

≤gTk+1pk+1‖gk+1‖2

≤ −1− c2gTkpk‖gk‖2

.

Finally, substituting for the termgTkpk‖gk‖2

from the LHS of the

inductive hypothesis (5.6), I get

−1−c2

1− c2≤gTk+1pk+1‖gk+1‖2

≤ −1+c2

1− c2.

So (5.6) holds for k+ 1.

By the Principle of Induction, (5.6) holds for all k.

Page 174: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 173'

&

$

%

Fletcher-Reeves Method — Global Convergence Global

convergence can be proved for the FR method — i.e. “the gradient

goes to zero”. The proof is a little tricky but is worth the effort.

(I write ∇f(xk) = gk for readability.)

Theorem 5.3 If Alg. (5.2) is implemented with a line search which

satisfies the strong Wolfe conditions with 0 < c1 < c2 <12

) then

under reasonable assumptions on f (the same as in Zoutendijk’s

Thm 4.3)

lim infk→∞ ‖gk‖ = 0.

This means that while the gradient may not have a limit of zero, it

is not bounded away from zero, i.e., picking any ε > 0, for K

sufficiently large, there is some k > K for which ‖gk‖ < ε.

Page 175: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 174'

&

$

%

Proof:

Assume that the conclusion is false, so that ‖gk‖ is bounded away

from zero — so that I must have ‖gk‖ ≥ γ > 0 for all k. I have

cos(θk) =−gTkpk‖gk‖‖pk‖

so (5.6) from Thm 5.2 can be written:

(1− 2c2)

(1− c2)

‖gk‖‖pk‖

≤ cos(θk) ≤1

(1− c2)

‖gk‖‖pk‖

. (5.9)

Page 176: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 175'

&

$

%

I also have the Zoutendijk condition

∞∑k=0

cos(θk)2‖gk‖2 <∞.

Using the lefthand inequality in (5.9) I can write

cos(θk)2 ≥

(1−2c21−c2

)2 ‖gk‖2‖pk‖2

and so I can restate the Zoutendijk

condition as: ∑ ‖gk‖4

‖pk‖2<∞. (5.10)

(I’ll use this to get a contradiction at the end of the proof.)

Read to here for Lecture 1, Week 4

Page 177: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 176'

&

$

%

The Strong version of the Second Wolfe condition can be written:

|gTk+1pk| ≤ −c2gTkpk

so again referring to (5.6) I have

|gTk+1pk| ≤ −c2gTkpk ≤

c2

1− c2‖gk‖2. (5.11)

Page 178: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 177'

&

$

%

Now referring to the nonlinear conjugate gradient method update

rule pk+1 = −gk+1 + βFRk+1pk and taking the squared norm of each

side,

I have

‖pk+1‖2= ‖gk+1‖2 + β2k+1‖pk‖

2− 2βk+1g

Tk+1pk

≤ ‖gk+1‖2 + β2k+1‖pk‖2+ 2βk+1|g

Tk+1pk|

≤ ‖gk+1‖2 + β2k+1‖pk‖2+ 2

c2

1− c2βk+1‖gk‖2 by (5.11)

=1+ c21− c2

‖gk+1‖2 + β2k+1‖pk‖2

using def. of βk+1.

Page 179: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 178'

&

$

%

So I have (with c3 =1+c21−c2

)

‖pk+1‖2 ≤ c3‖gk+1‖2 + β2k+1‖pk‖

2.

Iterating this inequality twice (again using the def. of βk+1);

‖pk+1‖2 ≤ c3

‖gk+1‖2 +

‖gk+1‖4

‖gk‖2+‖gk+1‖4

‖gk−1‖2

+‖gk+1‖4

‖gk−2‖4‖pk−2‖2.

Now iterating k times I get

‖pk+1‖2 ≤ c3‖gk+1‖4

1

‖gk+1‖2+

1

‖gk‖2+

1

‖gk−1‖2+ · · ·+ 1

‖g1‖2

+‖gk+1‖4

‖g0‖4‖p0‖2.

Page 180: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 179'

&

$

%

Using the fact that p0 = −g0 and that c3 ≥ 1, I can finally write

‖pk+1‖2 ≤ c3‖gk+1‖4

k+1∑j=0

1

‖gj‖2. (5.12)

or (for ease of comparison)

‖pk‖2 ≤ c3‖gk‖4

k∑j=0

1

‖gj‖2. (5.13)

By the conditions assumed for f (L bounded and f Lipschitz–C1 on

an open set N containing L) I have that gk is bounded above

‖gj‖ ≤ γ.

I also assumed that ‖gj‖ ≥ γ > 0.

Page 181: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 180'

&

$

%

Now let’s use these bounds on ‖gj‖ and ‖gk+1‖ in (5.12).

I find that ‖pk‖2 ≤ c3γ4(k+ 1)/γ2.

So ∞∑k=0

1

‖pk‖2≥ γ2

c3γ4

∞∑k=0

1

k+ 1

which diverges.

But with ‖gk‖ ≥ γ I can simplify my modified Zoutendijk

condition (5.10) to: ∞∑k=0

1

‖pk‖2<∞

which gives a contradiction.

So lim infk→∞ ‖gk‖ = 0, i.e. the Fletcher-Reeves Method has (more or

less) the global convergence property.

Page 182: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 181'

&

$

%

Fletcher-Reeves Method — Numerical Behaviour

Simplifying (5.9) above, I can write

χ1‖gk‖‖pk‖

≤ cos(θk) ≤ χ2‖gk‖‖pk‖

, (5.14)

where

cos(θk) =−gTkpk‖gk‖‖pk‖

. (5.15)

• A “bad” choice of pk, (large in norm compared to gk)

‖gk‖‖pk‖

<< 1,

leads to cos(θk) ≈ 0 — as χ1, χ2 ≈ 1.

• So I only get a very small change in fk (and therefore in gk) as

reductions in f will be negligible along a direction nearly

tangent to a surface f(x) = constant.

Page 183: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 182'

&

$

%

• It follows that ‖gk‖ ≈ ‖gk+1‖ and so βFRk+1 ≈ 1.

• I am assuming that ‖gk‖‖pk‖<< 1 and so both gk+1 and gk are

much smaller than pk.

• Using the update rule (8) I have

‖pk+1 − pk‖ ≈ ‖pk+1 − βFRk+1pk‖ ≈ ‖gk+1‖ ≈ ‖gk‖<< ‖pk‖ (5.16)

and so pk+1 ≈ pk.

• So the FR method “sticks” if ever it generates a bad search

direction.

• This behaviour means that, despite its good descent direction

and convergence properties, the Fletcher-Reeves method is

rarely used in practice.

Stopped here Lectures 1 & 2, Week 4

Page 184: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 183'

&

$

%

5.2.2 Polak-Ribiere Method

There are many variants on the older Fletcher-Reeves Method that

differ in the choice of the parameter βk . They all reduce to the

FR method in the case of quadratic objective functions with an

exact line search. The most often used of these — due to Polak and

Ribiere — defines βk by

βPRk+1 =gTk+1(gk+1 − gk)

‖gk‖2(5.17)

I refer to the algorithm where (5.17) replaces line (7) of

FR–CGM as PR–CGM.

Page 185: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 184'

&

$

%

Polak-Ribiere Method — Numerical Behaviour In

practice, the Polak-Ribiere method is found to be more robust than

the Fletcher-Reeves method. It is easy to see why. Following the

argument in Section 5.2.1 above, cos(θk) ≈ 0 leads to gk ≈ gk+1but now it follows that βPRk+1 ≈ 0 so that the new search direction

pk+1 ≈ −gk+1. This “automatic restart” property means that

them method will not “stick” if a poor choice of pk is made. This

good behaviour has made PR–CGM the most widely used

nonlinear conjugate gradient method for several decades.

Page 186: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 185'

&

$

%

Polak-Ribiere Method – Global Convergence

Unfortunately the strong Wolfe conditions do not guarantee that

pk is a descent direction and so convergence is not guaranteed.

However the simple change

β+k+1 = maxβPRk+1, 0 (5.18)

is all that is necessary to ensure that pk+1 is globally convergent

— provided that I ensure that each pk satisfy a “sufficient descent

condition” gTkpk ≤ −c3‖gk‖2, in addition to the strong Wolfe

conditions. Note that this ensures that each pk is a descent

direction. In practice this has not been a difficulty but has required

extra checking and (where necessary) extra iterations in the line

search code.

Page 187: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 186'

&

$

%

5.2.3 Advanced Methods

In Appendix A.22 I discuss some newer variations on nonlinear

conjugate gradient method — based on alternative formulas for β.

The material is technical — overall conclusions:

• FR cgm generates descent directions & is globally convergent.

• FR cgm behaves badly in that it tends to fail if ever cos θk ≈ 0and gk ≈ gk−1.

• PR cgm only generates descent directions & is globally

convergent when a two-stage version of the Strong Wolfe

conditions is applied.

• PR cgm does not suffer from the “sticking” problem —

informally; the top line in βPRk → 0 if gk ≈ gk−1, this causes

the algorithm to effectively “restart” by setting

pk+1 ≈ −gk+1.

Page 188: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 187'

&

$

%

• A new method (DY-cgm) where

βDYk =‖gk‖2

pTk−1yk−1(yk−1 ≡ gk − gk−1) (5.19)

both generates descent directions & is globally convergent

requiring only weak Wolfe conditions.

• But “sticks” like FR-cgm.

Page 189: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 188'

&

$

%

• An even newer “hybrid” method where

βHk = max0,minβHSk , βDYk (5.20)

and the Hestenes & Stiefel version of β is

βHSk =gTkyk−1pTk−1yk−1

(5.21)

generates descent directions & is globally convergent requiring

only weak Wolfe conditions and does not have the “sticking”

problem.

• Newer methods are still being developed.

Read to here for Lecture 2, Week 4

Page 190: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 189'

&

$

%

5.3 Exercises

1. Show that, when applied to a quadratic function with exact

line searches, the Polak-Ribiere Method reduces to the

Fletcher-Reeves formula.

Page 191: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 190'

&

$

%

References

[1] Y. H. Dai, Y. Yuan, A Nonlinear Conjugate Gradient Method

with a Strong Global Convergence Property, SIAM Journal on

Optimization, Volume 10, Number 1 pp. 177-182, 1999.

[2] Y. H. Dai, Y. Yuan, An Efficient Hybrid Conjugate Gradient

Method for Unconstrained Optimization, Annals of Operations

Research, Vol 103 pp. 33–47, 2001.

Page 192: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 191'

&

$

%

6 Quasi-Newton Methods

• My final class of line search methods for unconstrained

problems are referred to as quasi-Newton methods.

• Like the steepest descent method, they only require the gradient

of the objective function f to be supplied at each iteration.

• By measuring the changes in the gradient, they construct an

approximation to f good enough to produce super-linear

convergence (remember that Newton’s method converges

quadratically while the steepest descent method and nonlinear

conjugate gradient methods only converge linearly).

Page 193: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 192'

&

$

%

• As second derivatives are not required, quasi-Newton

methods are often more efficient than Newton’s method.

• (Conjugate gradient methods have the further advantage that

— unlike quasi-Newton methods — they do not require even

an estimate of the Hessian to be stored, at the price of slower

convergence).

Page 194: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 193'

&

$

%

6.1 The BFGS Method

In this Section, I will discuss the most popular quasi-Newton

method, the BFGS method, together with its precursor & close

relative, the DFP algorithm.

Start by forming the familiar quadratic model/approximation:

mk(p) = fk + gTk p+

1

2pTHkp (6.1)

• Here Hk is an n× n positive definite symmetric matrix (that

is an approximation to the exact Hessian) .

• Hk will be updated at each iteration.

• In most books and published articles, B is used for the current

estimate of the Hessian.

• For clarity, I will use H for approximations to the Hessian and

J for approximations to the Inverse Hessian.

Page 195: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 194'

&

$

%

• The function and gradient values of the model at p = 0 match

fk and gk .

• In other words mk(0) = fk and ∇pmk(p)|p=0 = gk.

• The minimiser of this model wrt p is as usual:

pk = −H−1k gk (6.2)

and is used as the search direction.

• The new iterate is

xk+1 = xk + αkpk (6.3)

again as usual, where the step length αk is chosen to satisfy

the Wolfe conditions.

• Clearly if Hk is the exact Hessian, I have Newton’s method —

in this Chapter, Hk will be an approximation to the Hessian

based on gradient values.

Page 196: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 195'

&

$

%

• Instead of computing Hk from scratch at each iteration,

Davidon used the following clever argument:

• Suppose that I have generated a new iterate xk+1 and wish to

construct a new quadratic model of the form

mk+1(p) = fk+1 + gTk+1 p+

1

2pTHk+1p.

• How should I keep Hk+1 consistent with Hk?

• It is reasonable to ask that the gradient of mk+1 should match

the gradient of f at xk & xk+1 .

• Since ∇mk+1(0) ≡ gk+1 , (they match at xk+1 ) I need only

check that they match at xk — which means I require that:

∇mk+1(−αkpk) ≡ gk+1 − αkHk+1pk = ∇mk(0) ≡ gk .

Page 197: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 196'

&

$

%

• Rearranging, I have

Hk+1αkpk = gk+1 − gk . (6.4)

Page 198: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 197'

&

$

%

• First define:

"∆x" sk = xk+1 − xk ≡ αkpk (6.5a)

"∆g" yk = gk+1 − gk (6.5b)

Then (6.4) gives us the secant equation

Hk+1sk = yk. (6.6)

• I am taking Hk+1 to be positive definite so skTHk+1sk > 0

and so this equation is possible only if the step sk and change

in gradients yk satisfy the curvature condition

sTkyk > 0. (6.7)

• When f is strongly convex, this condition is always satisfied

(see Exercises 6.5).

• In general, though, I need to enforce 6.7 by imposing

restrictions on the line search procedure for choosing αk.

Page 199: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 198'

&

$

%

• In fact, 6.7 is guaranteed to hold if I impose the Wolfe

conditions (strong or otherwise) on the line search.

• I check this: using W2 (4.16b) and remembering (6.5a) that

sk ≡ αppk, W2 reads gTk+1 sk ≥ c2gTk sk and so

yTksk ≥ (c2 − 1)αkgTk pk. (6.8)

• Since c2 < 1, αk > 0 and pk is a descent direction, the term on

the right is positive and the curvature condition holds.

• When the curvature condition is satisfied, the secant equation

6.6 always has a solution Hk+1.

• For example, check that Hk+1 =yky

Tk

sTkyk

satisfies (6.6).

• Exercise: is this choice of Hk+1 positive definite?

Page 200: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 199'

&

$

%

• The problem is that there are infinitely many solutions for

Hk as there are n(n+ 1)/2 degrees of freedom in a symmetric

matrix and the secant equation represents only n conditions.

• Requiring that Hk+1 be positive definite represents n

inequality conditions but there are still degrees of freedom left.

• To determine Hk+1uniquely, I impose the additional condition

that; among all symmetric matrices satisfying the

secant equation, Hk+1 is “closest to” the current

matrix Hk .

• So I need to solve the problem:

minH‖H−Hk‖ (6.9a)

subject to H = HT , Hsk = yk (6.9b)

Page 201: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 200'

&

$

%

• I can use any convenient matrix norm — a choice that

simplifies the algebra (reduces the pain) is the “weighted

Frobenius norm”:

‖A‖W ≡ ‖W12AW

12 ‖F, (6.10)

where ‖C‖2F ≡∑ni=1

∑nj=1 C

2ij for any square matrix C.

• Any choice of the weight matrix W will do provided it is

positive definite, symmetric and satisfies Wyk = sk.

• The weight matrix W doesn’t play any role in the algorithm to

be discussed below — but I need W to derive the algorithm.

• So I just need to know that a matrix W can be found s.t.

Wyk = sk — as if not, the derivation below is built on sand.

Page 202: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 201'

&

$

%

• For example, I could take W = Hk−1

, where Hkis the average

Hessian defined by

Hk =

∫10

∇2 f(xk + ταkpk)dτ. (6.11)

• It follows that

yk = Hkαkpk = Hksk (6.12)

using the definitions of sk & yk and the application of the

Chain Rule.

• Check that this choice of W is positive definite (if the Hessian

of f is) and symmetric.

Page 203: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 202'

&

$

%

I can now state an update formula for the Hessian estimate Hk as a

Theorem:

Theorem 6.1 a solution of (6.9a, 6.9b) is

DFP Hk+1 = (I− γkyksTk)Hk(I− γksky

Tk) + γkyky

Tk , (6.13)

where

γk =1

yTksk

Before I prove the Theorem a couple of points:

• Hk is my current estimate of the Hessian, usually initially the

Identity matrix.

• Hk+1 is my (I hope) improved estimate of the Hessian, using

newly available information, namely the two vectors sk & yk .

Page 204: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 203'

&

$

%

Proof: It is convenient to write

K = I− γkskyTk so that KT = I− γkyks

Tk . (6.14)

P = γkykyTk so that PT = P. (6.15)

It is easy to check that Ksk = 0, KTyk = 0 and Psk = yk.

• So any matrix of the form

H = AK+ P (6.16)

satisfies the secant equation — where A is an arbitrary n× nmatrix.

• Requiring symmetry tells us that H must take the form

H = KTAK+ P (6.17)

— where now A is is an arbitrary n× n symmetric matrix.

Stopped here Lectures 1 & 2, Week 5 Read to here

Page 205: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 204'

&

$

%

for Lecture 1, Week 5

Page 206: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 205'

&

$

%

• Now comes the hard part: I want to show that A = Hk.

• With H defined as above, define F(A) = ‖H−Hk‖2W .

• I need to minimise F(A) wrt A.

• It is easy to check that F(A) = Trace(WCWC) defining C by

C ≡ H−Hk = KTAK+ P −Hk. (6.18)

• I want to find the matrix A which minimises F(A).

• I will use the “Einstein summation convention” — repeated

indices are implicitly summed over.

• So I write:

F(A) =WijCjkWklCli,

and can calculate the partial derivative of F wrt Aαβ as:

∂F(A)

∂Aαβ=WijWklCli

∂Cjk

∂Aαβ+WijCjkWkl

∂Cli

∂Aαβ.

Page 207: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 206'

&

$

%

• You should be able to see that

∂Cjk

∂Aαβ= KTjαKβk and

∂Cli

∂Aαβ= KTlαKβi.

• Putting it all together, the choice of matrix A which minimises

F(A) must satisfy 2(KWCWKT

)βα

= 0 for all choices of the

subscripts α and β so I must have

KWCWKT = 0.

• Substituting for C, K, KT and P from 6.18, 6.14, 6.15, I have

0 = KW(KTAK+ P −Hk

)WKT

= KWKTAKWKT + KWPWKT − KWHkWKT .

Page 208: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 207'

&

$

%

• But (as Wyk = sk), KWP = KWγkykyTk = γkKsky

Tk = 0, so

we finally have (noting that KW = KWKT )

(KW)(A−Hk)(KW)T = 0 (6.19)

which is satisfied by A = Hk as claimed.

Page 209: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 208'

&

$

%

• The formula Eq. 6.13 is called the DFP formula due to

Davidon, Fletcher & Powell.

• Other choices of A also satisfy (6.19).

• Check that for any choice of the real parameters α & β, a

matrix of the form A = Hk + αysT + βyyT also satisfies the

equation.

• There is a “family” of formulas corresponding to different

choices of α and β. See Ex. 8.

• I will not discuss this approach further here.

Page 210: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 209'

&

$

%

6.2 Inverting the Hessian approximation

It would be very useful if I could calculate an estimate of the the

inverse Hessian ∇2f — say Jk ≡ H−1k . This would allow us to

calculate pk = −Jkgk instead of solving Hkpk = −gk for the search

direction pk — giving a speedup in the algorithm.

But how to transform Eq. 6.13 into an update formula for Jk+1in

terms of Jk ?

I need a formula that gives the inverse of Hk+1in terms of the

inverse of Hk .

Page 211: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 210'

&

$

%

The Sherman-Morrison-Woodbury formula is what I need.

It states that if a square non-singular matrix A is updated by

A = A+ RSTT

where R, T are n× p matrices for 1 ≤ p < n and S is p× p then

A−1 = A−1 −A−1RU−1TTA−1, (6.20)

where U = S−1 + TTA−1R.

See Ex. 3 for hints on proving this result.

Read to here for Lecture 2, Week 5

Page 212: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 211'

&

$

%

Using the SMW formula, I can derive the following equation for the

update of the inverse Hessian approximation, Hk that corresponds

to the DFP update of Bk in Eq. 6.13;

DFP − Inverse Jk+1 = Jk −Jkyky

TkJk

yTkJkyk+sks

Tk

yTksk. (6.21)

(See Exercise 4 for some of the details.)

This is a rank-2 update as the two terms added to Jk are both

rank-1.

Page 213: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 212'

&

$

%

The DFP method has been superseded by the BFGS (Broyden,

Fletcher, Goldfarb & Shanno) method. It can be derived by making

a small change in the derivation that led to Eq. 6.13. Instead of

imposing conditions on the Hessian approximations Hk , I impose

corresponding conditions on their inverses Jk . The updated

approximation Jk+1must be symmetric and positive definite. It

must satisfy the secant equation Eq. 6.6, now written as

Jk+1yk = sk. (6.22)

and also the “closeness” condition

minJ‖J− Jk‖ (6.23a)

subject to J = JT , Jyk = sk. (6.23b)

The matrix norm is again the weighted Frobenius norm, where the

weight matrix is now any matrix satisfying Wsk = yk.

Page 214: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 213'

&

$

%

(You can take W to be the “average” Hessian Hk defined in

Eq. 6.11 above — though any matrix satisfying Wsk = yk will do.)

Using the same reasoning as above, a solution to 6.23a is given by

BFGS Jk+1 = (I− γkskyTk)Jk(I− γkyks

Tk) + γksks

Tk . (6.24)

Note the symmetry between this equation and Eq. 6.13 — one

transforms into the other by simply interchanging sk and yk — of

course γk = 1skTyk

is invariant under this transformation.

J0 is often taken to be just the identity matrix — possibly scaled.

(Again, as the DFP update formula on Slide 208 above and in

Ex. 8, there is a two-parameter family of formulas that solve this

problem. See Ex. 9.)

Page 215: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 214'

&

$

%

Algorithm 6.1 (BFGS) Given x0, tolerance ε > 0 and starting

J0

k← 0

while ‖gk ‖ > ε do

pk ← −Jkgkxk+1 ← xk + αkpk(where αk satisfies the Wolfe conditions )

Define sk = xk+1 − xk and yk = gk+1 − gkCompute Jk+1using Eq. 6.24

k← k+ 1

end while

Page 216: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 215'

&

$

%

Each iteration takes O(n3) arithmetic operations (plus the cost of

function & gradient operations). (Solving linear systems requires

O(n3) arithmetic operations — unfortunately so does matrix

multiplication!)

The rate of convergence is superlinear. Newton’s method has

quadratic convergence but needs solution of a linear system and of

course calculation of the Hessian at each iteration.

One very nice property of the BFGS method is that if Jk is positive

definite then Jk+1is also, so a suitable choice for J0 ensures that

all subsequent pk ’s will be descent directions. (See Ex. 6.)

Page 217: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 216'

&

$

%

6.2.1 Robustness of BFGS

Finally, the superiority of the BFGS algorithm over the DFP

method is due to the its robustness wrt the scalar γk becoming

large. Suppose that at some iteration k, the inner product sTkyk is

very small, then γk = 1/sTkyk becomes very large and so Jk+1will

be also. Can the algorithm recover from this? It can be shown

that BFGS will tend to correct itself after a few iterations while

DFP will be slow to recover. See App. A.26 for details.

In fact robustness (in the Appendix) and convergence (in the next

Section) are proved for the confusingly named “inverse” BFGS

method BFGS-Inverse (6.25) that updates Hk ≈∇2f — as the

algebra is easier. Of course, the good properties of BFGS-Inverse

hold for BFGS as well because Jk ≡ H−1k at each iteration.

Similarly the bad behaviour of DFP (6.13) is also seen in

DFP-inverse (6.21) which updates Jk ≈ (∇2f)−1.

Page 218: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 217'

&

$

%

Stopped here Lectures 1 & 2, Week 6

Page 219: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 218'

&

$

%

6.3 Convergence Analysis

The convergence properties of the BFGS method are satisfactory in

practice. However, proofs of global convergence are only available

under restrictive assumptions — in particular that f is convex. I

will just prove a more limited result.

Note that the condition (6.26) in the statement of the Theorem

implies that the Hessian is positive definite — this is often an

unrealistic assumption.

I will prove convergence for the “inverse” BFGS method that

estimates the Hessian Hk rather than the inverse Hessian Jk:

BFGS − Inverse Hk+1 = Hk −Hksks

TkHk

sTkHksk+ γkyky

Tk (6.25)

It can be derived from the inverse DFP formula (6.21) simply by

swapping sk and yk — or by applying the SMW formula to the

BFGS method.

Page 220: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 219'

&

$

%

(Rather confusingly, the “inverse” BFGS formula computes an

estimate of the Hessian rather than the inverse Hessian. This

potential confusion is the reason why H and J are used in these

notes to refer to estimates of the Hessian and inverse Hessian

respectively — irrespective of the method used.)

Theorem 6.2 For any starting point x0; if the objective function f

is C2, and there exist positive constants m and m such that

m‖z‖2 ≤ zT∇2f(x)z ≤ m‖z‖2 (6.26)

for all z ∈ Rn and all x ∈ Ω = x ∈ Rn : f(x) ≤ f(x0), then the

sequence xk generated by the inverse BFGS formula (6.25)

satisfies

lim inf ‖∇f(xk)‖ = 0.

Page 221: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 220'

&

$

%

Proof:

First define

mk =yTksk

sTksk, Mk =

yTkykyTksk

(6.27)

I have already discussed the “average” Hessian Hk defined in

Eq. 6.11 above. I saw that Hksk = yk. so

mk ≡yTksk

sTksk=sTkHksk

sTksk≥ m (6.28)

by (6.26). Similarly (defining zk = Hk1/2sk),

Mk ≡yTkykyTksk

=zTkHkzk

zTkzk≤ m (6.29)

again using (6.26).

Page 222: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 221'

&

$

%

The following results are easily checked (see Exercises 7 and 12):

traceHk+1 = traceHk −‖Hksk‖2

sTkHksk+‖yk‖2

yTKsk(6.30)

detHk+1 = detHk

(yTksk

sTkHksk

). (6.31)

Now define

cos θk =sTkHksk‖sk‖‖Hksk‖

, equivalent to the standard definition (4.23)

and qk =sTkHksk‖sk‖2

, a useful intermediate quantity.

Page 223: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 222'

&

$

%

Using these definitions and those for Mk and mk I have

traceHk+1 = traceHk −qk

cos2 θk+Mk

detHk+1 = detHk

(mk

qk

).

Page 224: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 223'

&

$

%

Define ψ(B) = trace(B) − ln detB. For B positive definite, it is

easy to check that ψ(B) > 0. Now

ψ(Hk+1) = ψ(Hk) −qk

cos2 θk+Mk − lnmk + lnqk

= ψ(Hk) + (Mk − lnmk) +

[ln

qk

cos2 θk−

qk

cos2 θk

]+ ln cos2 θk.

As the function h(t) = ln t− t is negative for all positive t (check) I

have by iterating;

0 < ψ(Hk+1) < ψ(H1) + Ck+

k∑j=1

ln cos2 θj (6.32)

where C ≡ m− lnm can be taken to be positive without loss of

generality.

Read to here for Lecture 1, Week 6

Page 225: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 224'

&

$

%

Finally, by Zoutendijk’s Theorem, 4.3, I know that if

lim inf ‖gk‖ 6→ 0 then cos θk → 0. So (proving the Theorem by

contradiction) I have that “ln cos2 θk → −∞” or more usefully that

there is some N > 0 that for all j > N, ln cos2 θj < −2C, where C is

the positive constant defined above (or any positive constant).

Then (for k > N)

0 < ψ(Hk+1)

< ψ(H1) + Ck+

N∑j=1

ln cos2 θj +k∑

j=N+1

(−2C)

= ψ(H1) +

N∑j=1

ln cos2 θj + 2CN− Ck.

But the RHS in the final equation is negative for large k, which

contradicts ψ(Hk+1) > 0.

Page 226: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 225'

&

$

%

Note that if f is convex, then the above Theorem ensures that x

converges to a minimum point x∗ of f. My final result is even more

technical and so is not proved here. It (more or less) establishes

that BFGS has performance midway between Steepest descent &

Newton’s Method.

Theorem 6.3 Suppose that f is C2 and that the sequence xk

generated by the BFGS algorithm converges to the minimiser x∗ of

f. Suppose also that the condition

‖∇2f(x) −∇2f(x∗)‖ ≤ L‖x− x∗‖

holds for all x sufficiently close to x∗ for some positive constant L.

Finally, suppose that xk converges to x∗ linearly. Then

xk converges to x∗ superlinearly.

Page 227: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 226'

&

$

%

6.4 L-BFGS Method

An important variant of the BFGS method is the L-BFGS method

— based on the simple idea that the most recent s and y–values

are likely to be the most important in the sense that the current

(inverse) Hessian approximation is more likely to be influenced by s

and y–values computed at recent iterations. As only the most

recent m values of s and y are stored I can also expect huge

reductions in storage costs (and therefore increases in speed)

compared with the standard BFGS method.

See App. A.30 for details.

Read to here for Lecture 2, Week 6 Stopped

here Lectures 1 & 2, Week 7

Page 228: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 227'

&

$

%

6.5 Exercises

1. Show that if f is strongly convex, then the curvature condition

6.7 holds for any vectors xk & xk+1 .

2. Show that the second strong Wolfe condition 4.17b implies the

curvature condition 6.7.

3. Prove the Sherman-Morrison-Woodbury formula 6.20. See

Appendix A.24 for a proof.

4. Using the SMW formula derive (6.21) — the inverse DFP

update formula. See Appendix A.25 for a proof.

5. Check that Eq. 6.13 and Eq. 6.21 are inverses of each other.

6. Show that the update rule 6.24 implies that if Hk is positive

definite, then so is Hk+1.

7. Prove (6.30).

Page 229: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 228'

&

$

%

8. Check the claim on Slide 208 that any matrix

A = Hk + αysT + βyyT also satisfies (6.19).

9. Do the corresponding analysis for the BFGS update — find the

two-parameter family of update formulas that solve the

problem.

10. Prove that det(I+ xyT ) = 1+ yTx for any vectors x and y.

Hint: for any x 6= 0, choose vectors w1, . . . ,wn−1 and define a

matrix Q to have the vector x as its first column and the

vectors w1, . . . ,wn−1 as its remaining columns. The vectors

w1, . . . ,wn−1 can be chosen so that Q has an inverse and

satisfies x = Qe1. (The vector e1 = (1, 0, . . . , 0)T .) If I define

yTQ = (z1, . . . , zn), then z1 = yTQe1 = y

Tx so

det(I+ xyT ) = det(Q−1(I+ xyT )Q

)= det(I+ e1y

TQ).

Page 230: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 229'

&

$

%

11. Extend the above result to prove that

det(I+ xyT + uvT ) = (1+ yTx)(1+ vTu) − (xTv)(yTu).

12. Prove (6.31) — a simple application of the previous Exercise.

Page 231: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 230'

&

$

%

7 Introduction to Constrained

Optimisation

The remainder of these notes are concerned with minimising

functions subject to constraints on the variables. A general

formulation for these problems is

minx∈Rn

f(x) subject to

ci(x) = 0 i ∈ E ,ci(x) ≥ 0 i ∈ I

(7.1)

where f and the functions ci are all smooth, real-valued functions

on a subset of Rn, and E and I are two finite sets of indices. As

before, I call f the objective function, while ci, i ∈ E are the

equality constraints and ci, i ∈ I are the inequality

constraints .

Page 232: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 231'

&

$

%

I define the feasible set Ω to be the set of points x that satisfy

the constraints; that is,

Ω = x|ci(x) = 0, i ∈ E ; ci(x) ≥ 0, i ∈ I, (7.2)

so that I can rewrite 7.1 more compactly as

minx∈Ω

f(x). (7.3)

• Of course, “hiding” the constraints in this way doesn’t make

them go away.

• Or make it easier to solve the problem.

Page 233: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 232'

&

$

%

• In Section 7.1 I look at a couple of examples of constrained

problems and try to infer optimality conditions (analogous to

those for unconstrained problems — zero gradient and positive

definite/semi-definite Hessian) to characterise the solutions of

constrained optimisation problems.

• I’ll go through these examples quickly as they are very simple.

• In Section 7.2 I will formally state and prove a set of first-order

necessary conditions for optimality.

• In Section 7.3 I will derive second order necessary and sufficient

conditions for optimality.

Page 234: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 233'

&

$

%

7.1 Characterising Optimal Points

• Remember that for the unconstrained optimisation problem of

Chapter 3, I characterised solution points x∗ in the following

way:

– Necessary conditions: Local minima of unconstrained

problems have ∇f(x∗) = 0 and ∇2f(x∗) positive

semidefinite.

– Sufficient conditions: Any point x∗ at which ∇f(x∗) = 0 and

∇2f(x∗) is positive definite is a strong local minimiser of f.

• In this Section I look at a succession of constrained

problems and try to infer the corresponding conditions to

characterise the solutions of constrained optimisation problems.

Page 235: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 234'

&

$

%

7.1.1 Examples

• To introduce the basic principles behind the characterisation of

solutions of constrained optimisation problems, I’ll work

through three simple examples.

• The ideas discussed here will be made rigorous in Sections 7.2

and 7.3.

• I start by noting one item of terminology that I will often need:

at a feasible point x, the inequality constraint i ∈ I is said to

be active if ci(x) = 0 and inactive if the strict inequality

ci(x) > 0 is satisfied.

Example 7.1 (Single Equality Constraint) My first example

is a two-variable problem with a single equality constraint:

min x1 + x2 s.t. x21 + x22 − 2 = 0 (7.4)

Page 236: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 235'

&

$

%

x1

x2∇c1

∇f

∇f

∇f

∇c1

∇f

∇c1

∇c1

x1 + x2 = −2

x1 + x2 = 2

x∗

Figure 9: Constraint and function gradients at feasible points.

Page 237: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 236'

&

$

%

In the language of (7.1), I have f(x) = x1 + x2, I = , E = 1,

and c1(x) = x21 + x

22 − 2. I can see by inspection that the feasible set

for this problem is the circle of radius√2 centered at the origin —

just the circle, not its interior (disk).

The solution x∗ is obviously (−1,−1). From any other point on the

circle, it is easy to find a way to move that stays feasible (that is,

remains on the circle) while decreasing f. For instance, from the

point x = (√2, 0) any move in the clockwise direction around the

circle has the desired effect.

The gradient of f is just ∇f(x) =

11

and the constraint gradient

∇c(x) is just the “radius vector” 2x.

Page 238: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 237'

&

$

%

I also see from Figure 9 that at the solution x∗, the constraint

gradient ∇c1(x∗) is parallel to ∇f(x∗). That is, there is a scalar λ∗1such that

∇f(x∗) = λ∗1∇c1(x∗). (7.5)

(In this particular case, I have λ∗1 = −12

.)

• I can “explain” (7.5) by examining first-order Taylor series

approximations to the objective and constraint functions.

• To retain feasibility with respect to the function c1(x) = 0, I

require that, at least for very small steps d, c1(x+ d) = 0; that

is 0 = c1(x+ d) ≈ c1(x) +∇c1(x)Td = ∇c1(x)Td.

Page 239: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 238'

&

$

%

• So the direction d retains feasibility with respect to c1, to first

order, when it satisfies

∇c1(x)Td = 0. (7.6)

• Similarly, a direction of improvement must produce decrease in

f, so that 0 > f(x+ d) − f(x) ≈∇f(x)Td or, to first order,

∇f(x)Td < 0. (7.7)

Page 240: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 239'

&

$

%

• If there exists a direction d that satisfies both (7.6) and (7.7),

obviously improvement on my current point x is possible.

• It follows that a geometric necessary condition for

optimality for the problem (7.5) is that there exist no

direction d satisfying both (7.6) and (7.7).

• In other words, at a solution point

there must be no feasible descent directions.

• Using a sketch, it is easy to convince yourself that the only way

such a direction can not exist is if ∇f(x) and ∇c1(x) are

parallel, that is, if the condition ∇f(x) = λ1∇c1(x) holds at x,

for some scalar λ1.

Page 241: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 240'

&

$

%

• First define the projection operator

P =

(I−

∇c1(x)∇c1(x)T

‖∇c1(x)‖2

)• Then if the algebraic condition ∇f(x) = λ1∇c1(x) is not

satisfied, the direction defined by

d = −P∇f(x)

satisfies both conditions (7.6) and (7.7). (See Exercise 1).

• The vector d is just the component of −∇f(x) perpendicular

to ∇c1(x).

• What happens to d if ∇f(x) = λ1∇c1(x)?

Page 242: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 241'

&

$

%

• By introducing the Lagrangian function

L(x, λ1) = f(x) − λ1c1(x), (7.8)

and noting that ∇xL(x, λ1) = ∇f(x) − λ1∇c1(x), I can state

the condition (7.5) equivalently as follows: at the solution x∗,

there is a scalar λ∗1 such that

∇xL(x∗, λ∗1) = 0. (7.9)

• This observation suggests that I can search for solutions of the

equality-constrained problem (7.1) by searching for stationary

points of the Lagrangian function.

• The scalar quantity λ1 in (7.8) is called a Lagrange

multiplier for the constraint c1(x) = 0.

Page 243: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 242'

&

$

%

• Though the condition (7.5) — equivalently, (7.9) — appears to

be necessary for an optimal solution of the problem (7.1), it is

clearly not sufficient.

• For instance, in Example 7.1, (7.5) is satisfied at the point

x = (1, 1) (with λ∗1 =12

), but this point is obviously not a

solution — in fact, it maximises the function f on the circle.

• In the case of equality-constrained problems, I cannot turn the

condition (7.5) into a sufficient condition simply by placing

some restriction on the sign of λ1.

• To see this, consider replacing the constraint x21 + x22 − 2 = 0 by

its negative 2− x21 − x22 = 0 in Example 7.1.

• The solution of the problem is not affected, but the value of λ∗1that satisfies the condition (7.5) changes from λ∗1 = −1

2to

λ∗1 =12

.

Page 244: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 243'

&

$

%

Example 7.2 (A Single Inequality Constraint) This is a

slight modification of Example 7.1, in which the equality constraint

is replaced by an inequality.

Consider the problem:

min x1 + x2 s.t. 2− x21 − x22 ≥ 0, (7.10)

for which the feasible region consists of the circle of problem 7.4

and its interior — see Figure 10.

Note that the constraint normal ∇c1 points toward the interior of

the feasible region at each point on the boundary of the circle. By

inspection, I see that the solution is still (−1,−1) (the yellow circle

in the Figure) and that the condition (7.5) holds for the value

λ∗1 =12

.

Page 245: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 244'

&

$

%

∇c1

∇f

d

∇f

d

x1

x2

Figure 10: Improvement directions d from two feasible points.

However, this inequality-constrained problem differs from the

equality-constrained problem 7.4 of Example 7.1 in that the sign of

the Lagrange multiplier plays a significant role, as I now explain.

Page 246: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 245'

&

$

%

• As before, it seems reasonable that a given feasible point x is

not optimal if I can find a step d that both retains feasibility

and decreases the objective function f to first order.

• The main difference between this problem and the

equality-constrained version comes in the handling of the

feasibility condition c1(x) ≥ 0.

• As in (7.7) the direction d improves the objective function, to

first order, if ∇f(x)Td < 0, i.e. d is a descent direction for f.

• Meanwhile, the direction d retains feasibility if

0 ≤ c1(x+ d) ≈ c1(x) +∇c1(x)Td, (7.11)

so, to first order, feasibility is retained if

c1(x) +∇c1(x)Td ≥ 0. (7.12)

Page 247: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 246'

&

$

%

• In determining whether a direction d exists that satisfies both

(7.7) and (7.12) , I consider the following two cases, which are

illustrated in Figure 10.

Page 248: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 247'

&

$

%

1. Consider first the case in which x = x1 lies strictly inside

the circle, so that the strict inequality c1(x) > 0 holds.

– In this case, any vector d satisfies the condition (7.12),

provided only that its length is sufficiently small.

– In particular, whenever ∇f(x) 6= 0, I can obtain a

direction d that satisfies both (7.7) and (7.12) by setting

(see Exercise 2).

d = −c1(x)

‖∇c1(x)‖∇f(x)‖∇f(x)‖ . (7.13)

Page 249: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 248'

&

$

%

– The only situation in which such a direction fails to exist

is when ∇f(x) = 0 or ∇c1(x) = 0.– In the latter case (7.12) holds for all d so the factor

‖∇c1(x)‖ in the denominator can be omitted.

– If ‖∇f(x)‖ = 0 at a point x where c1(x) > 0 then no

feasible descent direction d exists at x and x is an

unconstrained minimum point.

– Summarising; in this case an optimal feasible

point is one where ∇f(x) = 0 or equivalently

∇xL(x∗, λ∗1) = 0 with λ1 = 0.

Page 250: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 249'

&

$

%

2. Consider now the case in which x lies on the boundary of

the circle, so that c1(x) = 0.

– The conditions (7.7) and (7.12) therefore become

∇f(x)Td < 0, ∇c1(x)Td ≥ 0,

i.e. d is a descent direction for f and a non-decreasing

direction for c1.

– The first of these conditions defines an open half-space,

while the second defines a closed half-space, as illustrated

in Figure 11.

– It is clear from this figure that the two regions fail to

intersect only when ∇f(x) and ∇c1(x) point in the same

direction, that is, when

∇f(x) = λ1∇c1(x), for some λ1 ≥ 0. (7.14)

Page 251: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 250'

&

$

%

∇c1

∇f

d

Figure 11: A direction d that satisfies (7.7) and (7.12).

– Examining the Figure, it is clear that the yellow

intersection shrinks as ∇f(x) and ∇c1(x) come closer and

vanishes when they are parallel.

Page 252: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 251'

&

$

%

– Note that the sign of the multiplier is significant here.

– If (7.14) were satisfied with a negative value of λ1, then

∇f(x) and ∇c1(x) would point in opposite directions,

and I see from Figure 11 that the set of directions that

satisfy both (7.7) and (7.12) would make up an entire

open half-plane.

– The optimality conditions for both the interior and the

boundary point cases can again be summarised neatly

with reference to the Lagrangian function.

– When no first-order feasible descent direction exists at

some point x∗, I have that

∇xL(x∗, λ∗1) = 0, for some λ∗1 ≥ 0, (7.15)

Note that in this case (a feasible point on the boundary,

c1(x) = 0), λ1 need not be zero at an optimal point.

Page 253: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 252'

&

$

%

• I can summarise the fact that λ1 must be zero at an internal

feasible optimal point (c1(x) > 0) but need not be at a

boundary feasible optimal point (c1(x) = 0) with the so-called

complementarity condition;

λ∗1c1(x∗) = 0. (7.16)

• This condition implies that the Lagrange multiplier λ1 can be

strictly positive only when the corresponding constraint

c1 is active i.e. c1(x) = 0.

• Conditions of this type play a central role in constrained

optimisation, as I see in the sections that follow.

• In the interior point case I have that c1(x∗) > 0, so (7.16)

requires that λ∗1 = 0.

• Hence, (7.15) reduces to ∇f(x∗) = 0, consistent with the

comments in blue following (7.13).

Page 254: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 253'

&

$

%

See App. A.33 for another worked example with two inequality

constraints.

In the next section, based on these Examples, I will state a set of

necessary conditions; conditions that must hold at an optimal

feasible point.

Page 255: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 254'

&

$

%

7.2 First-Order Optimality Conditions

• The three examples above suggest that a number of conditions

are necessary for a point to be a solution for (7.1).

• These include

– the equation ∇x L(x,λ) = 0,– the nonnegativity of λi for all inequality constraints ci(x)

– the complementarity condition λici(x) = 0 that is required

for all inequality constraints.

• Now we’ll generalise the observations made in these examples

and state the first-order optimality conditions in a rigorous

fashion.

Page 256: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 255'

&

$

%

• In general, the Lagrangian for the constrained optimisation

problem (7.1) is defined as

L(x,λ) = f(x) −∑i∈E∪I

λici(x). (7.17)

• The active set A(x) at any feasible x is the union of the set Ewith the indices of the active inequality constraints; that is,

A(x) = E ∪ i ∈ I |ci(x) = 0. (7.18)

Page 257: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 256'

&

$

%

• Next, I need to give more attention to the properties of the

constraint gradients.

• The vector ∇ci(x) is often called the normal to the constraint

ci at the point x,

– it is perpendicular (normal) to the contours of the

constraint ci at x

– in the case of an inequality constraint, it points toward the

feasible side of this constraint.

– Can you explain why???

Page 258: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 257'

&

$

%

• It can happen that ∇ci(x) = 0 for all feasible points x due to

the choice of formula used for the equality constraint ci(x) = 0,

so that the term λi∇ci(x) vanishes for all values of λi and does

not play a role in the Lagrangian gradient ∇x L.

• For instance, if I replaced the constraint in (7.4) by the

equivalent condition

c1(x) =

(x21 + x

22 − 2

)2= 0

I would have that

– ∇c1(x) = 0 for all feasible points x

– and the condition ∇f(x) = λ1∇c1(x) no longer holds at the

optimal point (−1,−1).

Page 259: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 258'

&

$

%

• An extra condition called a constraint qualification is added

to ensure that such “degenerate” behavior does not occur at

the value of x in question.

• One such constraint qualification— often used in the design of

algorithms—is the one defined as follows:

Definition 7.1 (LICQ) Given the point x∗ and the active set

A(x∗) defined by (7.18), I say that the linear independence

constraint qualification (LICQ) holds if the set of active

constraint gradients ∇ci(x∗), i ∈ A(x∗) is linearly

independent.

• Note that if this condition holds, none of the active constraint

gradients can be zero.

• Why????

Page 260: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 259'

&

$

%

• The LICQ is the final piece in the jigsaw.

• Now I can state the following optimality conditions for a

general nonlinear programming problem (7.1).

• These conditions provide the foundation for algorithms for the

solution of Constrained Optimisation problems.

• They are called first-order conditions because they concern

themselves with properties of the gradients (first-derivative

vectors) of the objective and constraint functions.

Read to here for 09:00–11:00 Tuesday Week 8 (Patrick’s

Day)

Page 261: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 260'

&

$

%

Theorem 7.1 (First-Order Necessary Conditions) Suppose

that x∗ is a local solution of (7.1) and that the LICQ (Def. 7.1)

holds at x∗. Then there is a Lagrange multiplier vector λ∗, with

components λ∗i , i ∈ E ∪ I, such that the following conditions are

satisfied at (x∗,λ∗)

(Conditions 7.19b and 7.19c simply require that the constraints be

satisfied.) — which is why they are green...)

∇x L(x∗,λ∗) = 0, (7.19a)

ci(x∗)= 0, for all i ∈ E , (7.19b)

ci(x∗)≥ 0, for all i ∈ I, (7.19c)

λ∗i ≥ 0, for all i ∈ I, (7.19d)

λ∗ici(x∗) = 0, for all i ∈ E ∪ I (7.19e)

The conditions (7.22a–7.19e) are the Karush-Kuhn-Tucker

conditions or KKT conditions for short.

Page 262: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 261'

&

$

%

• Because the complementarity condition (7.19e) implies that the

Lagrange multipliers corresponding to inactive inequality

constraints are zero, I can omit the terms for indices i /∈ A(x∗)from (7.22a) and rewrite this condition as

0 = ∇x L(x∗, λ∗) = ∇f(x∗) −∑

i∈A(x∗)

λ∗i∇ci(x∗). (7.20)

• A special case of complementarity is important and deserves its

own definition:

Definition 7.2 (Strict Complementarity) Given a local

solution x∗ of (7.1) and a vector λ∗ satisfying (7.22a–7.19e) , I

say that the strict complementarity condition holds if exactly

one of λ∗i and ci(x∗) is zero for each index i ∈ I. In other

words, I have that λ∗i > 0 for each i ∈ I ∩ A(x∗).

Page 263: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 262'

&

$

%

• For a given problem (7.1) and solution point x∗ there may be

many vectors λ∗ for which the conditions (7.22a–7.19e) are

satisfied.

• When the LICQ holds, however, the optimal λ∗ is unique (see

the exercises).

• Example 7.3 A toy problem:

– Let f(x) = x1 + x2 + 2,

– c1(x) = 2− (x1 − 1)2 − (x2 − 1)

2,

– c2(x) = 2− (x1 − 1)2 − (x2 + 1)

2

– c3(x) = x1.

– Sketch the problem.

– It is easy to see that x∗ = (0, 0).

– Find the Lagrange multipliers at x∗ and check whether the

LICQ is satisfied.

Page 264: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 263'

&

$

%

I will prove Theorem 7.1 in two steps.

• First in Thm. 7.2 I prove the special case (Problem E) where

all the constraints are equality constraints:

E : minx∈Rn

f(x) subject to ci(x) = 0, i ∈ E , (7.21)

• Then I extend the result to include inequality constraints —

proving Thm. 7.1.

Theorem 7.2 (1st-Order N. Conds. — Equality Constraints)

Suppose that x∗ is a local solution of (7.21) and that the LICQ

(Def. 7.1) holds at x∗. Then there is a Lagrange multiplier vector

λ∗, with components λ∗i , i ∈ E, such that the following conditions

are satisfied at (x∗, λ∗)

∇x L(x∗, λ∗) = 0, (7.22a)

ci(x∗) = 0, for all i ∈ E , (7.22b)

Page 265: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 264'

&

$

%

7.2.1 Background Material for KKT Theorem

I need some new ideas before I go ahead with the proof in

Section 7.2.2.

Definition 7.3 (Limit Point) A vector x ∈ Rn is a limit point of

a sequence xk if there is a subsequence of xk that converges to x.

(The Bolzano-Weirstrass Thm — which applies to Rn— states that

every sequence on a closed and bounded set has a convergent

subsequence.)

Example 7.4 The sequence 1,−1, 1,−1, . . . is defined on the

closed bounded set −1, 1. It is obviously not convergent but equally

obviously has convergent subsequences with converging to 1 and −1

so has 1 & −1 as limit points.

Example 7.5 The sequence 1, 2, 3, . . . is not defined on a closed

bounded set and has no convergent subsequences and therefore no

limit points.

Page 266: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 265'

&

$

%

As a means to the end of proving Thm. 7.2 I can define a penalty

function Fk for the equality-constrained minimisation problem E

(7.21) as follows.

Definition 7.4 (Penalty Function) Let x∗ be a local minimum

of problem E. Then I define

Fk(x) = f(x) +k

2‖c(x)‖2 + α

2‖x− x∗‖2. (7.23)

• Note that ‖c(x)‖2 ≡∑i∈E

ci(x)2.

• The α–term is included so that x∗ is a strict local minimum of

Eα : minx∈Rn

f(x) +α

2‖x− x∗‖2 subject to ci(x) = 0, i ∈ E

even if x∗ is only a weak local minimum of the original problem

E.

Page 267: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 266'

&

$

%

• Penalty functions have the nice property that in the limit as

k→∞, the unconstrained minimum of the penalty function

is equal to the solution to the actual constrained problem (in

this case E).

• This is intuitively reasonable as to minimise Fk(x) for any

given k I need to reduce ‖c(x)‖2 towards zero (moving to the

feasible region) and also minimise f(x).

• It seems plausible that the bigger k is, the more I “penalise”

the ‖c(x)‖2 term in Fk(x).

• The trade-off between reducing f(x) and driving ‖c(x)‖2 to

zero moves more and more towards the latter as k increases.

• So I can expect that in the limit as k→∞ the minimum of

Fk(x) will be a feasible point that minimises f(x), a solution to

E.

• I need to prove this.

Page 268: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 267'

&

$

%

Theorem 7.3 (Penalty Function) Given the

equality-constrained problem E (7.21), then the unconstrained

minima xk of Fk(x) as defined in (7.23) above have the property

that

limk→∞ xk = x∗ a local minimum of problem E.

Proof:

• Saying that x∗ is a local minimum of E means that x∗ must be

the point at which f(x) takes the smallest value for all feasible

points x near x∗ — i.e. within a distance ε for ε > 0

sufficiently small.

• In mathematical notation; ∃ε > 0 s.t. f(x∗) ≤ f(x) for all x s.t.

c(x) = 0 and x ∈ Sε ≡ x|‖x− x∗‖ ≤ ε.

• For each k > 0, let xk be an optimal solution to

min Fk(x) s.t. x ∈ Sε.

Page 269: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 268'

&

$

%

• I know that a solution exists as Sε is closed and bounded.

• R.T.P. that xk → x∗ as k→∞.

• First I note that because Fk has a minimum at xk ;

∀k, Fk(xk) ≡ f(xk)+k

2‖c(xk)‖2+

α

2‖xk−x∗‖2 ≤ Fk(x∗) ≡ f(x∗).

• As f(xk) is bounded on Sε for all k I must have

limk→∞ ‖c(xk)‖ = 0 as otherwise the LHS of the inequality will be

unbounded in the limit due to the k2

factor in k2‖c(xk)‖2.

• So every limit point x of xk is feasible (satisfies c(x) = 0).

• Also, from the above inequality I certainly have

∀k, f(xk) +α

2‖xk − x∗‖2 ≤ f(x∗).

Page 270: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 269'

&

$

%

• Pick any convergent subsequence and take the limit as k→∞.

• I have

f(x) +α

2‖x− x∗‖2 ≤ f(x∗).

• Since x ∈ Sε (as Sε is closed) and x is feasible it follows that

f(x∗) ≤ f(x) so

f(x) +α

2‖x− x∗‖2 ≤ f(x∗) ≤ f(x)

which requires that ‖x− x∗‖2 = 0.

• So x = x∗ and I have xk → x∗ as k→∞.

Page 271: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 270'

&

$

%

For k sufficiently large xk must be an interior point of the closed

sphere Sε so xk must be an unconstrained local minimum of Fk for

k sufficiently large.

Page 272: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 271'

&

$

%

7.2.2 Proof of Theorem 7.2 KKT (Equality Constraints)

Proof:

• From the first order necessary condition Thm. 3.4 for

unconstrained problems I have for k sufficiently large (so

that xk must be an unconstrained local minimum of Fk) that:

0 = ∇Fk(xk) = ∇f(xk) + k∇c(xk)c(xk) + α(xk − x∗). (7.24)

• The matrix ∇c(x) is just

[∇c1(x)∇c2(x) . . .∇cm(x)

]which

has n rows & m columns where m < n.

• As ∇c(x∗) has full rank (m) by the LICQ, the same must be

true for ∇c(xk) when k is sufficiently large as c(x) is C1.

• For such k, ∇c(xk)T∇c(xk) must be invertible (m×m).

Page 273: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 272'

&

$

%

• Now pre-multiply (7.24) by[∇c(xk)T∇c(xk)

]−1∇c(xk)Tgiving:

0 =[∇c(xk)T∇c(xk)

]−1∇c(xk)T∇f(xk) + kc(xk)+α[∇c(xk)T∇c(xk)

]−1∇c(xk)T (xk − x∗).• So kc(xk) =

−[∇c(xk)T∇c(xk)

]−1∇c(xk)T ∇f(xk) + α(xk − x∗).• Now, taking the limit as k→∞ (and xk → x∗),

kc(xk)→ −[∇c(x∗)T∇c(x∗)

]−1∇c(x∗)T∇f(x∗) (7.25)

• How do I know that the limit exists?

• Call the finite limit on the RHS of (7.25) −λ∗.

Page 274: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 273'

&

$

%

• Using this result for limk→∞kc(xk) and taking lim

k→∞ in (7.24), I

have 0 = ∇f(x∗) −∇c(x∗)λ∗.

• This is the required first-order KKT necessary condition for

equality-constrained problems.

Page 275: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 274'

&

$

%

7.2.3 KKT conditions for Inequality Constrained

problems

Proof: (of Thm 7.1) I can extend Thm. 7.2 to

inequality-constrained problems in two steps.

1. • Note that inequality constraints that are inactive at the

optimal point x∗ may be ignored as they cannot affect the

solution.

• Also, the the inequality constraints that are active at

x∗ may be treated as equality constraints in the sense that

if x∗ is a solution to the problem (7.1) then it is also a

solution to

minx∈Rn

f(x) subject to

ci(x) = 0 i ∈ E ,ci(x) = 0 i ∈ A(x∗) \ E

(7.26)

Page 276: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 275'

&

$

%

• Of course I don’t know which inequality constraints are

active at x∗

– so (7.26) does not give me a solution method

– but it does mean that I can apply the KKT conditions

for an equality-constrained problem to (7.26).

Page 277: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 276'

&

$

%

• So (for free) I get (most of) the KKT first-order necessary

conditions for a general mixed problem (7.1):

∇x L(x∗, λ∗) = 0, (7.26a)

ci(x∗)= 0, for all i ∈ E , (7.26b)

ci(x∗)≥ 0, for all i ∈ I, (7.26c)

The odd one out −→ λ∗i≥ 0, for all i ∈ I, (7.26d)

λ∗ici(x∗) = 0, for all i ∈ E ∪ I

(7.26e)

where (as in (7.20))

∇x L(x∗, λ∗) ≡∇f(x∗) −∑

i∈A(x∗)

λ∗i∇ci(x∗).

Page 278: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 277'

&

$

%

• The first condition (7.26a) follows immediately from

applying the (equality-constrained) version of the KKT

conditions to (7.26) — I set the multipliers corresponding to

inactive (at x∗ ) inequality constraints to zero as they

cannot affect the solution.

• The second (7.26b) and third (7.26c) green conditions just

require that all the constraints be satisfied at the optimal

point x∗.

• I will have to prove the fourth condition (7.26d)

separately as it does not follow from the

(equality-constrained) version of the KKT conditions.

Page 279: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 278'

&

$

%

• It is easy to check that the (fifth) complementarity

condition (7.26e) holds.

– It is trivial for the equality constraints — it means that

there is no restriction on the signs of the corresponding

Lagrange multipliers.

– For the inactive inequality constraints (ci(x∗) > 0) it

says the corresponding Lagrange multipliers must be zero

as these constraints may be omitted from the Lagrangian

without changing the solution.

– Finally, it says nothing about the multipliers

corresponding to the active constraints (ci(x∗) = 0).

Page 280: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 279'

&

$

%

2. • I finally need to prove that the fourth condition (7.26d) is

necessary for x∗ to be an optimal solution of (7.1).

• Define the functions c−j (x) = min0, cj(x), j ∈ I.

• Obviously c−j (x) ≤ 0, j ∈ I.

• If the jth constraint is satisfied at x then c−j (x) is zero.

• If the constraint is violated at x then c−j (x) = cj(x) < 0.

• For each value of k = 0, 1, · · · I define the penalty problem

corresponding to (7.1):

min Fk(x) ≡ f(x)+k2

∑i∈E

ci(x)2+k

2

∑i∈I

(c−i (x)

)2+α

2‖x−x∗‖2

provided that x ∈ Sε as before.

Page 281: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 280'

&

$

%

• As in the derivation of the KKT conditions for an

equality-constrained problem, I can apply the first-order

necessary conditions for an unconstrained problem to this

new version of Fk — note that(c−i (x)

)2is continuously

differentiable with gradient 2c−i (x)∇ci(x).• A similar argument (Exercise) to that used in the proof of

Thm. 7.2 leads to the conclusions (compare with (7.25)):

λ∗i = − limk→∞kci(xk), i ∈ E

λ∗i = − limk→∞kc−i (xk), i ∈ I.

• But c−i (xk) ≤ 0 by definition so λ∗i ≥ 0, i ∈ I.

Page 282: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 281'

&

$

%

I will illustrate the KKT conditions with another example.

Example 7.6 Minimise the function(x1 −

32

)2+(x2 −

12

)4in the

feasible region described by the four constraints

x1 + x2 ≤ 1, x1 − x2 ≤ 1, −x1 + x2 ≤ 1, −x1 − x2 ≤ 1.

Graphically the feasible region is just the diamond-shaped region

bounded by (1, 0), (0, 1), (−1, 0) and (0,−1).

Page 283: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 282'

&

$

%

By restating the constraints in the standard form of (7.1) the

problem becomes

minx

(x1 −

3

2

)2+

(x2 −

1

2

)4s.t.

1− x1 − x2

1− x1 + x2

1+ x1 − x2

1+ x1 + x2

≥ 0. (7.27)

Page 284: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 283'

&

$

%Figure 12: Inequality-constrained Example 7.6

It is clear from the Figure that the solution is x∗ = (1, 0).

Page 285: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 284'

&

$

%

The first and second constraints in (7.27) are active at this point.

Denoting them by c1 and c2 (and the inactive constraints by c3 and

c4), I have

∇f(x∗) =

−1−12

,∇c1(x∗) =−1−1

,∇c2(x∗) =−11

.Therefore, the KKT conditions (7.22a–7.19e) are satisfied when I

set

λ∗ =

(3

4,1

4, 0, 0

)T.

Read to here for 09:00–11:00, Week 9. For time reasons,

the remainder of Chapter 7 will not be covered or

examined. Go to Ch. 8.

Page 286: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 285'

&

$

%

7.2.4 Sensitivity Analysis

That Lagrange multipliers are useful should now be clear but what

do they “mean”?

I’ll show that the value of each Lagrange multiplier λ∗i tells me

something about the sensitivity of the optimal objective value

f(x∗) to the presence of constraint ci.

Page 287: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 286'

&

$

%

So I need to find the effect of “perturbing” a single constraint — or

all of them, replacing ci(x) = ui by ci(x) = ui for some or all of

i, i ∈ E .

I’ll show that if I perturb an equality constrained problem

min f(x)|ci(x) = 0, i ∈ E by solving min f(x)|ci(x) = ui, i ∈ E

then

∇uf(x(u)) = −λ(u) (7.28)

where x(u) is the optimal solution to the perturbed problem and

λ(u) is the vector of Lagrange multipliers for the perturbed

problem.

So the magnitude & sign of −λi tells me how strongly the

optimal value of the objective function depends on the

perturbation ui of the ith constraint.

Page 288: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 287'

&

$

%

• I am interested in the solutions of

min f(x), x ∈ Rn|ci(x) = ui, i ∈ E

which I can write as min f(x), x ∈ Rn|c(x) = u, where c(x) is

the vector of equality constraints and u the vector of

perturbations.

• For ‖u‖ sufficiently small it is reasonable to expect (and can be

shown using the Implicit Function Theorem http:

//en.wikipedia.org/wiki/Implicit_function_theorem or

http://math.stackexchange.com/questions/26205/

what-is-the-implicit-function-theorem) that the solution

(x(u),λ(u)) of the perturbed problem depends in a C1 manner

on u and that the KKT equation continues to hold:

∇xf(x(u)) +∇xc (x(u)) λ(u) = 0. (7.29)

together with the perturbed constraints c (x(u)) = u.

Page 289: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 288'

&

$

%

• Taking the gradient w.r.t. u of the perturbed constraints

c (x(u)) = u I have by the Chain Rule that (taking |E | = m):

∇uc (x(u)) ≡∇ux(u)∇xc (x(u)) = ∇uu ≡ Im.

• Note the unexpected order of the factors in the matrix product,

can you explain the sizes of the various matrices?

• Now multiply the perturbed KKT eq. (7.29) on the left by

∇ux(u):

∇ux(u)∇xf(x(u)) +∇ux(u)∇xc (x(u)) λ(u) = 0.

• Using ∇ux(u)∇xc (x(u)) = Im, I can write:

∇ux(u)∇xf(x(u)) + λ(u) = 0.

• So finally

λ(u) = −∇ux(u)∇xf(x(u))

and (again by the Chain Rule) (7.28) follows.

Page 290: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 289'

&

$

%

Notes:

• This result still holds for inequality-constrained problems if I

add the inequality constraints that are binding at the solution

to the set of equality constraints.

• See App. A.34 for a “low-brow” version of this result.

Page 291: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 290'

&

$

%

This discussion motivates the definition below, which classifies

constraints according to whether or not their corresponding

Lagrange multiplier is zero.

Definition 7.5 Let x∗ be a solution of the problem (7.1), and

suppose that the KKT conditions (7.22a–7.19e) are satisfied.

• I say that an inequality constraint ci is strongly active or

strongly binding if i ∈ A(x∗) and λ∗i > 0 for some Lagrange

multiplier λ∗ satisfying (7.22a–7.19e) .

• I say that ci is weakly active if i ∈ A(x∗) and λ∗i = 0 for all

λ∗ satisfying (7.22a–7.19e) .

Page 292: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 291'

&

$

%

7.3 Second-Order Conditions

• So far, I have described the first-order necessary

conditions—the KKT conditions—which tell me how the first

derivatives of f and the active constraints ci are related at x∗.

• They are not sufficient conditions.

• Although for the simple inequality constrained examples in

Sec 7.1 the non-negativity condition on multipliers

corresponding to active inequality constraints allowed me to

distinguish maximum from minimum points, this is not always

so, as I will show.

• Just as for unconstrained problems I need second-order

conditions to distinguish maximum, minimum and stationary

points.

Page 293: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 292'

&

$

%

• First I need to define “feasible directions” — directions that

maintain feasibility:

Definition 7.6 (Feasible Directions) Given a point x∗ and the

active constraint set A(x∗) defined by (7.18), the set F of feasible

directions is defined by

F(x∗) =αd∣∣α > 0, dT∇c∗i = 0, for all i ∈ E ,

dT∇c∗i ≥ 0, for all i ∈ A(x∗) ∩ I

(7.30)

F is the set of vectors that (to first order) maintain feasibility —

stay “on” equality and “inside or on” inequality constraints.

Page 294: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 293'

&

$

%

• When the (first-order) KKT conditions are satisfied, a move

along a “feasible direction” (d in F) either increases the

first-order approximation to the objective function (that is,

dT∇f(x∗) > 0), or else keeps this value the same (that is,

dT∇f(x∗) = 0).

• What implications does optimality have for the second

derivatives of f and the constraints ci?

• I will show in this Section that these derivatives play a

“tiebreaking” role.

• For the feasible directions d ∈ F for which dT∇f(x∗) = 0, I

cannot determine from first derivative information alone

whether a move along this direction will increase or decrease

the objective function f.

Page 295: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 294'

&

$

%

• Second-order conditions examine the second derivative terms in

the Taylor series expansions of f and ci, to see whether this

extra information resolves the issue of increase or decrease in f.

• In summary: the second-order conditions analyse the curvature

of the Lagrangian function in the “undecided” directions — the

directions d ∈ F for which dT∇f(x∗) = 0.

• Since I am discussing second derivatives, stronger smoothness

assumptions are needed here than in the previous Sections.

• For the purpose of this section, f and ci, i ∈ E ∪ I, are all

assumed to be twice continuously differentiable.

Page 296: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 295'

&

$

%

• Given F from Definition 7.6 and some Lagrange multiplier

vector λ∗ satisfying the KKT conditions (7.22a–7.19e) , I define

a restricted set of feasible directions; the set of critical

directions C(λ∗) a subset of F by

C(λ∗) =d ∈ F |∇ci(x∗)Td = 0, for all i ∈ A(x∗)∩Iwith λ∗i > 0

.

• Critical directions “keep strongly active constraints active” to

first order.

• An equivalent definition is:

d ∈ C(λ∗)⇔∇ci(x∗)Td = 0, for all i ∈ E ,∇ci(x∗)Td = 0, for all i ∈ A(x∗) ∩ I with λ∗i > 0,

∇ci(x∗)Td ≥ 0, for all i ∈ A(x∗) ∩ I with λ∗i = 0.

(7.31)

Page 297: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 296'

&

$

%

• From the definition (7.31) and the fact that λ∗i = 0 for all

inactive components i ∈ I\A(x∗), it follows immediately that

d ∈ C(λ∗)⇒ λ∗i∇ci(x∗)Td = 0 for all i ∈ E ∪ I. (7.32)

• From the first KKT condition (7.22a) and the definition (7.17)

of the Lagrangian function, I have that

d ∈ C(λ∗)⇒ dT∇f(x∗) =∑i∈E∪I

λ∗idT∇ci(x∗) = 0. (7.33)

• So the set C(λ∗) contains directions from F for which it is not

clear from first derivative information alone whether f will

increase or decrease — for this reason C is often called the set

of stationary directions.

Page 298: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 297'

&

$

%

The first theorem defines a necessary condition involving the

second derivatives: If x∗ is a local solution, then the curvature of

the Lagrangian along stationary directions (d ∈ C(λ∗)) must be

nonnegative.

Theorem 7.4 (Second-Order Necessary Conditions)

Suppose that x∗ is a local solution of (7.1) and that the LICQ

(Def. 7.1) constraint qualification is satisfied. Let λ∗ be a Lagrange

multiplier vector such that the KKT conditions (7.22a–7.19e) are

satisfied, and let C(λ∗) be defined as above. Then for all

critical/stationary directions d ∈ C(λ∗),

dT∇xx L(x∗, λ∗)d ≥ 0. (7.34)

Page 299: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 298'

&

$

%

• The general proof of Thm. 7.4 is quite technical so I will just

give the proof for the special case of equality constraints.

• Note that (7.31) implies that for equality-constrained problems,

C =d|∇ci(x∗)Td = 0, for all i ∈ E

(7.35)

• I state and prove a slightly weaker and easily proved version of

the general result in Thm. 7.6 below.

• See App. A.27 for a proof of the general result for

inequality-constrained problems.

Page 300: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 299'

&

$

%

So RTP that

Theorem 7.5 (Second-Order N. C.’s — E. Constr.) Suppose

that x∗ is a local solution of (7.21) and that the LICQ (Def. 7.1)

constraint qualification is satisfied. Let λ∗ be a Lagrange multiplier

vector such that the first-order (KKT) necessary conditions are

satisfied, and let C(λ∗) be defined as above. Then

dT∇xx L(x∗, λ∗)d ≥ 0,

for all vectors d such that d ⊥∇ci(x∗), for each i ∈ E.

i.e. for all vectors d ∈ C.

Page 301: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 300'

&

$

%

Proof:

• Just as in the proof of Thm. 7.2, I appeal to the corresponding

second-order necessary conditions Thm. 3.6 for an

unconstrained problem and apply them to the penalty function

Fk defined in Def. 7.23.

• So the Hessian of Fk;

∇2Fk(xk) = ∇2f(xk) + k∇c(xk)∇cT (xk)+

k

m∑i=1

ci(xk)∇2ci(xk) + αI

must be positive semidefinite. for k sufficiently large and for

α > 0.

• (As for k sufficiently large xk must be an interior point of the

closed sphere Sε ≡ x|‖x− x∗‖ ≤ ε so xk must be an

unconstrained local minimum of Fk for k sufficiently large.)

Page 302: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 301'

&

$

%

• Pick any fixed stationary direction d ∈ C (i.e. d ⊥∇ci(x∗) for

all i ∈ E) and define dk to be the projection of d onto the null

space of ∇c(xk)T ;

dk ≡ d−∇c(xk)[∇c(xk)T∇c(xk)

]−1∇c(xk)Td.• (Check that dk ⊥∇c(xk).) It follows that

0 ≤ dkT∇2Fk(xk)dk =

dkT

(∇2f(xk) + k

m∑i=1

ci(xk)∇2ci(xk)

)dk

+ α‖dk‖2. (7.36)

• I know from (7.25) that kci(xk)→ −λ∗i as k→∞.

• Check that, by definition of dk, dk → d as k→∞.

Page 303: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 302'

&

$

%

• So

0 ≤ dT(∇2f(x∗) −

∑i=im

λ∗i∇2ci(x

∗)

)d+ α‖d‖2,

for all stationary directions d ∈ C.

• But α > 0 is arbitrary so I can drop the +α‖d‖2 term (why?).

And I finally have

0 ≤ dTL(x∗, λ∗)d

for all stationary directions d ∈ C as required.

Page 304: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 303'

&

$

%

7.3.1 Weaker Necessary Conditions

It is worth noting that a weaker version of the second order KKT

necessary conditions for an inequality constrained problem is easily

proved, namely:

Theorem 7.6 (Second-Order Weak Necessary Conditions)

Suppose that x∗ is a local solution of (7.1) and that the LICQ

(Def. 7.1) constraint qualification is satisfied. Let λ∗ be a Lagrange

multiplier vector such that the KKT conditions (7.22a–7.19e) are

satisfied, and let C(λ∗) be defined as above. Then

dT∇xx L(x∗, λ∗)d ≥ 0, for all directions d s.t.

∇ci(x∗)Td = 0, for all i ∈ A(x∗). (7.37)

(Note that A(x∗) ≡ E ∪ (I ∩ A(x∗)).)

Page 305: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 304'

&

$

%

Proof:

Just as I proved the inequality-constrained version Thm. 7.1 of the

first-order necessary conditions based on the equality-constrained

version Thm. 7.2, I can use the same trick here, now based on the

proof for the equality-constrained case Thm. 7.5.

I use the same observation as in the proof of Thm. 7.1:

• Inequality constraints that are inactive at the optimal point

x∗ may be ignored as they cannot affect the solution.

• The inequality constraints that are active at x∗ may be

treated as equality constraints in the sense that if x∗ is a

solution to the problem (7.1) then it is also a solution to the

equality-constrained problem

minx∈Rn

f(x) subject to ci(x) = 0, i ∈ A(x∗). (7.38)

Page 306: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 305'

&

$

%

• So applying Thm. 7.5.

0 ≤ yTL(x∗, λ∗)y

for all directions y satisfying yT∇ci(x∗) = 0, i ∈ A(x∗) as

required.

Page 307: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 306'

&

$

%

Comments on Weak Necessary Conditions

• The difference between (7.37) and (7.34) is in the treatment of

the weakly active constraints — those for which ci(x∗) = 0 and

λ∗i = 0.

• The conditions are weak in the sense that the set of vectors d

satisfying ∇ci(x∗)Td = 0, for all i ∈ E ,∇ci(x∗)Td = 0, for all i ∈ A(x∗) ∩ I.

is a proper subset of C(x∗, λ∗) so the weak necessary conditions

may be satisfied at a point (which is not a local minimum)

while the stronger version of the second-order necessary

conditions may not.

Page 308: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 307'

&

$

%

I illustrate this with an example.

Example 7.7 (I will work in R3so will use the familiar (x, y, z)

notation and also use x to refer to the vector (x, y, z) where

convenient.)

Let f(x) = z− (x2 − y2) so that the level surfaces f(x) = c take the

form z = x2 − y2 + c.

I impose two inequality constraints:

c1(x) = 1− x2 − y2 − (z− 1)2 ≥ 0

c2(x) = ax+ by+ cz ≥ 0.

The constraint c1(x) ≥ 0 corresponds to the interior of a unit

sphere centred at (0, 0, 1) and c2(x) ≥ 0 to a plane through the

origin with normal vector (a, b, c)T . At the point x∗ = (0, 0, 0),

f(x∗) = 0 and both constraints are active. However x∗ is not a local

minimum as I will show.

Page 309: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 308'

&

$

%

First I check the first order KKT conditions at x∗ :

∇L(x∗,λ) =

−2x

2y

1

(0,0,0)

− λ1

−2x

−2y

−2(z− 1)

(0,0,0)

− λ2

a

b

c

= 0

=

0

0

1

− λ1

0

0

2

− λ2

a

b

c

= 0

So the first-order KKT necessary conditions are satisfied at x∗ if

λ1 =12

and λ2 = 0.

Page 310: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 309'

&

$

%

Now consider the second-order necessary conditions. The critical

directions C(x∗, λ∗) are the directions d s.t. dT

0

0

2

= 0 and

dT

a

b

c

≥ 0 so I must have d =

α

β

0

with αa+ βb ≥ 0.

The Hessian of the Lagrangian ∇2L(x∗, λ∗) =

−1 0 0

0 3 0

0 0 1

Page 311: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 310'

&

$

%

The second-order necessary condition is that dT∇2L(x∗, λ∗)d ≥ 0

for all d ∈ C. With d =

α

β

0

the conditions to be satisfied by α,β

are dT∇2L(x∗, λ∗)d = −α2 + 3β2 ≥ 0 together with αa+ βb ≥ 0.

But I can easily construct d s.t.−α2 + 3β2 < 0 or equivalently

3β2 < α2 while still satisfying αa+ βb ≥ 0. Just choose

sign(α) = sign(a) and sign(β) = sign(b) and (for example)

|α| = 2|β|.

So the condition dT∇2L(x∗, λ∗)d ≥ 0 is not true for all d ∈ C and

therefore x∗ is not a local minimum point.

Page 312: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 311'

&

$

%

But...

The weak necessary conditions of Thm. 7.6 are satisfied!

The vector d must satisfy

dT

0

0

2

= 0 and dT

a

b

c

= 0 so I must have d =

α

β

0

with

αa+ βb = 0.

The latter condition is satisfied by any α,β s.t.

αβ

= K

b−a

for

any K ∈ R.

Page 313: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 312'

&

$

%

As before I have dT∇2L(x∗, λ∗)d = −α2 + 3β2. Substituting for

α,β I have −α2 + 3β2 = K2(−b2 + 3a2

)which is non-negative for

all choices of a, b satisfying 3a2 ≥ b2.

So for certain choices of the weakly active constraint (namely

3a2 ≥ b2) the weak version of the necessary conditions is satisfied

at x∗ , even though it is not in fact a local minimum.

Page 314: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 313'

&

$

%

• The weak version of the necessary condition is weak precisely

because it is easier to “pass the test” — as the example

illustrates.

• The set of vectors (D, say) d that are orthogonal to the

gradients of the active constraints (the set specified in the weak

necessary conditions of Thm. 7.6) is a subset of C so

dT∇2L(x∗, λ∗)d may be non-negative for d ∈ D but not for all

d ∈ C.

• A final comment: weakly active constraints (ci(x∗) = 0 and

λ∗i = 0) may be ignored when examining the first-order KKT

necessary conditions but — as I have just seen — this is not

the case for the second-order necessary conditions.

Page 315: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 314'

&

$

%

Sufficient conditions are conditions on f and ci, i ∈ E ∪ I, that

ensure that x∗ is a local solution of the problem (7.1). The

second-order sufficient condition stated in the next theorem looks

very much like the necessary condition just discussed, but it differs

in that the LICQ constraint qualification is not required, and the

inequality in (7.34) is replaced by a strict inequality.

Theorem 7.7 (Second-Order Sufficient Conditions) Suppose

that for some feasible point x∗ ∈ Rn there is a Lagrange multiplier

vector λ∗ such that the KKT conditions (7.22a–7.19e) are satisfied.

Suppose also that

dT∇xxL(x∗,λ)d > 0,

for all stationary directions d ∈ C(λ∗), d 6= 0. (7.39)

Then x∗ is a strict local solution for (7.1).

Proof: See App. A.28.

Page 316: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 315'

&

$

%

Example 7.8 (Example 7.2 One Last Time) I now return to

Example 7.2 to check the second-order conditions for problem

(7.10). In this problem I have f(x) = x1 + x2, c1(x) = 2− x21 − x

22,

E = ∅, and I = 1. The Lagrangian is

L(x,λ) = (x1 + x2) − λ1(2− x21 − x

22),

and I saw that the KKT conditions (7.22a–7.19e) are satisfied by

x∗ = (−1,−1), with λ∗1 =12. The Lagrangian Hessian at this point is

∇xx L(x∗,λ∗) =

2λ∗1 0

0 2λ∗1

=

1 0

0 1

.This matrix is positive definite, that is, it satisfies

wT∇xxL(x∗,λ∗)w > 0 for all w 6= 0, so it certainly satisfies the

conditions of Theorem 7.7. I conclude that x∗ = (−1,−1) is a strict

local solution for (7.10).

Page 317: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 316'

&

$

%

Example 7.9 For an example in which the issues are more

complex, consider the problem

min x22 −1

10(x1 − 4)

2 s.t. x21 + x22 − 1 ≥ 0, (7.40)

in which I seek to minimise a nonconvex function over the

exterior of the unit circle. Obviously, the objective function is not

bounded below on the feasible region, since I can take the sequence

of feasible points (10, 0), (20, 0), (30, 0), . . . and note that f(x)

approaches −∞ along this sequence. Therefore, no global solution

exists, but it may still be possible to identify a strict local solution

on the boundary of the constraint. I search for such a solution by

using the KKT conditions (7.22a–7.19e) and the second-order

sufficient conditions of Theorem 7.7.

Page 318: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 317'

&

$

%

By defining the Lagrangian for (7.40) in the usual way, it is easy to

verify that

∇x L(x,λ) =

−0.2(x1 − 4) − 2λx1

2x2 − 2λx2

, (7.41)

∇xx L(x, λ) =

−0.2− 2λ 0

0 2− 2λ

. (7.42)

The point x∗ = (1, 0) satisfies the KKT conditions with λ∗1 = 0.3

and the active set A(x∗) = 1.

Page 319: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 318'

&

$

%

To check that the second-order sufficient conditions are satisfied at

this point,

I note that ∇c1(x∗) =

20

so that the space C defined in (7.31) is

simply C(λ∗) = w|w1 = 0 = (0,w2)T |w2 ∈ R.

Now, by substituting x∗ and λ∗ into (7.42) we have for any w ∈ Cwith w 6= 0 that

wT∇xx L(x∗,λ∗)w =[0 w2

]−0.4 0

0 1.4

0w2

= 1.4w22 > 0.

Hence, the second-order sufficient conditions are satisfied, and I

conclude from Theorem 7.7. that (1, 0) is a strict local solution for

(7.40).

Page 320: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 319'

&

$

%

7.4 Exercises

1. Prove that the direction d given in (7.1.1) satisfies both

conditions (7.6) and (7.7)

2. Prove that the direction d given in (7.13) satisfies both (7.7)

and (7.12).

3. Does problem (7.27) have a finite or infinite number of local

solutions? Use the first-order optimality conditions

(7.22a–7.19e) to justify your answer.

4. Sketch the feasible region defined by the constraint set:

x2 ≤ x31, x2 ≥ 0.

Check the LICQ (Def. 7.1) doesn’t hold at x∗ = (0, 0).

Page 321: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 320'

&

$

%

5. Show that for the feasible region defined by

(x1 − 1)2 + (x2 − 1)

2 ≤ 2,

(x1 − 1)2 + (x2 + 1)

2 ≤ 2, x1 ≥ 0,

the MFCQ is satisfied at x∗ = (0, 0) but the LICQ is not

satisfied.

6. Prove that when the KKT conditions (7.22a–7.19e) and the

LICQ are satisfied at a point x∗, the Lagrange multiplier λ∗ in

the KKT condition is unique.

Page 322: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 321'

&

$

%

7. Consider the problem

minx∈R2

f(x) = −2x1 + x2 subject to

(1− x1)3 − x2 ≥ 0

x2 + 0.25x21 − 1 ≥ 0.

(7.43)

The optimal solution is x∗ = (0, 1) where both constraints are

active. Does the LICQ hold at this point? Are the KKT

conditions satisfied?

8. Does the problem 7.40 have any other KKT points (other than

(1, 0)? Do these points (if any) satisfy the second-order

necessary or sufficient conditions?

Page 323: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 322'

&

$

%

8 Linear Programs

In this Chapter I look at a familiar (from the OR1 module)

problem — solving Linear Programs (LP’s). They are very

important in their own right and also allow me to exercise the

KKT necessary conditions on a problem of significant complexity.

I’ll use the KKT conditions to derive what is called the Revised

Simplex Method — the basis for the solution of large LP’s. The

tableau-based version of Simplex is not suited to large problems.

(This Chapter is based almost entirely on the first few Sections of

Ch.13 of Nocedal & Wright.)

Page 324: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 323'

&

$

%

8.1 LP Definitions

• Linear programs have a linear objective function and linear

constraints, which may include both equalities and inequalities.

• The feasible set is a polytope, a convex, connected set with

flat, polygonal faces.

• The level surfaces (contours in R2) of the objective function are

planes cTx = K (more correctly referred to as affine spaces as

they do not in general pass through the origin).

• In two dimensions it is easy to use graphical methods — the

optimal point will be either a vertex, an edge or perhaps the

problem is unbounded or infeasible.

• You should draw some rough sketches to illustrate all these

possible cases.

Page 325: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 324'

&

$

%

• In higher dimensions, the set of optimal points can be a single

vertex, an edge or face, or even the entire feasible set.

• The problem has no solution if the feasible set is empty (the

infeasible case) or if the objective function is unbounded below

on the feasible region (the unbounded case).

Page 326: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 325'

&

$

%

• Linear programs are usually defined and analyzed in the

following standard form:

min cTx, subject to Ax = b, x ≥ 0. (8.1)

where c and x are vectors in Rn, b is a vector in Rmand A is

an m× nmatrix with m ≤ n.

• It is easy to transform any linear program to this form.

• For instance, given the problem

min cTx, subject toAx ≤ b

(without any bounds on x), I can convert the inequality

constraints to equalities by introducing a vector of slack

variables z and writing

min cTx, subject to Ax+ z = b, z ≥ 0.

Page 327: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 326'

&

$

%

• This form is still not quite standard, since not all the variables

are constrained to be nonnegative.

• I deal with this by splitting x into its nonnegative and

nonpositive parts, x = x+ − x− , where x+ = max(x, 0) ≥ 0 and

x− = max(−x, 0) ≥ 0.

• The problem (8.1) can now be written as

min[cT −cT 0T

]x+

x−

z

s.t.[A −A I

]x+

x−

z

= b ,

x+

x−

z

≥ 0.(8.2)

which clearly has the same form as (8.1).

Page 328: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 327'

&

$

%

• Inequality constraints of the form Ax ≤ b or Ax ≥ b can

always be converted to equality constraints by adding or

subtracting slack variables to make up the difference between

the left- and right-hand sides.

• So Ax ≤ b⇔ Ax+ s = b, s ≥ 0 and

Ax ≥ b⇔ Ax− s = b, s ≥ 0.

• When I subtract the variables from the left hand side, as in the

second case, they are sometimes known as surplus variables.

• I can also convert a “maximize” objective max cTx into the

“minimize” form of (8.1) by simply negating c.

Page 329: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 328'

&

$

%

• I say that the linear program (8.1) is infeasible if the feasible

set is empty.

• I say that the problem (8.1) is unbounded if the objective

function is unbounded below on the feasible region, that is,

there is a sequence of points xk feasible for (8.1) such that

cTxk ↓ −∞.

• Of course, unbounded problems have no solution.

• For the standard formulation (8.1), I will assume throughout

that m < n.

• Otherwise, the system Ax = b contains redundant rows, or is

infeasible, or defines a unique point.

• When m ≥ n, factorisations such as the QR or LU

factorisation can be used to transform the system Ax = b to

one with a coefficient matrix of full row rank.

Page 330: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 329'

&

$

%

8.2 The Simplex Method

• In OR1 you learned how to solve LP’s using the Simplex

Method, a tabular method based on Gauss Elimination.

• The Simplex Method uses pivots as the key technique to

transform the tableau, reducing the objective at each iteration

while maintaining feasibility.

• It is an excellent way to introduce students to Linear

Programming.

• But it is not an efficient method for large practical problems.

• Instead I’ll derive the “Revised” version of the Simplex

Method, based on matrix algebra.

• The derivation depends on the KKT optimality conditions as I

will explain in the next Section.

Page 331: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 330'

&

$

%

8.3 Optimality Conditions

• Optimality conditions for the standard form problem (8.1) can

be derived from the theory of Chapter 7.

• Only the KKT first order necessary conditions are needed as

the problem is linear.

• Convexity of the problem ensures that these conditions are

sufficient for a global minimum.

• I do not need to refer to the second-order conditions from

Chapter 7, which are “empty” as the Hessian of the Lagrangian

for (8.1) is zero.

• The KKT theory that I explained in Chapter 7 makes

derivation of optimality and duality results for linear

programming much easier than in other treatments, where this

theory is developed more or less from scratch.

Page 332: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 331'

&

$

%

• The KKT conditions were stated in Theorem 7.1.

• As stated in Chapter 7, this theorem requires linear

independence of the active constraint gradients (LICQ).

• However, the Theorem continues to hold for dependent

constraints provided they are linear, as is the case here.

• It is useful to name the Lagrange multipliers for the problem

(8.1) as two vectors λ and s, where λ ∈ Rm is the multiplier

vector for the m equality constraints Ax = b, while s ∈ Rn is

the multiplier vector for the bound (inequality) constraints

x ≥ 0.

• Using the definition (7.8) I can write the Lagrangian function

for (8.1) as

L(x, λ, s) = cTx− λT (Ax− b) − sTx. (8.3)

Page 333: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 332'

&

$

%

• Applying the KKT conditions to (8.3), the first-order necessary

conditions that x∗ be a solution to problem (8.1) are that there

exist λ and s such that:

ATλ+ s = c (8.4a)

Ax = b (8.4b)

x ≥ 0 (8.4c)

s ≥ 0 (8.4d)

xisi = 0, i = 1, . . . , n. (8.4e)

Page 334: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 333'

&

$

%

• The complementarity condition (8.4e) can also be written

xT s = 0 as x and s are non-negative.

• Let x∗, λ∗, s∗ satisfy Eqs. 8.4a–8.4e.

• Then

cTx∗ = (ATλ∗ + s∗)Tx∗ = (Ax∗)Tλ∗ = bTλ∗. (8.5)

• As I’ll show in a moment, bTλ is the objective function for the

dual problem to (8.1) so (8.5) indicates that the primal and

dual objectives are equal for vector triples (x, λ, s) that satisfy

Eqs. 8.4a–8.4e.

• You’ve seen results like this in OR1 now they are easy to derive.

Page 335: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 334'

&

$

%

• It is easy (though unnecessary as noted above) to show directly

that the KKT conditions Eqs. 8.4a–8.4e are sufficient for x∗

to be a global solution of (8.1).

• Let x be any other feasible point, so that Ax = b and x ≥ 0.

• Then

cT x = (ATλ∗ + s∗)T x = bTλ∗ + xT s∗ ≥ bTλ∗ = cTx∗. (8.6)

• So no other feasible point can have a lower objective value than

cTx∗.

• I can say more:

– The feasible point x is optimal if and only if xT s∗ = 0 since

otherwise the inequality in (8.6) is strict.

– In other words, when s∗i > 0, then I must have xi = 0 for all

solutions x of (8.1).

Page 336: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 335'

&

$

%

8.4 The Dual Problem

• Given the data c, b and A, which defines the problem (8.1) , I

can define another, closely related, problem as follows:

maxbTλ, subject toATλ ≤ c. (8.7)

• This problem is called the dual problem for (8.1).

• The original problem (8.1) is often referred to as the primal.

• I can restate (8.7) in a slightly different form by introducing a

vector of dual slack variables s and writing

maxbTλ, subject toATλ+ s = c, s ≥ 0. (8.8)

• The variables (λ, s) in this problem are sometimes referred to

collectively as dual variables.

Page 337: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 336'

&

$

%

• The primal and dual problems present two different viewpoints

on the same data.

• Their close relationship becomes evident when I write down the

KKT conditions for (8.7).

• First let’s restate (8.7) in the form

min−bTλ s.t. c−ATλ ≥ 0,

to fit the formulation (7.1) in Ch 7.

• By using x for the Lagrange multipliers for the constraints

ATλ ≤ c, I see that the Lagrangian function is

L(λ, x) = −bTλ− xT (c−ATλ).

Page 338: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 337'

&

$

%

• Using Theorem 7.1 again, I find the first-order necessary

conditions for λ to be optimal for (8.7) is that there exists x

such that

Ax = b (8.9a)

ATλ ≤ c (8.9b)

x ≥ 0 (8.9c)

xi(c−ATλ)i = 0, i = 1, . . . , n. (8.9d)

• Defining s = c−ATλ (as in (8.8)), I find that the conditions

Eqs. 8.4a–8.4e and Eqs. 8.9a–8.9d are identical!

• The optimal Lagrange multipliers λ in the primal problem are

the optimal variables in the dual problem, while the optimal

Lagrange multipliers x in the dual problem are the optimal

variables in the primal problem.

Page 339: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 338'

&

$

%

• Analogously to (8.6), I can show that Eqs. 8.9a–8.9d are in fact

sufficient conditions for a solution of the dual problem (8.7).

• Given x∗ and λ∗ satisfying these conditions (so that the triple

(x, λ, s) = (x∗, λ∗, c−ATλ∗) satisfies Eqs. 8.4a–8.4e, I have for

any other dual feasible point λ (with AT λ ≤ c) that

bT λ = x∗TAT λ

= x∗T (AT λ− c) + cTx∗

≤ cTx∗ as AT λ− c ≤ 0 and x∗ ≥ 0.

= bTλ∗ from 8.5

• Hence λ∗ achieves the maximum of the dual objective bTλ over

the dual feasible region ATλ ≤ c, so it solves the dual problem

(8.7).

Page 340: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 339'

&

$

%

• The primal–dual relationship is symmetric; by taking the dual

of the dual problem (8.7), I recover the primal problem (8.1) —

an interesting Exercise.

• Given a feasible vector x for the primal (satisfying Ax = b and

x ≥ 0) and a feasible point (λ, s) for the dual (satisfying

ATλ+ s = c, s ≥ 0), I have as in (8.6) that

cTx− bTλ = (c−ATλ)Tx = sTx ≥ 0. (8.10)

• Therefore I have cTx ≥ bTλ (that is, the dual objective is a

lower bound on the primal objective) when both the primal

and dual variables are feasible—a result known as weak duality.

Page 341: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 340'

&

$

%

The following strong duality result is fundamental to the theory of

linear programming.

Theorem 8.1 (Strong Duality) I have a “dichotomy”:

(i) If either the primal (8.1) or dual (8.7) problem has a finite

solution then so does the other and the objective values are

equal.

(ii) If either problem is unbounded then the other problem is

infeasible.

Page 342: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 341'

&

$

%

Proof:

• For (i), suppose that (8.1) has a finite optimal solution x∗ .

• It follows from Theorem 7.1 that there are vectors λ∗ and s∗

such that (x∗, λ∗, s∗) satisfies (8.4a)–(8.4e)

• I noted above that (8.4a)–(8.4e) and (8.9a)–(8.9d) are

equivalent and that (8.9a)–(8.9d) are sufficient conditions for

λ∗ to be a solution of the dual problem (8.7).

• Moreover, it follows from (8.5) that cTx∗ = bTλ∗ , as claimed.

• A symmetric argument holds if I start by assuming that the

dual problem (8.7) has a solution.

Page 343: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 342'

&

$

%

• To prove (ii), suppose that the primal is unbounded, that is,

there is a sequence of points xk, k = 1, 2, 3, . . . such that

cTxk ↓ −∞, Axk = b and xk ≥ 0.

• (I could write cTxk ↓ −∞ more formally as

∀N ∈ N, ∃K ∈ N such that k > K⇒ cTxk < −N but happily

there is no need. :-) )

• Suppose too that the dual (8.7) is feasible, that is, there exists

a vector λ such that AT λ ≤ c.

• From the latter inequality together with xk ≥ 0, I have

λTAxk ≤ cTxk and the constant λTb = λTAxk ≤ cTxk ↓ −∞.

• So I have a contradiction.

• Hence, the dual must be infeasible.

• A similar argument can be used to show that unboundedness of

the dual implies infeasibility of the primal.

Page 344: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 343'

&

$

%

8.5 Geometry Of The Feasible Set

• I’ll repeat the definition of a Standard Form LP (8.1)

min cTx, x ∈ Rn, subject to Ax = b, x ≥ 0. (8.11)

• From now on I assume that the (short and wide) m× nmatrix

A has full row rank m ≤ n — in other words A has n linearly

independent columns.– In practice, a preprocessing phase is applied to the user-supplied data to remove some

redundancies from the given constraints and eliminate some of the variables.

– Reformulation by adding slack, surplus and artificial variables can also result in A

having full row rank.

• This means that the equation Ax = b has roughly(nm

)(a very

large number) different solutions; all found by setting n−m

components of x to zero and solving for the remaining m.

Page 345: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 344'

&

$

%

• Many/most of these solutions are infeasible (some of the

xi < 0) but included among them are all the feasible points.

Page 346: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 345'

&

$

%

• Of course, for a “real” problem, say

– 100 equality constraints so m = 100

– 200 variables so n = 200

there is still an astronomically large number of feasible points.

• Just for fun, can you work out an approximate value for(200100

)?

– Stirling’s formula does the job.

– Or cheat & use Maple.

• A “brute force” search is hopeless.

• I need a search algorithm, for example the tableau-based

Simplex Method that you learned about in OR1.

• In fact, I’ll explain an improved version, the Revised Simplex

Method.

Read to here for 09:00–11:00, Tuesday Week 10

Page 347: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 346'

&

$

%

Definition 8.1 (Basic Feasible Point) A vector x is a basic

feasible point if

• it is feasible (Ax = b and x ≥ 0) and

• if there exists a subset B of the index set 1, 2, . . . , n such that

– B contains exactly m indices (m < n).

– i 6∈ B ⇒ xi = 0 (i.e. the bound xi ≥ 0 is active only if

i 6∈ B).

– If I take Ai to be the ith column of A then the

m×mmatrix B defined by B = [Ai]i∈B is non-singular —

i.e. the Ai are linearly independent.

– This means that the “reduced” equation BxB = b has a

unique solution, can you see why?

∗ xB is the subvector of x corresponding to the columns of

A in B.

Page 348: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 347'

&

$

%

• I’ll show that the Revised Simplex Method generates a

succession of basic feasible points of (8.1).

• A set B satisfying these properties is called a basis for the

problem (8.1).

• The corresponding matrix B is called the basis matrix.

• The Revised Simplex Method’s strategy of examining only

basic feasible points will converge to a solution of (8.1) only if

(a) the problem has basic feasible points and

(b) at least one such point is a basic optimal point, that is, a

solution of (8.1) that is also a basic feasible point.

• Both (a) and (b) hold under reasonable assumptions, see

Thm. 8.3 (Fundamental Theorem of Linear Programming).

• I’ll come back this topic and to the geometrical significance of

basic feasible points in Section 8.7 at the end of the Chapter.

Page 349: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 348'

&

$

%

8.6 The Revised Simplex Method

8.6.1 Introduction to the method

In this Section I give a detailed description of the Revised Simplex

Method for the solution of (8.1).

• There are actually a number of variants of the Simplex

method; the one described here is generally known as the

Revised Simplex Method.

• As I said above, all iterates of the Revised Simplex Method are

basic feasible points for (8.1) and therefore vertices of the

feasible polytope.

– See Def 8.2 for a neat definition for the term vertex.

Page 350: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 349'

&

$

%

• Most steps consist of a move from one vertex to an adjacent

one for which the basis B differs in exactly one component.

• On most steps (but not all), the value of the primal objective

function cTx is decreased.

• Another type of step occurs when the problem is unbounded:

The step is an edge along which the objective function is

reduced and along which I can move infinitely far without ever

reaching a vertex.

• The major issue at each Simplex iteration is to decide which

index to remove from the basis B .

• Unless the step is a direction of unboundedness, a single index

must be removed from B and replaced by another from outside

B .

• I can gain insights into how this decision is made by looking

again at the KKT conditions (8.4a)–(8.4e).

Page 351: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 350'

&

$

%

• From the value of B and from (8.4a)–(8.4e), I can derive values

for not just the primal variable x but also the dual variables

(λ, s) as I now show.

Page 352: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 351'

&

$

%

• First, define the nonbasic index set N as the complement of B ,

that is,

N = 1, 2, . . . , n\B. (8.12)

• Just as B is the basic matrix, whose columns are Ai for i ∈ B, I

use N to denote the nonbasic matrix N = [Ai]i∈N .

• I also partition the n-element vectors x, s and c according to

the index sets B and N , using the notation

xB = [xi]i∈B, xN = [xi]i∈N

sB = [si]i∈B, sN = [si]i∈N

cB = [ci]i∈B, cN = [ci]i∈N

• From the KKT condition (8.4b), I have that

Ax = BxB +NxN = b.

Page 353: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 352'

&

$

%

• The primal variable x for this Simplex iterate is defined as

xB = B−1b, xN = 0. (8.13)

• Since I am dealing only with basic feasible points, I know that

B is nonsingular and that xB ≥ 0, so this choice of x satisfies

two of the KKT conditions: the equality constraints (8.4b) and

the nonnegativity condition (8.4c).

• I choose s to satisfy the complementarity condition (8.4e) by

setting sB = 0.

• The remaining variables λ and sN can be found by partitioning

the first KKT condition (8.4a) into cB and cN components and

using sB = 0 to obtain

BTλ = cB, NTλ+ sN = cN (8.14)

Page 354: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 353'

&

$

%

• Since B is square and nonsingular, the first equation uniquely

defines λ as

λ = B−TcB. (8.15)

• The second equation in (8.14) implies a value for sN :

sN = cN −NTλ = cN − (B−1N)TcB. (8.16)

• Computation of the vector sN is often referred to as pricing.

• The components of sN are called the reduced costs of the

nonbasic variables xN .

Page 355: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 354'

&

$

%

• The only KKT condition that I have not enforced explicitly is

the nonnegativity condition s ≥ 0.

• The basic components sB certainly satisfy this condition, by

my choice sB = 0.

• If the vector sN defined by (8.16) also satisfies sN ≥ 0, I have

found an optimal vector triple (x, λ, s), so the algorithm can

terminate and declare success.

• Usually, however, one or more of the components of sN are

negative.

Page 356: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 355'

&

$

%

• The new index to enter the basis B—the entering index—is

chosen to be one of the indices q ∈ N for which sq < 0.

• As I show below, the objective cTx will decrease when I allow

xq to become positive if and only if

(i) sq < 0

(ii) it is possible to increase xq away from zero while

maintaining feasibility of x.

Page 357: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 356'

&

$

%

• The procedure for altering B and changing x and s can be

described accordingly as follows:

– allow xq to increase from zero during the next step;

– fix all other components of xN at zero and figure out the

effect of increasing xq on the current basic vector xB , given

that I want to stay feasible with respect to the equality

constraints Ax = b

– keep increasing xq until one of the components of xB (xp ,

say) is driven to zero, or determining that no such

component exists (the unbounded case);

– remove index p (known as the leaving index) from B and

replace it with the entering index q.

Page 358: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 357'

&

$

%

• This process of selecting entering and leaving indices and

performing the algebraic operations necessary to keep track of

the values of the variables x, λ and s, is sometimes known as

pivoting.

• I now formalise the pivoting procedure in algebraic terms.

• Write the qth column of A as the vector Aq and the qth

element of x+ as x+q , a number.

• Since both the new iterate x+ and the current iterate x should

satisfy Ax = b, and since xN = 0 and x+i = 0 for i ∈ N\q, I

have Ax+ = BxB +NxN = Bx+B + x+qAq = BxB = Ax = b.

• By equating the blue terms and multiplying the resulting

equation by B−1 and rearranging, I obtain

x+B = B−1(b− x+qAq

)≡ xB − x+qB

−1Aq. (8.17)

Page 359: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 358'

&

$

%

• Geometrically speaking, (8.17) is usually a move along an edge

of the feasible polytope that decreases cTx.

• I continue to move along this edge until a new vertex is

encountered.

• At this vertex, a new constraint xp ≥ 0 must have become

active, that is, one of the components xp for some p ∈ B, has

decreased to zero.

• I then remove this index p from the basis B and replace it by q.

• I now show how the step defined by (8.17) affects the value of

cTx. From (8.17), I have (as all elements of x+N other than x+qare still zero)

cTx+ = cTBx+B + cqx

+q = cTBxB + x+q

(cq − cTBB

−1Aq). (8.18)

• From (8.15) I have cTBB−1 = λT .

Page 360: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 359'

&

$

%

So

cTx+ = cTBxB + x+q(cq − λTAq

). (8.19)

• From the second equation in (8.14), since q ∈ N , I have

ATqλ = cq − sq .

• So by substituting in (8.19) I obtain

cTx+ = cTBxB + x+q sq ≡ cTx+ x+q sq. (8.20)

• Since q was chosen so that sq < 0, it follows that the step

(8.17) produces a decrease in the primal objective function cTx

whenever x+q > 0.

Page 361: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 360'

&

$

%

• It is possible that I can increase xq to +∞ without ever

encountering a new vertex.

• In other words, the constraint x+B = xB − B−1Aqx+q ≥ 0 may

hold for all positive values of x+q .

• This can happen if B−1Aq ≤ 0.

Page 362: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 361'

&

$

%

• When this happens, the linear program is unbounded; the

Revised Simplex Method has identified a ray that lies entirely

within the feasible polytope along which the objective cTx

decreases to −∞.

• If the basis B is nondegenerate (see Definition 8.3), then I am

guaranteed that x+q > 0, so I can be assured of a strict decrease

in the objective function cTx at this step.

• If the problem (8.1) is nondegenerate, I can ensure a decrease

in cTx at every step and can therefore prove the following

result concerning termination of the Revised Simplex Method.

Page 363: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 362'

&

$

%

Theorem 8.2 Provided that the linear program (8.1) is

nondegenerate and bounded, the Revised Simplex Method terminates

at a basic optimal point.

Proof:

• The Revised Simplex Method cannot visit the same basic

feasible point x at two different iterations, because it attains a

strict decrease at each iteration.

• Since the number of possible bases B is finite (there are only a

finite number of ways to choose a subset of m indices from

1, 2, . . . , n) and since each basis defines a single basic feasible

point, there are only a finite number of basic feasible points.

Page 364: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 363'

&

$

%

• Hence, the number of iterations is finite.

• Moreover, since the method is always able to take a step away

from a nonoptimal basic feasible point and since the problem is

not unbounded, the method must terminate at a basic optimal

point.

This result gives me a proof of Theorem 8.3 (iii) in the case in

which the linear program is nondegenerate.

The proof of finite termination is considerably more complex when

nondegeneracy of (8.1) is not assumed.

Page 365: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 364'

&

$

%

8.6.2 A Single Step of the Revised Simplex Method

(RSM)

I have covered most of the details of taking a single step of the

RSM. Now I can formulate a step of the RSM in pseudo-code for

clarity.

Before doing so note that (8.17) indicates that the value of x+q is

determined as follows. Only positive elements of d = B−1Aq in the

formula x+B = xB − x+q d can reduce the value of the corresponding

elements of xB as x+q is increased from zero.

So x+q is just the value t (say) that “first” sets an element of

x+B = xB − td to zero — considering only elements of x+Bcorresponding to positive elements of d.

Page 366: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 365'

&

$

%

Equivalently the value of t ≡ x+q is the least of the ratios (xB)i/di

where d ≡ B−1Aq and I consider only positive elements of d.

I can express this algebraically as

x+q = mini∈B|di>0

(xB)i/di. (8.21)

The RSM algorithm follows on the next Slide.

Page 367: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 366'

&

$

%

Algorithm 8.1 Given B,N , xB = B−1b ≥ 0, xN = 0

Solve BTλ = cB for λ

sN = cN −NTλ ( pricing )

if sN ≥ 0 then

STOP ( optimal point found )

end if

Select q ∈ N with sq < 0 as the entering index.

Solve Bd = Aq for d ≡ B−1Aq.

if d ≤ 0 then

STOP ( problem is unbounded )

end if

Calculate x+q = mini∈B|di>0

(xB)i/di — just (8.21) on the previous slide.

Use p to denote the minimizing i.

Update x+B = xB − dx+q , x+N = (0, . . . , 0, x+q , 0, . . . , 0)

T .

Change B by adding q and removing the basic variable jp.

corresponding to column p of B.

(The pth column of B is the jthp column of A.)

Page 368: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 367'

&

$

%

Finally, an example!

Example 8.1 Consider the problem

min−3x1 − 2x2subject to

x1 + x2 + x3 = 5,

2x1 + (1/2)x2 + x4 = 8,

x ≥ 0.

Suppose I start with the basis B = 3, 4, for which I have

xB =

x3x4

=

58

, λ =

00

, sN =

s1s2

=

−3−2

and an objective value of cTx = 0.

Page 369: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 368'

&

$

%

1. • Since both elements of sN are negative, I could choose either

1 or 2 to be the entering variable.

• Suppose I choose q = 1. Check that I obtain d = (1, 2)T , so

I cannot (yet) conclude that the problem is unbounded.

• By performing the ratio calculation, I find that p = 2

(corresponding to jp = 4) and x+1 = 4.

• I update the basic and nonbasic index sets to B = 3, 1 and

N = 4, 2 and move to the next iteration.

Page 370: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 369'

&

$

%

2. • At the second iteration, I have

xB =

x3x1

=

14

, λ =

0

−3/2

, sN =

s4s2

=

3/2−5/4

with an objective value of −12.

• I see that sN has one negative component, corresponding to

the index q = 2 so I select this index to enter the basis.

• I obtain d = (3/4, 1/4)T , so again I do not detect

unboundedness.

• Continuing, I find that the maximum value of x+2 is 4/3 and

that p = 1, which indicates that index jp = 3 will leave the

basis B .

• I update the index sets to B = 2, 1 and N = 4, 3 and

continue.

Page 371: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 370'

&

$

%

3. At the start of the third iteration, I have

xB =

x2x1

=

4/311/3

, λ =

−5/3−2/3

, sN =

s4s3

=

2/35/3

with an objective value of cTx = −41/3. I see that sN ≥ 0, so the

optimality test is satisfied and I terminate.

Read to here for 09:00–11:00, Tuesday Week 11

Page 372: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 371'

&

$

%

8.7 More On Basic Feasible Points

Theorem 8.3 (Fundamental Thm. of Linear Programming)

The following cases arise:

(i) If (8.1) has feasible points then there is at least one basic

feasible point;

(ii) If (8.1) has solutions (optimal feasible points), then at least

one such solution is a basic optimal point.

(iii) If (8.1) is feasible and bounded, then it has an optimal

solution.

Page 373: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 372'

&

$

%

Proof:

(i) • Among all feasible vectors x, choose one (call it x) with as

few as possible nonzero components and let p stand for

this minimal number of nonzero components.

• Without loss of generality (I could re-order the columns of

A) assume that the nonzeros are x1, x2, . . . , xp

• Let A1,A2, . . . ,Ap be the corresponding columns of A.

• So I have Ax ≡∑pi=1 xiAi = b.

Page 374: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 373'

&

$

%

• Suppose first that A1,A2, . . . ,Ap are linearly dependent.

– Then I can express one of them ( Ap , say) in terms of

the others and write Ap =∑p−1i=1 ziAi for some scalars

z1, z2, . . . , zp−1 .

– It is easy to check that the vector

x(ε) = x+ ε(z1, z2, . . . , zp−1,−1, 0, 0, . . . , 0)T = x+ εz

satisfies Ax(ε) = b for any scalar ε.

– In addition, for all ε sufficiently small in magnitude,

since xi > 0 for i = 1, 2, . . . , p, I still have xi(ε) > 0 for

the same indices i = 1, 2, . . . , p.

– However, if I increase ε from zero, there is a “first” value

ε greater than 0 and less than or equal to xp such that

xi(ε) = 0 for some i = 1, 2, . . . , p. (Why?)

– Hence, x(ε) is feasible and has at most p− 1 nonzero

components, contradicting my choice of p as the

minimal number of nonzeros.

Page 375: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 374'

&

$

%

• Therefore, columns A1,A2, . . . ,Ap must be linearly

independent and so p ≤ m. (Why?)

• If p = m, I am done, since then x is a basic feasible point

and B is simply 1, 2, . . . ,m.

• Otherwise p < m and because A has full row rank, I can

choose m− p extra linearly independent columns from

among Ap+1,Ap+2, . . . ,An to build up a set of m linearly

independent vectors.

• I construct B by adding the corresponding indices to

1, 2, . . . , p.

• So x is a basic feasible point.

• (The vector x still has only p non-zero components.)

• The proof of (i) is complete.

Page 376: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 375'

&

$

%

(ii) The proof of (ii) is quite similar.

• Let x∗ be a solution (i.e feasible & optimal) with a

minimal number of nonzero components p and assume

again that x∗1, x∗2, . . . , x

∗p are the nonzeros.

• If the p columns A1,A2, . . . ,Ap are linearly dependent, I

define x∗(ε) = x∗ + εz, where z is chosen exactly as above.

Page 377: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 376'

&

$

%

– Just as before, x∗(ε) will be feasible for all ε sufficiently

small, both positive and negative.

– Hence, since x∗ is optimal, I must have

cT (x∗ + εz) ≥ cTx∗ ⇒ εcTz ≥ 0 for all ε sufficiently

small (positive and negative).

– So cTz must be zero and cTx∗(ε) = cTx∗ for all ε.

– The same logic as in the proof of (i) can be applied to

find ε > 0 such that x∗(ε) is feasible and optimal, with

at most p− 1 nonzero components.

– This contradicts my choice of p as the minimal number

of nonzeros, so the columns A1,A2, . . . ,Ap must be

linearly independent.

• I can now apply the same reasoning as in the proof of (i)

to conclude that x∗ is a basic feasible point and therefore a

basic optimal point.

Page 378: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 377'

&

$

%

(iii) The final statement (iii) is a consequence of finite termination

of the Simplex method. I comment on the latter property in

the next section.

Page 379: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 378'

&

$

%

8.7.1 Vertices Of the Feasible Polytope

• The feasible set defined by the linear constraints Ax = b and

x ≥ 0 is a polytope — a region bounded by affine spaces

“planes” aTi x = bi.

• The non-negativity condition on x is just a set of inequality

constraints, xi ≥ 0, i = 1, . . . , n.

Definition 8.2 (Vertex) The vertices of this polytope are

the points that do not lie on a straight line between two other

points in the set — a geometric definition.

• Basic feasible points were defined above algebraically.

• I will show that vertices ≡ basic feasible points.

• This gives a very useful link between the algebraic and

geometric viewpoints.

Page 380: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 379'

&

$

%

Theorem 8.4 All basic feasible points for (8.1) are vertices of the

feasible polytope x|Ax = b, x ≥ 0, and vice versa.

Proof:

1. Let x be a basic feasible point and assume without loss of

generality that B = 1, 2, . . . ,m.

• The matrix B = [Ai]i=1,2,...,m is therefore nonsingular and

xm+1 = xm+2 = . . . xn = 0. (8.22)

• Suppose that x lies on a straight line between two other

distinct feasible points y and z — i.e. that x is not a vertex.

• Then I can find α ∈ (0, 1) such that x = αy+ (1− α)z.

• Because of (8.22), the fact that α and 1− α are both

positive and the fact that y & z are both non-negative (as

feasible); I must have yi = zi = 0 for

i = m+ 1,m+ 2, . . . , n.

Page 381: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 380'

&

$

%

• Writing xB = (x1, x2, . . . , xm)T and defining yB and zBlikewise, I have from Ax = Ay = Az = b that

BxB = ByB = BzB = b and so, by nonsingularity of B, I

have xB = yB = zB .

• Therefore, x = y = z, contradicting my assertion that y and

z are two distinct feasible points other than x.

• Therefore, x is a vertex.

2. Conversely, let x be a vertex of the feasible polytope and

suppose that the nonzero components of x are x1, x2, . . . , xp.

• If the corresponding columns A1, A2, . . . , Ap are linearly

dependent, then I can construct the vector x(ε) = x+ εz as

in the proof of Thm. 8.3.

• Since x(ε) is feasible for all ε with sufficiently small

magnitude, I can find ε > 0 such that x(ε) and x(−ε) are

both feasible.

Page 382: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 381'

&

$

%

• Since x = x(0) obviously lies on a straight line between

these two points, it cannot be a vertex.

• Hence my assertion that A1, A2, . . . , Ap are linearly

dependent must be incorrect, so these columns must be

linearly independent and p ≤ m.

• If p < m then since A has full row rank, I can add m− p

indices to 1, 2, . . . , p to form a basis B , for which x is the

corresponding basic feasible point.

Page 383: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 382'

&

$

%

I conclude this discussion of the geometry of the feasible set with a

definition of degeneracy. For the purposes of this Chapter, I use the

following definition.

Definition 8.3 (Degeneracy) A basis B is said to be degenerate

if xi = 0 for some i ∈ B, where x is the basic feasible solution

corresponding to B . A linear program (8.1) is said to be degenerate

if it has at least one degenerate basis.

Example 8.2 Let A =

1 0 0

2 1 1

and b =

01

. Then B = 1, 2

and B = 1, 3 are both bases corresponding to the basic feasible

points (0, 1, 0) and (0, 0, 1). Can you see that both bases are

degenerate? Draw a diagram!

Page 384: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 383'

&

$

%

8.8 What Was Not Mentioned

• What to do if the “all-slack” solution is not feasible?

– I solve an “auxiliary” LP (a Phase I problem) with an

objective function which is zero if the the point is feasible

for the original problem.

– The auxiliary problem is designed so it it is trivial to find

an initial basic feasible solution.

– Details may be found in any textbook on LP.

Page 385: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 384'

&

$

%

• What happens if a problem is degenerate?

– Answer: the RSM is not guaranteed to converge.

– It may “cycle” through a set of vertices forever.

– To prevent this a more subtle choice of the leaving variable

at each iteration is needed.

– With this choice it can be shown that the RSM converges.

Read to here for 09:00–11:00, Tuesday Week 12

Page 386: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 385'

&

$

%

8.9 Exercises

1. Convert the following linear program to standard form:

maxx,y

cTx+ dTy s.t.A1x = b1, A2x+ B2y ≤ b2, l ≤ y ≤ u,

where there are no explicit bounds on x.

2. Verify that the dual of the dual is the primal.

3. Show that the dual of the linear program

min cTx s.t.Ax ≥ b, x ≥ 0 is maxbTλ s.t.ATλ ≤ c, λ ≥ 0.

Page 387: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 386'

&

$

%

4. Consider the following linear program:

min−5x1 − x2 subject to

x1 + x2 ≤ 5

2x1 + (1/2)x2 ≤ 8,

x ≥ 0.

(a) Add slack variables x3 and x4 to convert this problem to

standard form.

(b) Using Alg. 8.1, solve this problem using the RSM, showing

at each step the basis and the vectors λ, sN and xB and the

value of the objective function. (The initial choice of B for

which xB ≥ 0 should be obvious once you have added the

slacks in part (a).)

Page 388: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 387'

&

$

%

9 Quadratic Programs

• In this final Chapter I examine Quadratic Programs — the

simplest kind of non-linear constrained optimisation problem.

• Geometrically, Quadratic and Linear Programs are similar,

differing only in that QP’s have quadratic objective functions.

• The constraints are linear in both cases.

• Most of the ideas encountered when studying QP’s carry over

to the case of a general non-linear program.

Page 389: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 388'

&

$

%

9.1 QP Definitions

A quadratic program QP is a constrained optimisation problem

with a quadratic objective function and linear constraints:

minxq(x) =

1

2xTQx+ xTd, (9.1a)

subject to aTi x = bi, i ∈ E (9.1b)

aTi x ≥ bi, i ∈ I, (9.1c)

where Q is a symmetric n× n matrix; E and I are finite sets of

indices and d, x and ai, i ∈ E ∩ I are vectors in Rnand bi,

i ∈ E ∩ I are scalars.

Page 390: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 389'

&

$

%

• QP’s can always be solved (or shown to be infeasible) in a

finite number of iterations.

• It is not hard to see that a general nonlinear constrained

optimisation problem can be approximated by a QP at each

iteration.

• So by solving a succession of QP’s we can solve a general

nonlinear constrained problem.

• This leads to the standard method for solving constrained

problems, Sequential Quadratic Programming (SQP).

• I won’t say more about SQP in this course but a good

understanding of methods for QP’s is clearly the key to SQP.

Page 391: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 390'

&

$

%

9.2 Example QP’s

Example 9.1 (Portfolio Optimisation) • Suppose an

investor has a set of n possible investments with returns ri,

i = 1, . . . , n.

• The returns ri are not usually known a priori but are often

modelled as random variables from a normal distribution with

known means µi = E[ri] and variances σ2i = E[r2i ] − µ

2i .

• A “portfolio” is just an allocation of a fraction of resources to

each of the n investments, say xi, i = 1, . . . , n where∑ni=1 xi = 1 and xi ≥ 0.

• The “return” is just R =∑ni=1 xiri and the expected return is

E[R] = xTµ.

Page 392: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 391'

&

$

%

• The variance of the return depends on the covariances between

each pair of investments,

ρij =E[(ri − µi)(rj − µj)]

σiσj.

• The variance of the portfolio R is then given by

E[(R− E[R])2] =

n∑i=1

n∑j=1

xixjσiσjρij = xTQx,

• Here Q = ΣPΣ is an n× n symmetric and positive definite

matrix — (how do I know that Q is positive definite?).

• The strategy is usually to choose portfolios where the expected

return xTµ is large and the variance xTQx is small

(simultanaeously greedy and cowardly!).

Page 393: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 392'

&

$

%

• To combine these two apparently contradictory objectives I can

form a single combined objective function a using a “risk

tolerance” parameter κ ≥ 0 — a conservative investor will

choose a large value for κ — and solve the following QP to find

the “best” portfolio:

max xTµ− κxTQx, subject ton∑i=1

xi = 1 and xi ≥ 0.

• Exercise 9.1 Write down the KKT necessary conditions for

this problem.

Exercise 9.2 Are the second-order necessary and sufficient

conditions satisfied?

Exercise 9.3 Can you find the solution x directly from the

KKT conditions?

Page 394: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 393'

&

$

%

Now for a more complex and practical Example.

Example 9.2 Each day the Electricity Regulator assigns to each of

the 100+ Irish electricity generators large and small a production

schedule for the next day based on projected demand.

• The is a (hard) mixed Integer Linear program.

– Fortunately I don’t need to solve it.

• The Regulator does this on the basis of (honestly) stated costs

fixed and marginal costs provided by the generators.

• After each day (more or less) the Regulator is required to apply

a correction to the half-hourly electricity price for the day to

ensure that all generators at least have their fixed and marginal

costs met — as the actual amounts provided may not equal

those specified in the schedule.

See Appendix A.35 for the full details.

Page 395: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 394'

&

$

%

The remainder of the Chapter falls into two sections.

First I look at the important special case where (unlike the

examples above) all the constraints are equality constraints. For

this case, the KKT necessary conditions lead to a straightforward

matrix equation for the optimal solution x∗.

For the general case of equality & inequality constraints; if I knew

which inequality constraints were binding at the solution (which I

don’t) then I could reduce the problem to that of solving an

equality-constrained problem consisting of the given equality

constraints together with the active (at the optimal point)

inequality constraints treated as equality constraints. In the

final section I will see how to build an algorithm (reminiscent of the

Simplex method from Ch. 8) for the general case of equality &

inequality constraints based on this idea.

Page 396: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 395'

&

$

%

9.3 Equality Constrained QP’s

Assume that I have m constraints m < n and write the QP as

minxq(x) =

1

2xTQx+ xTd, (9.2a)

subject to Ax = b, (9.2b)

where A is the m× n “Jacobian” matrix of constraints — so the

columns of AT are the vectors ai. (Remember our convention that

all vectors are columns.)

Assume that the matrix A has “full row rank”, i.e. that its rows

are linearly independent (just the LICQ) and that the problem has

a solution.

Page 397: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 396'

&

$

%

It is easy to check that the first-order necessary conditions (the

KKT conditions (7.22a–7.19e) ) for x∗ to be a solution of

(9.2a–9.2b) mean there must be a vector λ∗ of Lagrange multipliers

such that the following system of equations is satisfied:

Q −AT

A 0

x∗λ∗

=

−db

(9.3)

The matrix in (9.3) is not symmetric — making solution more

difficult.

It is trivial to rewrite the equation asQ AT

A 0

−x∗λ∗

=

d−b

(9.4)

where the coefficient matrix is now symmetric.

Page 398: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 397'

&

$

%

It is convenient to write x∗ = x0 + p, where x0 is any estimate of

the solution and p the required step to the solution. Now the

matrix equation can be re-written as:Q AT

A 0

−pλ∗

=

gr

(9.5)

where the residual r = Ax0 − b, g = d+Qx0 (the gradient of f(x0))

and p = x∗ − x0.

Page 399: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 398'

&

$

%

Because of its source, the matrix in (9.5) is called the KKT matrix

and the following Theorem tells us when it is non-singular.

Lemma 9.1 Let A have full row rank and let Z be the n× (n−m)

matrix whose columns form a basis for the null space of A.

(AZ = 0.) Then, if the “reduced-Hessian” matrix ZTQZ is positive

definite, the KKT matrix

K =

Q AT

A 0

(9.6)

is non-singular and so there is a unique (x∗, λ∗) satisfying (9.3).

Proof: Suppose that there are vectors r and s such thatQ AT

A 0

rs

= 0. (9.7)

Page 400: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 399'

&

$

%

As Ar = 0, I have from (9.7) that

0 =[rT sT

]Q AT

A 0

rs

= rTQr.

As r is in the null space of A, I can write r = Zu for some vector u

in Rn−m. So I have

0 = rTQr = uTZTQZu,

which as ZTQZ is positive definite means that u = 0. Therefore

r = 0 and so AT s = 0 by (9.7). As A has full row rank conclude

that s = 0. So K

rs

= 0 implies that

rs

= 0 and so K is

non-singular.

Page 401: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 400'

&

$

%

Stopped here Lecture 1, Week 10

Page 402: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 401'

&

$

%

9.3.1 Second-Order Necessary & Sufficient Conditions for

Equality-constrained Quadratic Programs

• The general second-order necessary conditions were discussed

in a previous Chapter and stated and proved in Thm. 7.4.

• Fortunately in the case of an equality-constrained problem they

are quite simple.

• First I note that the set F2 of stationary directions is just:

F2 =d|dTai = 0, i ∈ E

,

the directions perpendicular to all the constraints, so F2 is just

the null space of A.

• As usual, I can construct a matrix Z whose columns form a

basis for the null space of A.

Page 403: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 402'

&

$

%

• Then the necessary condition (7.34) reduces (as the Hessian of

the Lagrangian is just Q) to requiring that ZTQZ be positive

semi-definite.

• Similarly, the second-order sufficient conditions (7.39) just

require that ZTQZ be positive definite.

• Exactly as I found in Lemma 9.1!

Page 404: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 403'

&

$

%

9.3.2 Solving the KKT equation

I know that the matrix K is non-singular provided the

“reduced-Hessian” matrix ZTQZ is positive definite, so having

chosen an arbitrary initial guess for the solution, x, the matrix

equation (9.5) can be solved for p and λ, Then x∗ = x+ p. The

matrix K is (n+m)× (n+m) where m is the number of equality

constraints. This can give rise to a very large set of equations.

It can be shown that if ZTQZ is positive definite then the KKT

matrix always has n positive and m negative eigenvalues, so

standard methods for solving large linear systems that depend on

the matrix being positive definite (such as Cholesky decomposition)

will not work.

An interesting alternative is the “Range-Space” method, where I

eliminate p from (9.5) and then solve for λ.

Page 405: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 404'

&

$

%

Range-Space Method I can dissect (9.5) into two matrix

equations:

−Qp+ATλ = g (9.8)

Ap = −r (9.9)

where r = Ax0 − b, g = d+Qx0 (the gradient of q(x0)) as before

— and x0 is an arbitrary starting guess for the solution x∗.

Now (provided Q is non-singular) I multiply (9.8) by AQ−1 and

cancel the term in p with (9.9), giving a matrix equation for λ∗

alone: (AQ−1AT

)λ∗ =

(AQ−1g− r

). (9.10)

Once λ∗ has been found, I can solve (9.8) for p.

Page 406: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 405'

&

$

%

As the method requires that I work with Q−1 it is most efficient

when one or more of the following holds:

• Q is diagonal or block-diagonal (easy to invert).

• Q−1 available at no extra cost using a quasi-Newton method

like BFGS.

• The number of equality constraints m is small, so that the

linear system (9.10) is easily solved.

Example 9.3 Consider the problem

minq(x) = 3x21+2x1x2+x1x3+2.5x22+2x2x3+2x

23−8x1−3x2−3x3,

subject to the constraints x1 + x3 = 3 and x2 + x3 = 0.

Page 407: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 406'

&

$

%

I can write this problem in the format (9.2a–9.2b) by defining

Q =

6 2 1

2 5 2

1 2 4

, d =

−8

−3

−3

, A =

1 0 1

0 1 1

, b =

30

.The solution x∗ and optimal Lagrange multiplier vector λ∗ are:

x∗ =

2

−1

1

, λ∗ = 3−2

Page 408: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 407'

&

$

%

The matrix Q is positive definite and the null-space basis matrix

can be taken to be Z = (−1,−1, 1)T .

First check that ZTQZ is positive definite so the KKT matrix is

guaranted to be invertible and the second-order sufficient condition

is satisfied (so the solution to the KKT matrix equation is

guaranteed to be a strong local solution to the problem).

Exercise 9.4 Using Matlab (or Maple), solve the problem using

both the direct method and the Range-Space method.

Page 409: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 408'

&

$

%

9.4 Inequality Constrained QP’s

Most Quadratic Programs (and constrained problems in general)

include inequality constraints. The following is a simple treatment

which omits much of the underlying theory but allows an algorithm

to be presented.

9.4.1 Optimality Conditions for Inequality Constrained

QP’s

Start by writing the Lagrangian for (9.1a–9.1c) as

L(x, λ) = 1

2xTQx+ xTd−

∑i∈I∪E

λi(aTi x− bi). (9.11)

As before, define the active set A(x∗) = E ∪ i ∈ I : aTi x∗ = bi at

the optimal point x∗ to be the set of indices where equality holds.

Page 410: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 409'

&

$

%

The KKT conditions (7.22a–7.19e) when applied to (9.11) take the

form:

Qx∗ + d−∑

i∈A(x∗)

λ∗iai = 0 (9.12a)

aTi x∗ = bi, for all i ∈ A(x∗), (9.12b)

aTi x∗ > bi, for all i ∈ I\A(x∗), (9.12c)

λ∗i ≥ 0, for all i ∈ I ∩ A(x∗). (9.12d)

λ∗i (aTi x∗ − bi) = 0, for all i ∈ I ∪ E . (9.12e)

• The last condition is just complementarity — requiring that

that inactive inequality constraints have zero multipliers.

• As the constraints are linear I do not need the LICQ.

Page 411: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 410'

&

$

%

• The second-order sufficient conditions are simply that ZTQZ

be positive definite where Z is defined as usual to be a

null-space basis matrix for the matrix whose columns are the

active (at x∗ ) constraint vectors ai, i ∈ A(x∗).

• I will consider only the convex case — where Q is positive

semidefinite.

• So the second-order sufficient conditions automatically hold.

Page 412: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 411'

&

$

%

9.4.2 Active Set Methods for Convex Inequality

Constrained QP’s

• If A(x∗) were known in advance the problem

(9.1a–9.1c) reduces to just solving an equality-constrained QP

with the active constraints treated as equality constraints.

• In practice, of course, I do not know the active set a priori so

we must use an iterative method where constraints are added

to & removed from a working set Wk at each iteration.

• I expect/hope that at the final iteration Wk = A(x∗) and so

the solution of this final equality-constrained problem will be

the solution to (9.1a–9.1c) .

• I start at a point x0 that is feasible with respect to all the

constraints — this will be true at every iteration.

• I will look at the choice of starting point in Section 9.4.5.

Page 413: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 412'

&

$

%

• Suppose that I have an iterate xk and a working set Wk at the

kth iteration.

• First I check whether xk minimises the quadratic q in the

subspace defined by Wk .

• If not, I calculate a step p by solving an equality-constrained

QP subproblem in which the constraints in Wk are treated as

equalities and all other constraints are (temporarily) ignored.

• To express the sub-problem in terms of the step p, I define

p = x− xk, gk = Qxk + d

and by substituting for x into the objective q(x) (9.1a) I get

q(x) = q(xk + p) =1

2pTQp+ gTkp+ c

where c = 12xkTQxk + d

Txk is a constant and so may be

ignored.

Page 414: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 413'

&

$

%

• So the QP sub-problem to be solved at the kth iteration is:

minp

1

2pTQp+ gTkp (9.13a)

subject to aTi p = 0 for all i ∈ Wk. (9.13b)

• Call the solution to this problem pk.

• If xk + pk is feasible with respect to all constraints, then set

xk+1 = xk + pk.

Page 415: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 414'

&

$

%

• If not I need to decide “how far” to move along the direction

pk , i.e. what value of α to choose in the formula

xk+1 = xk + αpk.

– For each i ∈ Wk, the term aTi x doesn’t change as we move

along pk from xk because aTi (xk + pk) = aTi xk = bi — so

since the constraints in Wk were satisfied at xk , they are

still satisfied at xk + αpk for any α.

– So focus on the “non-working” set Wck.

∗ The only non-working constraints i ∈ Wck that can

“enter” the working set are those for which aTi pk is

negative .

∗ To see this, note that if aTi pk ≥ 0 for some i ∈ Wk then

for any αk ≥ 0 I have aTi (xk + αkpk) ≥ aTi xk ≥ bi — so

this constraint is satisfied for all non-negative values of

the step-length αk.

Page 416: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 415'

&

$

%

∗ On the other hand, suppose that aTi pk < 0 for some

i ∈ Wck. Then aTi (xk + αkpk) ≥ bi only if

αk ≤bi − a

Ti xk

aTi pk.

∗ As I want αk to be as large as possible in the range [0, 1]

subject to maintaining feasibility, I conclude that

αk ≡ min

(1, mini∈Wc

k,aTipk<0

bi − aTi xk

aTi pk

). (9.14)

∗ In other words, choose α as large as possible so that all

the constraints hold at xk + αpk.

∗ Or equivalently, find the first “blocking” constraint index

i ∈ Wck — for which aTi (xk + αkpk) = bi.

Stopped here Lecture 2, Week 10

Page 417: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 416'

&

$

%

• Call the constraints where the minimum is attained blocking

constraints.

– If αk = 1 and no new constraints are active at xk + αkpk

then there are no blocking constraints (an unconstrained

step).

– If αk < 1 — the step along pk is blocked by one or more

constraints not in the working set Wk — I construct a new

working set Wk+1 by adding one of the blocking constraints

to Wk .

– The special case αk = 0 corresponds to aTi pk < 0 for one or

more constraints active at xk (aTi xk = bi) but not in the

working set — again construct a working set Wk+1 by

adding one of these blocking constraints to Wk .

• Now set xk+1 = xk + αkpk and solve the QP-subproblem

(9.13a), (9.13b) with Wk replaced by Wk+1 and gk by gk+1.

Page 418: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 417'

&

$

%

• I continue in this manner; adding constraints to the working

set, moving to the new point and re-solving until I reach a

point x that minimises the quadratic objective function over

the current working set W .

• I know when I have arrived at such a point as the sub-problem

has solution p = 0.

• As p = 0 satisfies the KKT conditions (9.5) for (9.13a–9.13b), I

have

∑i∈W

aiλi = g ≡ Qx+ d. (9.15)

• To make x & λ satisfy the first KKT condition (7.22a), just

define the multipliers corresponding to the inequality

constraints not in the working set to be zero.

Page 419: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 418'

&

$

%

• Because of the restrictions on the stepsize to ensure feasibility,

x is feasible wrt all the constraints so the second & third KKT

conditions (7.19b) and (7.19c) are satisfied by x .

• Now examine the sign of the multipliers corresponding to the

inequality constraints in the working set (i ∈ W ∩ I).

– If the multipliers are all nonnegative, then the fourth KKT

condition (7.19d) is satisfied so I conclude that x is a KKT

point for the original QP (9.1a–9.1c) .

∗ As I have taken Q to be positive semidefinite, in fact we

have that x is a local minimum point.

∗ If Q is positive definite then x is a global minimum point.

Page 420: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 419'

&

$

%

– On the other hand, if one of the multipliers λj for j in

W ∩ I is negative, then (7.19d) is not satisfied and the

objective q(x) may be reduced by dropping this constraint

(allowing movement to the “interior” or feasible side of this

constraint).

∗ I remove the index j corresponding to the most negative

multiplier and solve a new sub-problem for this working

set.

∗ I will see in Sec 9.4.3 that this strategy produces a

direction p at the next iteration that is feasible wrt the

dropped constraint.

Page 421: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 420'

&

$

%

I can now state an algorithm for solving (convex) QP’s.Algorithm 9.1 (Active-Set Method for convex QP’s) Compute a feasible start point x0.

Choose W0 to be a subset of the active constraints at x0.

while k ≥ 0 do

Solve (9.13a–9.13b) to find pk.

if pk = 0 then

Compute Lagrange multipliers λi that satisfy (9.15)

W =Wk.

if λi ≥ 0 for all i ∈ Wk ∩ I then

STOP with solution x∗ = xk (FINISHED)

else

j = arg minj∈Wk∩I

λj (constraint corr. to most neg. λj)

xk+1 ← xk.

Wk+1 ←Wk\j (drop constraint j )

end if

else

(pk not zero.)

Compute αk from (9.14)

xk+1 ← xk + αkpk.

if there are blocking constraints then

Get Wk+1 by adding one of the blocking constraints to Wk .

else

Wk+1 ←Wkend if

end if

k ← k+ 1

end while

Page 422: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 421'

&

$

%

9.4.3 Maintenance of Feasibility After Constraint is

Dropped

I need to check that, when a constraint corresponding to a negative

multiplier is dropped at line 11 in Algorithm 9.1, the direction p

found at the next iteration is guaranteed to be feasible wrt the

dropped constraint.

(So I do not “cycle” back and forth; alternatively adding and

removing the same constraints to & from the working set.)

It is convenient to state the result as a Theorem.

Page 423: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 422'

&

$

%

Theorem 9.2 Suppose that the point x satisfies the first-order

KKT conditions for the equality-constrained sub-problem with

working set W; so (9.15) is satisfied together with aTi x = bi for all

i ∈ W. Suppose that the constraint gradients are linearly

independent and that the multiplier for one of the indices j ∈ W is

negative (λj < 0). Let p be the solution to the “next” sub-problem:

minp

1

2pTQp+ (Qx+ d)

Tp, (9.16a)

subject to aTi p = 0, for all i ∈ W\j. (9.16b)

Then p is a feasible direction for constraint j (aTj p ≥ 0).

Also, if p satisfies second-order sufficient conditions for the “next”

sub-problem, I have aTj p > 0.

Page 424: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 423'

&

$

%

Proof: Since the direction p is the solution to (9.16a) & (9.16b),

I know that for all i ∈ W\j there are multipliers λi such that∑i∈W\j

λiai = Qp+ (Qx+ d). (9.17)

I also have (from the second-order necessary conditions) that if —

as usual — Z is a matrix whose columns form a basis for the null

space of the submatrix of A consisting of the rows corresponding to

W\j namely

[ai]i∈W\j

then ZTQZ is positive semi-definite. As p = ZpZ for some vector

pZ it follows that pTQp ≥ 0.

Page 425: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 424'

&

$

%

I assumed that x and W satisfy (9.15) so subtracting that equation

from (9.17) above I get:∑i∈W\j

(λi − λi)ai − λjaj = Qp. (9.18)

Page 426: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 425'

&

$

%

Taking inner products of both sides with p and using aTi p = 0 for

all i ∈ W\j, I get

− λjaTj p = pTQp. (9.19)

As pTQp ≥ 0 and λj < 0 by assumption, it follows that aTj p ≥ 0 as

required.

Finally, if the second-order sufficient conditions are satisfied, I have

that ZTQZ as defined above is positive definite. I have just shown

that aTj p ≥ 0. Now assume that aTj p = 0. By (9.19) above I have

that pTQp = 0. But p = ZpZ so pTZZTQZpZ = 0. As ZTQZ is

positive definite I must have pZ = 0 and so p = 0. The last step is

to substitute p = 0 into (9.18). By linear independance of W, I find

that λj = 0 which contradicts the fact that j ∈ W was chosen so

that λj < 0. So aTj p > 0.

Page 427: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 426'

&

$

%

9.4.4 Reduction in q at each iteration

• It is easy to see that — if the solution pk to (9.13a) & (9.13b)

is nonzero and satisfies second-order sufficient conditions for

the current Wk — pk is a strict descent direction for q(·).

• Argue as follows: pk is the unique global solution of (9.13a) &

(9.13b) (as second-order sufficient conditions hold).

• But p = 0 is obviously feasible (satisfies (9.13b)) so its

objective value of zero must be bigger than that of pk so

1

2pkTQpk + g

Tkpk < 0.

• I have Q positive semi-definite so gTkpk < 0.

• So, for α sufficiently small:

q(xk + αpk) = q(xk) + αgTkp+

1

2α2pk

TQpk < q(xk).

Page 428: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 427'

&

$

%

Linear Independence of the Working Set I have assumed in

the above that the constraint gradients in the working set Wk are

linearly independent at each iteration. See Exercise 6 at the end of

this Chapter for a justification.

9.4.5 Choosing a Start Point

Probably the most conceptually straightforward method to

generate a starting feasible point x0 is the “big M” method that

includes a measure of infeasibility in the objective that is

guaranteed to be zero at the solution. (The method is sometime

used to generate starting feasible points for LP)

Page 429: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 428'

&

$

%

I introduce a scalar “artificial” variable t to measure the constraint

violation and solve the problem:

minx,t

1

2xTQx+ xTd+Mt, (9.20a)

subject to t ≥(aTi x− bi

)for all i ∈ E . (9.20b)

t ≥ −(aTi x− bi

)for all i ∈ E . (9.20c)

t ≥ −aTi x+ bi for all i ∈ I. (9.20d)

t ≥ 0 (9.20e)

for some large positive value of M.

Page 430: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 429'

&

$

%

It can be shown that — if the original problem (9.1a–9.1c) is

feasible and if the constant M is large enough — the solution of

(9.20a–9.20e) will have t = 0, with a vector x that is feasible for the

original problem. An initial solution to (9.20a–9.20e) can be just

some “guess” for x and a value of t large enough to ensure that all

the constraints are satisfied.

Page 431: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 430'

&

$

%

Example 9.4 In this final example I will solve the following

problem:

minxq(x) = (x1 − 1)

2 + (x2 − 2.5)2

subject to x1 − 2x2 + 2 ≥ 0,

−x1 − 2x2 + 6 ≥ 0,

−x1 + 2x2 + 2 ≥ 0,

x1 ≥ 0,

x2 ≥ 0.

So Q = 2I and d =

−2−5

. The constraint gradients are:

a1 =

1−2

, a2 =

−1−2

, a3 =

−12

, a4 =

10

and a5 =

01

.

Page 432: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 431'

&

$

%

In the following I will use subscripts to indicate components and

superscripts to indicate iteration number. In the diagram below the

five constraints are numbered (1–5, circled) in the order they appear

in the problem statement above.

x2

x1

(4, 1)

(2, 0)

(2, 2)

(1, 0)

x2, x3 x0, x1

x5x4

(0, 1)

2

1 3

4

5

Figure 13: Final Example

Page 433: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 432'

&

$

%

For a “toy” problem like this it is easy to pick a vertex as a starting

feasible point — I take x0 = (2, 0). (If you want a challenge, try

starting at the infeasible point (−1,−1) and use the big-M method

above to generate a stating feasible point — you will need to use

Matlab as the algebra is considerable.)

• At x0, constraints 3 & 5 are active and I set W0 = 3, 5.

(Other choices include W0 = 3 , W0 = 5 and W0 = . Each

results in a different sequence of points leading to the solution.)

As x0 is a vertex of the feasible region (as may be seen from the

diagram), it obviously minimises the objective function wrt the

working set W0 — so the solution to (9.13a–9.13b) with k = 0

is p0 = 0. The feasible region for the sub-problem is the point

x0 = (2, 0) — a zero-dimensional space!

Of course if I had taken W0 = 3, 5 or we would have had

to do some work at this iteration.

Page 434: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 433'

&

$

%

• Now I need to use (9.15) to find the multipliers λ3 and λ5

corresponding to the active constraints. Substituting for the

current problem into (9.15) gives:−12

λ3 +01

λ5 = 2−5

,which has the solution λ3 = −2 and λ5 = −1.

• Now remove constraint 3 from the working set as it has the

most negative multiplier — setting W1 = 5. Begin iteration 1

by finding the solution of (9.13a–9.13b) with k = 1 — which is

p1 = (−1, 0)T . (Check by hand —easy!) The step-length

formula (9.14) gives us α1 = 1 (in other words I take the max

step as there is no blocking constraint — see Fig. 13). The new

point is x2 = x1 + α1p1 = (1, 0).

Page 435: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 434'

&

$

%

• There are no blocking constraints so W2 =W1 = 5 and I find

at the start of iteration 2 that the solution to (9.13a–9.13b) is

p2 = 0.

From (9.15) I find the multiplier for the single working

constraint is λ5 = −5. As this is negative, I drop 5 from the

working set to finish with W3 = ∅.

• The third iteration starts by solving the unconstrained problem

— whose solution is p3 = (0, 2.5). The step-length formula

(9.14) gives us α1 = 0.6, a new iterate x4 = (1, 1.5) and a new

blocking constraint; constraint 1. So W4 = 1.

• The solution to (9.13a–9.13b) is p4 = (0.4, 0.2) and the new

step length is 1. There are no blocking constraints at this step

so the working set is unchanged; W5 = 1. The new iterate is

x5 = x4 + p4 = (1.4, 1.7).

Page 436: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 435'

&

$

%

• Finally I solve (9.13a–9.13b) for k = 5 — the solution is

p5 = 0. The multiplier from (9.15) is λ1 = 0.8 so I have a

solution. Set x∗ = (1.4, 1.7) and STOP!

The second-order sufficient condition is as usual ZTQZ positive

definite where Z satisfies aT1Z = 0 so Z =

−21

and ZTQZ is just

the scalar 10 which is certainly positive definite so I know that

x∗ = (1.4, 1.7) is a strict local minimum of the problem.

Page 437: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 436'

&

$

%

9.4.6 Final Comments on Constrained Optimisation

Of course Quadratic Programs (QP’s) are a very special case of

general non-linear constrained optimisation. The method described

here (improved so it works for non-convex problems) forms the

basis for Sequential Quadratic Programming (SQP).

Consider first a general equality-constrained problem:

minx∈Rn

f(x) subject to ci(x) = 0, i ∈ E (9.21)

Without going into details; SQP (for an equality-constrained

problem) solves the following sub-problem at each iteration

Wk −ATk

Ak 0

pkλk+1

=

−gk−ck

which is essentially (9.3) for QP’s where now W is the Hessian of

Page 438: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 437'

&

$

%

the Lagrangian L(x, λ) = f(x) −∑ni=1 λici(x) at the current

(xk, λk) estimate; Ak is the matrix given by

ATk =

[∇c1(xk),∇c2(xk), . . . ,∇cn(xk)

],

ck is the vector of constraints at the current point xk and

xk+1 = xk + pk.

Provided Ak is full rank at each iteration and the matrix Wk

satisfies dTWkd > 0 for all non-zero “feasible directions” d (ie

directions such that Akd = 0), then (just as for QP’s) this linear

system has a unique solution.

This (in principle) gives us an algorithm for general non-lineal

equality constrained problems.

For an inequality-constrained problem a working set method

similar to that described above must be used.

Page 439: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 438'

&

$

%

9.5 Exercises

1. Solve the following QP and (using Matlab/Maple or by hand)

describe it geometrically.

minxq(x) = 2x1 + 3x2 + 4x

21 + 2x1x2 + x

22

subject to x1 − x2 ≥ 0,x1 + x2 ≤ 4,

x1 ≤ 3

2. The problem of finding the shortest distance from a point x0 to

the hyperplane x|Ax = b (where A is an m× n matrix with

full row rank m) can be formulated as the following QP:

min1

2(x− x0)

T (x− x0)

s.t. Ax = b.

Page 440: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 439'

&

$

%

(a) Show that the optimal multiplier vector is:

λ∗ =(AAT

)−1(b−Ax0)

and that the solution is

x∗ = x0 −AT(AAT

)−1(b−Ax0) .

(b) In the special case where A is a row vector ( a single

constraint), show that the shortest distance from x− x0 to

x∗ is|b−Ax0|

‖A‖.

Page 441: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 440'

&

$

%

3. Consider the general equality-constrained QP (9.2a) & (9.2a).

Suppose that the “projected Hessian” ZTQZ has a negative

eigenvalue, i.e. that uTZTQZu < 0 for some vector u. Show

that if there is a pair x∗ and λ∗ that satisfies the KKT matrix

equation (9.3), then the point x∗ is only a stationary point of

(9.2a) & (9.2a) — not a local minimiser. (Hint: consider the

function q(x∗ + αZu) for α 6= 0.)

4. For each of the possible choices of starting working set for

Example 9.4, work through the first two iterations of the

active-set algorithm.

Page 442: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 441'

&

$

%

5. Write Matlab code to implement Algorithm 9.1. Use it to solve

the following QP:

minxq(x) = x21 + 2x

22 − 2x1 − 6x2 − 2x1x2

subject to1

2x1 +

1

2x2 ≤ 1,

−x1 + 2x2 ≤ 2,

x1, x2 ≥ 3.

Sketch the feasible region to obtain a starting point.

Page 443: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 442'

&

$

%

6. Using (9.13a) & (9.13b) together with (9.14) show that the

gradient of a blocking constraint cannot be a linear

combination of the constraint gradients in the current working

set Wk. In particular, suppose that the initial working set W0in Algorithm 9.1 is chosen so that the constraint gradients

corresponding to this working set are linearly independent.

Show that the step selection rule (9.14) guarantees that

constraint gradients corresponding to all subsequent working

sets remain linearly independent.

Page 444: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 443'

&

$

%

A Supplementary Material

A.1 First-order Necessary Conditions—Proof

Assume that the Theorem is false — to gain a contradiction.

Then x∗ is a local minimiser and ∇f(x∗) 6= 0.

Write g(x∗) ≡∇f(x∗).

Now let p = −g(x∗) and note that pTg(x∗) = −||g(x∗) ||2 < 0. As

∇f is continuous at x∗ , pTg(x) “stays negative near x∗ ” so for

some δ > 0 (sufficiently small)

pTg(x∗ + αp) < 0 for all α ∈ [0, δ]. (A.1)

Page 445: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 444'

&

$

%

Now, I have by Taylor’s Theorem (3.10) that for any p ∈ Rn,

f(x∗ + p) = f(x∗) + pTg(x∗ + ξp)

for some ξ where 0 < ξ < 1.

Page 446: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 445'

&

$

%

Replacing p in the latter equation by tp (0 < t < δ) I have

f(x∗ + tp) = f(x∗) + tpTg(x∗ + tξp)

for some ξ where 0 < ξ < 1

so letting α = tξ I have 0 < α < t < δ.

So α satisfies the condition in Eq A.1 and so

the term in blue is negative so f(x∗ + tp) < f(x∗) for all t ∈ (0, δ].

I have found a direction p leading away from x∗ along which f

decreases, so x∗ cannot be a local minimum.

(This proof may seem over-elaborate but all the steps are needed.)

Back to Thm. 3.4.

Page 447: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 446'

&

$

%

A.2 Positive Definite Matrices— Proofs

First remember the standard results from Linear Algebra 1:

• If a real square matrix M is symmetric, then M = UΛUT .

• The columns ui of the matrix U are the eigenvectors of M and

can be taken to be real so U is real.

• So the matrix U is orthogonal, i.e. UTU = I which is equivalent

to the vectors ui being orthonormal (uTi uj = δij).

• The matrix Λ is diagonal with real diagonal elements

λ1, . . . , λn, the eigenvalues of M.

• And of course, I can write Mui = λiui, i = 1, . . . , n.

Page 448: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 447'

&

$

%

→:

Assume that M is positive definite so pTMp > 0 for all non-zero

p. For any i, choose p = ui,the eigenvector of M corresponding to

the eigenvalue λi. Then

pTMp = uTiMui

= uTi λiui

= λi as ui is a unit vector.

So λi > 0 for each i.

Page 449: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 448'

&

$

%

←:

Now suppose that all the eigenvalues λi > 0. Then for any non-zero

vector p ∈ Rn,

pTMp = pTUΛUTp

= qTΛq,where q = UTp

=

n∑i=1

λiq2i

which is certainly positive provided that the vector q is non-zero.

But q = 0 means UTp = 0 and therefore (why?) p = 0. So q 6= 0and the result follows.

Back to Thm. 3.5.

Page 450: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 449'

&

$

%

A.3 Second-order Necessary Conditions—Proof

Let x∗ be a local minimiser of f. I know from Theorem 3.4 that

g(x∗) = 0.

Assume for contradiction that the Theorem is false. So there must

be a vector p such that pT∇2f(x∗)p < 0 and as f is C2 at x∗ ,

there must be a (sufficiently small) scalar δ > 0 such that

pT∇2f(x∗ + tp)p < 0 for all t ∈ [0, δ].

Pick any t such that 0 < t ≤ δ.

By expanding f in a Taylor series around x∗ , (see 3.12) I have

f(x∗ + tp) = f(x∗) + tpTg(x∗) +1

2t2pT∇2f(x∗ + ξp)p

< f(x∗).

for some unknown ξ ∈ (0, t]. Again I have found a “descent

direction” from x∗ so x∗ cannot be a local minimiser.

Page 451: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 450'

&

$

%

Back to Thm. 3.6.

Page 452: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 451'

&

$

%

A.4 Second-order Sufficient Conditions—Proof

As the Hessian ∇2f is continuous and positive definite at x∗ , I

can choose a radius δ > 0 such that ∇2f(x) remains positive

definite for all x in the neighbourhood Nδ(x∗) = x | ||x− x∗|| < δ.

Pick any nonzero vector p with ||p|| < δ, then x∗ + p ∈ Nδ(x∗) and

so

f(x∗ + p) = f(x∗) + pTg(x∗) +1

2pT∇2f(x)p

= f(x∗) +1

2pT∇2f(x)p,

where x = x∗ + ξp for some ξ ∈ (0, 1). Since x ∈ Nδ(x∗), we have

pT∇2f(x)p > 0 and so f(x∗ + p) > f(x∗).

So f increases when I move in any direction away from x∗. This

means that x∗ is a strict local minimiser of f.

Page 453: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 452'

&

$

%

Back to Thm. 3.7.

Page 454: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 453'

&

$

%

A.5 Second Directional Derivative—Proof

To see this, reason as follows: pT∇f(x+ αp) is the composition of

the real-valued function pT∇f(x) with the vector-valued function

x+ αp.

So again by the Chain Rule,

d2

dα2f(x+ αp) =

d

d

dαf(x+ αp)

=d

dαpT∇f(x+ αp)

= the gradient of the real-valued function

pT∇f(x+ αp), i.e. ∇2f(x+ αp)p

inner producted (sic) with p

= pT∇2f(x+ αp)p.

Page 455: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 454'

&

$

%

N.B. ∇(pT∇f(x)

)= ∇2f(x)p.

This can be proved by writing the LHS as ∇∑ni=1 pi

∂f(x)∂xi

.

Now, differentiate wrt xj to get∑ni=1 pi

∂2f(x)∂xi∂xj

. As the Hessian is

symmetric, this is just(∇2f(x)p

)j.

So LHS=RHS.

Back to Thm. 3.2.

Page 456: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 455'

&

$

%

A.6 Convex Local Minimiser—Proof

Suppose that x∗ is a local but not a global minimiser. Then I can

find a point z ∈ Rn with f(z) < f(x∗). Let x be any point on the

line segment that joins x∗ to z, so x satisfies:

x = αz+ (1− α)x∗, for some α between 0 and 1. (A.2)

By the convexity property of f, (Def. A.2) I can write

f(x) ≤ αf(z) + (1− α)f(x∗) < f(x∗). (A.3)

Page 457: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 456'

&

$

%

Any neighbourhood N of x∗ contains a portion of the line segment

A.2, so there will always be points x ∈ N at which A.3 is satisfied.

So x∗ cannot be a local minimiser.

2

Page 458: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 457'

&

$

%

For the second part of the theorem, suppose that x∗ is a stationary

point but not a global minimiser and choose z as above with

f(z) < f(x∗). Then from convexity and using the Chain Rule I have;

(z− x∗)Tg(x∗) =d

dα(f(x∗ + α(z− x∗))|α=0

= limα→0

f(x∗ + α(z− x∗)) − f(x∗)

α

= limα→0

f(αz+ (1− α)x∗) − f(x∗)

α

≤ limα→0

αf(z) + (1/ − α)f(x∗)−f(x∗)/////////

α

= f(z) − f(x∗) < 0.

So g(x∗) 6= 0 i.e. x∗ is not a stationary point. Contradiction. So

a stationary point must be a global minimiser.

Page 459: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 458'

&

$

%

Back to Thm. 3.8.

Page 460: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 459'

&

$

%

A.7 Introduction to Convexity

Informally;

• The concept of convexity is important in optimisation — if it

holds then it usually means that the problem has a unique

solution and that the solution is more easily found.

• The term convex may be applied to both sets and functions.

Definition A.1 (Convex Set) A set S ∈ Rn is convex if the

straight line segment connecting any two points in S lies

entirely inside S. Formally; if for any two points x, y ∈ S, I

have αx+(1−α)y ∈ S for all α ∈ [0, 1] then the set S is convex.

Page 461: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 460'

&

$

%

x

y

αx+ (1− α)y

S

Figure 14: A convex set S

x

y

Figure 15: A non-convex set S

Page 462: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 461'

&

$

%

• The definition of convexity for functions is geometric: “For any

x and y in Rn, the function value a fraction α along the line

joining x and y is less than or equal to the intermediate value a

fraction α between f(x) and f(y).”

• More precisely:

Definition A.2 A function f is convex if for any x and

y ∈ Rn

f(αx+ (1− α)y

)≤ αf(x) + (1− α)f(y) for all α ∈ [0, 1].

• In words: “any arc is below the corresponding chord”.

• Or “the curve z = f(w) formed by points w on the line segment

z = αx+ (1− α)y in Rn joining the endpoints (x, f(x)) and

(y, f(y)) of the curve is below the line joining the two

endpoints”.

Page 463: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 462'

&

$

%

• Simpler than it looks on R at least — see Fig 16.

x y

f(x)f (αx+ (1− αy))

f(y)

αf(x) + (1− α)f(y)

αx+ (1− αy)

Figure 16: A convex function f

• αx+ (1− α)y is a point a fraction α along the line joining x

and y in Rn.

• αf(x) + (1−α)f(y) is a fraction α along the interval [f(x), f(y)].

Page 464: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 463'

&

$

%

• The (imprecise) equivalence of convexity and the function

having a non-negative second derivative or, if multivariate, a

positive semi-definite Hessian, will often be all I need.

• The Hessian matrix and the term positive semi-definite are

defined in Chapter 3, see Defs. 3.5 and 3.7.

• When the second derivative is not everywhere defined our naive

definition can be re-stated as requiring that the slope is

non-decreasing.

Page 465: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 464'

&

$

%Figure 17: Convex function f — multiple endpoints

Page 466: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 465'

&

$

%

Definition A.3 The level sets of a function f on Rnare

defined by

Sk = x ∈ Rn|f(x) ≤ k.

In R2 the level sets are just the closed regions defined by the

contours.

Exercise A.1 Show that if f is a smooth convex function and

the dimension n ≥ 2, then the regions defined by its contours

(level surfaces in general) define convex sets. So by looking at a

contour plot of a function f on R2 I can “see” whether it is

convex.

(Is the level set in Fig. 18 convex? If the function f convex?)

Page 467: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 466'

&

$

%

S

Contour x|f(x) = KLevel Set x|f(x) ≤ K

Figure 18: Level Set corresponding to contour x|f(x) = K

Definition A.4 A function f is said to be concave if −f is

convex.

• See App. A.8 for a fuller discussion of convexity.

Page 468: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 467'

&

$

%

In Appendix A.8 I state & prove some theorems concerning

convex functions. The conclusion will be that (if the function f

is differentiable at the points in question) then f is convex on Riff it has non-decreasing slope. Also if the second derivative is

defined and continuous at the points in question then f is

convex iff f ′′ ≥ 0.A similar result holds on Rn:

Theorem A.1 Let f be a function f : Rn → R with continuous

second derivative on Rn. Then f is convex if and only if ∇2f(x)is positive semi-definite for all x. (Note: the gradient g(x) and

the Hessian ∇2f(x) are defined in Eqs. 3.4 and 3.5 below.)

Proof: As the proof is algebraically involved and uses ideas

from the next Chapter, it is included in Section A.10 of the

Appendix.

Page 469: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 468'

&

$

%

A.8 Convexity Results

The following results are included here for reference.

Theorem A.2 (Three-Chord) Suppose that a function

f : R→ R is convex on an interval I = [a, b] ⊆ R. Let

x < y < z ∈ R. Then (see Fig. 19)

f(y) − f(x)

y− x≤ f(z) − f(x)

z− x≤ f(z) − f(y)

z− y. (A.4)

Page 470: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 469'

&

$

%

x y z

f

Figure 19: The 3-chord property

Proof: I have x < y < z so ∃t ∈ (0, 1) s.t. y = x+ t(z− x) for

Page 471: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 470'

&

$

%

some t ∈ (0, 1). So (using convexity of f in the second line)

f(y) − f(x) = f(tz+ (1− t)x) − f(x)

≤ tf(z) + (1− t)f(x) − f(x)

= t(f(z) − f(x)).

Dividing across by t(z− x) gives us

f(y) − f(x)

t(z− x)≤ f(z) − f(x)

(z− x).

Noting that t(z− x) = y− x gives the first inequality in (A.4).

Similarly

f(z) − f(y) = f(z) − f(tz+ (1− t)x)

≥ f(z) − tf(z) − (1− t)f(x)

= (1− t)(f(z) − f(x)).

Page 472: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 471'

&

$

%

So dividing across by (1− t)(z− x) g

f(z) − f(y)

(1− t)(z− x)≥ f(z) − f(x)

(z− x).

But z− y = z− (tz+ (1− t)x) = (1− t)(z− x) which gives us the

second inequality in (A.4).

Page 473: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 472'

&

$

%

I want to show that the slope f ′(x) (when it exists) is

non-decreasing. With this end in mind I will first prove that the

“secant slope” corresponding to a convex function f defined by

s(w; c) = f(w)−f(c)(w−c) ; (w 6= c,w ∈ I = [a, b] ⊆ R) is non-decreasing

as a function of w — in other words; the slope of the secant joining

(c, f(c)) and (w, f(w)) increases as w increases.

c

f

w2 w3w1

Figure 20: Non-decreasing secant slopes

Page 474: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 473'

&

$

%

Theorem A.3 Let f be convex on I = [a, b] ⊆ R. Then for each

c ∈ I; the secant slope s(w; c) is a non-decreasing function of w.

Proof: RTP that if w1 < w2 then s(w1; c) ≤ s(w2; c).

Either

Case 1 c < w1 < w2,

Case 2 w1 < w2 < c, or

Case 3 w1 < c < w2.

Just use the two inequalities from Theorem A.2.

[Case 1] f(w1)−f(c)w1−c

≤ f(w2)−f(c)w2−c

[Case 2] f(c)−f(w1)c−w1

≤ f(c)−f(w2)c−w2

(reverse signs of numerators and

denominators to get result)

[Case 3] f(c)−f(w1)c−w1

≤ f(w2)−f(c)w2−c

(reverse signs of numerators and

denominators to get result.)

Page 475: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 474'

&

$

%

Informally; I need to show that increasing functions always have

“limits from the right and left” — see the Figure.

Lemma A.4 If a function f is non-decreasing on an interval

I = [a, b] ⊆ R then lims→x+ f(s) = R at all points x such that

a ≤ x < b — (and similarly lims→x− f(s) = L for a < x ≤ b ).

f

R

L

f(x)

a x b

f(b)

Figure 21: Limit from the right for f non-decreasing

Page 476: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 475'

&

$

%

Proof: See Appendix A.9.

Now I can prove our main result — the left and right-hand

derivatives of a convex function are non-decreasing:

Theorem A.5 Let f be convex on I = [a, b] ⊆ R. Then for each

c < d ∈ I;f ′−(c) ≤ f ′+(c) ≤ f ′−(d) ≤ f ′+(d), (A.5)

where

f ′−(c) = limh→0−

f(c+ h) − f(c)

hthe left-hand derivative (A.6)

f ′+(c) = limh→0+

f(c+ h) − f(c)

hthe right-hand derivative. (A.7)

(When the left- and right-hand derivatives at a point are equal

then of course the function is differentiable at that point.)

Page 477: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 476'

&

$

%

Proof: First of all: I know (for any c ∈ (a, b) and for any

x ∈ I = [a, b]) that the secant slope s(x; c) is a non-decreasing

function of x by Theorem A.3. By Lemma A.4 I know that the left

and right-hand limits of s(x; c) as x→ c exist — these are f ′−(c)

and f ′+(c) respectively. It follows from the definitions of left and

right-hand limits (and the fact that the secant slope s(x; c) is a

non-decreasing function of x) that f ′−(c) ≤ f ′+(c).

Now let c < d be two points in (a, b) and let h > 0 be such that

c < d− h and c+ h < d. Then by the 3-chord Theorem A.2,

f(c+ h) − f(c)

h≤ f(d) − f(c)

d− c≤ f(d− h) − f(d)

−h≡ f(d) − f(d− h)

h.

Now let h→ 0+ in the first and third terms – I find that

f ′+(c) ≤ f ′−(d). Combining this with f ′−(c) ≤ f ′+(c) for any

c ∈ (a, b) I have that f ′−(c) ≤ f ′+(c) ≤ f ′−(d) ≤ f ′+(d).

Page 478: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 477'

&

$

%

I noted above that when the left- and right-hand derivatives at a

point are equal then of course the function is differentiable at that

point — in particular it follows from Theorem A.5 that if a convex

function is differentiable then its derivative is non-decreasing.

The first half of our final result follows immediately — because of

its importance I state it as a Theorem.

Theorem A.6 Suppose that a function f : I = [a, b] ⊆ R→ R is

convex and twice differentiable on I. Then f ′′(x) ≥ 0 for all x in

[a, b].

Proof: It is a standard result from first-year calculus that g

non-decreasing iff g ′ ≥ 0. Apply this to g = f ′.

Page 479: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 478'

&

$

%

So I have that f convex and twice differentiable on I implies that

f ′′(x) ≥ 0 for all x in I. To prove the converse ( f ′′(x) ≥ 0 for all x

in I implies that f is convex) is not so straightforward.

In fact I prove this as one half of Theorem A.8 which states that f ′′

non-negative and continuous on I ⊆ R implies that f is convex on I.

But the first part of the Theorem does not require that f ′′ be

continuous so I do in fact have the important result:

Theorem A.7 (Convexity/Second Derivative) Suppose that a

function f : I = [a, b] ⊆ R→ R is twice differentiable on

I = [a, b] ⊆ R. Then f ′′(x) ≥ 0 for all x in [a, b] iff f is convex on I.

Proof: Follows from Thm A.6 and the first half of Thm A.8.

Page 480: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 479'

&

$

%

The following Theorem is more limited than Theorem A.7 as it

requires that f be C2 but as noted above the first half of the proof

does not in fact use this property.

Theorem A.8 Suppose that a function f : R→ R has continuous

second derivative on R. Then f is convex on an interval [a, b] if

and only if f ′′(x) ≥ 0 for all x in [a, b].

(I have already proved the second half of the Theorem in

Theorem A.6 above. ) Proof: For any x and y in [a, b] define

Fxy(α) = αf(x) + (1− α)f(y) − f(αx+ (1− α)y), α ∈ [0, 1].

Obviously f is convex on [a, b] if and only if for any interval

[x, y] ⊆ [a, b], Fxy(α) ≥ 0 for 0 ≤ α ≤ 1. It is easy to check that

Fxy′(α) = (f(x) − f(y)) − (x− y)f ′(αx+ (1− α)y)

and that

Fxy′′(α) = −(x− y)2f ′′(αx+ (1− α)y).

Page 481: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 480'

&

$

%

It follows immediately that f ′′(z) and Fxy′′(α) have opposite signs

where z = αx+ (1− α)y — I can ignore the case x = y.

Page 482: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 481'

&

$

%

1. First show that f ′′ non-negative (≡ Fxy ′′(α) ≤ 0) on [a, b]

implies that f is convex on [a, b], or equivalently that

Fxy(α) ≥ 0 for any interval [x, y] ⊆ [a, b].

Slope = m1 Slope = m2

αα1 α2α

Fxy(α)

1

Figure 22: f ′′ ≥ 0 implies f convex

Page 483: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 482'

&

$

%

Suppose that the result is false. Then for some x, y,∈ R, with

x < y, there exists α, 0 < α < 1 such that Fxy(α) < 0.

Now refer to Fig. 22. Let

m1 =Fxy(α) − Fxy(0)

α− 0=Fxy(α)

α< 0

m2 =Fxy(1) − Fxy(α)

1− α=

−Fxy(α)

1− α> 0

By the Mean Value Theorem, ∃α1 ∈ (0, α) such that

F ′(α1) = m1 and α2 ∈ (α, 1) such that F ′(α2) = m2. But

m1 < m2 — this contradicts the assumption that the slope of

Fxy is decreasing (Fxy′′ ≤ 0 on (0, 1)).

So f ′′ non-negative on [a, b] implies that f is convex on [a, b]

— as required.

Page 484: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 483'

&

$

%

A.9 Proof of Lemma A.4

The formal definition of lims→x+ f(s) = R is

∃R such that ∀ε > 0,∃δ > 0 such that

∀s, 0 < s− x < δ⇒ |f(s) − R| < ε. (A.8)

Let F = f(s)|x < s ≤ b, referring to Figure 21, define R = glbF —

the greatest lower bound of the set F .

The glb of any set G is just the largest number b such that b ≤ gfor all g ∈ G. It is a fundamental property of the real numbers Rthat any set F of real numbers that is bounded below has a glb.

The set F is bounded below by f(x) (as f is non-decreasing) so is

must have a glb.

Note that the glb is not necessarily in F — in Figure 21, the glb of

F is R but F = (R, f(b)] as f is non-decreasing.

Page 485: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 484'

&

$

%

Back to the proof; assume that R is not the RH limit of f(s) at x –

i.e. that (A.8) is false.

So

∃ε > 0 such that ∀δ > 0, ∃s0 such that

0 < s0 − x < δ and |f(s0) − R| ≥ ε. (A.9)

I therefore have x < s0 < x+ δ and f(s0) ≥ R+ ε as R is a lower

bound for F and f(s0) ∈ F . As f is non-decreasing this implies that

f(x+ δ) ≥ R+ ε for all δ > 0.

As δ > 0 is arbitrary this means that R+ ε is a lower bound for Fwhich contradicts the definition of R as the greatest lower bound

of F .

Page 486: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 485'

&

$

%

Now, prove that f convex on an interval [a, b] implies f ′′ ≥ 0 on

[a, b]. I use a proof by contradiction. Assume that f is convex on

an interval [a, b] and that f ′′(x0) < 0 at some x0 ∈ [a, b]. By

continuity, f ′′ remains negative in some interval containing x0, say

[x1, x2]. As above, define

Fx1x2(α) = αf(x1) + (1− α)f(x2) − f(αx1 + (1− α)x2), α ∈ [0, 1].

αα2 1α1 α0

Fx1x2(α)

Figure 23: f convex implies f ′′ < 0

Page 487: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 486'

&

$

%

Then Fx1x2′′(α) is positive for α ∈ [0, 1] and of course convexity

gives us Fx1x2(α) ≥ 0 for 0 ≤ α ≤ 1. Obviously

Fx1x2(0) = Fx1x2(1) = 0. Now Fx1x2 cannot be identically zero on

[0, 1] as this contradicts Fx1x2′′ > 0. So pick some α0 such that

Fx1x2(α0) > 0. (See Figure 23.)

Now use an argument similar to that in part (1) of the proof to

show that there is a point α1 in [0, α0] and a point α2 in [α0, 1]

such that Fx1x2′(α1) > 0 and Fx1x2

′(α2) < 0. But this contradicts

Fx1x2′′(α) > 0.

Page 488: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 487'

&

$

%

A.10 Proof of Theorem A.1

1. Assume that f is convex. RTP ∇2f(x) is positive semi-definite

for all x ∈ Rn. Use a proof by contradiction: assume the

conclusion is false so there exist x, z ∈ Rn such that

zT∇2f(x)z < 0.Define φ(α) = f(αx+ (1− α)y), where y = x+ z. Let

xα = αx+ (1− α)y. Then φ ′′(α) = zT∇2f(xα)z and so

φ ′′(1) < 0. By continuity, φ ′′ is negative in some

neighbourhood of α = 1. Clearly, by Thm. A.8, φ is not

convex. There must exist an interval I = (α1, α2) such that for

0 < β < 1;

φ(βα1 + (1− β)α2) > βφ(α1) + (1− β)φ(α2) (A.10)

Now, let x1 = α1x+ (1− α1)y and x2 = α2x+ (1− α2)y. The

Page 489: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 488'

&

$

%

LHS of Eq. A.10 is just

f([βα1 + (1− β)α2] x+ (1− [βα1 + (1− β)α2])y)

and it is easy to check that

[βα1 + (1− β)α2] x+(1− [βα1 + (1− β)α2])y = βx1+(1−β)x2.

Also, φ(α1) = f(x1) and φ(α2) = f(x2). We therefore have

f(βx1 + (1− β)x2) > βf(x1) + (1− β)f(x2),

contradicting the assumption that f is convex.

2. Assume that ∇2f(x) is positive semi-definite for all x ∈ Rn.

RTP that f is convex. Assume not. Then there exist x, y ∈ Rn

such that

f(α0x+ (1− α0)y) > α0f(x) + (1− α0)f(y) (A.11)

for some α0 ∈ (0, 1).

Page 490: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 489'

&

$

%

Let φ(α) = f(αx+ (1− α)y). Then as before,

φ ′′(α) = zT∇2f(x)z. As φ ′′(α) ≥ 0 for all α, I have that φ is

convex. Clearly φ(1) = f(x) and φ(0) = f(y) so

φ(α1+ (1− α)0) ≤ αφ(1) + (1− α)φ(0)

which leads immediately to

f(αx+ (1− α)y) ≤ αf(x) + (1− α)f(y)

contradicting Eq. A.11.

Page 491: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 490'

&

$

%

A.11 Stronger Proof of First-Order Necessary

Conditions

I can drop the requirement that the gradient is continuous by

basing the proof on the corresponding result for real-valued

functions.

Theorem A.9 (Real Line) If a real-valued function f(x) is

differentiable at x = x0 and has a local extremum at this point, then

f ′(x0) = 0.

Proof: If f ′(x0) > 0 ( < 0), then f is increasing (decreasing) at

this point. As f has an extremum at x0 (so is neither increasing nor

decreasing), so f ′(x0) = 0.

Theorem A.10 If a function f(x1, x2, ...xn) is differentiable at

x = (a1, a2, ...an) and has a local extremum at this point, then

Page 492: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 491'

&

$

%

∂f∂xk

(a) = 0 for k = 1, . . . , n or equivalently ∇f(a) = 0.

Proof: The hypotheses of the theorem imply that the function

g(x1) = f(x1, a2, ...an)

(with frozen variables xk = ak for k = 2, . . . , n) has a local

extremum at x1 = a1 and is differentiable at this point. Hence, by

Theorem A.9, g ′1(a1) = 0, which is equivalent to

∂f

∂x1(a) = 0.

So I obtained the desired assertion for k = 1. The cases of k > 1

are considered similarly.

Back to Thm. 3.4.

Page 493: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 492'

&

$

%

A.12 Stronger Proof of Second-Order Necessary

Conditions

A stronger (not assuming that f ∈ C2(x∗)) and arguably simpler

proof of Thm. 3.6 not based on Taylor’s Thm. Proof:

• Let g(t) = f(x∗ + tp) where t ∈ R and p is any vector in Rn.

• So g is a function on the real line.

• I know from First Year Calculus that if g(t) has a minimum at

t = 0 then g ′(0) = 0 and g ′′(0) ≥ 0.

• Using the Chain Rule, g ′(t) = pT∇f(x∗ + tp) and that

g ′′(t) = pT∇2f(x∗ + tp)p.

• If f(x) has a minimum at x∗ then g(t) ≡ f(x∗ + tp) has a

minimum at t = 0 for all vectors p ∈ Rn.

• If not then f decreases as t increases from zero along some

Page 494: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 493'

&

$

%

direction p away from x∗ .

• So applying the First Year “Second Derivative Test” I must

have g ′′(0) = pT∇2f(x∗)p ≥ 0 for all vectors p ∈ Rn.

Back to Thm. 3.6.

Page 495: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 494'

&

$

%

A.13 Introduction to Trust Region Methods

• The alternative trust region strategy uses information

available about f to construct a model function mk whose

behaviour near the current point xk is similar to that of the

actual objective function f.

• Because the (often quadratic) model mk may not be a good

approximation to f far from xk, I restrict the search for a

minimiser of mk to some region (the trust region).

• In other words, I find the candidate step p by finding an

approximate solution to the sub-problem:

minpmk(xk + p), where xk + p lies inside the trust region.

(A.12)

Page 496: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 495'

&

$

%

• If the candidate solution does not produce a sufficient decrease

in f, I conclude that the trust region is too large and shrink it

& re-solve A.12.

• Usually, the trust region is a ball defined by ‖p‖2 ≤ ∆, where

the scalar ∆ > 0 is called the trust-region radius.

• The model mk is usually defined to be a quadratic function of

the form:

mk(xk + p) = fk + pT∇fk +

1

2pTBkp, (A.13)

where fk, ∇fk and Bk are a scalar, vector & matrix,

respectively.

• The matrix Bk is either the Hessian ∇2fk or some

approximation to it.

Page 497: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 496'

&

$

%

Example A.1 Suppose that the objective function is given by

Rosenbrock’s function: f(x) = (x1 − 1)2 + 10(x2 − x

21)2. At the

point xk = (0, 1), its gradient & Hessian are:

∇fk =

−220

and ∇2fk =

−38 0

0 20

Figure 24 shows two possible trust regions (blue circles) and

their corresponding steps (the red arrows p(1)k and p

(2)k ). Note

that changing the trust region radius will usually change the

direction as well as the magnitude of the step pk. The step p(2)k

is “better” as the Figure shows. The actual contours of f are

drawn in red and those of the quadratic model are drawn in

purple.

Page 498: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 497'

&

$

%

Minimiser x∗ = (1, 1)

m = 12

m = 7

m = 1

p(1)k

p(2)k

TR circle radius 0.5477

TR circle radius 0.2236

Contours of model

Contours of f

xk = (0, 1)

Figure 24: Trust Region Example

Page 499: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 498'

&

$

%

A.13.1 Contrasting Search Direction and Trust Region

Methods

• One way of distinguishing between Search Direction and trust

region methods is the order in which they choose the

direction and distance to the next iterate.

• A line search starts by fixing the direction pk and then finding

a suitable distance — the step length αk.

• On the other hand, a trust region method first chooses a

maximum distance — the trust region radius ∆k — and then

seeks a direction and step that yield the best improvement

possible subject to this distance constraint.

• If this step proves unsatisfactory, I reduce the radius ∆k and

try again.

Page 500: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 499'

&

$

%

A.14 Why is −∇f Perpendicular to the Tangent

to Contour/Tangent Plane to the Level

Surface?

One answer — for any direction p;

• I have f(x0 + αp) − f(x0) = αpT∇f(x0) +O(α2).

• If pT∇f(x0) = 0 then f(x0 + αp) − f(x0) = O(α2) and so

p ⊥∇f(x0) precisely when p is a “stationary direction” (one

along which f is constant to first order).

• In other words stationary directions (first-order infinitesimal

steps “along the contour”) are ⊥ to ∇f(x0).

• Or just ∇f(x0) is ⊥ to the tangent to the contour.

• In Rn, use the term “tangent plane to the level surface”.

Back to Slide 72.

Page 501: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 500'

&

$

%

A.15 Hessian With Uniformly Bounded Norm

Implies Lipschitz Continuity

Taylor’s Thm. 3.11 is (for any x and any p):

∇f(x+ p) = ∇f(x) +∫10

∇2f(x+ tp)pdt

so

‖∇f(x+ p) −∇f(x)‖ = ‖∫10

∇2f(x+ tp)pdt‖

≤∫‖∇2f(x+ tp)p‖dt

≤∫‖∇2f(x+ tp)‖‖p‖dt

≤M‖p‖

So ∇f is Lipschitz continuous. Back to Slide 115.

Page 502: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 501'

&

$

%

A.16 Proof of Theorem 4.2

If at least one iteration has taken place, then for some α ′;

φ(α ′) < φ(0) + cα ′φ ′(0) (A.14)

φ(α ′

ρ) ≥ φ(0) +

cα ′

ρφ ′(0). (A.15)

Clearly inequality A.14 means that the first Wolfe condition

Eq. 4.16a is satisfied at α ′ (and, by continuity, near α ′) with

c1 = c. Set c = c1 in the following.

Page 503: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 502'

&

$

%

Now subtract Eq. A.14 from Eq. A.15 (keeping track of the signs of

the inequalities)

φ(α ′

ρ) − φ(α ′) > c1α

′(1

ρ− 1

)φ ′(0). (A.16)

By the Mean Value Theorem, the lefthand side of Eq. A.16 can be

written as α ′(1ρ− 1)φ ′(α ′′) where α ′ < α ′′ < α ′

ρand so (as

0 < ρ < 1);

φ ′(α ′′) > c1φ′(0) (A.17)

Page 504: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 503'

&

$

%

Now, φ ′(0) < 0 as pk is a descent direction — so for any c2 > c1 I

have

φ ′(α ′′) > c2φ′(0), (A.18)

so the second Wolfe condition eq. 4.16b is satisfied at α ′′. Again by

continuity of φ ′ it must hold near α ′′. Finally, for ρ close enough

to 1, α ′ < α ′′ < α ′

ρmeans that |α ′′ − α ′| can be made as small as I

like, so that the two Wolfe conditions must hold in the interval

(α ′, α ′′), as required.

Page 505: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 504'

&

$

%

A.17 Solution to Question 4 on Slide 155

• I have cos θ =−pTg

‖p‖‖g‖.

• Use p = −B−1g to write cos θ as cos θ =gTB−1g

‖B−1g‖‖g‖.

• I also have ‖B‖ = |λmax| and ‖B−1‖ = 1/|λmin|.

• As I am taking B to be positive definite I can drop the

magnitude symbols.

• I can expand the TL in cos θ as cos θ =∑g2i /λi where the

scalars gi are just the components of g along the eigenvectors

of B, taken to be unit vectors.

• Therefore TL ≥ 1λmax‖g‖2 = ‖g‖2

‖B‖ .

• But in the bottom line, ‖B−1g‖ ≤ ‖B−1‖‖g‖ so I have

cos θ ≥ 1‖B‖‖B−1‖ ≥

1M

.

Page 506: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 505'

&

$

%

Page 507: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 506'

&

$

%

A.18 Proof of Question 6 on Slide 155 — the

Kantorovitch inequality

R.T.P. that

(xTx)2

(xTQx)(xTQ−1x)≥ 4λminλmax

(λmin + λmax)2, (A.19)

where λmin is the smallest eigenvalue and λmax is the largest. (As

Q is positive definite , I can write:

0 < λmin ≤ λi ≤ λmax, i = 1 . . . n. (A.20)

As Q is a real symmetric matrix, it can be written as Q = UΛUT

where Λ is the diagonal matrix of eigenvalues Λ = diag(λ1, . . . , λn)

and UTU = I. Writing y = Utx, the required inequality can be

re-written as:

Page 508: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 507'

&

$

%

(yTy)2

(yTΛy)(yTΛ−1y)≥ 4λminλmax

(λmin + λmax)2. (A.21)

Now, as Λ is diagonal and as yTy can be taken to be 1 (I can

divide above and below by ‖y‖2 if necessary), I can re-write the

inequality to be proved as:

n∑i=1

Yiλi

n∑j=1

Yj

λj≤ (λmin + λmax)

2

4λminλmax, (A.22)

where Yi = y2i and

∑ni=1 Yi = 1. Now, set f(λ1, . . . , λn) to be the

left hand side of A.22. The second derivative of f with respect to

each of the λi:

d2f(λ1, . . . , λn)

dλ2k= 2

Yk

λ3k

(n∑i=1

Yiλi − λkYk

)is non-negative and so f is a convex function of each of the λiseparately.

Page 509: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 508'

&

$

%

This means that f takes its maximum value for each λi at one of the

end-points of its range of values, i.e. at λi = λmin or at λi = λmax.

Why?

Letting Y =∑

i:λi=λmin

Yi, it follows that

f(λ1, . . . , λn) ≤ (Yλmin + (1− Y)λmax)

(Y

λmin+

(1− Y)

λmax

)= f∗ say.

(A.23)

Now, multiplying out the right hand side of A.23 and setting

z = Y(1− Y), I find

f∗ = 1+ z

(λmax

λmin+λmin

λmax− 2

). (A.24)

Page 510: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 509'

&

$

%

As the coefficient of z is positive (check) and using the simple

property of quadratics that Y(1− Y) ≤ 1/4, I have

f(λ1, . . . , λn) ≤ 1+1

4

(λmax

λmin+λmin

λmax− 2

)=

(λmin + λmax)2

4λminλmax,

(A.25)

which is the reciprocal of A.21.

Page 511: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 510'

&

$

%

A.19 Solution to Question 8 on Slide 156

I can always assume that a quadratic function f(x) has its

minimum at x∗ = 0 and that f(x∗) = 0 — as if not I can use the

change of variables y = x− x∗ transforms f(x) to f(y) = 12xTQx

apart from a constant which can be ignored.

So I have

f(x) =1

2xTQx, ∇f(x) = Qx, ∇2f(x) = Q.

The steepest descent update takes the form

xk+1 = xk − αk∇fk = (I− αkQ)xk.

It follows that

‖xk+1‖2 = xkT (I− αkQ)2xk.

Page 512: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 511'

&

$

%

For any quadratic form xTAx, I have xTAx ≤ λmax‖x‖2 where

λmax is the largest eigenvalue of A; so

‖xk+1‖2 = xkT (I− αkQ)2xk ≤(largest eval of (I− αkQ)2

)‖xk‖2.

Let the eigenvalues of Q be λ1 ≤ λ2 ≤ · · · ≤ λn. Then the

eigenvalues of (I− αkQ)2 are just (1− αkλk)2 so Λ the largest

eigenvalue of (I− αkQ)2, is just:

Λ = max(1− αkλ1)

2, (1− αkλn)2.

I now have for xk 6= 0 that

‖xk+1‖‖xk‖

≤ max(1− αkλ1)

2, (1− αkλn)2.

Fig. 25 on the next Slide illustrates the convergence rate bounds as

a function of the stepsize α.

Page 513: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 512'

&

$

%

1

α

λn−λ1λn+λ1

max|1− αλ1|, |1− αλn|

|1− αλ1|

|1− αλn|

2λn

2λ1+λn

1λ1

1λn

Figure 25: Convergence rate bound for steepest descent.

Page 514: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 513'

&

$

%

From the diagram (and after a little algebra), the value of αk that

minimises the bound is α∗ =2

λ1+λn.

I therefore have the required result:

‖xk+1‖‖xk‖

≤ λn − λ1λ1 + λn

.

I have recovered Eq. 4.37 as required. Note that the result holds for

any quadratic function 12xTQx− bTx using the change of variables

mentioned above. Also I have used the conventional Euclidean

norm rather than the weighted norm ‖x‖2Q ≡ xTQx.

Page 515: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 514'

&

$

%

A.20 Step-Length Selection Algorithms — an

Introduction

I now consider practical algorithms for minimising the

one-dimensional function 4.10 — repeated here for convenience.

φ(α) = f(xk + αpk), α > 0, (A.26)

or (typically) finding a step length αk satisfying the Wolfe

conditions . We assume that pk is a descent direction (φ ′(0) < 0)

so the search can be limited to positive values of α.

All line search algorithms need an initial estimate α0 and generate

a sequence αi that either terminates with a step length satisfying

the Wolfe conditions or determines that such a step length does

not exist. Usually (as mentioned in Section 4.2) I have a

bracketing phase that finds an interval [a, b] containing

acceptable step lengths and a refinement phase that zooms in to

Page 516: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 515'

&

$

%

find the final step length.

Page 517: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 516'

&

$

%

A.20.1 Some Technical Results

In this subsection I develop some results which will be useful in

proving convergence of the linesearch algorithm to be described in

Sec A.21. This section may be skipped on first reading and referred

to later.

First, I will define an auxiliary function Φ — a function that allows

us to prove results about the function φ. Properties of φ such as

the Wolfe conditions can be expressed conveniently in terms of the

signs of Φ and its derivative.

Page 518: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 517'

&

$

%

Definition A.5 Once the constant c1 is specified, define the

function Φ by

Φ(α) = φ(α) − [φ(0) + c1αφ′(0)] (A.27)

It is easy to check that the following properties follow from the

definition of Φ. I state this as a Theorem for convenience.

Page 519: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 518'

&

$

%

Theorem A.11 Once Φ is defined as in Def A.5 the following

properties hold:

1. Φ(α) ≤ 0 is equivalent to the First Wolfe condition 4.16a

holding at α,

2. Φ ′(α) ≥ 0 implies the (weak form of the ) Second Wolfe

condition 4.16b holds at α,

3. Φ ′(α) = 0 (i.e. α a local minimum of Φ) implies that the

Strong version of the Second Wolfe condition holds.

4. (α1 < α2) and φ(α1) ≤ φ(α2) implies that Φ(α1) < Φ(α2),

5. φ ′(α) ≥ 0 implies that Φ ′(α) > 0,

6. If the Strong version of the Second Wolfe condition is false at

α then sign(Φ ′(α)) = sign(φ ′(α)).

Page 520: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 519'

&

$

%

Proof: I check the properties one-by-one.

1. By definition of Φ (A.27) and the first Wolfe condition (4.16a).

2. Φ ′(α) = φ ′(α) − c1φ′(0). If Φ ′(α) ≥ 0 clearly

φ ′(α) ≥ c1φ ′(0) ≥ c2φ ′(0) so the weak form of the Second

Wolfe condition 4.16b holds at α.

3. If Φ ′(α) = 0 then φ ′(α) = c1φ′(0) > c2φ

′(0) so the weak form

of the Second Wolfe condition holds. Also

φ ′(α) = c1φ′(0) < 0 < −c2φ

′(0) so the Strong form of the

Second Wolfe condition holds.

4. Let ∆Φ = Φ(α2) −Φ(α1), then ∆Φ = ∆φ− c1φ′(0)∆α. So as

φ ′(0) < 0, ∆φ ≥ 0 and ∆α > 0 then ∆Φ ≥ 0 as required.

Page 521: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 520'

&

$

%

5. The second term in Φ ′(α) is strictly positive so provided the

first term φ ′(α) ≥ 0 the result follows.

6. If the strong form of the Second Wolfe condition (4.17b) is false

at α then |φ ′(α)| > −c2φ′(0) > −c1φ

′(0) as c1 < c2. Again it

is clear that if φ ′(α) > 0 then so is Φ ′(α). And because the

magnitude of φ ′(α) is bigger than the second term in Φ ′(α) it

follows that if φ ′(α) < 0 then so is Φ ′(α). Of course the case

φ ′(α) = 0 cannot arise as |φ ′(α)| > −c2φ′(0) > 0.

A little thought should convince you that the direction of the

implications can be reversed as(A⇒ B) ≡ (B⇒ A).

I need some results about when the Wolfe conditions hold.

Page 522: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 521'

&

$

%

Theorem A.12 If

φ(α0)>φ(0) + c1α0φ′(0), (A.28)

at some α0 > 0, the interval [0, α0] contains α-values that satisfy

the strong Wolfe conditions.

Φ(α)

Slope Φ ′(0) is negative.

α

Φ

α0

Φ(α0)

α∗Φ(0)

Figure 26: First Wolfe condition fails at α0

Page 523: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 522'

&

$

%

Proof: See the Figure on the previous Slide. Φ(0) = 0 and

Φ ′(0) = (1− c1)φ′0 < 0 so Φ decreases initially from zero, then

increases from a negative to a positive value at α0. So (by Rolle’s

Theorem — why?) Φ must have a minimum, say α∗ , between 0

and α0 — where Φ ′ = 0 and Φ is negative. Theorem A.11 tell us

that the strong Wolfe conditions must hold at α∗ .

I can extend this result to the following important Theorem:

Page 524: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 523'

&

$

%

Theorem A.13 If the sufficient decrease condition 4.16a holds at

an α-value, say αi−1 and fails at a larger α-value, say αi, then

there is an α-value α in the interval [αi−1, αi] where the strong

Wolfe conditions 4.17a and 4.17b hold.

Φ

Φ(αi−1)

Φ(αi)

αi−1 αiα

α∗

Figure 27: First Wolfe condition true at αi−1 and fails at αi

Page 525: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 524'

&

$

%

Proof: See the Figure on the previous Slide. This time Φ is

negative at αi−1 and positive at αi so must have a minimum, say

α∗ , between αi−1 and αi — where Φ ′ = 0 and Φ is negative.

(Again, can you see how the result follows from Rolle’s Theorem?)

Theorem A.11 tells us that the strong Wolfe conditions must hold

at α∗ .

Page 526: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 525'

&

$

%

A.20.2 Interpolation

In the next few slides I give an informal description of the steps

involved as a numbered sequence — the idea of interpolation

(essentially using a polynomial fit to current data to produce a

candidate for the next point) turns out to be crucial. I begin by

describing a line search procedure based on interpolation of

function & derivative values of φ. It can be viewed as an improved

version of Algorithm 4.1. The aim is to find a value of α that

satisfies the sufficient decrease condition Eq. 4.16a without being

“too small”.

For the sake of clarity, I use αk and αk−1 to denote the step

lengths used at iterations k and k− 1 of the overall optimisation

algorithm. I use the letters i and j to index the trial step lengths

generated during the line search and refer to the initial guess as α0.

The procedures described here generate a decreasing sequence of

Page 527: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 526'

&

$

%

values αi such that each αi is not much smaller than its

predecessor αi−1.

Remember that the sufficient decrease condition can be written (in

the notation of Eq. 4.10 as

φ(αk) ≤ φ(0) + c1αkφ ′(0), (A.29)

and since the constant c1 is usually chosen small (≈ 10−4, say),

this condition really only asks for some small reduction in φ. I

design the procedure to be efficient in that it computes φ ′ as

seldom as possible.

Page 528: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 527'

&

$

%

1. Suppose that the initial guess α0 is given. If I have

φ(α0) ≤ φ(0) + c1α0φ ′(0), (A.30)

then I can stop. If not — and this is the key to understanding

the algorithm— the interval [0, α0] must contain acceptable

step lengths by Theorem A.12.

2. I form a quadratic approximation φq(α) to φ by interpolating

the three pieces of information available — φ(0), φ ′(0) and

φ(α0) — to obtain

φq(α) =

(φ(α0) − φ(0) − α0φ

′(0)

α20

)α2 + φ ′(0)α+ φ(0).

(A.31)

(Check that φq(0) = φ(0), φ′q(0) = φ

′(0) and

φq(α0) = φ(α0).) Note also that the coefficient of α2 is

positive as condition A.30 is false so the quadratic

approximation φq has a unique minimum.

Page 529: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 528'

&

$

%

• The new trial value α1 is taken to be the minimiser of

φq(α), so

α1 = −φ ′(0)α20

2 [φ(α0) − φ(0) − α0φ ′(0)]. (A.32)

It can be shown that

α1 ≤1

2(1− c1)α0.

This means that for c1 <12

, α1 < α0. For the small values

of c1 normally used, α1 ≈ 12α0.

Page 530: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 529'

&

$

%

3. If the sufficient decrease condition Eq. A.29 is satisfied at α1 I

know by Thm. A.13 that there is a point in the interval

(α1, α0) where the strong Wolfe conditions hold.

4. Otherwise I can construct a cubic function that interpolates

the four pieces of information φ(0), φ ′(0) and φ(α0) and

φ(α1), namely

φc(α) = aα3 + bα2 + φ ′(0)α+ φ(0). (A.33)

Page 531: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 530'

&

$

%

• The values of a and b that ensure φc interpolates correctly

are ab

=1

α20α21(α1 − α0)

α20 −α21

−α30 α31

D1D0

, (A.34)

where

D0 = φ(α0) − φ(0) − α0φ′(0) and (A.35)

D1 = φ(α1) − φ(0) − α1φ′(0). (A.36)

• By differentiating φc(α), I find that the minimiser α2 of φc

is given by

α2 =−b+

√b2 − 3aφ ′(0)

3a. (A.37)

Page 532: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 531'

&

$

%

• An obvious question is whether α2 is well-defined, i.e is the

argument of the square root in (A.37) always non-negative?

Fortunately the answer is yes. See

• It can be shown that provided c1 <14

, α2 lies in the interval

[0,2

3α1]. (The constant c1 is usually taken to be much

smaller than 14

.)

5. If necessary, this step is repeated, using a cubic interpolant of

φ(0), φ ′(0) and the two most recent values of φ, until an α

that satisfies the strong Wolfe conditions is found. If any αi is

either too close to its predecessor αi−1 or else too much smaller

than αi−1, I reset αi = αi−1/2. This safeguard procedure

ensures that I make reasonable progress on each iteration and

that the final α is not too small.

Page 533: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 532'

&

$

%

Alternative Interpolant If directional derivatives

(φ ′–values) are easily (cheaply) computed then an alternative

approach is based on cubic interpolation of the values of φ and

φ ′ at the two most recent values of α.

Suppose that I have an interval [a, b] known to contain “good”

step lengths (as above) and two previous step length

estimates αi−1 and αi in this interval. Use a cubic Φc to

interpolate φ(αi−1), φ′(αi−1), φ(αi) and φ ′(αi). (This

interpolant always exists and is unique.) The minimiser in

[a, b] is either at one of the endpoints or in the interior at

αi+1 = αi + ∆αi, (A.38)

where

∆αi = −∆αi−1

[φ ′(αi) + d2 − d1

φ ′(αi) − φ ′(αi−1) + 2d2

], (A.39)

Page 534: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 533'

&

$

%

with

d1 = φ ′(αi−1) + φ′(αi) −

∆φi−1

∆αi−1,

d2 =[d21 − φ

′(αi−1)φ′(αi)

]1/2.

In the above, ∆φi−1 ≡ φi − φi−1 and ∆αi−1 ≡ αi − αi−1 .

The interpolation process is repeated (if necessary) by

discarding one or other of the two “old” step lengths αi−1 or

αi. I can use the Wolfe conditions to guide us as to which

should be discarded.

Page 535: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 534'

&

$

%

Initial Step Length For Newton and quasi-Newton

methods, the initial step α0 = 1 should always be chosen.

(Remember that as discussed in Section 4.4.3, this allows rapid

convergence to take effect.)

For methods such as steepest descent and the nonlinear

conjugate gradient method , a reasonable choice is to assume

that the first-order change in f at xk will be the same as that

obtained at the previous step. In other words, I choose α0 so

that α0gkTpk = αk−1g

Tk−1pk−1 or

α0 = αk−1gTk−1pk−1

gkTpk

An alternative would be to use quadratic interpolation to fit

f(xk−1), f(xk) and φ ′(0) = gkTpk.

Page 536: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 535'

&

$

%

A.21 A Step-Length Selection Algorithm — the

Details

I now describe in detail a one-dimensional search procedure that is

guaranteed to find step length satisfying the strong Wolfe

conditions for any values of the parameters c1, c2 satisfying

0 < c1 < c2 < 1. As before, I assume that p is a descent

direction and that f is bounded below along p.

The algorithm has two stages. The first stage LineSearch

(Algorithm A.1) begins with a trial estimate α1 and keeps

increasing it till it either finds an acceptable step length or an

interval that brackets the desired step lengths. In the latter case,

the second stage is invoked by calling a function called zoom

(Algorithm A.2 below), which successively decreases the size of the

interval until an acceptable step length is found.

Page 537: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 536'

&

$

%

The Line Search algorithm on the next slide either

• terminates with α∗ set to a step length that satisfies the

strong Wolfe conditions .

• or fails due to “maximum number of iterations exceeded”.

The parameter αmax is an upper bound on the step length and

imax is the maximum number of steps allowed.

Page 538: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 537'

&

$

%

Algorithm A.1 (Line Search) Set α0 ← 0, choose imax, αmax and α1 > 0

i ← 1.

while i < imax do

Evaluate φ(αi).

if φ(αi) > φ(0) + c1αiφ′(0) ∨

[φ(αi) ≥ φ(αi−1) ∧ i > 1

]then

α∗ ← zoom (αi−1,αi);EXIT

end if

Evaluate φ ′(αi)if φ ′(αi) ≤ −c2φ

′(0) then

α∗ ← αi EXIT

end if

if φ ′(αi) ≥ 0 then

α∗ ← zoom (αi,αi−1) EXIT

end if

FAILURE — choose αi+1 ∈ (αi,αmax) so αi−1 < αi for each i.

i ← i+ 1

end while

Page 539: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 538'

&

$

%

Note that the sequence of trial step lengths αi is monotonically

increasing, but that the order of the arguments supplied to the

zoom function may vary.

Line number 15 performs extrapolation to find the next trial value

αi+1 (as this line is only called if the interval (αi−1, αi) does not

contain step lengths satisfying the strong Wolfe conditions ). To

implement this step I could simply set αi+1 to a fixed multiple

(greater than 1) of αi or else to a point midway between αi and

αmax.

Page 540: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 539'

&

$

%

In the following Lemma I show that the intervals (αi−1, αi) used in

the calls to zoom at lines 9 and 18 always contain step lengths α

satisfying the strong Wolfe conditions — so it makes sense to

“zoom” in on the interval.

Lemma A.14 In Alg. A.1, the interval (αi−1, αi) contains step

lengths α satisfying the strong Wolfe conditions if one of the

following three conditions is satisfied — i.e. at lines 5, 5 and 12.

(i) αi violates the first Wolfe condition; (Line number 5)

(ii) φ(αi) ≥ φ(αi−1); (Line number 5)

(iii) φ ′(αi) ≥ 0. (Line number 12)

Page 541: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 540'

&

$

%

Proof: I check that the conclusion holds for each condition in

turn. In all cases as the algorithm failed at the previous

iteration (see Def A.5 for the definition of Φ and Thm. A.11 for

its properties)

Φ(αi−1) ≤ 0 and Φ ′(αi−1) < 0. (A.40)

(i) I have that αi violates the first Wolfe condition; so the

conditions of Theorem A.13 are met.

(ii) By Prop. 4 of Φ I have that Φ(αi) > Φ(αi−1). A simple

modification of Theorem A.13 shows that there must be a

α∗ in (αi−1, αi) where Φ(α∗) ≤ 0 and Φ ′(α∗) = 0 — sketch

the situation.

(iii) As the Second Wolfe condition is false at line number 12, by

Prop 6 of Φ I have that Φ ′(αi) > 0. Also I have Φ(αi) ≤ 0and φ(αi) < φ(αi−1). (The latter inequality doesn’t help us.)

Also note (A.40). See the Figure on the next Slide.

Page 542: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 541'

&

$

%

Φ(αi−1)

αα∗ αi

Φ(αi)

αi−1

Φ ′(αi) > 0

Φ

Φ ′(αi−1) < 0

Figure 28: Φ ′(αi) > 0 and Φ ≤ 0 at αi−1 and αi

Φ is ≤ 0 and strictly decreasing at αi−1 and is ≤ 0 and strictly

increasing at αi so, as Φ ′ is continuous, Φ must have have a

minimum in (αi−1, αi) and is of course negative at the minimum.

So there must be a α∗ in (αi−1, αi) where Φ(α∗) ≤ 0 and

Φ ′(α∗) = 0.

Page 543: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 542'

&

$

%

Page 544: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 543'

&

$

%

Next, I analyse the inputs to the algorithm zoom . The order of

its input arguments is such that each call (in linesearch) takes the

form zoom (αlo, αhi),

Lemma A.15 where the following conditions hold:

(a) the interval bounded by αlo and αhi (use the notation

I(αlo, αhi)) contains step lengths that satisfy the strong Wolfe

conditions ;

(b) αlo is, of all the step lengths generated so far which satisfy the

first Wolfe condition, the one with the least φ-value — or

equivalently

• Φ(αlo) ≤ 0 and either Φ(αhi) > 0 or φ(αhi) ≥ φ(αlo).

(c) αhi is chosen so that Φ ′(αlo)(αhi − αlo) < 0 — sketch this

and it is much easier to understand!

Proof:

Page 545: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 544'

&

$

%

(a) zoom is invoked at lines 6 and 13 of LineSearch

(Algorithm A.1). In both cases one of conditions (i) to (iii) of

Lemma A.14 hold so I(αlo, αhi) contains α∗ such that the

strong Wolfe conditions hold at α∗ .

(b) • If zoom is invoked at line 6 then αlo is αi−1. In this case

Φ(αlo) ≤ 0 and either Φ(αhi) > 0 or φhi ≥ φlo as claimed.

• If zoom is invoked at line 13 then αlo is αi. I have Φlo ≤ 0and φ(αi) < φ(αi−1) which translates into φhi ≥ φlo as

claimed. (It is not true that Φhi > 0 but I only need one of

the two conditions φhi ≥ φlo and Φhi > 0 to hold for

(Φhi > 0)∨ (φhi ≥ φlo) to be true.)

Page 546: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 545'

&

$

%

(c) • If zoom is invoked at line 6 I have αlo = αi−1 and

αhi = αi so αhi − αlo is positive. The condition

φ ′(αlo) < 0 holds as one of the exit conditions from the

previous invocation of LineSearch φ ′(αi−1) < 0. But

(because the second Wolfe condition failed at line 9 of

LineSearch at the previous iteration) — by property 6 of

Φ, the functions φ ′ and Φ ′ have the same sign at αi−1 so

Φ ′(αi−1) ≡ Φlo ′ < 0 as claimed.

• If zoom is invoked at line 13 then αlo = αi and αhi = αi−1

so αhi − αlo is negative. But (because the second Wolfe

condition failed at line 9 of LineSearch at the current

iteration) — by property 6 of Φ, the functions φ ′ and Φ ′

have the same sign at αi so Φ ′(αi) ≡ Φlo ′ > 0 as claimed.

Page 547: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 546'

&

$

%

Algorithm A.2 (zoom) while NOT too many iterations) ∧ (Tolerance NOT reached) do

Interpolate (using quadratic, cubic or bisection method)

to find a trial step length αj between αlo and αhi.

Evaluate φ(αj)

if φ(αj) > φ(0) + c1αjφ′(0) ∨ φ(αj) ≥ φ(αlo) then

αhi ← αj;else

Evaluate φ ′(αj)if φ ′(αj) ≤ −c2φ

′(0) then

α∗ ← αj;EXITend if

if φ ′(αj)(αhi − αlo) ≥ 0 then

αhi ← αlo;

end if

αlo ← αj;end if

end while

Page 548: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 547'

&

$

%

Finally, an analysis of the output of zoom . Only two cases can

arise — I refer to them as the “Easy” and “Hard” cases

respectively.

Lemma A.16 (Easy Case) If Φlo ≤ 0 and Φhi ≥ 0 and

Φ ′lo (αhi − αlo) < 0 then the interval I(αlo, αhi) contains a point

α∗ where Φ(α∗) ≤ 0 and Φ ′(α∗) = 0.

Proof: There are two possibilities;

(i) αlo < αhi: I have Φlo ≤ 0 ≤ Φhi and Φ ′lo < 0. So, as Φ is

decreasing at αlo and is ≤ 0 there, it follows that Φ has a

minimum in (αlo, αhi) — the minimum cannot be at αhi as

Φ is non-negative there. Therefore there is a point

α∗ ∈ (αlo, αhi) where Φ(α∗) < 0 and Φ ′(α∗) = 0.

(ii) αhi < αlo: exercise.

Page 549: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 548'

&

$

%

Lemma A.17 (Hard Case) If Φlo ≤ 0 but Φhi < Φlo and

φ(αhi) ≥ φ(αlo) and Φ ′lo (αhi − αlo) < 0 then the interval

I(αlo, αhi) contains a point α∗ where Φ(α∗) ≤ 0 and the Strong

version of the second Wolfe condition holds.

In this case I cannot prove that Φ ′(α∗) = 0 but can show that

nonetheless the Strong version of the Second Wolfe condition

(4.17b) holds at α0. I will show first that this “hard case” cannot

arise when αlo < αhi then show that if αlo > αhi the Wolfe

conditions hold as required.

Page 550: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 549'

&

$

%

Proof: There are two possibilities;

• αlo < αhi: I have Φlo ≤ 0 and Φhi < Φlo and Φ ′lo < 0. By

the Mean Value Theorem, there is an α0 in (αlo, αhi) such

that:

Φ ′(α0) =Φhi −Φloαhi − αlo

. (A.41)

It follows that Φ ′(α0) is negative.

Now, by definition, Φ(α) ≡ φ(α) − [φ(0) + c1αφ′(0)].

Substituting for Φ in (A.41) we find that

Φ ′(α0) =φhi−φloαhi−αlo

− c1φ′(0) and so, as the first term in the

sum is ≥ 0, we have that

0 > Φ ′(α0) ≥ −c1φ′(0) (A.42)

which is a contradiction — so this case cannot arise.

Page 551: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 550'

&

$

%

• αlo > αhi: I have Φlo ≤ 0 and Φhi < Φlo and Φ ′lo > 0. By

the Mean Value Theorem, there is an α0 in (αlo, αhi) such

that:

Φ ′(α0) =Φlo −Φhiαlo − αhi

. (A.43)

It follows that Φ ′(α0) is positive. Substituting for Φ in

(A.43) we find that Φ ′(α0) =φlo−φhiαlo−αhi

− c1φ′(0) and so, as the

first term in the sum is ≤ 0, we have that

0 < Φ ′(α0) ≤ −c1φ′(0) ≤ −(c1 + c2)φ

′(0). (A.44)

Substituting for Φ ′ in terms of φ ′,

c2φ′0 < c1φ

′0 ≤ φ ′(α0) ≤ −c2φ

′0 so the Strong version of the

Second Wolfe condition (4.17b) holds at α0.

Page 552: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 551'

&

$

%

Provided that Φ(α0) ≤ 0 I am finished. But if Φ(α0) > 0 this

is just case (ii) of the Easy case with α0 playing the role of αhi

— so there is an α1 ∈ (α0, αlo) such that Φ(α1) ≤ 0 and

Φ ′(α1) = 0.

Page 553: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 552'

&

$

%

Lemma A.18 Each iteration of zoom generates an iterate αj

between αlo and αhi and then replaces one of these endpoints by αj

in such a way that the properties (a), (b) and (c) continue to hold.

Proof: Consider the conditions that are true after each update

in zoom. I examine each in turn, expressing the conditions in

terms of Φ where possible.

(i) Line 6: Φ ′lo (αhi − αlo) < 0 and Φlo ≤ 0 and either

Φhi > 0 or φ(αhi) ≥ φ(αlo).• The first two conditions are “inherited” as αlo is

unchanged and the sign of αhi − αlo is also unchanged.

• Properties (b) and (c) follow immediately.

• RTP (a). I have Φlo ≤ 0 < Φhi and Φ ′lo (αhi − αlo) < 0.

This is the Easy case so by Lemma A.16 there is a point

α∗ where Φ(α∗) ≤ 0 and Φ ′(α∗) = 0.

Page 554: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 553'

&

$

%

(ii) Line 10: EXIT with α∗ satisfying the Wolfe conditions.

(iii) Line 13: Φlo ≤ 0 and φ(αlo) < φ(αhi) and |φ ′lo| > c2|φ′0|

and φ ′lo (αhi − αlo) < 0. The last condition implies that

Φ ′lo (αhi − αlo) < 0 as φ ′ and Φ ′ have the same sign when

|φ ′lo| > c2|φ′0|.

• Properties (b) and (c) follow immediately.

• RTP (a)

– if Φhi ≥ Φlo I have the Easy case and by Lemma A.16

there is a point α∗ where Φ(α∗) ≤ 0 and Φ ′(α∗) = 0.

– If Φhi < Φlo I have the Hard case and by Lemma A.17

there is a point α∗ where Φ(α∗) ≤ 0 and the Strong

version of the Second Wolfe condition holds.

Page 555: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 554'

&

$

%

(iv) Line 15: Φlo ≤ 0 and |φ ′lo| > c2|φ′0| and

φ ′lo (αhi − αlo) < 0. Also (as αhi unchanged and φlo

decreases) I have Φhi > 0 or φ(αhi) ≥ φ(αlo). These are the

same conditions as those that hold at Line 13 and so

properties (a), (b) and (c) hold after the update.

Page 556: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 555'

&

$

%

If the new estimate αj happens to satisfy the strong Wolfe

conditions , then zoom has done its job, so it terminates with

α∗ = αj. Otherwise, if αj satisfies the sufficient decrease

condition and has a lower function value than αlo, I set αlo ← αj

to maintain condition (b). If this results in a violation of condition

(c), I fix things by setting αhi to the old value of αlo .

As mentioned earlier, the interpolation step that determines

αj should be safeguarded to ensure that the new step length is not

too close to the endpoints of the interval. Finally, as the algorithm

approaches the solution, two consecutive function values may be

indistinguishable in finite-precision arithmetic. A line search must

include a stopping test if it cannot attain a lower function value

after a certain number (say ten) of trial step lengths. Some

procedures also stop if the relative change in x is close to “machine

epsilon”.

Page 557: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 556'

&

$

%

A.22 Advanced nonlinear conjugate gradient

methods

A.22.1 Dai-Yuan Method

In a paper published in 1999, [1] available on-line (within U.L.) at

http://epubs.siam.org/sam-bin/getfile/SIOPT/articles/

31899.pdf the authors proposed a new method. In this section a

complete analysis of both convergence and numerical properties is

presented — as in this case the analysis is relatively

straightforward! The new formula for βk+1 is

βDYk+1 =‖gk+1‖2

pTkyk, (A.45)

where yk ≡ gk+1 − gk. Again, it is easy to check that the new

method reduces to the the FR method in the case of quadratic

objective functions with an exact line search.

Page 558: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 557'

&

$

%

Dai-Yuan Method — Global Convergence Despite the fact

that the numerical properties of the new method are no better than

those of the FR method, I include a proof of convergence here for

two reasons:

1. The proof is similar to that for the F.R. method.

2. It is also a useful preliminary to the corresponding proof for the

Hybrid method in Section A.22.2 below — which does have

good numerical behaviour as well as convergence properties.

I will state the required result as a Theorem.

Theorem A.19 (DY-convergence) Under the same

assumptions as those of Zoutendijk’s Theorem 4.3, (in particular

that the weak Wolfe conditions hold and that f is bounded below) —

with the exception that I need not assume that the pk are descent

directions, I have that the algorithm either stops at a stationary

point (‖gk‖ = 0) or lim inf ‖gk‖ = 0.

Page 559: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 558'

&

$

%

Proof:

• First I show using induction that all the search directions pk

are descent directions, i.e. pTkgk < 0.

– (Base Step — k = 0) Obviously p1 = −g1 so

pT1g1 = −‖g1‖2 < 0.– (Inductive Step — k > 0) Assume that pTkgk < 0. RTP

pTk+1gk+1 < 0. Using the update rule and the definition of

βDYk+1 (A.45), I have

pTk+1gk+1 =‖gk+1‖2

pTkykpTkgk.

But using the second Wolfe condition,

pTkyk ≡ pTk(gk+1 − gk) ≥ (c2 − 1)pTkgk > 0.

Therefore pTk+1gk+1 < 0 as required.

Page 560: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 559'

&

$

%

• Now to prove the major result. Rewriting the update rule as

pk+1 + gk+1 = βk+1pk and taking the squared norm of each

side I have;

‖pk+1‖2 = (βDYk+1)2‖pk‖2 − ‖gk+1‖2 − 2pk+1Tgk+1. (A.46)

It is easy to check that:

pTk+1gk+1

pTkgk≡

(−gk+1 + βDYk+1pk)

Tgk+1

pTkgk

=(−gk+1 +

‖gk+1‖2pTkyk

pk)Tgk+1

pTkgk

=−‖gk+1‖2(pTkyk) + ‖gk+1‖2(pkgk+1)

(pTkgk)(pTkyk)

=‖gk+1‖2

pTkyk= βDYk+1.

Page 561: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 560'

&

$

%

So βDYk+1 =pTk+1gk+1

(pTkgk). (N.B. only when the DY formula for

βk+1 is used!)

Now, divide (A.46) across by (pTk+1gk+1)2 and using the above

formula for βDYk+1 I have

‖pk+1‖2

(pTk+1gk+1)2=‖pk‖2

(pTkgk)2−

2

pTk+1gk+1−

‖gk+1‖2

(pTk+1gk+1)2

(A.47)

Completing the square I have

‖pk+1‖2

(pTk+1gk+1)2=‖pk‖2

(pTkgk)2−

(1

‖gk+1‖+‖gk+1‖pTk+1gk+1

)2+

1

‖gk+1‖2

and so‖pk+1‖2

(pTk+1gk+1)2≤ ‖pk‖2

(pTkgk)2+

1

‖gk+1‖2. (A.48)

Page 562: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 561'

&

$

%

As ‖p0‖2(pT0g0)2

≡ 1‖g0‖2 , by iterating (A.48)

‖pk‖2

(pTkgk)2≤

k∑i=0

1

‖gi‖2for k ≥ 0. (A.49)

If the Theorem is false then for some c > 0, I have

‖gk‖ ≥ γ > 0 for all k > 0. Substituting in (A.49), it follows

that‖pk‖2

(pTkgk)2≤ k+ 1

γ2

and so ∑k≥0

(pTkgk)2

‖pk‖2≥∑k≥0

γ2

k+ 1.

But this final sum diverges which contradicts Zoutendijk’s

Theorem 4.3.

Page 563: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 562'

&

$

%

Dai-Yuan Method — Numerical Behaviour I can “re-cycle”

a lot of the algebra from the Theorem. Repeating (A.47);

‖pk+1‖2

(pTk+1gk+1)2=‖pk‖2

(pTkgk)2−

2

pTk+1gk+1−

‖gk+1‖2

(pTk+1gk+1)2

Let lk =pTkgk+1pTkgk

and re-using the formula

pTk+1gk+1 =pTkgkpTkyk‖gk+1‖2;

I have:‖pk+1‖2

(pTk+1gk+1)2=‖pk‖2

(pTkgk)2+ (1− l2k)

1

‖gk+1‖2.

Defining cos(θk+1) as previously, I have:

1

cos2 θk+1=‖gk+1‖2

‖gk‖21

cos2 θk+ (1− l2k).

Page 564: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 563'

&

$

%

But the strong Wolfe conditions give |lk| ≤ c2 and so

1− l2k ≥ 1− c22 > 0. So if as in the analysis of the FR algorithm, a

“bad” choice of pk+1 sets θk+1 ≈ π/2 and gk ≈ gk+1, then it

follows that 1cos2 θk+1

>> 1 and so the algorithm “sticks” — even

when the strong Wolfe conditions hold.

Page 565: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 564'

&

$

%

A.22.2 Hybrid Method

In a paper published in 2001, [2] Y.H. Dai & Y. Yuan proposed a

new method that uses a “hybrid” version of β, namely

βHk+1 = max0,minβHSk+1, βDYk+1 (A.50)

where the Hestenes & Stiefel version of β is βHSk+1 =gTk+1yk

pTkyk

.

The method (like the DY method) is globally convergent requiring

only weak Wolfe conditions. The proof is similar to that for the DY

method and is given here for the sake of completeness. For clarity I

state the result as a general Theorem — note that the hybrid

method satisfies the condition (A.51).

Page 566: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 565'

&

$

%

Hybrid Method — Global Convergence

Theorem A.20 Suppose that the formula βk+1 satisfies

rk+1 ≡βk+1

βDYk+1∈ [−c, 1],where c =

1− c21+ c2

> 0. (A.51)

Under the same assumptions as those of Zoutendijk’s Theorem 4.3,

(in particular that the weak Wolfe conditions hold and that f is

bounded below) — with the exception that I need not assume that

the pk+1 are descent directions, I have that the algorithm either

stops at a stationary point (‖gk+1‖ = 0) or lim inf ‖gk+1‖ = 0.

Page 567: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 566'

&

$

%

Proof: The proof is structured as follows; first some results are

assembled, then (as for the DY-convergence proof) I prove that the

search directions pk+1 are descent directions, finally I prove the

substantive result.

Page 568: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 567'

&

$

%

[Preliminaries] I have as usual that

gTk+1pk+1 = −‖gk+1‖2 + βk+1gTk+1pk.

Using the substitution βk+1 = rk+1βk+1DY , this can be

re-written as

gTk+1pk+1 =‖gk+1‖2

pTkyk

pTkgk + (rk+1 − 1)g

Tk+1pk

= βk+1

DYpTkgk + (rk+1 − 1)g

Tk+1pk

.

So, solving for βk+1DY and using βk+1 ≡ rkβk+1DY I can write

βk+1 = ξk+1gTk+1pk+1

gTkpk, (A.52)

where lk =gTk+1pk

gTkpkas before and “xi”:ξk+1 =

rk+1

1+ (rk+1 − 1)lk.

Page 569: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 568'

&

$

%

Finally, defining “eta”: ηk+1 =1+(rk+1−1)lk

lk−1, I can show that

gTk+1pk+1 = ηk+1‖gk+1‖2 as follows:

‖gk+1‖2ηk+1 = ‖gk+1‖2(1+ (rk+1 − 1)lk)

lk − 1

= ‖gk+1‖2(1+ (rk+1 − 1)

gTk+1pk

gTkpk

)

gTk+1pk

gTkpk

− 1

= ‖gk+1‖2(rk+1 − 1)g

Tk+1pk + g

Tkpk

gTk+1pk − gTkpk

= ‖gk+1‖2(rk+1g

Tk+1pk − p

Tkyk)

pTkyk

= ‖gk+1‖2(−1+ rk+1

gTk+1pk

pTkyk

)= gTk+1

(−gk+1 + βk+1pk

)≡ gTk+1pk+1.

Page 570: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 569'

&

$

%

[Descent Direction] As in the DY-convergence proof, I use

induction.

• The Base Step is trivial as pT0g0 ≡ −‖g0‖2 < 0.• Assume pTkgk < 0.

– As I am assuming that the weak Wolfe conditions apply

to the step size αk (pk is a descent direction), I have (as

in analysis of DY cgm) lk < c2.

– So, as rk+1 ∈ [−c, 1],

1+ (rk+1 − 1)lk ≥ 1+ c2(−c− 1) Check!

= 1+ c2

(−1− c21+ c2

− 1

)=1− c21+ c2

= c.

(A.53)

Page 571: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 570'

&

$

%

– Remembering that ηk+1 ≡ 1+(rk+1−1)lklk−1

, I have just

shown that TL (the Top Line in ηk+1) satisfies TL ≥ c > 0.– I know that the Bottom Line BL satisfies BL < 0 as

lk < c2 < 1.

– It follows that ηk+1 is negative and so as

gTk+1pk+1 ≡ ηk+1‖gk+1‖2 I have gTk+1pk+1 < 0 as

required.

Page 572: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 571'

&

$

%

[Global Convergence] Now RTP that lim inf ‖gk+1‖ = 0.Assume not — so I have for some γ > 0 that ‖gk+1‖ > γ for all

k ≥ 0. As usual, I can write:

‖pk+1‖2 = βk+12‖pk‖2 − ‖gk+1‖2 − 2pk+1Tgk+1.

Dividing across by (pk+1Tgk+1)

2 and using

βk+1 = ξk+1pk+1

Tgk+1

pTkgk

pk+1Tgk+1 = ηk+1‖gk+1‖2,

I have

‖pk+1‖2

(pk+1Tgk+1)2

= ξ2k+1‖pk‖2

(pTkgk)2−

1

η2k+1

1

‖gk+1‖2−

2

ηk+1

1

‖gk+1‖2

Page 573: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 572'

&

$

%

Re-arranging the second and third terms in the RHS I can write

‖pk+1‖2

(pk+1Tgk+1)2

= ξ2k+1‖pk‖2

(pTkgk)2+

1

‖gk+1‖2

[1−

(1+

1

ηk+1

)2]

≤ ξ2k+1‖pk‖2

(pTkgk)2+

1

‖gk+1‖2. (A.54)

I need to show that |ξk+1| ≤ 1.• Remember that ξk+1 =

rk+11+(rk+1−1)lk

.

• I have already seen (A.53) that (with c ≡ (1− c2)/(1+ c2);

1+ (rk+1 − 1)lk ≥ c.

• Also rk+1 ≥ −c so c ≥ −rk+1.

• Therefore

1+ (rk+1 − 1)lk ≥ −rk+1.

Page 574: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 573'

&

$

%

• As lk ≤ 1 and rk+1 ≤ 1, I have (1− rk+1)(1− lk) ≥ 0 and so

1+ (rk+1 − 1)lk ≥ rk+1.

• Combining these two lower bounds for 1+ (rk+1 − 1)lk I

have

|1+ (rk+1 − 1)lk| ≥ |rk+1|.

Therefore |ξk+1| ≤ 1 so from (A.54) I can derive the inequality

‖pk+1‖2

(pk+1Tgk+1)2

≤ ‖pk‖2

(pTkgk)2+

1

‖gk+1‖2. (A.55)

Page 575: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 574'

&

$

%

As in the proof of convergence for the DY-algorithm, I can

iterate this inequality, giving

‖pk+1‖2

(pk+1Tgk+1)2

≤k+1∑i=0

1

‖gi‖2.

and using the assumption ‖gk‖ > γ for all k ≥ 0 I have

(pk+1Tgk+1)

2

‖pk+1‖2≥ γ2

k+ 2.

Therefore the sum∑∞k=0

(pkTgk)

2

‖pk‖2 diverges which contradicts

Zoutendijk’s Theorem 4.3. So lim inf ‖gk+1‖ = 0 as required.

Page 576: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 575'

&

$

%

Hybrid Method — Numerical Behaviour The method does

not “stick”: I show this using a similar argument to that for the

DY method

• I have ξk+1 =rk+1

1+(rk+1−1)lk.

• For any rk+1 ∈ [−c, 1], the denominator satisfies

1+ (rk+1 − 1)lk ≥ c — see (A.53).

• So |ξk+1| ≤ |rk+1|/c (rk+1 may be negative).

• As previously (A.54) I have

‖pk+1‖2

(pTkgk)2≤ ξ2k+1

‖pk‖2

(pTkgk)2+

1

‖gk+1‖2(A.56)

• Therefore, multiplying across by ‖gk+1‖2:

1

cos2 θk+1≤ ξ2k+1

‖gk+1‖2

‖gk‖21

cos2 θk+ 1 (A.57)

Page 577: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 576'

&

$

%

• Finally, using the upper bound above for ξk+1, I have (as

ξ2k+1 < r2k+1/c

2)

1

cos2 θk+1≤ 1

c2r2k+1

‖gk+1‖2

‖gk‖21

cos2 θk+ 1 (A.58)

• Also, for the Hybrid methd, rk+1 ≡βHk+1βDYk+1

is just

rk+1 = max0,mingTk+1yk

‖gk+1‖2, 1 (A.59)

• So, for the Hybrid method, rk+1 is small precisely when

gk ≈ gk+1 or equivalently yk+1 ≈ 0 and a “bad” θk+1 gives

cos θk+1 >> cos θk as ξk+1 ≈ 0 when gk+1 ≈ gk. So no

“sticking”.

Page 578: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 577'

&

$

%

A.23 Matrix Norms

Definition A.6 The norm of a matrix (not necessarily square) A

is defined in terms of a corresponding vector norm:

‖A‖ = supx 6=0

‖Ax‖‖x‖

≡ sup‖x‖=1

‖Ax‖ (A.60)

as any scalar factor in x can be cancelled above and below.

For the familiar choice ‖x‖ = ‖x‖2 ≡√∑

x2i , I need to show that

‖A‖ = maxi=1,...,n

√Λi (A.61)

where Λi are the eigenvalues of the symmetric positive

semidefinite matrix ATA as mentioned on Slide 127.

Page 579: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 578'

&

$

%

When the matrix A is itself symmetric,

‖A‖ = maxi=1,...,n

|λi| (A.62)

where λi are the (real) eigenvalues of the matrix A.

Let R(x) =‖Ax‖2

‖x‖2. Obviously

R(x) =xTATAx.

xTx

I need to show that the largest value R(x) can have is Λ1 (provided

that ‖x‖ = 1).

I use the notation a1, . . . , an for the eigenvectors of ATA

corresponding to the eigenvalues Λ1 ≥ Λ2 ≥ · · · ≥ Λn. As ATA is

symmetric, the Λi are real and the corresponding eigenvectors aiare orthogonal and can be taken to be orthonormal. In fact the Λiare non-negative (check).

Page 580: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 579'

&

$

%

Using the orthonormality of the ai I can write any vector

x =∑xiai and

R(x) =

∑iΛix

2i∑

j x2j

. (A.63)

Now differentiate R(x) wrt xk (say) and set the result to zero to

find extremal values of R(x):

2xk

‖x‖2Λk −∑j

Λjx2j

= 0

Let x∗ be any x ∈ Rn that satisfies this equation. I want the

supremum of R(x) over non-zero x so at least one of the x∗k, say

x∗p 6= 0. So

R(x∗) = Λp

for any stationary value x∗. The choice of x∗ that maximises R(x)

is one that has x∗1 6= 0 and in this case R(x∗) = Λ1.

Page 581: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 580'

&

$

%

So

‖A‖ ≡ supx6=0

‖Ax‖‖x‖

≡ supx6=0

√R(x) = Λ1.

Finally, if A is symmetric then Λi = λ2i , where λi are the

eigenvalues of A so

‖A‖ ≡ supx6=0

‖Ax‖‖x‖

≡ supx 6=0

√R(x) = |λ1|.

Page 582: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 581'

&

$

%

A.24 Sherman-Morrison-Woodbury Formula

Just multiply the RHS of (6.20) by (A+ RSTT ). In other words,

RTP that (A−1 −A−1RU−1TTA−1

) (A+ RSTT

)= I.

Multiplying out this matrix product, it equates to I+ T2

where

T2 = A−1RSTT −A−1RU−1TT −A−1RU−1TTA−1RSTT .

Now, RTP that T2 = 0. But

T2 = A−1R

[S−U−1 −U−1TTA−1RS

]TT .

The factor in square brackets is zero iff S = U−1(I+ TTA−1RS) but

this is true by definition of U.

Page 583: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 582'

&

$

%

A.25 Derivation of Inverse DFP Formula

The DFP update formula (6.13)

Hk+1 = (I− γkyksTk)Hk(I− γksky

Tk) + γkyky

Tk ,

may be written as Hk+1 = Hk + ∆Hk, where

∆Hk = RSRT ,

where

R =[yk Hksk

], S = γk

1+ γksTkHksk −1

−1 0

.

Page 584: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 583'

&

$

%

A direct application of the SMW formula gives

(Hk + ∆Hk)−1 = Hk

−1 −H−1k RU

−1RTH−1k

where U = S−1 + RTH−1k R. Now,

S−1 =−1

γ2k

0 γk

γk γk + γ2ksTkHksk

= −

0 sTkyk

sTkyk sTkyk + sTkHksk

.It follows by direct substitution that the 2× 2 matrix U is given by:

U =

yTkH−1k yk 0

0 −sTkyk

.

Page 585: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 584'

&

$

%

Assembling the pieces I find that

(Hk+1+∆Hk)−1 = Hk+1

−1−

1

yTkH−1k yk

H−1k yky

TkH

−1k −

1

sTkyksks

Tk

.

Writing Jk ≡ H−1k , I have generated (6.21) as required.

Page 586: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 585'

&

$

%

A.26 Robustness of BFGS

In Subsection 6.2.1 I stated that BFGS tends to correct itself

quickly if it encounters numerical problems while DFP will be slow

to recover.

Our strategy in proving “robustness” will be to prove that when

the eigenvalues of Hk become large, these large eigenvalues will be

reduced at the next iteration of BFGS. Similarly when the

eigenvalues of Hk become excessively small, these small eigenvalues

will be increased at the next iteration of BFGS. This behaviour was

not designed into the algorithm — an unexpected bonus.

Page 587: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 586'

&

$

%

The tools I will use to examine the eigenvalues of Hk are the trace

and determinant of the matrix. As part of the proof of convergence

for BFGS I proved that the trace and determinant of Hk are

modified in a particular way after an update (Eq. 6.30 and

Eq. 6.31):

traceHk+1 = traceHk −‖Hksk‖2

sTkHksk+‖yk‖2

yTKsk(A.64)

and

detHk+1 = detHk

(yTksk

sTkHksk

). (A.65)

I will make the same assumptions as in the statement of Thm 6.26

(convergence Theorem for BFGS), and will re-cycle some of the

algebra from the proof.

Page 588: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 587'

&

$

%

First I need to show that the second term (T2 = −‖Hksk‖2

sTkHksk, say) on

the RHS of (A.64) has the desired “eigenvalue reduction” property.

Taylor’s Theorem can be written as

fk+1 − fk = gTksk +1

2sTk∇2f(ξk)sk,

where ξk is on the line segment from xk to xk+1. From the first

Wolfe condition (4.16a) I have that

fk+1 ≤ fk + c1αkgTkpk = fk + c1gTksk.

Combining the latter two equations gives us:

(c1 − 1)gTksk ≥

1

2sTk∇2f(ξk)sk ≥ m‖s2k‖

using the lower bound on zT∇2f(x)z from Thm 6.26.

Page 589: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 588'

&

$

%

Now using (as usual)

cos θk =−gTkpk‖gk‖‖pk‖

=−gTksk‖gk‖‖sk‖

,

I can simplify the previous inequality to

‖sk‖ ≤ d‖gk‖ cos θk, d ≡ 2(1− c1)m

. (A.66)

Page 590: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 589'

&

$

%

Now to use these results to simplify T2. As Hkpk = −gk it follows

that Hksk = −αkgk so

‖Hksk‖2

sTkHksk=

αk2‖gk‖2

αk‖sk‖‖gk‖ cos θk

=αk‖gk‖‖sk‖ cos θk

(A.67)

≥ αk‖gk‖d‖gk‖ cos2 θk

using (A.66)

=αk

d cos2 θk.

So T2 in the trace inequality (A.64) above satisfies T2 ≤ − αkd cos2 θk

.

Page 591: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 590'

&

$

%

I showed previously (6.29) in the convergence analysis for BFGS

thatyTkyk

yTksk≤M,

where M is the positive constant referred to in (6.26) of Thm. 6.2.

So the third term T3 =yTkykyTksk

in the trace inequality (A.64) is

bounded above by M and I can write

traceHk+1 ≤ traceHk −αk

d cos2 θk+M.

Now to use this result:

(i) Suppose that at the current iteration, I do not have cos θkclose to zero, then as I saw in Ch. 4.2 (in the discussion

following Zoutendijk’s Thm. 4.3) good progress can be made

towards the minimum. However in this case the trace is likely

to increase so some eigenvalues may become large as T2 is

likely to be much smaller in magnitude than M.

Page 592: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 591'

&

$

%

(ii) Large eigenvalues in Hk correspond to | cos θk| 1 as in

(A.67) I saw that

‖Hksk‖2

sTkHksk=

αk‖gk‖‖sk‖ cos θk

In this “problem” case progress will be slow as the gradient is

almost perpendicular to the update direction s, (again, refer

to the discussion following Zoutendijk’s Thm. 4.3). But

T2 ≤ − αkd cos2 θk

so T2 is large and negative (and the “worse”

cos θk is, the more negative T2 is) so the trace of Hk+1will be

much reduced from that of Hk — so some or all of the large

eigenvalues will be reduced to moderate values.

Page 593: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 592'

&

$

%

(iii) What if αk → 0 — as will happen if Hk is “nearly singular”,

resulting in ‖pk‖ becoming very large as Hkpk = −gk?

(“Nearly singular” means one or more eigevalues are very

small in magnitude.)

But this difficulty is also “fixed” by BFGS — as follows. I

have (Eq. A.65 above)

detHk+1 = detHk

(yTksk

sTkHksk

).

If sTkHksk is “small” compared to yTksk ≡ sTkHksk then Hkhas a small eigenvalue compared to those of the average

Hessian Hk— the “nearly singular” case. But this means that

the factor multiplying detHk is large, so the determinant of

Hk and therefore the eigenvalues are increased (in

magnitude). So the small eigenvalue case is self-correcting

just as the large eigenvalue case was.

Page 594: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 593'

&

$

%

It is an interesting Exercise to show (using a similar analysis) that,

for the DFP algorithm (6.13), the −1cos2 θ

term is missing from the

trace update formula so excessively large eigenvalues are not

reduced. (On the other hand, excessively small eigenvalues are

increased.)

(See App. A.29 for some of the details.)

Page 595: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 594'

&

$

%

A.27 Second-Order Necessary Conditions for

Inequality-Constrained Problems

I begin with a definition:

Definition A.7 (Tangent Cone) A vector d is a tangent vector

to the feasible region F at a point x if these is a sequence zk of

feasible points (a “feasible sequence”) approaching x and a sequence

of positive scalars tk with tk → 0 such that

limk→∞

zk − x

tk= d. (A.68)

The set of all tangents to F at x∗ is called the tangent cone and

is written TF (x∗).

It is easy to see that the tangent cone is a cone in the technical

sense that v ∈ TF (x∗)⇒ αv ∈ TF (x∗) for all α > 0. Setting the

sequence zk ≡ x∗ shows that 0 ∈ TF (x∗).

Page 596: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 595'

&

$

%

The definition of the tangent cone is not affected by the algebraic

specification of the feasible region F , only on its geometry. The

feasible direction set F1(x∗) however is a linearised description of

the (algebraic) constraints at x∗ and so is dependent on the

algebraic form of the constraints.

The tangent cone description is very useful when analysing the

geometry of F near x∗ but the feasible direction set F1(x∗) is

easier to work with.

Page 597: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 596'

&

$

%

I will now prove that if the LICQ Def. 7.1 holds then the tangent

cone at x∗ is equal to the set F(x∗, λ∗) of feasible directions defined

in Def. 7.6. This result will allow us to prove Thm. 7.4.

Lemma A.21 Let x∗ be a feasible point. Then the following

statements are true:

1. TF (x∗) ⊆ F(x∗)

2. If the LICQ is satisfied at x∗ then TF (x∗) = F(x∗).

Proof: Without loss of generality, assume that all the

constraints are active at x∗ by simply dropping the inactive ones –

they are irrelevant sufficiently close to x∗.

Page 598: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 597'

&

$

%

1. RTP that TF (x∗) ⊆ F(x∗) so let d ∈ TF (x∗), I need to show

that d ∈ F(x∗). As d ∈ TF (x∗) I have that limk→∞

zk − x

tk= d. or

equivalently that

zk = x∗ + tkd+ o(tk). (A.69)

where the “little-oh” symbol is defined in Def. 3.12. For any

i ∈ E I have that

0 =1

tkci(zk)

=1

tk

(ci(x

∗) + tk∇ci(x∗)Td+ o(tk))

= ∇ci(x∗)Td+o(tk)

tk.

Taking the limit as k→∞ the last term goes to zero so

∇ci(x∗)Td for i ∈ E .

Page 599: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 598'

&

$

%

Now consider the active inequality constraints. Let

i ∈ I ∩ A(x∗) then:

0 ≤ 1

tkci(zk)

=1

tk

(ci(x

∗) + tk∇ci(x∗)Td+ o(tk))

= ∇ci(x∗)Td+o(tk)

tk.

Again taking the limit as k→∞ the last term goes to zero so

∇ci(x∗)Td ≥ 0 for i ∈ I ∩A(x∗) as required. So d ∈ F(x∗) and

therefore TF (x∗) ⊆ F(x∗) as required.

Page 600: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 599'

&

$

%

2. Now RTP that if the LICQ holds then F(x∗) ⊆ TF (x∗) and so

F(x∗) = TF (x∗). So I assume that d ∈ F(x∗) and seek to show

that d ∈ TF (x∗).As the LICQ holds, the m× n matrix A(x∗) of active

constraint gradients has full row rank m= |A(x∗)|. Let Z (as

usual) be a matrix whose columns form a basis for the null

space of A(x∗) so that Z ∈ Rn×(n−m) and A(x∗)Z = 0.

Let d ∈ F(x∗) and suppose that tk∞k=0 is any sequence of

positive reals such that limk→∞ = 0. Define a system of n

equations in n unknowns R(z, t) = (where t is a scalar

parameter) such that R : Rn × R→ Rn by:

R(z, t) =

c(z) − tA(x∗)dZT (z− x∗ − td)

=

00

. (A.70)

Page 601: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 600'

&

$

%

I want to show that the solutions z = zk of this system of

equations corresponding to (small) t = tk constitute a feasible

sequence that approaches x∗ and satisfies the definition

Def. A.68.

At t = 0, z = x∗ satisfies R(z, t) = 0 and the Jacobian of R at

this value of (z, t) is

∇xR(x∗, 0) =

A(x∗)ZT

. (A.71)

This matrix is non-singular due to the definition of Z. So (by

the Implicit Function Theorem) I can “solve for z” when t is

sufficiently close to zero. The I.F. Thm. guarantees that the

solution exists and is unique when t is sufficiently close to zero.

So R(z, tk) = 0 has a unique solution zk for all sufficiently small

values of tk.

Page 602: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 601'

&

$

%

It follows from the definition of R(z, t) (A.70) that I have

c(zk) = tkA(x∗)d for all k sufficiently large and so as

d ∈ F(x∗):

i ∈ E ⇒ ci(zk) = tk∇ci(x∗)d = 0 (A.72)

i ∈ I ∩ A(x∗)⇒ ci(zk) = tk∇ci(x∗)d ≥ 0 (A.73)

so certainly zk is feasible for all k sufficiently large.

Page 603: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 602'

&

$

%

I need to check that (A.68) holds at x∗ for the feasible

sequence zk. Using the fact that R(zk, tk) = 0 for all k

sufficiently large together with Taylor’s Theorem I have that:

0 = R(zk, tk) =

c(zk) − tkA(x∗)dZT (zk − x

∗ − tkd)

=

A(x∗)(zk − x∗) + o(‖zk − x∗‖) − tkA(x∗)dZT (zk − x

∗ − tkd)

=

A(x∗)ZT

(zk − x∗ − tkd) + o(‖zk − x∗‖).

Page 604: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 603'

&

$

%

If I divide the last equation across by tk and use the fact that

the Jacobian (A.71) is non-singular I have that

zk − x∗

tk= d+ o

(‖zk − x∗‖

tk

)and so that (A.68) holds at x∗ for the feasible sequence zk.

Therefore d ∈ TF (x∗) and so TF (x∗) = F(x∗) as required.

Page 605: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 604'

&

$

%

I can now prove Thm. 7.4— the full Second-order Necessary

conditions. Proof: (of Thm. 7.4) Since x∗ is a local minimum,

all feasible sequences zk approaching x∗ must have f(zk) ≥ f(x∗)for all k sufficiently large. I will construct a feasible sequence whose

limiting direction is w and show that the property f(zk) ≥ f(x∗)implies that wT∇xxL(x∗, λ∗)w ≥ 0.

Choose an arbitrary w ∈ C(x∗). Since w ∈ C(x∗) ⊆ F(x∗) = TF (x∗)by Lemma A.21 I can use the technique in the Lemma to choose a

sequence of positive reals tk and a feasible sequence zk

converging to x∗ such that

limk→∞

zk − x∗

tk= w (A.74)

or just

zk − x∗ = tkw+ o(tk). (A.75)

Page 606: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 605'

&

$

%

By the construction technique for the feasible sequence zk, I have

by (A.72) and (A.73) that

ci(zk) = tk∇ci(x∗)w, for all i ∈ A(x∗). (A.76)

I can write:

L(zk, λ∗) = f(zk) −∑i∈E∪I

λ∗ici(zk)

= f(zk) − tk∑

i∈A(x∗)

λ∗i∇ci(x∗)Tw

= f(zk) (A.77)

Page 607: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 606'

&

$

%

I can also perform a Taylor series expansion to estimate L(zk, λ∗)near x∗.

L(zk, λ∗) = L(x∗, λ∗) + (zk − x∗)T∇L(x∗, λ∗)

+1

2(zk − x

∗)T∇2L(x∗, λ)(zk − x∗)

+ o(‖zk − x∗‖2). (A.78)

By complementarity (7.19e) I have L(x∗, λ∗) = f(x∗). By (7.22a),

the gradient term in (A.78) is zero.

So using (A.77) I have

f(zk) = f(x∗) +

1

2(zk − x

∗)T∇2L(x∗, λ)(zk − x∗) + o(t2k). (A.79)

Finally, if wT∇xxL(x∗, λ∗)w < 0. then (A.79) implies that

f(zk) < f(x∗) for all k sufficiently large — contradicting the fact

that x∗ is a local minimum. Therefore (7.34) must hold.

Page 608: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 607'

&

$

%

(Back to Thm. 7.4)

A.28 Second-Order Sufficient Conditions for

Inequality-Constrained Problems

Proof of Thm. 7.7. I repeat the statement of the Theorem for

convenience.

Theorem A.22 (Second-Order Sufficient Conditions)

Suppose that for some feasible point x∗ ∈ Rn there is a Lagrange

multiplier vector λ∗ such that the KKT conditions (7.22a–7.19e) are

satisfied. Suppose also that

dT∇xxL(x∗, λ∗)d > 0,for all stationary directions d ∈ C(λ∗), d 6= 0. (A.80)

Page 609: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 608'

&

$

%

Then x∗ is a strict local solution for (7.1).

Proof:

• First define C = d ∈ C(x∗, λ∗)|‖d‖ = 1.

• This is a closed and bounded subset of C(x∗, λ∗) so by (A.80)

the minimiser of dT∇xxL(x∗, λ∗)d over this set is a strictly

positive number, σ.

– A continuous function on a closed and bounded subset of

Rnis bounded above and below and attains its upper and

lower bounds.

• It is easy to check that if d ∈ C(x∗, λ∗) then so is αd for any

α > 0 (this is the defining property of a cone).

• It follows that (d/‖d‖) ∈ C if and only if d ∈ C(x∗, λ∗)| for

non-zero d. So (A.80) implies that

dT∇xxL(x∗, λ∗)d ≥ σ‖d‖2, for all d ∈ C(x∗, λ∗). (A.81)

Page 610: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 609'

&

$

%

• I prove the Theorem by showing that every feasible sequence

zk approaching x∗ has f(zk) ≥ f(x∗) + (σ/2)‖zk − x∗‖2, for all

k sufficiently large.

• Assume the opposite; that there is a feasible sequence zk

approaching x∗ such that:

f(zk) < f(x∗) + (σ/2)‖zk − x∗‖2 for all k sufficiently large

(A.82)

— I will show that this leads to a contradiction.

• The sequence dk =zk − x

‖zk − x∗‖is a bounded sequence in Rn.

• As mentioned in Sec. 7.2.1, the Bolzano-Weirstrass Thm states

that every sequence on a closed and bounded set has a

convergent subsequence.

– The set of vectors with unit norm is closed as well as

bounded so the Bolzano-Weirstrass Thm applies.

Page 611: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 610'

&

$

%

• So dk has a convergent subsequence converging to some

vector d (say). If necessary re-numbering, I can write

limk→∞

zk − x∗

‖zk − x∗‖= d. (A.83)

• By Lemma A.21 I know that TF (x∗) ⊆ F(x∗, λ∗) and so

d ∈ F(x∗, λ∗).

• By definition of the Lagrangian and as the optimal multipliers

are non-negative for i ∈ I and also as ci(zk) ≥ 0, i ∈ I and

ci(zk) = 0, i ∈ E I have

L(zk, λ∗) = f(zk) −∑

i∈A(x∗)

λ∗ici(zk) ≤ f(zk). (A.84)

• Note that when (as in the proof for the necessary conditions)

the LICQ holds, I have L(zk, λ∗) = f(zk).

Page 612: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 611'

&

$

%

• The Taylor series result from the proof for the necessary

conditions still holds in the form:

L(zk, λ∗) = f(x∗)+1

2(zk−x

∗)T∇2L(x∗, λ∗)(zk−x∗)+o(‖zk−x∗‖2).(A.85)

• Now if d 6∈ C(x∗, λ∗) then for at least one j ∈ I ∩ A(x∗), I have

λ∗jdT∇cj(x∗) > 0 (A.86)

and λ∗idT∇ci(x∗) ≥ 0 for all other i ∈ I ∩ A(x∗).

Page 613: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 612'

&

$

%

• I can expand λ∗j cj(zk) in a Taylor series:

λ∗j cj(zk) = λ∗j cj(x

∗) + λ∗j (zk − x∗)T∇cj(x∗) + o(‖(zk − x∗‖)

= ‖zk − x∗‖λ∗jdT∇cj(x∗) + o(‖(zk − x∗‖).

• This allows us to get an upper bound on the Lagrangian at zk:

L(zk, λ∗) ≡ f(zk) −∑

i∈A(x∗)

λ∗ici(zk)

≤ f(zk) − λ∗j cj(zk)

= f(zk) − ‖zk − x∗‖λ∗jdT∇cj(x∗) + o(‖(zk − x∗‖).(A.87)

Page 614: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 613'

&

$

%

• Using (A.85) I can write a TS expansion for the Lagrangian at

zk:

L(zk, λ∗) = f(x∗) +O(‖zk − x∗‖2)

and combining this with (A.87) (flipping the inequality

around):

f(zk) ≥ f(x∗) + ‖zk − x∗‖λ∗jdT∇cj(x∗) + o(‖(zk − x∗‖). (A.88)

• But in (A.82) I assumed that f(zk) < f(x∗) + (σ/2)‖zk − x∗‖2

for all k sufficiently large.

Page 615: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 614'

&

$

%

• I can show these two inqualities are incompatible as follows.

– Subtract (A.88) from (A.82):

0 < ‖zk − x∗‖((σ/2)‖zk − x∗‖− λ∗jdT∇cj(x∗)

).

– But for k sufficiently large

(σ/2)‖zk− x∗‖− λ∗jdT∇cj(x∗) < 0 — giving a contradiction.

– I conclude that our assumption d 6∈ C(x∗, λ∗) is false, so

d ∈ C(x∗, λ∗) and so dT∇xxL(x∗, λ∗)d ≥ σ > 0 from the

discussion at the start of this proof.

Page 616: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 615'

&

$

%

• Finally I show that the assumption (A.82) yields a

contradiction, even with d ∈ C(x∗, λ∗).– I will use the result dT∇xxL(x∗, λ∗)d ≥ σ > 0.

f(zk) ≥ L(zk, λ∗)

= f(x∗) +1

2(zk − x

∗)T∇2L(x∗, λ∗)(zk − x∗) + o(‖zk − x∗‖2)

= f(x∗) +1

2dT∇2L(x∗, λ∗)d‖zk − x∗‖2 + o(‖zk − x∗‖2)

≥ f(x∗) + (σ/2)‖zk − x∗‖2 + o(‖zk − x∗‖2).

• This latter inequality contradicts (A.82).

Page 617: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 616'

&

$

%

• So every feasible sequence zk approaching x∗ must satisfy

f(zk) ≥ f(x∗) + (σ/2)‖zk − x∗‖2 + o(‖zk − x∗‖2) for all k

sufficiently large.

• I conclude that x∗ is a strict local solution in the sense that

f(x) > f(x∗) for all feasible x in some neighbourhood of x∗.

Page 618: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 617'

&

$

%

A.29 Outline of Analysis for Robustness of DFP

Begin by showing that for for the DFP algorithm (6.13), I have

TrHk+1 = TrHk − 2γkykHksk + γ2ksTkHksk + γk‖yk‖2.

Referring to the terms on the RHS as T1, · · · , T4 respectively I can

find an upper bound for each (in magnitude).

It is easy to check that

‖yk‖2

yTksk≤M

Page 619: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 618'

&

$

%

and that

skHksk

yTksk≤ skHksk

(1− c2)(−gTksk)(2nd.W.cond.)

=(−αk)g

Tksk

(1− c2)(−gTksk)(as Hksk = −αkgk.)

=αk

1− c2.

Using these inequalities T4 ≤M and T3 ≤ Mαk1−c2

.

Page 620: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 619'

&

$

%

Finding an upper bound on the magnitude of T2 is a bit trickier.

First note that

• m‖z‖2 ≤ zT∇2f(x)z≤M‖z‖2 so taking z = sk and setting

x = xk + τsk and integrating from τ = 0 to 1

m‖sk‖2 ≤ sTkHksk ≡ sTkyk ≤M‖sk‖2

so sTkyk ≥ m‖sk‖2.

• ‖gk‖‖sk‖ cos θk ≡ −gTksk ≤ 11−c2

yTksk (2nd. W. cond.) But I

saw above that sTkyk ≤M‖sk‖2 so ‖sk‖ ≥ K‖gk‖ cos θk where

K = 1−c2M

.

Now examine the magnitude of T2:

|T2| =|ykHksk|

yTksk(as yTksk > 0)

≤ |ykHksk|

m‖sk‖2(using sTkyk ≥ m‖sk‖2).

Page 621: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 620'

&

$

%

Now consider the top line; |ykHksk|. Using Hksk ≡ −αkgk and the

Cauchy-Schwartz inequality,

|T2| ≤|ykHksk|

m‖sk‖2

≤ αk‖yk‖‖gk‖m‖sk‖2

.

But ‖yk‖ ≤M‖sk‖ follows directly from sTkyk ≤M‖sk‖2 above

(why?) so

|T2| ≤αk‖yk‖‖gk‖m‖sk‖2

≤ αkM‖gk‖m‖sk‖

≤ αkM

mK cos θkusing ‖sk‖ ≥ K‖gk‖ cos θk above.

Page 622: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 621'

&

$

%

So, finally;

TrHk+1 ≤ TrHk +αkM

mK cos θk+Mαk

1− c2+M

so that the trace of Hk (and therefore the eigenvalues of Hk) may

increase by up to M. The term αkMmK cosθk

that I might hope would

decrease the trace of Hk when cos θk is small, is a bound on the

magnitude of T2. So |T2| may be large when cos θk is small but as

T2 itself is of uncertain sign I cannot rely on T2 to reduce large

eigenvalues in Hk when they occur. This is the major failing of the

DFP method. (Compare with the discussion of BFGS on Slide 591.)

Page 623: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 622'

&

$

%

A.30 The L-BFGS Algorithm

The method is unchanged from the standard BFGS method for the

first m iterations — except that I store

Vi ≡ (I− γiyisTi ), γi and si

at each iteration. The BFGS update rule can be written:

Jk+1 = VTk JkVk + γksks

Tk .

I need to see the effect of this succession of iterations. Given a

Page 624: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 623'

&

$

%

starting value J0, I can explicitly calculate the successive Ji:

J1 = VT0 J0V0 + γ0s0s

T0

J2 = VT1 J1V1 + γ1s1s

T1

= VT1 VT0 J0V0V1 + γ0V

T1 s0s

T0V1 + γ1s1s

T1

J3 = VT2 J2V2 + γ2s2s

T2

= VT2 VT1 V

T0 J0V0V1V2 + γ0V

T2 V

T1 s0s

T0V1V2 + γ1V

T2 s1s

T1V2 + γ2s2s

T2

...

Page 625: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 624'

&

$

%

and so

Jk =VTk−1VTk−2 . . . V

T0 J0V0V1 . . . Vk−2Vk−1

+ γ0VTk−1V

Tk−2 . . . V

T1 s0s

T0V1 . . . Vk−2Vk−1

+ γ1VTk−1V

Tk−2 . . . V

T2 s1s

T1V2 . . . Vk−2Vk−1

...

+ γk−3VTk−1V

Tk−2sk−3s

Tk−3Vk−2Vk−1

+ γk−2VTk−1sk−2s

Tk−2Vk−1

+ γk−1sk−1sTk−1. (A.89)

Page 626: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 625'

&

$

%

After m iterations I have:

Jm =VTm−1VTm−2 . . . V

T0 J0V0V1 . . . Vm−2Vm−1

+ γ0VTm−1V

Tm−2 . . . V

T1 s0s

T0V1 . . . Vm−2Vm−1

+ γ1VTm−1V

Tm−2 . . . V

T2 s1s

T1V2 . . . Vm−2Vm−1

...

+ γm−3VTm−1V

Tm−2sm−3s

Tm−3Vm−2Vm−1

+ γm−2VTm−1sm−2s

Tm−2Vm−1

+ γm−1sm−1sTm−1. (A.90)

After m iterations I discard the oldest Vk, sk and γk (k = 0) and

from now on I continue to only use the m most recent s and y

values. (Effectively I set V0 = I and γ0 = 0 for the purposes of

amending (A.90).)

Page 627: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 626'

&

$

%

So

Jm+1 =VTmV

Tm−1 . . . V

T1 J0V1V2 . . . Vm−1Vm

+ γ1VTmV

Tm−1 . . . V

T2 s1s

T1V2 . . . Vm−1Vm

+ γ2VTmV

Tm−1 . . . V

T3 s2s

T2V3 . . . Vm−1Vm

...

+ γm−2VTmV

Tm−1sm−2s

Tm−2Vm−1Vm

+ γm−1VTmsm−1s

Tm−1Vm

+ γmsmsTm.

Page 628: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 627'

&

$

%

and for any k > m I have:

Jk =VTk−1VTk−2 . . . V

Tk−mJ0Vk−mVk−m+1 . . . Vk−2Vk−1

+ γk−mVTk−1V

Tk−2 . . . V

Tk−m+1s

Tk−msk−mVk−m+1 . . . Vk−2Vk−1

+ γk−m+1VTk−1V

Tk−2 . . . V

Tk−m+2s

Tk−m+1sk−m+1Vk−m+2 . . . Vk−2Vk−1

...

+ γk−3VTk−1V

Tk−2s

Tk−3sk−3Vk−2Vk−1

+ γk−2VTk−1s

Tk−2sk−2Vk−1

+ γk−1sTk−1sk−1.

Page 629: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 628'

&

$

%

or if you prefer

Jk+1 =VTkV

Tk−1 . . . V

Tk−m+1J0Vk−m+1Vk−m+2 . . . Vk−1Vk

+ γk−m+1VTkV

Tk−1 . . . V

Tk−m+2s

Tk−m+1sk−m+1Vk−m+2 . . . Vk−1Vk

+ γk−m+2VTkV

Tk−1 . . . V

Tk−m+3s

Tk−m+2sk−m+2Vk−m+3 . . . Vk−1Vk

...

+ γk−2VTkV

Tk−1s

Tk−2sk−2Vk−1Vk

+ γk−1VTk sTk−1sk−1Vk

+ γksTksk. (A.91)

Page 630: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 629'

&

$

%

Despite its messy appearance, the above formula for Jk+1 is not

that hard to program. It only requires that I accumulate successive

values of Vk, sk and γk at each iteration and that I discard the

oldest values of Vk, sk for each iteration after k = m.

In practice I store yk, sk as Vk and γk are easy to calculate from

them. This greatly reduces the storage requirements to 2nm for s

and y. Also I only require −Jk+1g so I only need to calculate a

product of Vi’s, VTi ’s and si’s with g for each line in (A.91) and

add them together. No n×n matrices needed — except J0 which is

usually a multiple of the identity matrix and so does not need to be

stored.

Exercise A.2 Can you write down a formula for one of the lines

of (A.91) times g?

There is an ingenious variation on (A.91) that is more efficient in

terms of storage and much simpler to program:

Page 631: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 630'

&

$

%

Algorithm A.3 (L-BFGS (Inner Loop) ) Given J0 then at

the kth iteration of the main algorithm

if k <= m then

Bound = k; Y = [Y y]; S = [S s]; Γ = [Γ γ]

else

Bound = m;

Y = [Y(:, 2 : m) y];S = [S(:, 2 : m)s]; Γ = [Γ(2 : m) γ];

end if

q = g; A = [ ];

I have augmented the (n× k− 1) matrices S, Y

with an extra column sk, yk

and the k− 1-dim vector Γ

with an extra entry γk.

When k > m I discard the oldest columns of s and y

and the oldest entry of γ.

I now use the accumulated s, y and γ-values

Page 632: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 631'

&

$

%

to accumulate a k-dim vector A of α-values

and calculate a n-dim vector q

for i=Bound:-1:1 do

s = S(:, i);

y = Y(:, i);

γ = Γ(i);

α = γsTq;

A = [α A];

q = q− αy;

end for

r = J0q;

Now I use the accumulated α-values in A

to calculate the final value of r ≡ Jk+1g.

for i = 1 : Bound do

s = S(:, i);

y = Y(:, i);

Page 633: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 632'

&

$

%

α = A(i);

γ = Γ(i);

β = γyT r;

r = r+ (α− β)s;

end for

p = −r;

See App. A.31 for a justification of this algorithm and App. A.32

for a proof that it converges to a stationary point.

Page 634: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 633'

&

$

%

A.31 Justification for the L-BFGS Algorithm

It is not at all obvious that the above L-BFGS algorithm is

equivalent to (A.91).

This Section demonstrates the required equivalence by stepping

through the pseudo-code of Alg. A.3. It is convenient to index the

“stored” numbers γk−m . . . γk−1, vectors sk−m . . . sk−1 and

matrices Vk−m . . . Vk−1 needed to compute Jkg by the indices 1 to

m. So I will show that Alg. A.3 computes Jm+1g.

Page 635: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 634'

&

$

%

• Start by setting Q = g, the gradient gk. For arbitrary m ≥ 1:

• Step through Lines 19 to 24 of the Algorithm for i from i = m

down to i = 1. (“Forward Pass”)

αm = γmsTmQ ≡ γmsTmg

Q = Q− αmym ≡ g− γmsTmgym =(I− γmyms

Tm

)g ≡ Vmg

αm−1 = γm−1sTm−1Q ≡ γm−1s

Tm−1Vmg

Q = Q− αm−1ym−1 ≡ Q− γm−1sTm−1Vmg ≡ VmVm−1g

...

Q = V2 . . . Vmg

α1 = γ1sT1V2 . . . Vmg

r0 = J0Q ≡ J0V1 . . . Vmg.

Page 636: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 635'

&

$

%

• Step through Lines 30 to 35 of the Algorithm for i from i = 1

up to i = m. (“BackwardPass”) (I subscript successive values

of r for clarity — in fact each r overwrites its predecessor.)

Page 637: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 636'

&

$

%

β = γ1yT1 r0

r1 = r0 + (α1 − β)s1 = r0 +(γ1s

T1V2 . . . Vmg− γ1y

T1 r0)s1

= VT1 r0 + γ1s1sT1V2 . . . Vmg

β = γ1yT2 r1

r2 = r1 + (α2 − β)s2 = r1 +(γ2s

T2V3 . . . Vmg− γ2y

T2 r1)s2

= VT2 r1 + γ2s2sT2V3 . . . Vmg

...

ri = VTi ri−1 + γisis

Ti Vi+1 . . . Vmg

...

rm−1 = VTm−1rm−2 + γm−1sm−1s

Tm−1Vmg

rm = VTmrm−1 + γmsmsTmg

Page 638: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 637'

&

$

%

• Finally, “back-substitute” for the ri to get an explicit

expression for r ≡ rm.

r ≡ rm = VTmrm−1 + γmsmsTmg = VTmrm−1 + Tm

= VTm

(VTm−1rm−2 + γm−1sm−1sTm−1Vmg

)+ Tm

= VTmVTm−1rm−2 + Tm−1 + Tm

= VTmVTm−1

(VTm−2rm−3 + γm−2sm−2s

Tm−2Vm−1Vmg

)+ Tm−1 + Tm

...

So, by induction,

r ≡ rm = VTm . . . VT1 r0+γmsms

Tmg+γm−1V

Tmsm−1s

Tm−1Vmg

+ γm−2VTmV

Tm−1sm−2s

Tm−2Vm−1Vmg+

+ · · ·+ γ1VTm . . . VT2 s1sT1V2 . . . Vm

Page 639: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 638'

&

$

%

which is (A.91) as claimed.

Page 640: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 639'

&

$

%

A.32 Convergence of the L-BFGS Algorithm

Finally, I know a lot about the convergence properties of the BFGS

method. can I say anything about those of L-BFGS?

I will be able to prove that L-BFGS has R-linear convergence — a

slightly weaker version of linear convergence that I now define.

Definition A.8 (R-linear) Let xk be a sequence in Rnthat

converges to x∗ . I say that the convergence is R-linear if there is

a constant r ∈ (0, 1) such that

‖xk−x∗‖ ≤ νk, for all k sufficiently large, where νk → 0 linearly.

(A.92)

This is a weaker property than conventional Q-linear convergence

(as defined in (3.13)), i.e. linear convergence implies R-linear

convergence but not vice versa.

Page 641: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 640'

&

$

%

Example A.2 The sequence

xk =

1+ 2−k k even

1 k odd.

converges R-linearly to 1. Note that this sequence does not have

(Q-)linear convergence as the “error” increases from 0 at every

second iteration.

Similarly the sequence

xk = 1+ 2−k

converges linearly to 1.

Page 642: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 641'

&

$

%

I can now state and prove a Theorem on the convergence properties

of L-BFGS, subject to strong (restrictive) assumptions on f.

Theorem A.23 (L-BFGS Convergence) Let x0 be a starting

point and let f satisfy:

• f is C2 on Rn

• The set D = x ∈ Rn : f(x) ≤ f(x0) is convex

• There exist M1, M2 positive s.t.

M1‖z‖2 ≤ zT∇2f(x)z ≤M2‖z‖2, for all z ∈ Rn and all x ∈ D.(A.93)

Assume that the “starting estimates” of the Hessian and inverse

Hessian at each value of k before updating using the Alg. A.3 are

bounded in norm. Then for any positive definite matrix B0, the

algorithm generates a sequence xk that converges to x∗.

Page 643: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 642'

&

$

%

Also there is a constant 0 ≤ r < 1 such that

fk − f∗ ≤ rk (f0 − f∗)

so xk converges R-linearly (as defined above) to x∗.

Proof: From the proof of Zoutendijk’s Theorem 4.3 I have

fk+1 ≤ fk − c cos2 θk‖∇fk‖2,

for some c > 0 which may be taken as small as I wish wlog. So

(fk+1 − f∗) ≤ (fk − f∗) − c cos2 θk‖∇fk‖2. (A.94)

Now RTP that

‖∇fk‖2 ≥ d (fk − f∗) (A.95)

for some positive constant d — as this will imply that

(fk+1 − f∗) ≤(1− c ′ cos2 θk

)(fk − f∗) (A.96)

for some positive constant c ′.

Page 644: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 643'

&

$

%

I need to combine some results:

• Using Taylor’s Thm.:

gk ≡ gk − g∗ = ∇2f(xk + τ(xk − x∗))(xk − x∗), 0 ≤ τ ≤ 1

So ‖gk‖2 = (xk − x∗)T∇2f(xk + τ(xk − x∗))(xk − x∗). Using

the lower bound on zT∇2f(x)z, I have

‖gk‖2 ≥M1‖xk − x∗‖2.

• Again using Taylor’s Thm.:

fk − f∗ = (xk − x∗)Tg∗ +

1

2(xk − x

∗)T∇2f(xk + η(xk − x∗))(xk − x∗)

≤ M2

2‖xk − x∗‖2.

• So ‖∇fk‖2 ≥M1‖xk − x∗‖2 ≥ 2M1

M22

(fk − f∗) which is (A.95)

with d = 2M1

M22

.

Page 645: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 644'

&

$

%

Substituting (A.95) in (A.94) gives (A.96) as required.

Now RTP that cos θk > C > 0 for all k as this combined with

Zoutendijk’s Theorem implies that xk → x∗.

I need to examine L-BFGS again. Alg. A.3 computes Jk+1 in terms

of (sk, yk), (sk−1, yk−1), . . . , (sk−m+1, yk−m+1) and J0. This is

equivalent to a succession of m iterations of the conventional BFGS

algorithm using these (s, y) pairs — starting with the same J0.

As the algebra is easier for the inverse BFGS algorithm, I will work

with this update rule. So I can represent the sequence of updates

by:

H(l+1)k = H

(l)K −

H(l)K s

(l)k s

(l)Tk H

(l)K

s(l)Tk H

(l)K s

(l)k

+y(l)k y

(l)Tk

s(l)Tk s

(l)k

(A.97)

Page 646: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 645'

&

$

%

where Hk+1 ≡ H(m)k and s

(l)k and y

(l)k for l = 1 . . .m are the lth

values of s and y stored at the kth iteration of the outer loop of the

algorithm.

The results previously derived for the determinants and traces of

Hk+1 may be recycled based on (A.97) above.

Certainly (neglecting the negative term in (6.30))

Tr(H(l)k ) ≤ Tr((H(0)

k ) +

m∑l=1

‖y(l)k ‖2

y(l)Tk s

(l)k

. (A.98)

Also‖y(l)k ‖2

y(l)Tk s

(l)k

≤M for some positive constant M by (6.29)so that

Tr(Hk+1 ≤ Tr((H(0)k ) +mM ≤M3, for some M3 > 0.

Also (relying on the result for Det(Hk) (6.31));

Page 647: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 646'

&

$

%

Det(H(l+1)k ) = Det(H

(l)k )

y(l)Tk s

(l)k

s(l)Tk H

(l)k s

(l)k

so

Det(Hk+1) ≡ Det(H(m)k ) = Det(H

(0)k )

m∏l=1

y(l)Tk s

(l)k

s(l)Tk s

(l)k

m∏l=1

s(l)Tk s

(l)k

s(l)Tk H

(l)k s

(l)k

≥ Det(H(0)k )Mm

1 Mm3 ≡M4, say,

where M1 was defined in (A.93).

Page 648: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 647'

&

$

%

I have Tr(Hk+1) ≤M3 and Det(Hk+1) ≥M4, so the least

eigenvalue of Hk+1 is uniformly bounded below (by m0, say) given

that I know that the largest eigenvalue is bounded above (by M0

say). (I justify this claim in Lemma A.24 below.)

So

cos(θk) ≡sTkHksk

‖sk‖‖Hksk‖≥ m0‖sk‖2

‖sk‖‖Hksk‖.

But |‖Hksk‖ ≤ ‖Hk‖‖sk‖ ≤M0‖sk‖ which means that

cos(θk) ≥ m0M0

= µ > 0 and therefore by Zoutendijk’s Theorem

xk → x∗.

Now finally, I have cos(θk) ≥ µ > 0 with µ < 1 and also

fk+1 − f∗ ≤(1− C cos(θk)

2)(fk − f∗) (A.99)

it follows that

1− C cos(θk)2 ≤ (1− cµ2)(fk − f∗).

Page 649: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 648'

&

$

%

Setting r = 1− Cµ2 < 1 and iterating (A.99) gives us

fk − f∗ ≤ rk(f0 − f∗)

as required.

Page 650: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 649'

&

$

%

Lemma A.24 Given a sequence of positive definite matrices Ak, if

TrAk ≤M3 and DetAk ≥M4 for some positive constants M3 and

M4 for all k then for all k I have that the smalles eigenvalue λ(k)1

satisfies λ(k)1 > m0 for some positive constant m0.

Proof: Assume that there is a subsequence K ⊆ N such that

λ(j)1 < 1/j for all j ∈ K and seek a contradiction.( This is just the

negation of λ(k)1 > m0 — check.) It follows that

n∏i=1

λ(j)i <

1

j

n∏i=2

λ(j)i for all j ∈ K.

Now using DetAk ≥M4, I have

n∏i=2

λ(j)i ≥ jM4 for all k ∈ K.

But TrAk ≤M3 ⇒ λ(j)i ≤M3 for all k ∈ K.

Page 651: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 650'

&

$

%

So

n∏i=2

λ(j)i ≤M

n−13 ≡M5 a positive constant, for all j ∈ K.

Therefore M5 ≥ jM4 for all j ∈ K — which is false.

Page 652: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 651'

&

$

%

A.33 Example With Two Inequality Constraints

Back to Slide 253

Example A.3 (Two Inequality Constraints) Suppose I add an

extra constraint to the problem (7.10) to obtain

min x1 + x2 s.t. 2− x21 − x22 ≥ 0, x2 ≥ 0, (A.100)

Page 653: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 652'

&

$

%

∇c2

∇f

∇c1

Figure 29: Illustration of Example A.3

The feasible region is the half-disk illustrated in the Figure.

Page 654: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 653'

&

$

%

It is easy to see that the solution lies at (−√2, 0)T , a point at which

both constraints are active.

• By repeating the arguments for the previous examples, I

conclude that a direction d is a feasible descent direction, to

first order, if it satisfies the following conditions:

∇ci(x)Td ≥ 0, i ∈ I = 1, 2, ∇f(x)Td < 0. (A.101)

• It is clear from Figure 29 that no such direction exists when

x = (−√2, 0)T .

• Or in other words, there are no feasible descent directions

at this point — confirming that this point is a solution.

• The conditions ∇ci(x)Td ≥ 0, i = 1, 2, are both satisfied only if

d lies in the quadrant defined by ∇c1(x) and ∇c2(x) but it is

clear by inspection that all vectors d in this quadrant satisfy

Page 655: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 654'

&

$

%

∇f(x)Td ≥ 0.

Page 656: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 655'

&

$

%

• How do the Lagrangian and its derivatives behave for this

problem and the solution point (−√2, 0)T?

• First, I include an additional term λici(x) in the Lagrangian

for each additional constraint, so I have

L(x, λ) = f(x) − λ1c1(x) − λ2c2(x), (A.102)

where λ = (λ1, λ2)T is the vector of Lagrange multipliers.

• The extension of condition (7.15) to this case is

∇xL(x∗, λ∗) = 0, for some λ∗ ≥ 0, (A.103)

where the inequality λ∗ ≥ 0 means that all components of λ∗

are required to be nonnegative.

Page 657: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 656'

&

$

%

• By applying the complementarity condition (7.16) to both

inequality constraints, I obtain

λ∗1c1(x∗) = 0, λ∗2c2(x

∗) = 0. (A.104)

• When x∗ = (−√2, 0)T , I have

∇f(x∗) =

1

1

, ∇c1(x∗) =

2√2

0

, ∇c2(x∗) =

0

1

,so that it is easy to verify that ∇x L(x∗, λ∗) = 0 when I select

λ∗ as follows:

λ∗ =

1/(2√2)

1

. (A.105)

Page 658: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 657'

&

$

%

• Note that both components of λ∗ are positive.

• I consider now some other feasible points that are not solutions

of (A.100) and examine the properties of the Lagrangian and

its gradient at these points.

• For the point x = (√2, 0)T , I again have that both constraints

are active.

• However, the objective gradient ∇f(x) no longer lies in the

quadrant defined by the conditions ∇ci(x)Td ≥ 0, i = 1, 2 (see

Figure 30).

Page 659: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 658'

&

$

%

∇f

∇c1

∇c2

Figure 30: Illustration of Example A.3

• One first-order feasible descent direction from this point—a

vector d that satisfies (A.101) — is d = (−1, 0)T ; there are

many others (see the exercises).

• For this value of x it is easy to verify that the condition

∇x L(x, λ) = 0 is satisfied only when λ = (−1/(2√2), 1)T .

Page 660: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 659'

&

$

%

• Note that the first component λ1 is negative, so that the

conditions (A.103) are not satisfied at this point.

• Finally, consider the point x = (1, 0)T , at which only the second

constraint c2 is active.

• At this point, linearisation of f and c as in Example 7.2 gives

the following conditions, which must be satisfied for d to be a

feasible descent direction, to first order:

1+∇c1(x)Td ≥ 0, ∇c2(x)Td ≥ 0, ∇f(x)Td < 0. (A.106)

• In fact, I need worry only about satisfying the second and third

conditions, since I can always satisfy the first condition by

making d small enough in magnitude.

Page 661: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 660'

&

$

%

• By noting that

∇f(x) =

1

1

, ∇c2(x) =

0

1

.it is easy to verify that the vector d = (−1

2, 14)T satisfies

(A.106) and is therefore a descent direction.

• To show that optimality conditions (A.103) and (A.104) fail, I

note first from (A.104) that since c1(x) > 0, I must have λ1 = 0.

• Therefore, in trying to satisfy ∇x L(x, λ) = 0, I am left to

search for a value λ2 such that ∇f(x) − λ2∇c2(x) = 0.

• No such λ2 exists — so this point fails to satisfy the optimality

conditions.

Back to Slide 253

Page 662: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 661'

&

$

%

A.34 Informal Sensitivity Analysis for Inequality

Constrained problems

When I choose an inactive constraint i /∈ A(x∗) such that

ci(x∗) > 0, the solution x∗ and function value f(x∗) are quite

indifferent to whether this constraint is present or not. If I perturb

ci by a tiny amount, it will still be inactive and x∗ will still be a

local solution of the optimisation problem. Since λ∗i = 0 from

(7.19e), the Lagrange multiplier indicates accurately that

constraint i is not significant.

Page 663: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 662'

&

$

%

Suppose instead that constraint i is active, and I perturb the

right-hand-side of this constraint a little, requiring, say, that

ci(x) ≥ −ε instead of ci(x) ≥ 0. Note:

• ε > 0 corresponds to “weakening” the constraint (making the

feasible region bigger) and ε < 0 to “tightening” it.

• I expect that weakening the constraint will decrease the value

of the optimal f(x∗(ε)) as the minimum over a larger set will be

smaller (or the same).

Suppose that ε is sufficiently small that the perturbed solution

x∗(ε) still has the same set of active constraints, and that the

Lagrange multipliers are not much affected by the perturbation.

I then find that for all j ∈ A(x∗) with j 6= i;

−ε = ci(x∗(ε)) − ci(x

∗) ≈ (x∗(ε) − x∗)T∇ci(x∗),

0 = cj(x∗(ε)) − cj(x

∗) ≈ (x∗(ε) − x∗)T∇cj(x∗).

Page 664: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 663'

&

$

%

The value of f(x∗(ε)), meanwhile, can be estimated with the help of

(7.22a). I have

f(x∗(ε)) − f(x∗) ≈ (x∗(ε) − x∗)T∇f(x∗)

=∑

j∈A(x∗)

λ∗j (x∗(ε) − x∗)T∇cj(x∗)

≈ −ελ∗i .

Dividing across by ε and taking limits as ε→ 0, I see that the

family of solutions x∗(ε) satisfies

df(x∗(ε))

dε= −λ∗i (A.107)

a simplified version of (7.28).

Page 665: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 664'

&

$

%

So this simple sensitivity analysis of this problem concludes that:

• If λ∗i is large, then the optimal value is sensitive to the

placement of the ith constraint,

• If this quantity is small, the dependence is weak.

• If λ∗i is exactly zero for some active constraint, small

perturbations to ci in some directions will hardly affect the

optimal objective value at all; the change is zero, to first order.

Page 666: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 665'

&

$

%

A.35 The Bord Gais Uplift

Problem—Introduction

I briefly introduced this problem in the Introduction to these

Notes. I’ll repeat the preamble here for completeness before going

into the details.

• Each day the Electricity Regulator assigns to each of the 100+

electricity generators large and small a production schedule for

the next day based on projected demand.

• The is a (hard) mixed Integer Linear program.

– Fortunately I don’t need to solve it.

• The Regulator does this on the basis of (honestly) stated costs

fixed and marginal costs provided by the generators.

• After each day (more or less) the Regulator is required to apply

a correction to the half-hourly electricity price for the day to

Page 667: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 666'

&

$

%

ensure that all generators at least have their fixed and marginal

costs met — as the actual amounts provided may not equal

those specified in the schedule.

• The method for doing this is unusual!

• The Regulator solves a “Quadratic program” (QP):

minUPh,h=1...48

F(UPh) ≡ α∑h

[(SPh +UPh)

∑g

Qgh

]+β∑h

UP2h

(A.108)

subject to∑h

[(SPh +UPh)Qgh] ≥ CRg, for g = 1 . . . G (A.109)

UPh ≥ 0, for h = 1 . . . 48 (A.110)

where G is the number of generators, approximately 130.

• The symbols:

Page 668: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 667'

&

$

%

– SPh stands for the “Shadow prices”, the marginal price of

electricity per MWhr in each (half-)hour based on the

information provided by the generators.

– UPh stands for the “uplift”, the correction factor that is

applied retrospectively to the shadow prices.

– Qgh stands for the volume (quantity) of electricity provided

by each generator in each (half-)hour.

• The constraints ensure that:

– The constraints ensure that each generator “covers their

costs”.

– and that the uplifts are non-negative.

• The above can be written in a Matlab-like notation as

minu∈R48

F(u) ≡ αeTQ(s+ u) + βuTu (A.111)

Page 669: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 668'

&

$

%

where e is a column vector of size G of ones. and subject to

Q(s+ u) ≥ c (A.112)

u ≥ 0 (A.113)

A.35.1 Solving the QP

• The Regulator solves the QP — easily done in a fraction of a

second — for example with Matlab.

• But Bord Gais want to understand the solutions.

A.35.2 KKT equations

• The first-order necessary condition for x to be a local minimum

of the unconstrained minimisation problem minx∈R

f(x) is that

f ′(x) = 0.

Page 670: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 669'

&

$

%

• The corresponding condition on Rn for x to be a local

minimum of the unconstrained minimisation problem minx∈Rn

f(x)

is that the gradient (the vector of first partial derivatives) of f

is zero — ∇f(x) = 0.

• The condition on Rn for x to be a local minimum of the

constrained minimisation problem minx∈Rn

f(x) is that the

gradient of the Lagrangian L (a combination of f and the

constraints) is zero — ∇L(x) = 0.

A.35.3 The KKT Equations for the QP

• Calculating the gradients wrt u gives:

αQTe+ 2βu−QTλ− µ = 0 (A.114)

where λg ≥ 0 for g = 1 . . . G and µh ≥ 0 for h = 1 . . . 48 and

Page 671: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 670'

&

$

%

also λg and µh are zero when the corresponding constraints are

inactive.

• It can be shown that the multipliers µh must all be zero.

• For a convex QP (which the present problem is) the KKT

conditions are both necessary and sufficient for optimality —

and the multipliers are unique.

A.35.4 Analysis

• I can write (A.114) as

2βu = −αQTe+QTλ. (A.115)

• If (as the Regulator has decreed) α = 0 and β = 1 if several

Page 672: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 671'

&

$

%

generation constraints (say g ∈ Ag0) to bind then I have

u =1

2

∑g∈Ag0

λg (qg) . (A.116)

• The λg must (as part of the necessary conditions) all be

non-negative.

• The binding constraints now take the form

(Qu)g = cg − (Qs)g for g ∈ Ag0 .

A.35.5 Significance of the KKT necessary/sufficient

condition

The optimal uplifts in any day must satisfy:

u =1

2

∑g∈Ag0

λg (qg) . (A.117)

Page 673: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 672'

&

$

%

• So the optimal set of uplifts u found by the Regulator must be

a non-negative linear combination of the columns of QT (rows

of Q) corresponding to the binding generation constraints.

• Of course I don’t know until the problem is solved which

generation constraints are binding.

• So of what use is the result?

• I should check (over the year for which the system has been

operating) which generation constraints have been binding in

each 24-hour period.

Page 674: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 673'

&

$

%Figure 31: Recurrence of Binding Generators

• There is a very clear band structure in the Figure.

Page 675: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 674'

&

$

%

• A small subset of “usual suspect” generators are clearly

binding from day to day.

• Which?

Page 676: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 675'

&

$

%

Sheet1

Page 1

Type Binding FrequencyGas CCGT 199Oil 86Distillate 58Coal 52

48Hydro 4Wind 0Pumped Storage 0Peat 0

0

Gas Peaker

Interconnector

Gas CCGT

Oil

Distillate

Coal

Gas Peaker

Hydro

Wind

Pumped Storage

Peat

Interconnector

0 50 100 150 200 250

Binding Frequency

Figure 32: Frequency of binding by generator type

Page 677: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 676'

&

$

%

It appears that it is almost always the large thermal plants that

have binding generation constraints.

• Of the small subset of generators that are clearly binding from

day to day —

• How many generators are typically binding?

Page 678: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 677'

&

$

%

Sheet1

Page 1

0 321 1792 1353 374 75 5

NrBinding Occurances

1 2 3 4 5 6

0

20

40

60

80

100

120

140

160

180

NrBindingOccurances

Figure 33: Frequency of binding by generator type

Page 679: Course Notes for MS4327 Optimisationjkcray.maths.ul.ie/ms4327/Slides.pdfMS4327 Optimisation 4 ’ & $ % Attendance at lectures and tutorials will be recorded. The course will be assessed

MS4327 Optimisation 678'

&

$

%

A.35.6 Preliminary Conclusions From KKT Analysis

Bord Gais state:

• It (study) was a perfect example of how to apply a

sophisticated mathematical technique to get a clear and clean

explanation of something that was previously an opaque black

box to us and to the market as a whole

• It was a real insight to learn that uplift is just a linear

combination of the output of one or two generators on most

days.

• And to classify which generators those were.