An optimization problem involves minimizing a function (called the

**objective function**) of several variables, possibly subject to restrictions on the values of the variables defined by a set of**constraint functions**. Most methods in the Library are concerned with function**minimization**only, since the problem of maximizing a given objective function F(x) is equivalent to minimizing $-F\left(x\right)$. Some methods allow you to specify whether you are solving a minimization or maximization problem, carrying out the required transformation of the objective function in the latter case.In general methods in this chapter find a local minimum of a function $f$, that is a point ${x}^{*}$ s.t. for all $x$ near ${x}^{*}\text{}f\left(x\right)\ge f\left({x}^{*}\right)$.

The

**E05**class contains methods to find the global minimum of a function $f$. At a global minimum ${x}^{*}\text{}f\left(x\right)\ge f\left({x}^{*}\right)$ for all $x$.The (H not in this release) contains methods typically regarded as belonging to the field of operations research.

This introduction is only a brief guide to the subject of optimization designed for the casual user. Anyone with a difficult or protracted problem to solve will find it beneficial to consult a more detailed text, such as Gill et al. (1981) or Fletcher (1987).

If you are unfamiliar with the mathematics of the subject you may find some sections difficult at first reading; if so, you should

**concentrate**on [Types of Optimization Problems], [Geometric Representation and Terminology], [Scaling], [Analysis of Computed Results] and [Recommendations on Choice and Use of Available Methods].# Syntax

C# |
---|

public static class E04 |

Visual Basic |
---|

Public NotInheritable Class E04 |

Visual C++ |
---|

public ref class E04 abstract sealed |

F# |
---|

[<AbstractClassAttribute>] [<SealedAttribute>] type E04 = class end |

# Background to the Problems

# Types of Optimization Problems

The solution of optimization problems by a single, all-purpose, method is cumbersome and inefficient. Optimization problems are therefore classified into particular categories, where each category is defined by the properties of the objective and constraint functions, as illustrated by some examples below.

For instance, a specific problem category involves the minimization of a nonlinear objective function subject to bounds on the variables. In the following sections we define the particular categories of problems that can be solved by methods contained in this chapter. Not every category is given special treatment in the current version of the Library; however, the long-term objective is to provide a comprehensive set of methods to solve problems in all such categories.

Properties of Objective Function | Properties of Constraints |

Nonlinear | Nonlinear |

Sums of squares of nonlinear functions | Sparse linear |

Quadratic | Linear |

Sums of squares of linear functions | Bounds |

Linear | None |

# Unconstrained minimization

In unconstrained minimization problems there are no constraints on the variables. The problem can be stated mathematically as follows:

where $x\in {R}^{n}$, that is, $x={\left({x}_{1},{x}_{2},\dots ,{x}_{n}\right)}^{\mathrm{T}}$.

$$\underset{x}{\mathrm{minimize}}\phantom{\rule{0.25em}{0ex}}F\left(x\right)$$ |

# Nonlinear least squares problems

Special consideration is given to the problem for which the function to be minimized can be expressed as a sum of squared functions. The least squares problem can be stated mathematically as follows:

where the $i$th element of the $m$-vector $f$ is the function ${f}_{i}\left(x\right)$.

$$\underset{x}{\mathrm{minimize}}\phantom{\rule{0.25em}{0ex}}\left\{{f}^{\mathrm{T}}f=\sum _{i=1}^{m}{f}_{i}^{2}\left(x\right)\right\}\text{, \hspace{1em}}x\in {R}^{n}$$ |

# Minimization subject to bounds on the variables

These problems differ from the unconstrained problem in that at least one of the variables is subject to a simple bound (or restriction) on its value, e.g., ${x}_{5}\le 10$, but no constraints of a more general form are present.

The problem can be stated mathematically as follows:

subject to ${l}_{\mathit{i}}\le {x}_{\mathit{i}}\le {u}_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,n$.

$$\underset{x}{\mathrm{minimize}}\phantom{\rule{0.25em}{0ex}}F\left(x\right)\text{, \hspace{1em}}x\in {R}^{n}$$ |

This format assumes that upper and lower bounds exist on all the variables. By conceptually allowing ${u}_{i}=+\infty $ and ${l}_{i}=-\infty $ all the variables need not be restricted.

# Minimization subject to linear constraints

A general linear constraint is defined as a constraint function that is linear in more than one of the variables, e.g., $3{x}_{1}+2{x}_{2}\ge 4$. The various types of linear constraint are reflected in the following mathematical statement of the problem:

subject to the

where each ${a}_{i}$ is a vector of length $n$; ${b}_{i}$, ${s}_{j}$ and ${t}_{j}$ are constant scalars; and any of the categories may be empty.

equality constraints: | ${a}_{i}^{\mathrm{T}}x={b}_{i}$ | $i=1,2,\dots ,{m}_{1}$; |

inequality constraints: | ${a}_{i}^{\mathrm{T}}x\ge {b}_{i}$ | $i={m}_{1}+1,{m}_{1}+2,\dots ,{m}_{2}$; |

${a}_{i}^{\mathrm{T}}x\le {b}_{i}$ | $i={m}_{2}+1,{m}_{2}+2,\dots ,{m}_{3}$; | |

range constraints: | ${s}_{j}\le {a}_{i}^{\mathrm{T}}x\le {t}_{j}$ | $i={m}_{3}+1,{m}_{3}+2,\dots ,{m}_{4}\text{;}$ |

$j=1,2,\dots ,{m}_{4}-{m}_{3}\text{;}$ | ||

bounds constraints: | ${l}_{i}\le {x}_{i}\le {u}_{i}$ | $i=1,2,\dots ,n$ |

Although the bounds on ${x}_{i}$ could be included in the definition of general linear constraints, we prefer to distinguish between them for reasons of computational efficiency.

If $F\left(x\right)$ is a linear function, the linearly-constrained problem is termed a linear programming problem (LP); if $F\left(x\right)$ is a quadratic function, the problem is termed a quadratic programming problem (QP). For further discussion of LP and QP problems, including the dual formulation of such problems, see Dantzig (1963).

# Minimization subject to nonlinear constraints

A problem is included in this category if at least one constraint function is nonlinear, e.g., ${x}_{1}^{2}+{x}_{3}+{x}_{4}-2\ge 0$. The mathematical statement of the problem is identical to that for the linearly-constrained case, except for the addition of the following constraints:

where each ${c}_{i}$ is a nonlinear function; ${v}_{j}$ and ${w}_{j}$ are constant scalars; and any category may be empty. Note that we do not include a separate category for constraints of the form ${c}_{i}\left(x\right)\le 0$, since this is equivalent to $\text{}-{c}_{i}\left(x\right)\ge 0$.

equality constraints: | ${c}_{i}\left(x\right)=0$ | $i=1,2,\dots ,{m}_{5}$; |

inequality constraints: | ${c}_{i}\left(x\right)\ge 0$ | $i={m}_{5}+1,{m}_{5}+2,\dots ,{m}_{6}$; |

range constraints: | ${v}_{j}\le {c}_{i}\left(x\right)\le {w}_{j}$ | $i={m}_{6}+1,{m}_{6}+2,\dots ,{m}_{7}$, |

$j=1,2,\dots ,{m}_{7}-{m}_{6}$ |

Although the general linear constraints could be included in the definition of nonlinear constraints, again we prefer to distinguish between them for reasons of computational efficiency.

If $F\left(x\right)$ is a nonlinear function, the nonlinearly-constrained problem is termed a nonlinear programming problem (NLP). For further discussion of NLP problems, see Gill et al. (1981) or Fletcher (1987).

# Minimization subject to bounds on the objective function

In all of the above problem categories it is assumed that

where $a=-\infty $ and $b=+\infty $. Problems in which $a$ and/or $b$ are finite can be solved by adding an extra constraint of the appropriate type (i.e., linear or nonlinear) depending on the form of $F\left(x\right)$. Further advice is given in [Function Evaluations at Infeasible Points].

$$a\le F\left(x\right)\le b$$ |

# Multi-objective optimization

Sometimes a problem may have two or more objective functions which are to be optimized at the same time. Such problems are called multi-object, multi-criteria or multi-attribute optimization. If the constraints are linear and the objectives are all linear then the terminology ‘goal programming’ is also used.

Techniques used in this chapter and in

**E05**class may be employed to address such problems.# Semidefinite Programming

Methods in

where the expression $S\ge 0$ stands for a non-negativity constraint on the the eigenvalues of the symmetric matrix $S$, that is, $S$ must be positive semidefinite. The chapter can also deal with problems involving bilinear matrix inequalities

or a linear matrix inequality constraint extended by bilinear terms.

**E04**class can be used to solve linear semidefinite programming problems, that is, linear programming problems which include one or more linear matrix inequality constraints of the form$$\sum _{\mathit{i}=1}^{n}{x}_{i}{A}_{i}-{A}_{0}\u2ab00$$ |

$$\sum _{\mathit{i,j}=1}^{n}{x}_{i}{x}_{j}{Q}_{ij}\u2ab00$$ |

# Geometric Representation and Terminology

To illustrate the nature of optimization problems it is useful to consider the following example in two dimensions:

(This function is used as the example function in the documentation for the unconstrained methods.)

$$F\left(x\right)={e}^{{x}_{1}}\left(4{x}_{1}^{2}+2{x}_{2}^{2}+4{x}_{1}{x}_{2}+2{x}_{2}+1\right)\text{.}$$ |

**Figure 1**

Figure 1 is a contour diagram of $F\left(x\right)$. The contours labelled ${F}_{0},{F}_{1},\dots ,{F}_{4}$ are isovalue contours, or lines along which the function $F\left(x\right)$ takes specific constant values. The point ${x}^{*}={\left(\frac{1}{2},-1\right)}^{\mathrm{T}}$ is a

**local unconstrained minimum**, that is, the value of $F\left({x}^{*}\right)$ ($\text{}=0$) is less than at all the neighbouring points. A function may have several such minima. The lowest of the local minima is termed a**global minimum**. In the problem illustrated in Figure 1, ${x}^{*}$ is the only local minimum. The point ${x}_{s}$ is said to be a**saddle point**because it is a minimum along the line AB, but a maximum along CD.If we add the constraint ${x}_{1}\ge 0$ (a simple bound) to the problem of minimizing $F\left(x\right)$, the solution remains unaltered. In Figure 1 this constraint is represented by the straight line passing through ${x}_{1}=0$, and the shading on the line indicates the unacceptable region (i.e., ${x}_{1}<0$). The region in ${R}^{n}$ satisfying the constraints of an optimization problem is termed the

**feasible region**. A point satisfying the constraints is defined as a**feasible point**.If we add the nonlinear constraint ${c}_{1}\left(x\right):{x}_{1}+{x}_{2}-{x}_{1}{x}_{2}-\frac{3}{2}\ge 0$, represented by the curved shaded line in Figure 1, then ${x}^{*}$ is not a feasible point because ${c}_{1}\left({x}^{*}\right)<0$. The solution of the new constrained problem is ${x}_{b}\simeq {\left(1.1825,-1.7397\right)}^{\mathrm{T}}$, the feasible point with the smallest function value (where $F\left({x}_{b}\right)\simeq 3.0607$).

# Gradient vector

The vector of first partial derivatives of $F\left(x\right)$ is called the

For the function illustrated in Figure 1,

The gradient vector is of importance in optimization because it must be zero at an unconstrained minimum of any function with continuous first derivatives.

**gradient vector**, and is denoted by $g\left(x\right)$, i.e.,$$g\left(x\right)={\left[\frac{\partial F\left(x\right)}{\partial {x}_{1}},\frac{\partial F\left(x\right)}{\partial {x}_{2}},\dots ,\frac{\partial F\left(x\right)}{\partial {x}_{n}}\right]}^{\mathrm{T}}\text{.}$$ |

$$g\left(x\right)=\left[\begin{array}{c}F\left(x\right)+{e}^{{x}_{1}}\left(8{x}_{1}+4{x}_{2}\right)\\ {e}^{{x}_{1}}\left(4{x}_{2}+4{x}_{1}+2\right)\end{array}\right]\text{.}$$ |

# Hessian matrix

The matrix of second partial derivatives of a function is termed its

**Hessian matrix**. The Hessian matrix of $F\left(x\right)$ is denoted by $G\left(x\right)$, and its $\left(i,j\right)$th element is given by ${\partial}^{2}F\left(x\right)/\partial {x}_{i}\partial {x}_{j}$. If $F\left(x\right)$ has continuous second derivatives, then $G\left(x\right)$ must be positive definite at any unconstrained minimum of $F$.# Jacobian matrix; matrix of constraint normals

In nonlinear least squares problems, the matrix of first partial derivatives of the vector-valued function $f\left(x\right)$ is termed the

**Jacobian matrix**of $f\left(x\right)$ and its $\left(i,j\right)$th component is $\partial {f}_{i}/\partial {x}_{j}$.The vector of first partial derivatives of the constraint ${c}_{i}\left(x\right)$ is denoted by

The matrix whose columns are the vectors $\left\{{a}_{i}\right\}$ is termed the

$${a}_{i}\left(x\right)={\left[\frac{\partial {c}_{i}\left(x\right)}{\partial {x}_{1}},\frac{\partial {c}_{i}\left(x\right)}{\partial {x}_{2}},\dots ,\frac{\partial {c}_{i}\left(x\right)}{\partial {x}_{n}}\right]}^{\mathrm{T}}\text{.}$$ |

**matrix of constraint normals**. At a point $\hat{x}$, the vector ${a}_{i}\left(\hat{x}\right)$ is orthogonal (normal) to the isovalue contour of ${c}_{i}\left(x\right)$ passing through $\hat{x}$; this relationship is illustrated for a two-dimensional function in Figure 2.**Figure 2**

Note that if ${c}_{i}\left(x\right)$ is a linear constraint involving ${a}_{i}^{\mathrm{T}}x$, then its vector of first partial derivatives is simply the vector ${a}_{i}$.

# Sufficient Conditions for a Solution

All nonlinear functions will be assumed to have continuous second derivatives in the neighbourhood of the solution.

# Unconstrained minimization

The following conditions are sufficient for the point ${x}^{*}$ to be an unconstrained local minimum of $F\left(x\right)$:

where $\Vert g\Vert $ denotes the Euclidean length of $g$.

(i) | $\Vert g\left({x}^{*}\right)\Vert =0$; and |

(ii) | $G\left({x}^{*}\right)$ is positive definite, |

# Minimization subject to bounds on the variables

At the solution of a bounds-constrained problem, variables which are not on their bounds are termed

**free variables**. If it is known in advance which variables are on their bounds at the solution, the problem can be solved as an unconstrained problem in just the free variables; thus, the sufficient conditions for a solution are similar to those for the unconstrained case, applied only to the free variables.Sufficient conditions for a feasible point ${x}^{*}$ to be the solution of a bounds-constrained problem are as follows:

where $\stackrel{-}{g}\left(x\right)$ is the gradient of $F\left(x\right)$ with respect to the free variables, and $\stackrel{-}{G}\left(x\right)$ is the Hessian matrix of $F\left(x\right)$ with respect to the free variables. The extra condition (iii) ensures that $F\left(x\right)$ cannot be reduced by moving off one or more of the bounds.

(i) | $\Vert \stackrel{-}{g}\left({x}^{*}\right)\Vert =0$; and |

(ii) | $\stackrel{-}{G}\left({x}^{*}\right)$ is positive definite; and |

(iii) | ${g}_{j}\left({x}^{*}\right)<0,{x}_{j}={u}_{j}$; ${g}_{j}\left({x}^{*}\right)>0,{x}_{j}={l}_{j}$, |

# Linearly-constrained minimization

For the sake of simplicity, the following description does not include a specific treatment of bounds or range constraints, since the results for general linear inequality constraints can be applied directly to these cases.

At a solution ${x}^{*}$, of a linearly-constrained problem, the constraints which hold as equalities are called the

The matrix $Z$ is defined as an $n\times \left(n-t\right)$ matrix satisfying:

The columns of $Z$ form an orthogonal basis for the set of vectors orthogonal to the columns of $\hat{A}$.

**active**or**binding**constraints. Assume that there are $t$ active constraints at the solution ${x}^{*}$, and let $\hat{A}$ denote the matrix whose columns are the columns of $A$ corresponding to the active constraints, with $\hat{b}$ the vector similarly obtained from $b$; then$${\hat{A}}^{\mathrm{T}}{x}^{*}=\hat{b}\text{.}$$ |

$$\begin{array}{l}{\hat{A}}^{\mathrm{T}}Z=0\text{;}\\ {Z}^{\mathrm{T}}Z=I\text{.}\end{array}$$ |

Define

- ${g}_{Z}\left(x\right)={Z}^{\mathrm{T}}g\left(x\right)$, the
**projected gradient vector**of $F\left(x\right)$; - ${G}_{Z}\left(x\right)={Z}^{\mathrm{T}}G\left(x\right)Z$, the
**projected Hessian matrix**of $F\left(x\right)$.

At the solution of a linearly-constrained problem, the projected gradient vector must be zero, which implies that the gradient vector $g\left({x}^{*}\right)$ can be written as a linear combination of the columns of $\hat{A}$, i.e., $g\left({x}^{*}\right)={\displaystyle \sum _{i=1}^{t}}{\lambda}_{i}^{*}{\hat{a}}_{i}=\hat{A}{\lambda}^{*}$. The scalar ${\lambda}_{i}^{*}$ is defined as the

Sufficient conditions for ${x}^{*}$ to be the solution of a linearly-constrained problem are:

**Lagrange multiplier**corresponding to the $i$th active constraint. A simple interpretation of the $i$th Lagrange multiplier is that it gives the gradient of $F\left(x\right)$ along the $i$th active constraint normal; a convenient definition of the Lagrange multiplier vector (although not a recommended method for computation) is:$${\lambda}^{*}={\left({\hat{A}}^{\mathrm{T}}\hat{A}\right)}^{-1}{\hat{A}}^{\mathrm{T}}g\left({x}^{*}\right)\text{.}$$ |

(i) | ${x}^{*}$ is feasible, and ${\hat{A}}^{\mathrm{T}}{x}^{*}=\hat{b}$; and |

(ii) | $\Vert {g}_{Z}\left({x}^{*}\right)\Vert =0$, or equivalently, $g\left({x}^{*}\right)=\hat{A}{\lambda}^{*}$; and |

(iii) | ${G}_{Z}\left({x}^{*}\right)$ is positive definite; and |

(iv) | ${\lambda}_{i}^{*}>0$ if ${\lambda}_{i}^{*}$ corresponds to a constraint ${\hat{a}}_{i}^{\mathrm{T}}{x}^{*}\ge {\hat{b}}_{i}$;
${\lambda}_{i}^{*}<0$ if ${\lambda}_{i}^{*}$ corresponds to a constraint ${\hat{a}}_{i}^{\mathrm{T}}{x}^{*}\le {\hat{b}}_{i}$.
The sign of ${\lambda}_{i}^{*}$ is immaterial for equality constraints, which by definition are always active. |

# Nonlinearly-constrained minimization

For nonlinearly-constrained problems, much of the terminology is defined exactly as in the linearly-constrained case. The set of active constraints at $x$ again means the set of constraints that hold as equalities at $x$, with corresponding definitions of $\hat{c}$ and $\hat{A}$: the vector $\hat{c}\left(x\right)$ contains the active constraint functions, and the columns of $\hat{A}\left(x\right)$ are the gradient vectors of the active constraints. As before, $Z$ is defined in terms of $\hat{A}\left(x\right)$ as a matrix such that:

where the dependence on $x$ has been suppressed for compactness.

$$\begin{array}{l}{\hat{A}}^{\mathrm{T}}Z=0\text{;}\\ {Z}^{\mathrm{T}}Z=I\end{array}$$ |

The projected gradient vector ${g}_{Z}\left(x\right)$ is the vector ${Z}^{\mathrm{T}}g\left(x\right)$. At the solution ${x}^{*}$ of a nonlinearly-constrained problem, the projected gradient must be zero, which implies the existence of Lagrange multipliers corresponding to the active constraints, i.e., $g\left({x}^{*}\right)=\hat{A}\left({x}^{*}\right){\lambda}^{*}$.

The

We define ${g}_{L}\left(x\right)$ as the gradient of the Lagrangian function; ${G}_{L}\left(x\right)$ as its Hessian matrix, and ${\hat{G}}_{L}\left(x\right)$ as its projected Hessian matrix, i.e., ${\hat{G}}_{L}={Z}^{\mathrm{T}}{G}_{L}Z$.

**Lagrangian function**is given by:$$L\left(x,\lambda \right)=F\left(x\right)-{\lambda}^{\mathrm{T}}\hat{c}\left(x\right)\text{.}$$ |

Sufficient conditions for ${x}^{*}$ to be the solution of a nonlinearly-constrained problem are:

(i) | ${x}^{*}$ is feasible, and $\hat{c}\left({x}^{*}\right)=0$; and |

(ii) | $\Vert {g}_{Z}\left({x}^{*}\right)\Vert =0$, or, equivalently, $g\left({x}^{*}\right)=\hat{A}\left({x}^{*}\right){\lambda}^{*}$; and |

(iii) | ${\hat{G}}_{L}\left({x}^{*}\right)$ is positive definite; and |

(iv) | ${\lambda}_{i}^{*}>0$ if ${\lambda}_{i}^{*}$ corresponds to a constraint of the form ${\hat{c}}_{i}\ge 0$.
The sign of ${\lambda}_{i}^{*}$ is immaterial for equality constraints, which by definition are always active. |

Note that condition (ii) implies that the projected gradient of the Lagrangian function must also be zero at ${x}^{*}$, since the application of ${Z}^{\mathrm{T}}$ annihilates the matrix $\hat{A}\left({x}^{*}\right)$.

# Background to Optimization Methods

All the algorithms contained in this chapter generate an iterative sequence $\left\{{x}^{\left(k\right)}\right\}$ that converges to the solution ${x}^{*}$ in the limit, except for some special problem categories (i.e., linear and quadratic programming). To terminate computation of the sequence, a convergence test is performed to determine whether the current estimate of the solution is an adequate approximation. The convergence tests are discussed in [Analysis of Computed Results].

Most of the methods construct a sequence $\left\{{x}^{\left(k\right)}\right\}$ satisfying:

where the vector ${p}^{\left(k\right)}$ is termed the

$${x}^{\left(k+1\right)}={x}^{\left(k\right)}+{\alpha}^{\left(k\right)}{p}^{\left(k\right)}\text{,}$$ |

**direction of search**, and ${\alpha}^{\left(k\right)}$ is the**steplength**. The steplength ${\alpha}^{\left(k\right)}$ is chosen so that $F\left({x}^{\left(k+1\right)}\right)<F\left({x}^{\left(k\right)}\right)$ and is computed using one of the techniques for one-dimensional optimization referred to in [One-dimensional optimization].# One-dimensional optimization

The Library contains two special methods for minimizing a function of a single variable. Both methods are based on safeguarded polynomial approximation. One method requires function evaluations only and fits a quadratic polynomial whilst the other requires function and gradient evaluations and fits a cubic polynomial. See Section 4.1 of Gill et al. (1981).

# Methods for unconstrained optimization

The distinctions among methods arise primarily from the need to use varying levels of information about derivatives of $F\left(x\right)$ in defining the search direction. We describe three basic approaches to unconstrained problems, which may be extended to other problem categories. Since a full description of the methods would fill several volumes, the discussion here can do little more than allude to the processes involved, and direct you to other sources for a full explanation.

(a) | Newton-type Methods (Modified Newton Methods)
Newton-type methods use the Hessian matrix $G\left({x}^{\left(k\right)}\right)$, or a finite difference approximation to $G\left({x}^{\left(k\right)}\right)$, to define the search direction. The methods in the Library either require a method that computes the elements of $G\left({x}^{\left(k\right)}\right)$ directly, or they approximate $G\left({x}^{\left(k\right)}\right)$ by finite differences.
Newton-type methods are the most powerful methods available for general problems and will find the minimum of a quadratic function in one iteration. See Sections 4.4 and 4.5.1 of Gill et al. (1981). |

(b) | Quasi-Newton Methods
Quasi-Newton methods approximate the Hessian $G\left({x}^{\left(k\right)}\right)$ by a matrix ${B}^{\left(k\right)}$ which is modified at each iteration to include information obtained about the curvature of $F$ along the current search direction ${p}^{\left(k\right)}$. Although not as robust as Newton-type methods, quasi-Newton methods can be more efficient because $G\left({x}^{\left(k\right)}\right)$ is not computed directly, or approximated by finite differences. Quasi-Newton methods minimize a quadratic function in $n$ iterations, where $n$ is the number of variables. See Section 4.5.2 of Gill et al. (1981). |

(c) | Conjugate-gradient Methods
Unlike Newton-type and quasi-Newton methods, conjugate-gradient methods do not require the storage of an $n$ by $n$ matrix and so are ideally suited to solve large problems. Conjugate-gradient type methods are not usually as reliable or efficient as Newton-type, or quasi-Newton methods. See Section 4.8.3 of Gill et al. (1981). |

# Methods for nonlinear least squares problems

These methods are similar to those for unconstrained optimization, but exploit the special structure of the Hessian matrix to give improved computational efficiency.

Since

the Hessian matrix $G\left(x\right)$ is of the form

where $J\left(x\right)$ is the Jacobian matrix of $f\left(x\right)$, and ${G}_{i}\left(x\right)$ is the Hessian matrix of ${f}_{i}\left(x\right)$.

$$F\left(x\right)=\sum _{i=1}^{m}{f}_{i}^{2}\left(x\right)$$ |

$$G\left(x\right)=2\left(J{\left(x\right)}^{\mathrm{T}}J\left(x\right)+\sum _{i=1}^{m}{f}_{i}\left(x\right){G}_{i}\left(x\right)\right)\text{,}$$ |

In the neighbourhood of the solution, $\Vert f\left(x\right)\Vert $ is often small compared to $\Vert J{\left(x\right)}^{\mathrm{T}}J\left(x\right)\Vert $ (for example, when $f\left(x\right)$ represents the goodness-of-fit of a nonlinear model to observed data). In such cases, $2J{\left(x\right)}^{\mathrm{T}}J\left(x\right)$ may be an adequate approximation to $G\left(x\right)$, thereby avoiding the need to compute or approximate second derivatives of $\left\{{f}_{i}\left(x\right)\right\}$. See Section 4.7 of Gill et al. (1981).

# Methods for handling constraints

Bounds on the variables are dealt with by fixing some of the variables on their bounds and adjusting the remaining free variables to minimize the function. By examining estimates of the Lagrange multipliers it is possible to adjust the set of variables fixed on their bounds so that eventually the bounds active at the solution should be correctly identified. This type of method is called an

**active set method**. One feature of such methods is that, given an initial feasible point, all approximations ${x}^{\left(k\right)}$ are feasible. This approach can be extended to general linear constraints. At a point, $x$, the set of constraints which hold as equalities being used to predict, or approximate, the set of active constraints is called the**working set**.Nonlinear constraints are more difficult to handle. If at all possible, it is usually beneficial to avoid including nonlinear constraints during the formulation of the problem. The methods currently implemented in the Library handle nonlinearly constrained problems by transforming them into a sequence of quadratic programming problems. A feature of such methods is that ${x}^{\left(k\right)}$ is not guaranteed to be feasible except in the limit, and this is certainly true of the methods currently in the Library. See Chapter 6, particularly Sections 6.4 and 6.5, of Gill et al. (1981).

Anyone interested in a detailed description of methods for optimization should consult the references.

# Methods for handling multi-objective optimization

Suppose we have objective functions ${f}_{i}\left(x\right)$, $i>1$, all of which we need to minimize at the same time. There are two main approaches to this problem:

(a) | Combine the individual objectives into one composite objective. Typically this might be a weighted sum of the objectives, e.g.,
Here you choose the weights to express the relative importance of the corresponding objective. Ideally each of the ${f}_{i}\left(x\right)$ should be of comparable size at a solution. |
||

(b) | Order the objectives in order of importance. Suppose ${f}_{\mathit{i}}$ are ordered such that ${f}_{\mathit{i}}\left(x\right)$ is more important than ${f}_{\mathit{i}+1}\left(x\right)$, for $\mathit{i}=1,2,\dots ,n-1$. Then in the lexicographical approach to multi-objective optimization a sequence of subproblems are solved. Firstly solve the problem for objective function ${f}_{1}\left(x\right)$ and denote by ${r}_{1}$ the value of this minimum. If $\left(\mathit{i}-1\right)$ subproblems have been solved with results ${r}_{\mathit{i}-1}$ then subproblem $\mathit{i}$ becomes $\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left({f}_{\mathit{i}}\left(x\right)\right)$ subject to ${r}_{k}\le {f}_{k}\left(x\right)\le {r}_{k}$, for $\mathit{k}=1,2,\dots ,i-1$ plus the other constraints. |

Clearly the bounds on ${f}_{k}$ might be relaxed at your discretion.

In general, if NAG methods from the

**E04**class are used then only local minima are found. This means that a better solution to an individual objective might be found without worsening the optimal solutions to the other objectives. Ideally you seek a Pareto solution; one in which an improvement in one objective can only be achieved by a worsening of another objective.To obtain a Pareto solution methods from

**E05**class might be used or, alternatively, a pragmatic attempt to derive a global minimum might be tried (see e05uc). In this approach a variety of different minima are computed for each subproblem by starting from a range of different starting points. The best solution achieved is taken to be the global minimum. The more starting points chosen the greater confidence you might have in the computed global minimum.# Scaling

Scaling (in a broadly defined sense) often has a significant influence on the performance of optimization methods. Since convergence tolerances and other criteria are necessarily based on an implicit definition of ‘small’ and ‘large’, problems with unusual or unbalanced scaling may cause difficulties for some algorithms. Although there are currently no user-callable scaling methods in the Library, scaling is automatically performed by default in the methods which solve sparse LP, QP or NLP problems and in some newer dense solver methods. The following sections present some general comments on problem scaling.

# Transformation of variables

One method of scaling is to transform the variables from their original representation, which may reflect the physical nature of the problem, to variables that have certain desirable properties in terms of optimization. It is generally helpful for the following conditions to be satisfied:

(i) | the variables are all of similar magnitude in the region of interest; |

(ii) | a fixed change in any of the variables results in similar changes in $F\left(x\right)$. Ideally, a unit change in any variable produces a unit change in $F\left(x\right)$; |

(iii) | the variables are transformed so as to avoid cancellation error in the evaluation of $F\left(x\right)$. |

Normally, you should restrict yourself to linear transformations of variables, although occasionally nonlinear transformations are possible. The most common such transformation (and often the most appropriate) is of the form

where $D$ is a diagonal matrix with constant coefficients. Our experience suggests that more use should be made of the transformation

where $v$ is a constant vector.

$${x}_{\mathrm{new}}=D{x}_{\mathrm{old}}\text{,}$$ |

$${x}_{\mathrm{new}}=D{x}_{\mathrm{old}}+v\text{,}$$ |

Consider, for example, a problem in which the variable ${x}_{3}$ represents the position of the peak of a Gaussian curve to be fitted to data for which the extreme values are $150$ and $170$; therefore ${x}_{3}$ is known to lie in the range $150$–$170$. One possible scaling would be to define a new variable ${\stackrel{-}{x}}_{3}$, given by

A better transformation, however, is given by defining ${\stackrel{-}{x}}_{3}$ as

Frequently, an improvement in the accuracy of evaluation of $F\left(x\right)$ can result if the variables are scaled before the methods to evaluate $F\left(x\right)$ are coded. For instance, in the above problem just mentioned of Gaussian curve-fitting, ${x}_{3}$ may always occur in terms of the form $\left({x}_{3}-{x}_{m}\right)$, where ${x}_{m}$ is a constant representing the mean peak position.

$${\stackrel{-}{x}}_{3}=\frac{{x}_{3}}{170}\text{.}$$ |

$${\stackrel{-}{x}}_{3}=\frac{{x}_{3}-160}{10}\text{.}$$ |

# Scaling the objective function

The objective function has already been mentioned in the discussion of scaling the variables. The solution of a given problem is unaltered if $F\left(x\right)$ is multiplied by a positive constant, or if a constant value is added to $F\left(x\right)$. It is generally preferable for the objective function to be of the order of unity in the region of interest; thus, if in the original formulation $F\left(x\right)$ is always of the order of ${10}^{+5}$ (say), then the value of $F\left(x\right)$ should be multiplied by ${10}^{-5}$ when evaluating the function within an optimization method. If a constant is added or subtracted in the computation of $F\left(x\right)$, usually it should be omitted, i.e., it is better to formulate $F\left(x\right)$ as ${x}_{1}^{2}+{x}_{2}^{2}$ rather than as ${x}_{1}^{2}+{x}_{2}^{2}+1000$ or even ${x}_{1}^{2}+{x}_{2}^{2}+1$. The inclusion of such a constant in the calculation of $F\left(x\right)$ can result in a loss of significant figures.

# Scaling the constraints

A ‘well scaled’ set of constraints has two main properties. Firstly, each constraint should be well-conditioned with respect to perturbations of the variables. Secondly, the constraints should be balanced with respect to each other, i.e., all the constraints should have ‘equal weight’ in the solution process.

The solution of a linearly- or nonlinearly-constrained problem is unaltered if the $i$th constraint is multiplied by a positive weight ${w}_{i}$. At the approximation of the solution determined by a Library method, any active linear constraints will (in general) be satisfied ‘exactly’ (i.e., to within the tolerance defined by machine precision) if they have been properly scaled. This is in contrast to any active nonlinear constraints, which will not (in general) be satisfied ‘exactly’ but will have ‘small’ values (for example, ${\hat{c}}_{1}\left({x}^{*}\right)={10}^{-8}$, ${\hat{c}}_{2}\left({x}^{*}\right)={-10}^{-6}$, and so on). In general, this discrepancy will be minimized if the constraints are weighted so that a unit change in $x$ produces a similar change in each constraint.

A second reason for introducing weights is related to the effect of the size of the constraints on the Lagrange multiplier estimates and, consequently, on the active set strategy. This means that different sets of weights may cause an algorithm to produce different sequences of iterates. Additional discussion is given in Gill et al. (1981).

# Analysis of Computed Results

# Convergence criteria

The convergence criteria inevitably vary from method to method, since in some cases more information is available to be checked (for example, is the Hessian matrix positive definite?), and different checks need to be made for different problem categories (for example, in constrained minimization it is necessary to verify whether a trial solution is feasible). Nonetheless, the underlying principles of the various criteria are the same; in non-mathematical terms, they are:

(i) | is the sequence $\left\{{x}^{\left(k\right)}\right\}$ converging? |

(ii) | is the sequence $\left\{{F}^{\left(k\right)}\right\}$ converging? |

(iii) | are the necessary and sufficient conditions for the solution satisfied? |

The decision as to whether a sequence is converging is necessarily speculative. The criterion used in the present methods is to assume convergence if the relative change occurring between two successive iterations is less than some prescribed quantity. Criterion (iii) is the most reliable but often the conditions cannot be checked fully because not all the required information may be available.

# Checking results

Little a priori guidance can be given as to the quality of the solution found by a nonlinear optimization algorithm, since no guarantees can be given that the methods will not fail. Therefore, you should always check the computed solution even if the method reports success. Frequently a ‘solution’ may have been found even when the method does not report a success. The reason for this apparent contradiction is that the method needs to assess the accuracy of the solution. This assessment is not an exact process and consequently may be unduly pessimistic. Any ‘solution’ is in general only an approximation to the exact solution, and it is possible that the accuracy you have specified is too stringent.

Further confirmation can be sought by trying to check whether or not convergence tests are almost satisfied, or whether or not some of the sufficient conditions are nearly satisfied. When it is thought that a method has returned a
nonzero value of ifail
only because the requirements for ‘success’ were too stringent it may be worth restarting with increased convergence tolerances.

For nonlinearly-constrained problems, check whether the solution returned is feasible, or nearly feasible; if not, the solution returned is not an adequate solution.

Confidence in a solution may be increased by resolving the problem with a different initial approximation to the solution. See Section 8.3 of Gill et al. (1981) for further information.

# Monitoring progress

Many of the methods in the chapter have facilities to allow you to monitor the progress of the minimization process, and you are encouraged to make use of these facilities. Monitoring information can be a great aid in assessing whether or not a satisfactory solution has been obtained, and in indicating difficulties in the minimization problem or in the ability of the method to cope with the problem.

The behaviour of the function, the estimated solution and first derivatives can help in deciding whether a solution is acceptable and what to do in the event of a return with a
nonzero value of ifail.

# Confidence intervals for least squares solutions

When estimates of the parameters in a nonlinear least squares problem have been found, it may be necessary to estimate the variances of the parameters and the fitted function. These can be calculated from the Hessian of $F\left(x\right)$ at the solution.

In many least squares problems, the Hessian is adequately approximated at the solution by $G=2{J}^{\mathrm{T}}J$ (see [Methods for nonlinear least squares problems]). The Jacobian, $J$, or a factorization of $J$ is returned by all the comprehensive least squares methods and, in addition, a method is available in the Library to estimate variances of the parameters following the use of most of the nonlinear least squares methods, in the case that $G=2{J}^{\mathrm{T}}J$ is an adequate approximation.

Let $H$ be the inverse of $G$, and $S$ be the sum of squares, both calculated at the solution $\stackrel{-}{x}$; an unbiased estimate of the

and an unbiased estimate of the covariance of ${\stackrel{-}{x}}_{i}$ and ${\stackrel{-}{x}}_{j}$ is

If ${x}^{*}$ is the true solution, then the $100\left(1-\beta \right)\%\text{}$

where ${t}_{\left(1-\beta /2,m-n\right)}$ is the $100\left(1-\beta \right)/2$ percentage point of the $t$-distribution with $m-n$ degrees of freedom.

**variance**of the $i$th parameter ${x}_{i}$ is$$\mathrm{var}\u200a{\stackrel{-}{x}}_{i}=\frac{2S}{m-n}{H}_{ii}$$ |

$$\mathrm{covar}\left({\stackrel{-}{x}}_{i},{\stackrel{-}{x}}_{j}\right)=\frac{2S}{m-n}{H}_{ij}\text{.}$$ |

**confidence interval**on $\stackrel{-}{x}$ is$${\stackrel{-}{x}}_{i}-\sqrt{\mathrm{var}\u200a{\stackrel{-}{x}}_{i}}.{t}_{\left(1-\beta /2,m-n\right)}<{x}_{i}^{*}<{\stackrel{-}{x}}_{i}+\sqrt{\mathrm{var}\u200a{\stackrel{-}{x}}_{i}}.{t}_{\left(1-\beta /2,m-n\right)}\text{, \hspace{1em}}i=1,2,\dots ,n$$ |

In the majority of problems, the residuals ${f}_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,m$, contain the difference between the values of a model function $\varphi \left(z,x\right)$ calculated for $m$ different values of the independent variable $z$, and the corresponding observed values at these points. The minimization process determines the parameters, or constants $x$, of the fitted function $\varphi \left(z,x\right)$. For any value, $\stackrel{-}{z}$, of the independent variable $z$, an unbiased estimate of the

**variance**of $\varphi $ is$$\mathrm{var}\u200a\varphi =\frac{2S}{m-n}\sum _{i=1}^{n}\sum _{j=1}^{n}{\left[\frac{\partial \varphi}{\partial {x}_{i}}\right]}_{\stackrel{-}{z}}{\left[\frac{\partial \varphi}{\partial {x}_{j}}\right]}_{\stackrel{-}{z}}{H}_{ij}\text{.}$$ |

The $100\left(1-\beta \right)\%$

For further details on the analysis of least squares solutions see Bard (1974) and Wolberg (1967).

**confidence interval**on $F$ at the point $\stackrel{-}{z}$ is$$\varphi \left(\stackrel{-}{z},\stackrel{-}{x}\right)-\sqrt{\mathrm{var}\u200a\varphi}.{t}_{\left(\beta /2,m-n\right)}<\varphi \left(\stackrel{-}{z},{x}^{*}\right)<\varphi \left(\stackrel{-}{z},\stackrel{-}{x}\right)+\sqrt{\mathrm{var}\u200a\varphi}.{t}_{\left(\beta /2,m-n\right)}\text{.}$$ |

# Recommendations on Choice and Use of Available Methods

The choice of method depends on several factors: the type of problem (unconstrained, etc.); the level of derivative information available (function values only, etc.); your experience (there are easy-to-use versions of some methods); whether or not storage is a problem; whether or not the method is to be used in a multithreaded environment; and whether computational time has a high priority. Not all choices are catered for in the current version of the Library.

# Easy-to-use and Comprehensive Methods

Many methods appear in the Library in two forms: a comprehensive form and an easy-to-use form. The objective in the easy-to-use forms is to make the method simple to use by including in the calling sequence only those parameters absolutely essential to the definition of the problem, as opposed to parameters relevant to the solution method. If you are an experienced user the comprehensive methods have additional parameters which enable you to improve their efficiency by ‘tuning’ the method to a particular problem. If you are a casual or inexperienced user, this feature is of little value and may in some cases cause a failure because of a poor choice of some parameters.

In the easy-to-use methods, these extra parameters are determined either by fixing them at a known safe and reasonably efficient value, or by an auxiliary method which generates a ‘good’ value automatically.

For methods introduced since Mark 12 of the Library a different approach has been adopted towards the choice of easy-to-use and comprehensive methods. The optimization method has an easy-to-use parameter list, but additional parameters may be changed from their default values by calling an ‘option’ setting method before the call to the main optimization method. This approach has the advantages of allowing the options to be given in the form of keywords and requiring only those options that are to be different from their default values to be set.

# Thread Safe Methods

Many of the methods in this chapter come in pairs, with each method in the pair having exactly the same functionality, except that one of them has additional parameters in order to make it safe for use in multithreaded applications. The method that is safe for use in multithreaded applicatons has an ‘A’ as the last character in the name, in place of the usual ‘F’.

An example of such a pair is

**e04ab**(E04ABA not in this release).All ‘F’ methods not scheduled for withdrawal from the Library and where there is no ‘A’ version of that method are thread safe provided that the implementation as a whole is considered thread safe (refer to the Users' Note for your implementation).

# Reverse Communication Methods

Most of the methods in this chapter are called just once in order to compute the minimum of a given objective function subject to a set of constraints on the variables. The objective function and nonlinear constraints (if any) are specified by you and written as methods to a very rigid format described in the relevant method document.

For the majority of applications this is the simplest and most convenient usage. Sometimes however this approach can be restrictive:

(i) | when the required format of the method does not allow useful information to be passed conveniently to and from your calling program; |

(ii) | when the minimization method is being called from another computer language, such as Visual Basic, which does not fully support procedure arguments in a way that is compatible with the Library. |

A way around these problems is to utilize

**reverse communication**methods. Instead of performing complete optimizations, these methods perform one step in the solution process before returning to the calling program with an appropriate flag (irevcm) set. The value of irevcm determines whether the minimization process has finished or whether fresh information is required. In the latter case you calculate this information (in the form of a vector or as a scalar, as appropriate) and re-enter the reverse communication method with the information contained in appropriate arguments. Thus you have the responsibility for providing the iterative loop in the minimization process, but as compensation, you have an extremely flexible and basic user-interface to the reverse communication method.The only reverse communication methods in this chapter are e04uf, which solve dense NLP problems using a sequential quadratic programming method.

# Service Methods

One of the most common errors in the use of optimization methods is that user-supplied delegates do not evaluate the relevant partial derivatives correctly. Because exact gradient information normally enhances efficiency in all areas of optimization, you are encouraged to provide analytical derivatives whenever possible. However, mistakes in the computation of derivatives can result in serious and obscure run-time errors. Consequently,

**service methods**are provided to perform an elementary check on the gradients you supplied. These methods are inexpensive to use in terms of the number of calls they require to user-supplied delegates.
The appropriate checking methods are as follows:

It should be noted that methods
e04uf, e04us, e04vh and e04wd
each incorporate a check on the gradients being supplied. This involves verifying the gradients at the first point that satisfies the linear constraints and bounds. There is also an option to perform a more reliable (but more expensive) check on the individual gradient elements being supplied. Note that the checks are not infallible.

A second type of service method computes a set of finite differences to be used when approximating first derivatives. Such differences are required as input parameters by some methods that use only function evaluations.

(E04YCF not in this release) estimates selected elements of the variance-covariance matrix for the computed regression parameters following the use of a nonlinear least squares method.

e04xa estimates the gradient and Hessian of a function at a point, given a method to calculate function values only, or estimates the Hessian of a function at a point, given a method to calculate function and gradient values.

# Function Evaluations at Infeasible Points

All the methods for constrained problems will ensure that any evaluations of the objective function occur at points which

**approximately**satisfy any**simple bounds**or**linear constraints**. Satisfaction of such constraints is only approximate because methods which estimate derivatives by finite differences may require function evaluations at points which just violate such constraints even though the current iteration just satisfies them.There is no attempt to ensure that the current iteration satisfies any nonlinear constraints. If you wish to prevent your objective function being evaluated outside some known region (where it may be undefined or not practically computable), you may try to confine the iteration within this region by imposing suitable simple bounds or linear constraints (but beware as this may create new local minima where these constraints are active).

# Related Problems

Apart from the standard types of optimization problem, there are other related problems which can be solved by methods in this or other chapters of the Library.

h02bb solves

**dense integer LP**problems, h02cb solves**dense integer QP**problems, h02ce solves**sparse integer QP**problems and (H03ABF not in this release) solves a special type of such problem known as a**‘transportation’ problem**.Several methods in (F04 not in this release)

**F08**class solve**linear least squares problems**, i.e., $\mathrm{minimize}\u200a{\displaystyle \sum _{i=1}^{m}}{r}_{i}{\left(x\right)}^{2}$ where ${r}_{i}\left(x\right)={b}_{i}-{\displaystyle \sum _{j=1}^{n}}{a}_{ij}{x}_{j}$. (E02GAF not in this release) solves an overdetermined system of linear equations in the ${l}_{1}$ norm, i.e., minimizes $\sum _{i=1}^{m}}\left|{r}_{i}\left(x\right)\right|$, with ${r}_{i}$ as above, and (E02GBF not in this release) solves the same problem subject to linear inequality constraints.

(E02GCF not in this release) solves an overdetermined system of linear equations in the ${l}_{\infty}$ norm, i.e., minimizes $\underset{i}{\mathrm{max}}}\phantom{\rule{0.25em}{0ex}}\left|{r}_{i}\left(x\right)\right|$, with ${r}_{i}$ as above.

**E05**class contains methods for global minimization.

[Methods for handling multi-objective optimization] describes how a multi-objective optimization problem might be addressed using methods from this chapter and from

**E05**class.# Choosing Between Variant Methods for Some Problems

As evidenced by the wide variety of methods available in

**E04**class, it is clear that no single algorithm can solve all optimization problems. It is important to try to match the problem to the most suitable method, and that is what the decision trees in [Decision Trees] help to do.Sometimes in

**E04**class more than one method is available to solve precisely the same minimization problem. Thus, for example, the general nonlinear programming methods e04uc and e04wd are based on similar methods. Experience shows that although both methods can usually solve the same problem and get similar results, sometimes one method will be faster, sometimes one might find a different local minimum to the other, or, in difficult cases, one method may obtain a solution when the other one fails.After using one of these methods, if the results obtained are unacceptable for some reason, it may be worthwhile trying the other method instead. In the absence of any other information, in the first instance you are recommended to try using e04uc, and if that proves unsatisfactory, try using e04wd. Although the algorithms used are very similar, the two methods each have slightly different optional arguments which may allow the course of the computation to be altered in different ways.

Other pairs of methods which solve the same kind of problem are e04nq (recommended first choice) or e04nk, for sparse quadratic or linear programming problems, and e04ug or e04vh, for sparse nonlinear programming. In these cases the argument lists are not so similar as e04uc or e04wd, but the same considerations apply.

# Decision Trees

### Tree 1: Selection chart for unconstrained problems

Only one variable? | _ yes |
Are first derivatives available? | _ yes |
e04bb | ||||

| | no | |
|||||||

| | e04ab | |||||||

no | |
||||||||

Does the function have many discontinuities? | _ yes |
e04cb | ||||||

no | |
||||||||

Is store size a problem? | _ yes |
e04dg | ||||||

no | |
||||||||

Is the function a sum of squares? | _ yes |
Are you an experienced user? | _ yes |
Are first derivatives available? | _ yes |
Are second derivatives available? | _ yes |
e04he |

| | | | | | no | |
|||||

| | | | | | Are there more than ten variables? | _ yes |
(E04GBF not in this release) | |||

| | | | | | no | |
|||||

| | | | | | e04gd | |||||

| | | | no | |
||||||

| | | | e04fc | ||||||

| | no | |
|||||||

| | Are first derivatives available? | _ yes |
Are second derivatives available? | _ yes |
e04hy | |||

| | | | no | |
||||||

| | | | Are there more than ten variables? | _ yes |
e04gy | ||||

| | | | no | |
||||||

| | | | e04gz | ||||||

| | no | |
|||||||

| | e04fy | |||||||

no | |
||||||||

Are you an experienced user? | _ yes |
Are first derivatives available? | _ yes |
Are second derivatives available? | _ yes |
e04lb | ||

| | | | no | |
||||||

| | | | Is computational cost critical? | _ yes |
e04uc, e04uf, e04ug, e04vh or e04wd | ||||

| | | | no | |
||||||

| | | | e04kd | ||||||

| | no | |
|||||||

| | e04uc, e04uf, e04ug, e04vh or e04wd | |||||||

no | |
||||||||

Are first derivatives available? | _ yes |
Are second derivatives available? | _ yes |
e04ly | ||||

| | no | |
|||||||

| | Is computational cost critical? | _ yes |
e04ky | |||||

| | no | |
|||||||

| | e04kz | |||||||

no | |
||||||||

e04jy |

### Tree 2: Selection chart for bound-constrained, linearly-constrained and nonlinearly-constrained problems

Are there any nonlinear constraints? | _ yes |
Is the objective function a sum of squares? (A least squares problem) | _ yes |
e04us | ||||

| | no | |
|||||||

| | Are the constraints sparse? | _ yes |
e04ug or e04vh | |||||

| | no | |
|||||||

| | e04uc, e04uf or e04wd | |||||||

no | |
||||||||

Is the objective function linear? (An LP problem) | _ yes |
See Tree 3 | ||||||

no | |
||||||||

Is the objective function quadratic? (A $QP$ or least squares problem) | _ yes |
Is the problem a least squares problem? | _ yes |
Are the constraints simple bounds? | _ yes |
e04pc | ||

| | | | no | |
||||||

| | | | e04nc and e04pc | ||||||

| | no | |
|||||||

| | See Tree 3 | |||||||

no | |
||||||||

Is the objective function a sum of squares? (A least squares problem) | _ yes |
e04us | ||||||

no | |
||||||||

Are the constraints simple bounds? | _ yes |
Are you an experienced user? | _ yes |
Are first derivatives available? | _ yes |
Are second derivatives available? | _ yes |
e04lb |

| | | | | | no | |
|||||

| | | | | | e04kd, e04uc, e04uf, e04ug or e04vh | |||||

| | | | no | |
||||||

| | | | e04uc, e04uf, e04ug, e04vh or e04wd | ||||||

| | no | |
|||||||

| | Are first derivatives available? | _ yes |
Are second derivatives available? | _ yes |
e04ly | |||

| | | | no | |
||||||

| | | | Is computational cost critical? | _ yes |
e04ky | ||||

| | | | no | |
||||||

| | | | e04kz | ||||||

| | no | |
|||||||

| | e04jc or e04jy | |||||||

no | |
||||||||

e04uc, e04uf, e04ug or e04vh |

### Tree 3: Linear, Quadratic and Semi-definite Programming (LP, QP and SDP)

Does the problem include semidefinite constraints or bilinear matrix inequalities (an SDP problem)? | _ yes |
(E04RAF not in this release) and associated suite |

no | |
||

Is the linear constraint matrix sparse? | _ yes |
e04nq, e04nk, e04vh and e04ug |

no | |
||

Is the objective function linear (an LP problem)? | _ yes |
e04mf |

no | |
||

Is the QP problem convex? | _ yes |
e04nc |

no | |
||

e04nf |

# References

Bard Y (1974)

*Nonlinear Parameter Estimation*Academic PressDantzig G B (1963)

*Linear Programming and Extensions*Princeton University PressFletcher R (1987)

*Practical Methods of Optimization*(2nd Edition) WileyGill P E and Murray W (ed.) (1974)

*Numerical Methods for Constrained Optimization*Academic PressGill P E, Murray W and Wright M H (1981)

*Practical Optimization*Academic PressMurray W (ed.) (1972)

*Numerical Methods for Unconstrained Optimization*Academic PressWolberg J R (1967)

*Prediction Analysis*Van Nostrand