Home Laboratory Computer Lab Theses

2.9 Numerical methods for nonlinear programming problems

Nowadays, strong and efficient mathematical programming techniques are available for solving a great variety of nonlinear problems, which are based on solid theoretical results and extensive numerical studies. Approximated functions, derivatives and optimal solutions can be employed together with optimization algorithms to reduce the computational time. The aim of this section is not to describe state-of-the-art algorithms in nonlinear programming, but to explain, in a simple way, a number of modern algorithms for solving nonlinear problems. These techniques are typically iterative in the sense that, given an initial point x0 , a sequence of points, {xk} , is obtained by repeated application of an algorithmic rule. The objective is to make this sequence converge to a point x¯ in a pre-specified solution set. Typically, the solution set is specified in terms of optimality conditions, such as those presented in 2.5 through 2.8.

We start by recalling a number of concepts in 2.9.1. Then, we discuss the principles of Newton-like algorithms for nonlinear systems in 2.9.2, and use these concepts for the solution of unconstrained optimization problems in 2.9.3. Finally, algorithms for solving general nonlinear problems are presented in 2.9.7, with emphasizes on sequential unconstrained minimization (SUM) and sequential quadratic programming (SQP) techniques.

2.9.1 Preliminaries

Two essential questions must be addressed concerning iterative algorithms. The first question, which is qualitative in nature, is whether a given algorithm in some sense yields, at least in the limit, a solution to the original problem; the second question, the more quantitative one, is concerned with how fast the algorithm converges to a solution. We elaborate on these concepts in this subsection.

The convergence of an algorithm is said to be asymptotic when the solution is not achieved after a finite number of iterations; except for particular problems such as linear and quadratic programming, this is generally the case in nonlinear programming. That is, a very desirable property of an optimization algorithm is global convergence:

Definition 2.23: Global Convergence, Local Convergence

An algorithm is said to be globally convergent if, for any initial point x0 , it generates a sequence of points that converges to a point x¯ in the solution set. It is said to be locally convergent if there exists a ρ>0 such that for any initial point x0 such that x¯x0<ρ it generates a sequence of points converging to x¯ in the solution set.

Most modern mathematical programming algorithms are globally convergent. Locally convergent algorithms are not useful in practice because the neighborhood of convergence is not known in advance and can be arbitrarily small.

Next, what distinguishes optimization algorithms with the global convergence property is the order of convergence:

Definition 2.24: Order of Convergence

The order of convergence of a sequence {xk}x¯ is the largest nonnegative integer p such that

limkxk+1x¯xkx¯p=β<

When p=1 and the convergence ratio β<1 , the convergence is said to be linear; if β=0 , the convergence is said to be superlinear. When p=2 , the convergence is said to be quadratic.

Since they involve the limit when k , p and β are a measure of the asymptotic rate of convergence, i.e., as the iterates gets close to the solution; yet, a sequence with a good order of convergence may be very ”slow” far from the solution. Clearly, the convergence is faster when p is larger and β is smaller. Near the solution, if the convergence rate is linear, then the error is multiplied by β at each iteration. The error reduction is squared for quadratic convergence, i.e., each iteration roughly doubles the number of significant digits. The methods that will be studied hereafter have convergence rates varying between linear and quadratic.

Example 2.19. Consider the problem to minimizef(x)=x2 , subject tox1 .

Let the (point-to-point) algorithmic map1 be defined defined as1(x)=12(x+1) . It is easily verified that the sequence obtained by applying the map1 , with any starting point, converges to the optimal solutionx=1 , i.e.,1 is globally convergent. For example, withx0=4 , the algorithm generates the sequence{4,2.5,1.75,1.375,1.1875,...} . We have(xk+11)=12(xk1) , so that the limit in Definition 2.24isβ=12 withp=1 ; moreover, forp>1 , this limit is infinity. Consequently,xk1 linearly with convergence ratio12 .

On the other hand, consider the (point-to-point) algorithmic map2 be defined defined as2(x;k)=1+12k+1(x1) . Again, the sequence obtained by applying2 converges tox=1 , from any starting point. However, we now have|xk+11||xk1|=12k , which approaches0 ask . Hence,xk1 superlinearly in this case. Withx0=4 , the algorithm generates the sequence{4,2.5,1.375,1.046875} . The algorithmic maps1 and2 are illustrated on the left and right plots in Fig 1.14., respectively.

It should also be noted that for most algorithms, the user must set initial values for certain parameters, such as the starting point and the initial step size, as well as parameters for terminating the algorithm. Optimization procedures are often quite sensitive to these parameters, and may produce different results, or even stop prematurely, depending on their values. Therefore, it is crucial for the user to understand the principles of the algorithms used, so that he or she can select adequate values for the parameters and diagnose the reasons of a premature termination (failure).

2.9.2 Newton-like Algorithms for nonlinear Systems

The fundamental approach to most iterative schemes was suggested over 300 years ago by Newton. In fact, Newton’s method is the basis for nearly all the algorithms that are described herein.

Suppose one wants to find the value of the variable xnx such that

ϕ(x)=0

where ϕ:nxnx is continuously differentiable. Let us assume that one such solution exists, and denote it by x . Let also x be a guess for the solution. The basic idea of Newton’s method is to approximate the nonlinear function ϕ by the first two terms in its Taylor series expansion about the current point x . This yields a linear approximation for the vector function ϕ at the new point x¯ ,

ϕ(x¯)=ϕ(x)+ϕx[x¯x]=ϕ(x)+ϕ(x)[x¯x]

Using this linear approximation, and provided that the Jacobian matrix ϕx is nonsingular, a new estimate for the solution x can be computed by solving the previous equation for ϕ(x)=0

x¯=x(ϕx|x)1ϕ(x)

Letting d=(ϕx|x)1ϕ(x) , we get the update x¯=x+d .

Of course, ϕ being a nonlinear function, one cannot expect that ϕ(x¯)=0 , but there is much hope that x¯ be a better estimate for the root x than the original guess x . In other words, we might expect that

x¯xxxandϕ(x¯)ϕ(x)

If the new point is an improvement, then it makes sense to repeat the process, thereby defining a sequence of points {x0,x1,} . An algorithm implementing Newton’s method is as follows:

Algorithm 2.1

Initialization Step:

Let 𝜖>0 be a termination scalar, and choose an initial point x0 .

Let k=0 and go to the main step.

Main Step:

  • Solve the linear system (ϕx|xk)dk=ϕ(xk) for dk .
  • Compute the new estimate xk+1=xk+dk
  • If ϕ(xk+1)<𝜖 , stop; otherwise, replace kk+1 , and go to step 1.

It can be shown that the rate of convergence for Newton’s method is quadratic (see Definition 2.24). Loosely speaking, it implies that each successive estimate of the solution doubles the number significant digits, which is a very desirable property for an algorithm to possess.

Theorem 2.21: Quadratic convergence for Newton’s algorithm

Let ϕ:nxnx be continuously differentiable, and consider Newton’s algorithm defined by the map (x):=xϕ(x)ϕ(x) . Let x be such that ϕ(x)=0 , and suppose that ϕ(x) is nonsingular. Let the starting point x0 be sufficiently close to x , so that there exist c1,c2>0 with c1c2x0x<1 , and

ϕ(x)Tc1aaFor a rectangular matrix An×m we define the operator norm A=sup{Ax,xmsuch thatx=1}ϕ(x)ϕ(x)ϕ(x)[xx]c2xx2

for each x satisfying xxxx0 . Then, Newton’s algorithm converges with a quadratic rate of convergence.

Proof. See [6, Theorem 8.6.5] for a proof. □

But can anything go wrong with Newton’s method?

Lack of Global Convergence First and foremost, if the initial guess is not sufficiently close to the solution, i.e., within the region of convergence, Newton’s method may diverge. Said differently, Newton’s method as presented above does not have the global convergence property (see Definition 2.23 and Example 2.20 hereafter). This is because dk:=ϕ(xk)ϕ(xk) may not be a valid descent direction far from the solution, and even if , a unit step size might not give a descent in ϕ . Globalization strategies, which aim at correcting this latter deficiency, will be presented in 2.9.4 in the context of unconstrained optimization.

Singular Jacobian Matrix A second difficulty occurs when the Jacobian matrix ϕ(xk) becomes singular during the iteration process, since the correction defined by the Newton’s algorithm is not defined in this case. Note that the assumption in Theorem 2.21 guarantees that ϕ(x) cannot be singular. But when the Jacobian matrix is singular at the solution point x , then Newton’s method looses its quadratic convergence property.

Computational Efficiency Finally, at each iteration, Newton’s method requires (i) that the Jacobian matrix ϕ(xk) be computed, which may be difficult and/or costly especially when the expression of ϕ(x) is complicated, and (ii) that a linear system be solved. The analytic Jacobian can be replaced by a finite-difference approximation, yet this is costly as nx additional evaluations of ϕ are required at each iteration. With the objective of reducing the computational effort, quasi-Newton methods generate an approximation of the Jacobian matrix, based on the information gathered from the iteration progress. To avoid solving a linear system for the search direction, variants of quasi-Newton methods also exist that generate an approximation of the inverse of the Jacobian matrix. Such methods will be described in 2.9.5 in the context of unconstrained optimization.

Example 2.20. Consider the problem to find a solution to the nonlinear equation

f(x)=arctan(x)=0

The Newton iteration sequence obtained by starting fromx0=1 is as follows:

̲̲̲kxk|f(xk)|̲̲̲010.78539810.5707960.51866920.1168600.11633231.061022×1031.061022×10347.963096×10107.963096×1010̲̲̲

Notice the very fast convergence to the solutionx=0 , as could be expected from Theorem 2.21. The first three iterations are represented in Fig. 1.15., on the left plot.

However, convergence is not guaranteed for any initial guess. More precisely, it can be shown that Newton’s method actually diverges when the initial guess is chosen such that|x0|>α , withα=1.3917452002707 being a solution ofarctan(z)=2z1+z2 ; further, the method cycles indefinitely forx0=α . Both these situations are illustrated in the right plot and the bottom plot of Fig. 1.15., respectively.

2.9.3 Unconstrained Optimization

We now turn to a description of basic techniques used for iteratively solving unconstrained problems of the form:

minf(x)xnx

Many unconstrained optimization algorithms work along the same lines. Starting from an initial point, a direction of movement is determined according to a fixed rule, and then a move is made in that direction so that the objective function value is reduced; at the new point, a new direction is determined and the process is repeated. The main difference between these algorithms rest with the rule by which successive directions of movement are selected. A distinction is usually made between those algorithms which determine the search direction without using gradient information (gradient-free methods), and those using gradient (and higher-order derivatives) information (gradient-based methods). Here, we shall focus our attention on the latter class of methods, and more specifically on Newton-like algorithms.

Throughout this subsection, we shall assume that the objective function f is twice continuously differentiable. By theorem 2.3, a necessary condition for x to be a local minimum of f is f(x)=0 . Hence, the idea is to devise an iterative scheme that finds a point satisfying the foregoing condition. Following the techniques discussed earlier in 2.9.2, this can be done by using a Newton-like algorithm, with ϕ corresponding to the gradient f of f , and ϕ to its Hessian matrix 2f .

At each iteration, a new iterate xk+1 is obtained such that the linear approximation to the gradient at that point is zero,

f(xk+1)f(xk)+2f(xk)[xk+1xk]=0

The linear approximation yields the Newton search direction:

dk:=xk+1xk=2f(xk)1f(xk)

As discussed in 2.9.2, if it converges, Newton’s method exhibits a quadratic rate of convergence when the Hessian matrix 2f(x) is nonsingular at the solution point. However, since the Newton iteration is based on finding a zero of the gradient vector, there is no guarantee that the step will move towards a local minimum, rather than a saddle point or even a maximum. To preclude this, the Newton steps should be taken downhill, i.e., the following descent condition should be satisfied at each iteration,

f(xk)dk<0

Interestingly enough, with the Newton direction iteration, the descent condition becomes

f(xk)2f(xk)1f(xk)<0

That is, a sufficient condition to obtain a descent direction at xk is that the Hessian matrix 2f(xk) be positive definite. Moreover, if 2f(x) is positive definite at a local minimizer x of f , then the Newton iteration converges to x when started sufficiently close to x . (Recall that, by Theorem 2.8, positive definiteness of 2f(x) is a sufficient condition for a local minimum of f to be a strict local minimum.)

We now discuss two important improvements to Newton’s method, which are directly related to the issues discussed in Subsection 2.9.2, namely (i) the lack of global convergence, and (ii) computational efficiency.

2.9.4 Globalization Strategies

Up to this point, the development has focused on the application of Newton’s method. However, even in the simplest one-dimensional applications, Newton’s method has deficiencies (see, e.g., Example 2.20). Methods for correcting global convergence deficiencies are referred to as globalization strategies. It should be stressed than an efficient globalization strategy should only alter the iterates when a problem is encountered, but it should not impede the ultimate behavior of the method, i.e., the quadratic convergence of a Newton’s method should be retained.

In unconstrained optimization, one can detect problems in a very simple fashion, by monitoring whether the next iterate xk+1 satisfies a descent condition with respect to the actual iterate xk , e.g., f(xk+1)<f(xk) . Then, either one of two globalization strategies can be used to correct the Newton step. The first strategy, known as line search method, is to alter the magnitude of the step; the second one, known as trust region method, is to modify both the step magnitude and direction. We shall only concentrate on the former class of globalization strategies subsequently.

A line search method proceeds by replacing the full Newton step xk+1=xk+αdk with

xk+1=xk+αdk

where the step-length α0 is chosen such that the objective function is reduced,

f(xk+αdk)<f(xk)

Clearly, the optimal choice for α would be α=argmin{l(α)=f(xk+αdkα0} . The resulting minimization problem can be solved by any one-dimensional exact minimization technique (e.g., Newton’s method itself). However, such techniques are costly in the sense that they often require many iterations to converge and, therefore, many function (or even gradient) evaluations.

In response to this, most modern algorithms implement so-called inexact line search criteria, which aim to find a step-length giving an ”acceptable” decrease in the objective function. Note that sacrificing accuracy, we might impair the convergence of the overall algorithm that iteratively employs such a line search. However, by adopting a line search that guarantees a sufficient degree of descent in the objective function, the convergence of the overall algorithm can still be established.

We now describe one popular definition of an acceptable step-length known as Armijo’s rule. Other popular approaches are the quadratic and cubic fit techniques, as well as Wolfe’s and Glodstein’s tests. Armijo’s rule is driven by two parameters 0<κ1<1 and κ2>1 , which respectively manage the acceptable step-length from being too large or too small (Typical vales are κ1=0.2 and κ2=2 ). Define the line search function l(α):=f(xk+αdk) , for α0 , and consider the modified first-order approximation l^(α)=l(0)+κ1αl(0) . A step-length α¯(0,1) is deemed acceptable if the following conditions hold:

l(α¯)l¯(α¯)l(κ2α¯)l^(κ2α¯)

The first condition prevents the step-length α¯ from being too large, whereas the second condition prevents α¯ from being too small. The acceptable region defined by the Armijo’s rule is shown in Fig. 1.16. below.

2.9.5 Recursive Updates

Another limitation of Newton’s method when applied to unconstrained optimization problems is that the Hessian matrix of the objective function is needed at each iteration, then a linear system must be solved for obtaining the search direction. For many applications, this can be a costly computational burden. In response to this, quasi-Newton methods attempt to construct this information recursively. However, by so doing, the quadratic rate of convergence is lost.

The basic idea for many quasi-Newton methods is that two successive iterates xk,xk+1 together with the corresponding gradients f(xk),f(xk+1) , yield curvature information by means of the first-order approximation relation

f(xk+1)=f(xk)+2f(xk)dk+o(d)

with dk=xk+1xk . In particular, given nx linearly independent iteration increments δ0,,δnx1 an approximation of the Hessian matrix can be obtained as

2f(xnx)[γ0γnx1][d0dnx1]1

or for the inverse Hessian matrix as

2f(xnx)[d0dnx1][γ0γnx1]1

where γk=f(xk+1)f(xk)

Note that when the objective function is quadratic, the previous relations are exact. Many interesting quasi-Newton methods use similar ways, although more sophisticated, to construct an approximate Hessian matrix Bk that progressively approaches the inverse Hessian. One of the most popular class of quasi-Newton methods (known as the Broyden family) proceeds as follows:

Bk+1:=Bk+dkdkdkγkBkγkγkBkγkBkγk++ξγkBkγk(dkdkγkBkγkγkBkγk)(dkdkγkBkγkγkBkγk)

where 0ξ1 . It is easily seen that when supplemented with a line search strategy, dkγk<0 at each k , and hence the Hessian matrix approximations are guaranteed to exist. Moreover, it can be shown that the successive approximates remain positive definite provided that B0 is itself positive definite.

By setting ξ=0 , the previous equation yields the Davidon-Fletcher-Powell (DFP) method, which is historically the first quasi-Newton method, while setting ξ=1 gives the Broyden-Fletcher-Goldfard-Shanno (BFGS) method, for which there is substantial evidence that it is the best general purpose quasi-Newton method currently known.

2.9.6 Summary

A Newton-like algorithm including both a line search method (Armijo’s rule) and Hessian recursive update (DFP update) is as follows:

Algorithm 2.2

Initialization Step:

Let 𝜖>0 be a termination scalar, and choose an initial point x0Rnx and a symmetric, positive definite matrix B0nx×nx . Let k=0 , and go to the main step.

Main Step:

  • Search Direction - dk=Bkf(xk) .
  • Line Search - Find a step αk satisfying Armijo’s conditions.
  • Update - Compute the new estimates:
    xk+1:=xk+αkdkBk+1:=Bk+dkdkdkγkBkγkγkBkγkBkγk

    with dk:=xk+1xk and γk:=f(xk+1)f(xk)

  • If f(xk+1<𝜖 , stop; otherwise, replace kk+1 , and go to step 1.

The standard unconstrained optimization algorithm in MATLAB (i.e. the function fminunc) is an implementation of quasi-Newton’s method, with DFP or BFGS update, and a line search strategy.

Example 2.21. Consider the problem to find a minimum to Rosenbrock’s function

f(x)=(1x1)2+c(x2x12)2

forx2 withc:=105 . We solved this problem using the function fminunc .

The results are shown in Fig. 1.17. Observe the slow convergence of the iterates far from the optimal solutionx=(1,1) but the very fast convergence in the vicinity ofx .

2.9.7 Constrained Nonlinear Optimization

In this subsection, we turn our attention to algorithms for iteratively solving constrained problems of the form:

minf(x);xXnx

Many modern deterministic algorithms for constrained NLP problems are based on the (rather natural) principle that, instead of solving a difficult problem directly, one had better solve a sequence of simpler, but related, subproblems, which converges to a solution of the original problem either in a finite number of steps or in the limit. Working along these lines, two classes of algorithms can be distinguished for solution of NLP problems with equality and/or inequality constraints. On the one hand, penalty function and interior-point methods consist of solving the problem as a sequence of unconstrained problems (or problems with simple constraints), so that algorithms for unconstrained optimization can be used. These methods, which do not rely on the KKT theory described earlier in 2.6 through 2.8, shall be briefly presented in 2.9.8 and 2.9.9. On the other hand, Newton-like methods solve NLP problems by attempting to find a point satisfying the necessary conditions of optimality (KKT conditions in general). Sequential quadratic programming (SQP), which shall be presented in 2.9.10, represents one such class of methods.

2.9.8 Penalty Function Methods

Methods using penalty functions transform a constrained problem into a single unconstrained problem or a sequence of unconstrained problems. This is done by placing the constraints into the objective function via a penalty parameter in a way that penalizes any violation of the constraints. To illustrate it, consider the NLP problem:

minf(x) s.t. g(x)0h(x)=0xX

where Xnx , xnx and f:X , g:Xng and h:Xnh are defined on X .

In general, a suitable penalty function α(x) for the minimization problem is defined by:

α(x)=k=1ngϕ[gk(x)]+k=1nhψ[hk(x)]

where ϕ and ψ are continuous functions satisfying the conditions:

{ϕ(z)=0 if z0ϕ(z)>0otherwise and {ψ(z)=0 if z=0ψ(z)>0 otherwise

Typically, ϕ and ψ are of the forms

ϕ(z)=(max{0,z})p and ψ(z)=|z|p

with p a positive integer (taking p2 provides continuously differentiable penalty functions). The function f(x)+μα(x) is referred to as the auxiliary function.

Example 2.22. Consider the problem to minimizef(x)=x , subject tog(x)=x+20 . It is immediately evident that the optimal solution lies at the pointx=2 , and has objective valuef(x)=2 .

Now, consider the penalty problem to minimizef(x)+μα(x)=x+μmax{0,2x}2 in , whereμ is a large number. Note first that for anyμ , the auxiliary function is convex since it is sum of convex functions. Thus, a necessary and sufficient condition for optimality is that the gradient off(x)+μα(x) be equal to zero, yieldingxμ=212μ . Thus, the solution of the penalty problem can be made arbitrarily close to the solution of the original problem by choosingμ sufficiently large. Moreover,f(xμ)+μα(xμ)=214μ , which can also be made arbitrarily close tof(x) by takingμ sufficiently large. These considerations are illustrated in Fig. 1.18. below.

The conclusions of Example 2.22 that the solution of the penalty problem can be made arbitrarily close to the solution of the original problem, and the optimal auxiliary function value arbitrarily close to the optimal objective value, by choosing sufficiently large, is formalized in the following:

Theorem 2.22

Consider a general NLP problem, where f , g and h are continuous functions on nx and X is a nonempty set in nx . Suppose that the NLP problem has a feasible solution, and let α be a continuous penalty function. Suppose further that for each μ there exists a solution xμX to the problem min{f(x)+μα(x):xX} , and that {xμ} is contained in a compact subset of X . Then,

min{f(x):g(x)0,h(x)=0,xX}=supμ0𝜃(μ)=limμ𝜃(μ)

with 𝜃(μ):=f(xμ)+μα(xμ) . Furthermore, the limit x¯ of any convergent subsequence of {xμ} is an optimal solution to the original problem and μα(xμ)0 as μ .

Proof. See [6, Theorem 9.2.2] for a proof. □

Note that the assumption that X is compact is necessary, for it possible that the optimal objective values of the original and penalty problems are not equal otherwise. Yet, this assumption is not very restrictive in most practical cases as the variables usually lie between finite upper and lower bounds. Note also that no restriction is imposed on f , g and h other than continuity. However, the application of an efficient solution procedure for the (unconstrained) auxiliary problems may impose additional restriction on these functions (see 2.9.3).

Under the conditions that (i) f , g , h and ϕ , ψ are continuously differentiable, and (ii) x¯ is a regular point the solution to the penalty problem can be used to recover the Lagrange multipliers associated with the constraints at optimality. In the particular case where X=nx , we get

νiμ=μϕ[gi(xμ)]i𝒜(x¯)λiμ=μψ[hi(xμ)]i=1,,nh

The larger μ , the better the approximation of the Lagrange multipliers:

νμν and λμλ as μ

Example 2.23. Consider the same problem as in Example 1.71. The auxiliary functionf(x)+μα(x)=x+μmax{0,2x}2 being continuously differentiable, the Lagrange multiplier associated to the inequality constraintg(x)=x+20 can be recovered asνμ=2μmax{0,2x} (assumingμ>0 ). Note that the exact value of the Lagrange multiplier is obtained for eachμ>0 here, becauseg is a linear constraint.

From a computational viewpoint, superlinear convergence rates might be achievable, in principle, by applying Newton’s method (or its variants such as quasi-Newton methods). Yet, one can expect ill-conditioning problems when μ is taken very large in the penalty problem. With a large μ , more emphasis is placed on feasibility, and most procedures for unconstrained optimization will move quickly towards a feasible point. Even though this point may be far from the optimum, both slow convergence and premature termination can occur due to very small step size and finite precision computations (round-off errors).

As a result of the above mentioned difficulties associated with large penalty parameters, most algorithms using penalty functions employ a sequence of increasing penalty parameters. With each new value of the penalty parameter, an optimization technique is employed, starting with the optimal solution corresponding to the previously chosen parameters value. Such an approach is often referred to as sequential unconstrained minimization (SUM) technique. This way, a sequence of infeasible points is typically generated, whose limit is an optimal solution to the original problem (hence the term exterior penalty function approach).

To conclude our discussion on the penalty function approach, we give an algorithm to solve a general NLP problem, where the penalty function used are of the form specified by ϕ and ψ

Algorithm 2.3

Initialization Step:

Let 𝜖>0 be a termination scalar, and choose an initial point x0 , a penalty parameter μ0>0 , and a scalar β>1 . Let k=0 and go to the main step.

Main Step:

  • Starting with xk , get a solution to the problem:
    xk+1argmin{f(x)+μkα(x):xX}
  • If μkα(xk+1)<𝜖 , stop; otherwise, let μk+1=βμk , replace kk+1 , and go to step 1.

2.9.9 Interior-Point Methods

Similar to penalty functions, barrier functions can also be used to transform a constrained problem into an unconstrained problem (or into a sequence of unconstrained problems). These functions act as a barrier and prevent the iterates from leaving the feasible region. If the optimal solution occurs at the boundary of the feasible domain, the procedure moves from the interior to the boundary of the domain, hence the name interior-point methods. To illustrate these methods, consider the NLP problem:

minxf(x) s.t. g(x)0xX

where X is a subset of nx , and f:X , g:Xng are continuous on nx . Note that equality constraints, if any, should be accommodated within the set X . (In the case of affine equality constraints, one can possibly eliminate them after solving for some variables in terms of the others, thereby reducing the dimension of the problem.) The reason why this treatment is necessary is because barrier function methods require the set {xnx:g(x)<0} to be nonempty; this would obviously be not possible if the equality constraints h(x)=0 were accommodated within the set of inequalities as h(x)0 and h(x)0 .

A barrier problem formulates as:

infμ𝜃(μ) s.t. μ>0

where 𝜃(μ):=inf{f(x)+μb(x):g(x)<0,xX} . Ideally, the barrier function b should take value zero on the region {x:g(x)0} , and value on its boundary. This would guarantee that the iterates do not leave the domain {x:g(x)0} provided the minimization problem started at an interior point. However, this discontinuity poses serious difficulties for any computational procedure. Therefore, this ideal construction of b is replaced by the more realistic requirement that b be nonnegative and continuous over the region {x:g(x)0} and approach infinity as the boundary is approached from the interior:

b(x)=k=1ngϕ[gk(x)]

where ϕ is a continuous function over {z:z<0} that satisfies the conditions

{ϕ(z)0 if z<0limz0ϕ(z)=+

In particular, μb approaches the ideal barrier function described above as μ approaches zero.

Typically barrier functions are

b(x)=k=1ng1gk(x) or b(x)=k=1ngln[min{1,gk(x)}]

The following barrier function, known as Frisch’s logarithmic barrier function, is also widely used

b(x)=k=1ngln[gk(x)]

Actually the Frisch’s logarithmic barrier ϕ(z)=ln(z) does not satisfy the nonnegativity requirement for z<1 . However the requirement on ϕ can be relaxed and it is sufficient that ϕ be positive close to z=0 .

The function f(x)+μb(x) is referred to as the auxiliary function.

Given μ>0 , evaluating 𝜃(μ)=inf{f(x)+μb(x):g(x)<0,xX} seems no simpler than solving the original problem because of the constraint g(x)<0 . However, starting the optimization from a point in the region S:={x:g(x)<0}X yields an optimal point in S , even when the constraint g(x)<0 is ignored. This is because b approaches infinity as the iterates approach the boundary of {x:g(x)0} from within S , hence preventing them from leaving the set S . This is formalized in the following:

Theorem 2.23

Consider a NLP problem with inequality constraints , where f and g are continuous functions on nx and X is a nonempty closed set in nx . Suppose that the minimization problem has an optimal solution x with the property that, given any neighborhood η(x) around x , there exists an xXη(x) such that g(x)<0 . Suppose further that for each μ , there exists a solution xμX to the problem min{f(x)+μb(x):xX} . Then,

min{f(x):g(x)0,xX}=limμ0+𝜃(μ)=infμ>0𝜃(μ)

with 𝜃(μ):=f(xμ)+μb(xμ) . Furthermore, the limit of any convergent subsequence of {xμ} is an optimal solution to the original problem, and μb(xμ)0 as μ0+ .

Proof. See [6, Theorem 9.4.3] for a proof. □

Under the conditions that (i) f , g and ϕ are continuously differentiable, and (ii) x is a regular point, the solution to the barrier function problem can be used to recover the Lagrange multipliers associated with the constraints at optimality. In the particular case where X=nx , we get:

νiμ=μϕ[gi(xμ)]i𝒜(x)

The approximation of the Lagrange multipliers, gets better as μ gets closer to 0 ,

νμν as μ0+

Example 2.24. Consider the problem to minimizef(x)=x , subject tog(x)=x+20 , the solution of which lies at the pointx=2 with objective valuef(x)=2 . Now, consider the barrier function problem to minimizef(x)+μb(x)=xμ2x in , whereμ is a large number. Note first that for anyμ , the auxiliary function is convex 1 1 μ2x is a concave function on the convex setS:={x,x2} , thereforeμ2x is convex and thusf(x)+μb(x) is sum of convex functions. . Thus, a necessary and sufficient condition for optimality is that the gradient off(x)+μb(x) be equal to zero, yieldingxμ=2+μ (assumingμ>0 ). Thus, the solution of the penalty problem can be made arbitrarily close to the solution of the original problem by choosingμ sufficiently close to zero. Moreover,f(xμ)+μb(xμ)=2+2μ , which can also be made arbitrarily close tof(x) by takingμ sufficiently close to zero. These considerations are illustrated in Fig. 1.19. below. Regarding the Lagrange multiplier associated to the inequality constraintg(x)=x+20 , the objective and constraint functions being continuously differentiable, an approximate value can be obtained asνμ=μ(2xμ)2=1 . Here again, the exact value of the Lagrange multiplier is obtained for eachμ>0 becauseg is a linear constraint.

The use of barrier functions for solving constrained NLP problems also faces several computational difficulties. First, the search must start with a point xX such that g(x)<0 , and finding such a point may not be an easy task for some problems. Also, because of the structure of the barrier function b , and for small values of the parameter μ , most search techniques may face serious ill-conditioning and difficulties with round-off errors while solving the problem to minimize f(x)+μb(x) over xX , especially as the boundary of the region {x:g(x)0} is approached. Accordingly, interior-point algorithms employ a sequence of decreasing penalty parameters {μk}0 as k ; with each new value μk , an optimal solution to the barrier problem is sought by starting from the previous optimal solution. As in the exterior penalty function approach, it is highly recommended to use suitable second-order Newton or quasi-Newton methods for solving the successive barrier problems.

We describe below a scheme using barrier functions for optimizing a NLP problem.

Algorithm 2.4

Initialization Step:

Let 𝜖>0 be a termination scalar, and choose an initial point x0 , with g(x0)<0 . Let μ0>0 , β(0,1) , k=0 , and go to the main step.

Main Step:

  • Starting with xk , get a solution to the problem:
    xk+1argmin{f(x)+μkb(x):xX}
  • If μkb(xk+1)<𝜖 , stop; otherwise, let μk+1=βμk , replace kk+1 , and go to step 1.

Note that although the constraint g(x)<0 may be ignored, it is considered in the problem formulation as most line search methods use discrete steps, and a step could lead to a point outside the feasible region (where the value of the barrier function is a large negative number), when close to the boundary. Therefore, the problem can effectively be treated as an unconstrained optimization problem only if an explicit check for feasibility is made.

In recent years, there has been much excitement because some variants of the interior-point algorithm can be shown to be polynomial in time for many classes of convex programs. Moreover, interior-point codes are now proving to be highly competitive with codes based on other algorithms, such as SQP algorithms presented subsequently. A number of free and commercial interior-point solvers are given in Tab. 1.1. below.

2.9.10 Sequential Quadratic Programming

Sequential quadratic programming (SQP) methods, also known as successive, or recursive, quadratic programming, employ Newton’s method (or quasi-Newton methods) to directly solve the KKT conditions for the original problem. As a result, the accompanying subproblem turns out to be the minimization of a quadratic approximation to the Lagrangian function subject to a linear approximation to the constraints. Hence, this type of process is also known as a projected Lagrangian, or the Newton-Lagrange, approach. By its nature, this method produces both primal and dual (Lagrange multiplier) solutions.

To present the concept of SQP, consider first the equality constrained nonlinear program:

minxf(x) s.t. h(x)=0

where xnx , and f:nx , h:nxnh are twice continuously differentiable. We shall also assume throughout that the equality constraints are linearly independent at a solution x . (The extension for including inequality constraints is considered subsequently.)

By Theorem 2.13, the first-order necessary conditions of optimality for an equality constrained NLP require a primal solution xnx and a Lagrange multiplier vector λnh such that:

0=x(x,λ)=f(x)+h(x)λ0=λ(x,λ)=h(x)=0

where (x,λ):=f(x)+λh(x) . Now, consider a Newton-like method to solve the latter system of nx+nh nonlinear equations. Given an iterate (xk,λk) , a new iterate (xk+1,λk+1) is obtained by solving the first-order approximation:

0=(x(xk,λk)λ(xk,λk))+(xx2(xk,λk)h(xk)h(xk)0)(xk+1xkλk+1λk)

Substituting x(xk,λk)=f(xk)+h(xk)λk , the first row of the system of equations is:

xx2(xk,λk)[xk+1xk]+h(xk)[λk+1λk]+f(xk)+h(xk)λk=0

The Lagrange multiplier λk can be simplified and thus:

xx2(xk,λk)[xk+1xk]+h(xk)λk+1+f(xk)=0

The second row of the system of equations is independent of the Lagrange multipliers, it is:

h(xk)[xk+1xk]+h(xk)=0

Therefore the system can be simplified as:

(xx2(xk,λk)h(xk)h(xk)0)(dkλk+1)=(f(xk)h(xk))

Where we have defined the Newton step on x as dk=xk+1xk . The simplified system can be solved for (dk,λk) if a solution exists. Setting xk+1:=xk+dk , and incrementing k by 1 , we can then repeat the process until dk=0 happens to solve the linear system. When this occurs, if at all, we shall have found a stationary point to the equality constrained NLP.

Interestingly enough, a quadratic programming (QP) minimization subproblem can be employed in lieu of the foregoing linear system to find any optimal solution for the linearized NLP problem. Given (xk,λk) we define the subproblem QP(xk,λk) as:

mindkf(xk)+f(xk)dk+12dkxx2(xk,λk)dk s.t. h(xk)+h(xk)dk=0

First, note that an optimum dk to QP(xk,λk) , if it exists, together with the set of Lagrange multipliers λk+1 associated with the linearized constraints satisfies the linearized KKT conditions. Second, the objective function of QP(xk,λk) represents not just a quadratic approximation for f(x) but also incorporates an additional term 12dk{i=1nhλik2hi(xk)}dk to represent the curvature of the constraints.

Algorithm 2.5: SQP

Initialization Step:

Choose and initial primal/dual point (x0,λ0) , let k=0 , and go to the main step.

Main Step:

  • Solve the quadratic subproblem QP(xk,λk) to obtain a solution dk long with a set of Lagrange multipliers λk+1 .
  • If dk=0 , then (dk,λk+1) satisfies the stationarity conditions of the original NLP problem; stop. Otherwise, let xk+1:=xk+dk , replace kk+1 , and go to step 1.

In the case x is a regular stationary solution for the NLP problem which, together with a set of Lagrange multipliers λ , satisfies the second-order sufficiency conditions of Theorem 2.16, then the matrix

W:=(xx2(x,λ)h(x)h(x)0)

can be shown to be nonsingular. Hence, the above rudimentary SQP algorithm exhibits a quadratic rate of convergence by Theorem 2.21.

We now consider the inclusion of inequality constraints gi(x)0,i=1,,nh in the NLP problem, that is:

minxf(x) s.t. h(x)=0g(x)0

where the functions gi are twice continuously differentiable.

Given an iterate (xk,λk,νk) , where λk and νk0 are the Lagrange multiplier estimates for the equality and inequality constraints, respectively, consider the following QP subproblem as a direct extension of QP(xk,λk) :

mindkf(xk)+f(xk)dk+12dkxx2(xk,λk,νk)dk s.t. g(xk)+g(xk)dk0h(xk)+h(xk)dk=0

where (x,λ,ν):=f(x)+νg(x)+λh(x) . Note that the KKT conditions for QP(xk,λk,νk) require that, in addition to primal feasibility, Lagrange multipliers λk+1 , νk+1 be found such that:

f(xk)+xx2(xk,λk,νk)dk+g(xk)νk+1+h(xk)λk+1=0[g(xk)+g(xk)dk]νk+1=0

with νk+10 and λk+1 unrestricted in sign. Clearly, if dk=0 , then dk together with λk+1 , νk+1 yields a KKT solution to the NLP original problem. Otherwise, we set xk+1:=xk+dk as before, increment k by 1 , and repeat the process. Regarding convergence rate, it can be shown that if x is a regular KKT solution which, together with λ , ν satisfies the second-order sufficient conditions of Theorem 2.18, and if (x0,λ0,ν0) is initialized sufficiently close to (x,λ,ν) , then the foregoing iterative procedure shall exhibit a quadratic convergence rate.

The SQP method, as presented thus far, obviously shares the disadvantages of Newton’s method: (i) it requires second-order derivatives xx2 to be calculated, which in addition might not be positive definite, and (ii) it lacks the global convergence property.

  • Regarding second-order derivatives, a quasi-Newton positive definite approximation can be used for xx2 . For example, given a positive definite approximation Bk for xx2 , the quadratic problem QP(xk,λk,νk) can be solved with xx2 replaced by Bk . For example, an approximation of the inverse Hessian matrix can be obtained via a Broyden-like procedure, with γk given by
    γk:=(xk+1,λk+1,νk+1)(xk,λk+1,νk+1)

    It can be shown that this modification to the rudimentary SQP algorithm, similar to the quasi-Newton modification of Newton’s algorithm, looses the quadratic convergence rate property. Instead, it can be shown that the convergence is superlinear when initialized sufficiently close to a solution (x,λ,ν) that satisfies both regularity and second-order sufficiency conditions. However, this superlinear convergence rate is strongly based on the use of unit step sizes (see point (ii) below).

  • In order to remedy the global convergence deficiency, a globalization strategy can be used, e.g., a line search procedure. Unlike unconstrained optimization problems, however, the choice of a suitable line search or merit function providing a measure of progress is not obvious in the presence of constraints. Two such popular choices of a line search function are:
    • The 1 Merit Function:
      1(x;μ):=f(x)+μ[i=1nh|hi(x)|+i=1ngmax{0,gi(x)}]

      which satisfies the important property that x is a local minimizer of 1 , provided (x,λ,ν) satisfies the second-order sufficient conditions (see Theorem 2.18) and the penalty parameter μ is so chosen that μ>|λi| , i=1,,nh and μ>νi , i=1,,ng . Yet, the 1 merit function is not differentiable at those x with either gi(x)=0 or hi(x)=0 , and it can be unbounded below even though x is a local minimizer.

    • The 2 Augmented Lagrangian (ALAG) Merit Function:
      2(x,λ,ν;μ):=f(x)+i=1nhλihi(x)+μ2i=1nh[hi(x)]2+12i=1ngψi(x,ν;μ)

      with ψi(x,ν;μ):=1μ(max{0,νi+μgi(x)}2νi2) , has similar properties to the l1 merit function, provided μ is chosen large enough, and is continuously differentiable (although its Hessian matrix is discontinuous). Yet, for x to be a (local) minimizer of 2(x,λ,ν;μ) , it is necessary that λ=λ and ν=ν .

An SQP algorithm including the modifications discussed in (i) and (ii) is as follows:

Algorithm 2.6: Improved SQP

Initialization Step:

Choose and initial primal/dual point (x0,λ0,ν0) , with ν00 , and a positive definite matrix B0 . Let k=0 , and go to the main step.

Main Step:

  • Solve the quadratic subproblem QP(xk,λk,νk) , with
    xx2(xk,λk,νk) replaced by Bk , to obtain a direction dk along with a set of Lagrange multipliers (λk+1,νk+1) .
  • If dk=0 , then (dk,λk+1,νk+1) satisfies the KKT conditions of the original NLP problem; stop.
  • Find xk+1:=xk+αkdk , where αk improves 1(xk+αdk) over {α:α>0} [or any other suitable merit function]. Update Bk to a positive definite matrix Bk+1 [e.g., according to the quasi-Newton update]. Replace kk+1 , and go to step 1.

What Can Go Wrong?

The material presented up to this point was intended to give the reader an understanding of how SQP methods should work. Things do not go so smoothly in practice though. We now discuss a number of common difficulties that can be encountered, and suggest remedial actions to correct the deficiencies. Because real applications may involve more than a single difficulty, the user must be prepared to correct all problems before obtaining satisfactory performance from an optimization software.

  • Infeasible Constraints

    One of the most common difficulties occurs when the NLP problem has infeasible constraints, i.e., the constraints taken all together have no solution. Applying general-purpose SQP software to such problems typically produces one or more of the following symptoms:

    • one of the QP subproblem happen to be infeasible, which occurs when the linearized constraints have no solution;
    • many NLP iterations produce very little progress;
    • the penalty parameters μ of the merit functions growsvery large;
    • the Lagrange multipliers become very large.

    Although robust SQP software attempt to diagnose this situation, ultimately the only remedy is to reformulate the NLP.

  • Rank-Deficient Constraints

    In contrast to the previous situation, it is possible that the constraints be consistent, but the Jacobian matrix of the active constraints, at the solution point, be either ill-conditioned or rank deficient. This situation was illustrated in Examples 1.43 and 1.55. The application of general-purpose SQP software is likely to produce the following symptoms:

    • many NLP iterations produce very little progress;
    • the penalty parameters μ of the merit functions grows very large;
    • the Lagrange multipliers become very large;
    • the rank deficiency in the Jacobian of the active constraints is detected.

    Note that many symptoms of rank-deficient constraints are the same as those of inconsistent constraints. It is therefore quite common to confuse this deficiency with inconsistent constraints. Again, the remedy is to reformulate the problem.

  • Redundant Constraints

    A third type of difficulty occurs when the NLP problem contains redundant constraints. Two types of redundancy may be distinguished. In the first type, some of the constraints are unnecessary to the problem formulation, which typically results in the following symptoms:

    • the Lagrange multipliers are close to zero;
    • the solver has difficulty in detecting the active set.

    In the second type, the redundant constraints give rise to rank deficiency, and the problem then exhibits symptoms similar to the rank-deficient case discussed previously. Obviously, the remedy is to reformulate the problem by eliminating the redundant constraints.

  • Discontinuities

    Perhaps the biggest obstacle encountered in the practical application of SQP methods (as well as many other NLP methods including SUM techniques) is the presence of discontinuous behavior. All of the numerical methods described herein assume continuous and differentiable objective function and constraints. Yet, there are many common examples of discontinuous functions in practice, including: IF tests in codes; absolute value, min , and max functions; linear interpolation of data; internal iterations such as root finding; etc.

    Regarding SQP methods, the standard QP subproblems are no longer appropriate when discontinuities are present. In fact, the KKT necessary conditions simply do not apply! The most common symptoms of discontinuous functions are:

    • the iterates converge slowly or, even, diverge;
    • the line search takes very small steps (α0) ;
    • the Hessian matrix becomes badly ill-conditioned.

    The remedy consists in reformulating discontinuous problems into smooth problems: for absolute value, min, and max functions, tricks can be used that introduce slack variables and additional constraints; linear data interpolation can be replaced by higher order interpolation schemes that are continuous through second derivatives; internal iterations can also be handled via additional NLP constraints; etc.

  • Inaccurate Gradient Estimation

    Any SQP code requires that the user supply the objective function and constraint values, as well as their gradient (and possibly their Hessian too). In general, the user is proposed the option to calculate the gradients via finite differences, e.g.,

    f(x)f(x+δx)f(x)δx

    However, this may cause the problem to stop prematurely. First of all, the choice of the perturbation vector δx is highly non trivial. If too large a value clearly provides inaccurate estimates, too small a value may also result in very bad estimates due to finite arithmetic precision computations. Therefore, one must try to find a trade-off between these two extreme situations. The difficulty stems from the fact that a trade-off may not necessarily exist if the requested accuracy for the gradient is too high. In other word, the error made in the finite-difference approximation of a gradient cannot be made as small as desired. Further, the maximum accuracy that can be achieved with finite difference is both problem dependent (e.g., badly-scaled functions are more problematic than well-scaled functions) and machine dependent (e.g., double precision computations provides more accurate estimates than single precision computations). Typical symptoms of inaccurate gradient estimates in an SQP code are:

    • the iterates converge slowly, and the solver may stop prematurely at a suboptimal point (jamming);
    • the line search takes very small steps (α0) .

    The situation can be understood as follows. Assume that the gradient estimate is contaminated with noise. Then, instead of computing the true value (x) , we get (x)+𝜖 . But since the iteration seeks a point such that (x)=0 , we can expect either a degraded rate of convergence or, worse, no convergence at all, because ultimately the gradient will be dominated by noise.

    To avoid these problems, the user should always consider providing the gradients explicitely to the SQP solver, instead of relying on finite-difference estimates. For large-scale problems, this is obviously a time-consuming and error-prone task. In response to this, efficient algorithmic differentiation tools (also called automatic differentiation) have been developed within the last fifteen years. The idea behind it is that, given a piece of program calculating a number of function values (e.g., in fortran77 or C language), an auxiliary program is generated that calculates the derivatives of these functions.

  • Scaling

    Scaling affects everything! Poor scaling can make a good algorithm behave badly. Scaling changes the convergence rate, termination tests, and numerical conditioning.

    The most common way of scaling a problem is by introducing scaled variables of the form

    x~k:=ukxk+rk

    for k=1,...,nx with uk and rk being scale weights and shifts, respectively. Likewise, the objective function and constraints are commonly scaled using

    f~:=ω0fg~k:=ωkgk

    for k=1,...,ng . The idea is to let the optimization algorithm work with the well-scaled quantities in order to improve performance. However, what well-scaled quantities mean is hard to define, although conventional wisdom suggests the following hints:

    • normalize the independent variables to have the same range, e.g., 0x~k1 ;
    • normalize the dependent functions to have the same magnitude, e.g., f~g~1g~ng1 ;
    • normalize the rows and columns of the Jacobian to be of the same magnitude;
    • scale the dependent functions so that the Lagrange multipliers are close to one, e.g., |λ1||λng|1 ; etc.