NAG Library Routine Document
e04nkf
(qpconvex1_sparse_solve_old)
e04nka (qpconvex1_sparse_solve)
Note: this routine uses optional parameters to define choices in the problem specification and in the details of the algorithm. If you wish to use default
settings for all of the optional parameters, you need only read Sections 1 to 10 of this document. If, however, you wish to reset some or all of the settings please refer to Section 11 for a detailed description of the algorithm, to Section 12 for a detailed description of the specification of the optional parameters and to Section 13 for a detailed description of the monitoring information produced by the routine.
1
Purpose
e04nkf/e04nka solves sparse linear programming or convex quadratic programming problems.
e04nka is a version of
e04nkf that has additional arguments in order to make it safe for use in multithreaded applications (see
Section 5). The initialization routine
e04wbf must have been called before calling
e04nka.
2
Specification
2.1
Specification for e04nkf
Fortran Interface
Subroutine e04nkf ( |
n,
m,
nnz,
iobj,
ncolh,
qphx,
a,
ha,
ka,
bl,
bu,
start,
names,
nname,
crname,
ns,
xs,
istate,
miniz,
minz,
ninf,
sinf,
obj,
clamda,
iz,
leniz,
z,
lenz,
ifail) |
Integer, Intent (In) | :: |
n,
m,
nnz,
iobj,
ncolh,
ha(nnz),
ka(n+1),
nname,
leniz,
lenz | Integer, Intent (Inout) | :: |
ns,
istate(n+m),
ifail | Integer, Intent (Out) | :: |
miniz,
minz,
ninf,
iz(leniz) | Real (Kind=nag_wp), Intent (Inout) | :: |
a(nnz),
bl(n+m),
bu(n+m),
xs(n+m) | Real (Kind=nag_wp), Intent (Out) | :: |
sinf,
obj,
clamda(n+m),
z(lenz) | Character (1), Intent (In) | :: |
start | Character (8), Intent (In) | :: |
names(5),
crname(nname) | External | :: |
qphx |
|
C Header Interface
#include nagmk26.h
void |
e04nkf_ (
const Integer *n,
const Integer *m,
const Integer *nnz,
const Integer *iobj,
const Integer *ncolh,
void (NAG_CALL *qphx)(
const Integer *nstate,
const Integer *ncolh,
const double x[],
double hx[]),
double a[],
const Integer ha[],
const Integer ka[],
double bl[],
double bu[],
const char *start,
const char names[],
const Integer *nname,
const char crname[],
Integer *ns,
double xs[],
Integer istate[],
Integer *miniz,
Integer *minz,
Integer *ninf,
double *sinf,
double *obj,
double clamda[],
Integer iz[],
const Integer *leniz,
double z[],
const Integer *lenz,
Integer *ifail,
const Charlen length_start,
const Charlen length_names,
const Charlen length_crname) |
|
2.2
Specification for e04nka
Fortran Interface
Subroutine e04nka ( |
n,
m,
nnz,
iobj,
ncolh,
qphx,
a,
ha,
ka,
bl,
bu,
start,
names,
nname,
crname,
ns,
xs,
istate,
miniz,
minz,
ninf,
sinf,
obj,
clamda,
iz,
leniz,
z,
lenz,
iuser,
ruser,
lwsav,
iwsav,
rwsav,
ifail) |
Integer, Intent (In) | :: |
n,
m,
nnz,
iobj,
ncolh,
ha(nnz),
ka(n+1),
nname,
leniz,
lenz | Integer, Intent (Inout) | :: |
ns,
istate(n+m),
iuser(*),
iwsav(380),
ifail | Integer, Intent (Out) | :: |
miniz,
minz,
ninf,
iz(leniz) | Real (Kind=nag_wp), Intent (Inout) | :: |
a(nnz),
bl(n+m),
bu(n+m),
xs(n+m),
ruser(*),
rwsav(285) | Real (Kind=nag_wp), Intent (Out) | :: |
sinf,
obj,
clamda(n+m),
z(lenz) | Logical, Intent (Inout) | :: |
lwsav(20) | Character (1), Intent (In) | :: |
start | Character (8), Intent (In) | :: |
names(5),
crname(nname) | External | :: |
qphx |
|
C Header Interface
#include nagmk26.h
void |
e04nka_ (
const Integer *n,
const Integer *m,
const Integer *nnz,
const Integer *iobj,
const Integer *ncolh,
void (NAG_CALL *qphx)(
const Integer *nstate,
const Integer *ncolh,
const double x[],
double hx[],
Integer iuser[],
double ruser[]),
double a[],
const Integer ha[],
const Integer ka[],
double bl[],
double bu[],
const char *start,
const char names[],
const Integer *nname,
const char crname[],
Integer *ns,
double xs[],
Integer istate[],
Integer *miniz,
Integer *minz,
Integer *ninf,
double *sinf,
double *obj,
double clamda[],
Integer iz[],
const Integer *leniz,
double z[],
const Integer *lenz,
Integer iuser[],
double ruser[],
logical lwsav[],
Integer iwsav[],
double rwsav[],
Integer *ifail,
const Charlen length_start,
const Charlen length_names,
const Charlen length_crname) |
|
Before calling
e04nka, or
either of the option setting routines
e04nla or
e04nma,
e04wbf must be called.
The specification for
e04wbf is:
Fortran Interface
Integer, Intent (In) | :: |
lcwsav,
llwsav,
liwsav,
lrwsav | Integer, Intent (Inout) | :: |
ifail | Integer, Intent (Out) | :: |
iwsav(liwsav) | Real (Kind=nag_wp), Intent (Out) | :: |
rwsav(lrwsav) | Logical, Intent (Out) | :: |
lwsav(llwsav) | Character (*), Intent (In) | :: |
rname | Character (80), Intent (Out) | :: |
cwsav(lcwsav) |
|
C Header Interface
#include nagmk26.h
void |
e04wbf (
const char *rname,
char cwsav[],
const Integer *lcwsav,
logical lwsav[],
const Integer *llwsav,
Integer iwsav[],
const Integer *liwsav,
double rwsav[],
const Integer *lrwsav,
Integer *ifail,
const Charlen length_rname,
const Charlen length_cwsav) |
|
e04wbf should be called with
.
lcwsav,
llwsav,
liwsav and
lrwsav, the declared lengths of
cwsav,
lwsav,
iwsav and
rwsav respectively, must satisfy:
The contents of the
arrays
cwsav,
lwsav,
iwsav and
rwsav
must not be altered between calling routines
e04nka,
e04nla,
e04nma and
e04wbf.
3
Description
e04nkf/e04nka is designed to solve a class of quadratic programming problems that are assumed to be stated in the following general form:
where
is a set of variables,
is an
by
matrix and the objective function
may be specified in a variety of ways depending upon the particular problem to be solved. The optional parameter
Maximize may be used to specify an alternative problem in which
is maximized. The possible forms for
are listed in
Table 1, in which the prefixes FP, LP and QP stand for ‘feasible point’, ‘linear programming’ and ‘quadratic programming’ respectively,
is an
-element vector and
is the
by
second-derivative matrix
(the
Hessian matrix).
Problem type |
Objective function |
Hessian matrix |
FP |
Not applicable |
Not applicable |
LP |
|
Not applicable |
QP |
|
Symmetric positive semidefinite |
Table 1
For LP and QP problems, the unique global minimum value of
is found. For FP problems,
is omitted and the routine attempts to find a feasible point for the set of constraints. For QP problems, you must also provide a subroutine that computes
for any given vector
. (
need not be stored explicitly.) If
is the zero matrix, the routine will still solve the resulting LP problem; however, this can be accomplished more efficiently by setting
(see
Section 5).
The defining feature of a
convex QP problem is that the matrix
must be
positive semidefinite, i.e., it must satisfy
for all
. Otherwise,
is said to be
nonconvex and it may be more appropriate to call
e04ugf/e04uga instead.
e04nkf/e04nka is intended to solve large-scale linear and quadratic programming problems in which the constraint matrix
is
sparse (i.e., when the number of zero elements is sufficiently large that it is worthwhile using algorithms which avoid computations and storage involving zero elements). The routine also takes advantage of sparsity in
. (Sparsity in
can be exploited in the subroutine that computes
.) For problems in which
can be treated as a
dense matrix, it is usually more efficient to use
e04mff/e04mfa,
e04ncf/e04nca or
e04nff/e04nfa.
The upper and lower bounds on the
elements of
are said to define the
general constraints of the problem. Internally,
e04nkf/e04nka converts the general constraints to equalities by introducing a set of
slack variables , where
. For example, the linear constraint
is replaced by
, together with the bounded slack
. The problem defined by
(1) can therefore be re-written in the following equivalent form:
Since the slack variables
are subject to the same upper and lower bounds as the elements of
, the bounds on
and
can simply be thought of as bounds on the combined vector
. (In order to indicate their special role in QP problems, the original variables
are sometimes known as ‘column variables’, and the slack variables
are known as ‘row variables’.)
Each LP or QP problem is solved using an active-set method. This is an iterative procedure with two phases: a feasibility phase, in which the sum of infeasibilities is minimized to find a feasible point; and an optimality phase, in which is minimized by constructing a sequence of iterations that lies within the feasible region.
A constraint is said to be active or binding at if the associated element of either or is equal to one of its upper or lower bounds. Since an active constraint in has its associated slack variable at a bound, the status of both simple and general upper and lower bounds can be conveniently described in terms of the status of the variables . A variable is said to be nonbasic if it is temporarily fixed at its upper or lower bound. It follows that regarding a general constraint as being active is equivalent to thinking of its associated slack as being nonbasic.
At each iteration of an active-set method, the constraints
are (conceptually) partitioned into the form
where
consists of the nonbasic elements of
and the
basis matrix is square and nonsingular. The elements of
and
are called the
basic and
superbasic variables respectively; with
they are a permutation of the elements of
and
. At a QP solution, the basic and superbasic variables will lie somewhere between their upper or lower bounds, while the nonbasic variables will be equal to one of their bounds. At each iteration,
is regarded as a set of independent variables that are free to move in any desired direction, namely one that will improve the value of the objective function (or sum of infeasibilities). The basic variables are then adjusted in order to ensure that
continues to satisfy
. The number of superbasic variables (
say) therefore indicates the number of degrees of freedom remaining after the constraints have been satisfied. In broad terms,
is a measure of
how nonlinear the problem is. In particular,
will always be zero for FP and LP problems.
If it appears that no improvement can be made with the current definition of , and , a nonbasic variable is selected to be added to , and the process is repeated with the value of increased by one. At all stages, if a basic or superbasic variable encounters one of its bounds, the variable is made nonbasic and the value of is decreased by one.
Associated with each of the
equality constraints
is a
dual variable . Similarly, each variable in
has an associated
reduced gradient (also known as a
reduced cost). The reduced gradients for the variables
are the quantities
, where
is the gradient of the QP objective function; and the reduced gradients for the slack variables
are the dual variables
. The QP subproblem is optimal if
for all nonbasic variables at their lower bounds,
for all nonbasic variables at their upper bounds and
for all superbasic variables. In practice, an
approximate QP solution is found by slightly relaxing these conditions on
(see the description of the optional parameter
Optimality Tolerance).
The process of computing and comparing reduced gradients is known as
pricing (a term first introduced in the context of the simplex method for linear programming). To ‘price’ a nonbasic variable
means that the reduced gradient
associated with the relevant active upper or lower bound on
is computed via the formula
, where
is the
th column of
. (The variable selected by such a process and the corresponding value of
(i.e., its reduced gradient) are the quantities
+S and
dj in the monitoring file output; see
Section 13.) If
has significantly more columns than rows (i.e.,
), pricing can be computationally expensive. In this case, a strategy known as
partial pricing can be used to compute and compare only a subset of the
's.
e04nkf/e04nka is based on SQOPT, which is part of the SNOPT package described in
Gill et al. (2002), which in turn utilizes routines from the MINOS package (see
Murtagh and Saunders (1995)). It uses stable numerical methods throughout and includes a reliable basis package (for maintaining sparse
factors of the basis matrix
), a practical anti-degeneracy procedure, efficient handling of linear constraints and bounds on the variables (by an active-set strategy), as well as automatic scaling of the constraints. Further details can be found in
Section 11.
4
References
Fourer R (1982) Solving staircase linear programs by the simplex method Math. Programming 23 274–313
Gill P E and Murray W (1978) Numerically stable methods for quadratic programming Math. Programming 14 349–372
Gill P E, Murray W and Saunders M A (2002) SNOPT: An SQP Algorithm for Large-scale Constrained Optimization 12 979–1006 SIAM J. Optim.
Gill P E, Murray W, Saunders M A and Wright M H (1987) Maintaining LU factors of a general sparse matrix Linear Algebra and its Applics. 88/89 239–270
Gill P E, Murray W, Saunders M A and Wright M H (1989) A practical anti-cycling procedure for linearly constrained optimization Math. Programming 45 437–474
Gill P E, Murray W, Saunders M A and Wright M H (1991) Inertia-controlling methods for general quadratic programming SIAM Rev. 33 1–36
Hall J A J and McKinnon K I M (1996) The simplest examples where the simplex method cycles and conditions where EXPAND fails to prevent cycling Report MS 96–100 Department of Mathematics and Statistics, University of Edinburgh
Murtagh B A and Saunders M A (1995) MINOS 5.4 users' guide Report SOL 83-20R Department of Operations Research, Stanford University
5
Arguments
- 1: – IntegerInput
-
On entry: , the number of variables (excluding slacks). This is the number of columns in the linear constraint matrix .
Constraint:
.
- 2: – IntegerInput
-
On entry:
, the number of general linear constraints (or slacks). This is the number of rows in
, including the free row (if any; see
iobj).
Constraint:
.
- 3: – IntegerInput
-
On entry: the number of nonzero elements in .
Constraint:
.
- 4: – IntegerInput
-
On entry: if
, row
iobj of
is a free row containing the nonzero elements of the vector
appearing in the linear objective term
.
If
, there is no free row, i.e., the problem is either an FP problem (in which case
iobj must be set to zero), or a QP problem with
.
Constraint:
.
- 5: – IntegerInput
-
On entry:
, the number of leading nonzero columns of the Hessian matrix
. For FP and LP problems,
ncolh must be set to zero.
Constraint:
.
- 6: – Subroutine, supplied by the NAG Library or the user.External Procedure
-
For QP problems, you must supply a version of
qphx to compute the matrix product
. If
has zero rows and columns, it is most efficient to order the variables
so that
where the nonlinear variables
appear first as shown. For FP and LP problems,
qphx will never be called by
e04nkf/e04nka and hence
qphx may be the dummy routine e04nku/e54nku.
The specification of
qphx
for
e04nkf is:
Fortran Interface
Integer, Intent (In) | :: |
nstate,
ncolh | Real (Kind=nag_wp), Intent (In) | :: |
x(ncolh) | Real (Kind=nag_wp), Intent (Out) | :: |
hx(ncolh) |
|
C Header Interface
#include nagmk26.h
void |
qphx (
const Integer *nstate,
const Integer *ncolh,
const double x[],
double hx[]) |
|
The specification of
qphx
for
e04nka is:
Fortran Interface
Integer, Intent (In) | :: |
nstate,
ncolh | Integer, Intent (Inout) | :: |
iuser(*) | Real (Kind=nag_wp), Intent (In) | :: |
x(ncolh) | Real (Kind=nag_wp), Intent (Inout) | :: |
ruser(*) | Real (Kind=nag_wp), Intent (Out) | :: |
hx(ncolh) |
|
C Header Interface
#include nagmk26.h
void |
qphx (
const Integer *nstate,
const Integer *ncolh,
const double x[],
double hx[],
Integer iuser[],
double ruser[]) |
|
- 1: – IntegerInput
-
On entry: if
,
e04nkf/e04nka is calling
qphx for the first time. This argument setting allows you to save computation time if certain data must be read or calculated only once.
If
,
e04nkf/e04nka is calling
qphx for the last time. This argument setting allows you to perform some additional computation on the final solution. In general, the last call to
qphx is made with
(see
Section 6).
Otherwise, .
- 2: – IntegerInput
-
On entry: this is the same argument
ncolh as supplied to
e04nkf/e04nka.
- 3: – Real (Kind=nag_wp) arrayInput
-
On entry: the first
ncolh elements of the vector
.
- 4: – Real (Kind=nag_wp) arrayOutput
-
On exit: the product .
- Note: the following are additional arguments for specific use with e04nka. Users of e04nkf therefore need not read the remainder of this description.
- 5: – Integer arrayUser Workspace
- 6: – Real (Kind=nag_wp) arrayUser Workspace
-
qphx is called with the arguments
iuser and
ruser as supplied to
e04nkf/e04nka. You should use the arrays
iuser and
ruser to supply information to
qphx.
qphx must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which
e04nkf/e04nka is called. Arguments denoted as
Input must
not be changed by this procedure.
Note: qphx should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by
e04nkf/e04nka. If your code inadvertently
does return any NaNs or infinities,
e04nkf/e04nka is likely to produce unexpected results.
- 7: – Real (Kind=nag_wp) arrayInput
-
On entry: the nonzero elements of , ordered by increasing column index. Note that elements with the same row and column indices are not allowed.
- 8: – Integer arrayInput
-
On entry: must contain the row index of the nonzero element stored in , for . Note that the row indices for a column may be supplied in any order.
Constraint:
, for .
- 9: – Integer arrayInput
-
On entry:
must contain the index in
a of the start of the
th column, for
.
must be set to
. To specify the
th column as empty, set
. As a consequence
is always
.
Constraints:
- ;
- , for ;
- ;
- , for .
- 10: – Real (Kind=nag_wp) arrayInput
-
On entry:
, the lower bounds for all the variables and general constraints, in the following order. The first
n elements of
bl must contain the bounds on the variables
, and the next
m elements the bounds for the general linear constraints
(or slacks
) and the free row (if any). To specify a nonexistent lower bound (i.e.,
), set
, where
is the value of the optional parameter
Infinite Bound Size. To specify the
th constraint as an
equality, set
, say, where
. Note that the lower bound corresponding to the free row must be set to
and stored in
.
Constraint:
if
,
(See also the description for
bu.)
- 11: – Real (Kind=nag_wp) arrayInput
-
On entry:
, the upper bounds for all the variables and general constraints, in the following order. The first
n elements of
bu must contain the bounds on the variables
, and the next
m elements the bounds for the general linear constraints
(or slacks
) and the free row (if any). To specify a nonexistent upper bound (i.e.,
), set
. Note that the upper bound corresponding to the free row must be set to
and stored in
.
Constraints:
- if , ;
- , for ;
- if , .
- 12: – Character(1)Input
-
On entry: indicates how a starting basis is to be obtained.
- An internal Crash procedure will be used to choose an initial basis matrix .
- A basis is already defined in istate (probably from a previous call).
Constraint:
or .
- 13: – Character(8) arrayInput
-
On entry: a set of names associated with the so-called MPSX form of the problem, as follows:
- Must contain the name for the problem (or be blank).
- Must contain the name for the free row (or be blank).
- Must contain the name for the constraint right-hand side (or be blank).
- Must contain the name for the ranges (or be blank).
- Must contain the name for the bounds (or be blank).
(These names are used in the monitoring file output; see
Section 13.)
- 14: – IntegerInput
-
On entry: the number of column (i.e., variable) and row names supplied in
crname.
- There are no names. Default names will be used in the printed output.
- All names must be supplied.
Constraint:
or .
- 15: – Character(8) arrayInput
-
On entry: the optional column and row names, respectively.
If
,
crname is not referenced and the printed output will use default names for the columns and rows.
If
, the first
n elements must contain the names for the columns and the next
m elements must contain the names for the rows. Note that the name for the free row (if any) must be stored in
.
- 16: – IntegerInput/Output
-
On entry:
, the number of superbasics. For QP problems,
ns need not be specified if
, but must retain its value from a previous call when
. For FP and LP problems,
ns need not be initialized.
On exit: the final number of superbasics. This will be zero for FP and LP problems.
- 17: – Real (Kind=nag_wp) arrayInput/Output
-
On entry: the initial values of the variables and slacks
. (See the description for
istate.)
On exit: the final values of the variables and slacks .
- 18: – Integer arrayInput/Output
-
On entry: if
, the first
n elements of
istate and
xs must specify the initial states and values, respectively, of the variables
. (The slacks
need not be initialized.) An internal Crash procedure is then used to select an initial basis matrix
. The initial basis matrix will be triangular (neglecting certain small elements in each column). It is chosen from various rows and columns of
. Possible values for
are as follows:
| State of during Crash procedure |
or | Eligible for the basis |
| Ignored |
| Eligible for the basis (given preference over or ) |
or | Ignored |
If nothing special is known about the problem, or there is no wish to provide special information, you may set
and , for . All variables will then be eligible for the initial basis. Less trivially, to say that the th variable will probably be equal to one of its bounds, set and or and as appropriate.
Following the Crash procedure, variables for which are made superbasic. Other variables not selected for the basis are then made nonbasic at the value if , or at the value or closest to .
If
,
istate and
xs must specify the initial states and values, respectively, of the variables and slacks
. If
e04nkf/e04nka has been called previously with the same values of
n and
m,
istate already contains satisfactory information.
Constraints:
- if , , for ;
- if , , for .
On exit: the final states of the variables and slacks
. The significance of each possible value of
is as follows:
| State of variable | Normal value of |
| Nonbasic | |
| Nonbasic | |
| Superbasic | Between and |
| Basic | Between and |
If
, basic and superbasic variables may be outside their bounds by as much as the value of the optional parameter
Feasibility Tolerance. Note that unless the
is specified, the optional parameter
Feasibility Tolerance applies to the variables of the scaled problem. In this case, the variables of the original problem may be as much as
outside their bounds, but this is unlikely unless the problem is very badly scaled.
Very occasionally some nonbasic variables may be outside their bounds by as much as the optional parameter
Feasibility Tolerance, and there may be some nonbasic variables for which
lies strictly between its bounds.
If
, some basic and superbasic variables may be outside their bounds by an arbitrary amount (bounded by
sinf if
).
- 19: – IntegerOutput
-
On exit: the minimum value of
leniz required to start solving the problem. If
,
e04nkf/e04nka may be called again with
leniz suitably larger than
miniz. (The bigger the better, since it is not certain how much workspace the basis factors need.)
- 20: – IntegerOutput
-
On exit: the minimum value of
lenz required to start solving the problem. If
,
e04nkf/e04nka may be called again with
lenz suitably larger than
minz. (The bigger the better, since it is not certain how much workspace the basis factors need.)
- 21: – IntegerOutput
-
On exit: the number of infeasibilities. This will be zero if or .
- 22: – Real (Kind=nag_wp)Output
-
On exit: the sum of infeasibilities. This will be zero if
. (Note that
e04nkf/e04nka does
not attempt to compute the minimum value of
sinf if
.)
- 23: – Real (Kind=nag_wp)Output
-
On exit: the value of the objective function.
If
,
obj includes the quadratic objective term
(if any).
If
,
obj is just the linear objective term
(if any).
For FP problems,
obj is set to zero.
- 24: – Real (Kind=nag_wp) arrayOutput
-
On exit: a set of Lagrange multipliers for the bounds on the variables and the general constraints. More precisely, the first
n elements contain the multipliers (
reduced costs) for the bounds on the variables, and the next
m elements contain the multipliers (
shadow prices) for the general linear constraints.
- 25: – Integer arrayWorkspace
-
- 26: – IntegerInput
-
On entry: the dimension of the array
iz as declared in the (sub)program from which
e04nkf/e04nka is called.
Constraint:
.
- 27: – Real (Kind=nag_wp) arrayWorkspace
- 28: – IntegerInput
-
On entry: the dimension of the array
z as declared in the (sub)program from which
e04nkf/e04nka is called.
Constraint:
.
The amounts of workspace provided (i.e.,
leniz and
lenz) and required (i.e.,
miniz and
minz) are (by default for
e04nkf) output on the current advisory message unit
nadv (as defined by
x04abf). Since the minimum values of
leniz and
lenz required to start solving the problem are returned in
miniz and
minz, respectively, you may prefer to obtain appropriate values from the output of a preliminary run with
leniz and
lenz set to
. (
e04nkf/e04nka will then terminate with
.)
- 29: – IntegerInput/Output
-
Note: for e04nka, ifail does not occur in this position in the argument list. See the additional arguments described below.
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, because for this routine the values of the output arguments may be useful even if
on exit, the recommended value is
.
When the value is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
e04nkf/e04nka returns with
if the reduced gradient (
Norm rg; see
Section 9.1) is negligible, the Lagrange multipliers (
Lagr Mult; see
Section 9.1) are optimal and
satisfies the constraints to the accuracy requested by the value of the optional parameter
Feasibility Tolerance (
, where
is the
machine precision).
- Note: the following are additional arguments for specific use with e04nka. Users of e04nkf therefore need not read the remainder of this description.
- 29: – Integer arrayUser Workspace
- 30: – Real (Kind=nag_wp) arrayUser Workspace
-
iuser and
ruser are not used by
e04nkf/e04nka, but are passed directly to
qphx and may be used to pass information to this routine.
- 31: – Logical arrayCommunication Array
- 32: – Integer arrayCommunication Array
- 33: – Real (Kind=nag_wp) arrayCommunication Array
-
The arrays
lwsav,
iwsav and
rwsav must not be altered between calls to any of the routines
e04nka,
e04nla,
e04nma or
e04wbf.
- 34: – IntegerInput/Output
-
Note: see the argument description for
ifail above.
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Note: e04nkf/e04nka may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
-
Weak solution found. The final is not unique, although gives the global minimum value of the objective function.
-
The problem is unbounded (or badly scaled). The objective function is not bounded below in the feasible region.
-
The problem is infeasible. The general constraints cannot all be satisfied simultaneously to within the value of the optional parameter
Feasibility Tolerance (
, where
is the
machine precision).
-
Too many iterations. The value of the optional parameter
Iteration Limit (
) is too small.
-
The reduced Hessian matrix
(see
Section 11.2) exceeds its assigned dimension. The value of the optional parameter
Superbasics Limit (
) is too small.
-
The Hessian matrix
appears to be indefinite. This sometimes occurs because the values of the optional parameters
LU Factor Tolerance (
) and
LU Update Tolerance (
) are too large. Check also that
qphx has been coded correctly and that all relevant elements of
have been assigned their correct values.
-
An input argument is invalid.
-
Numerical error in trying to satisfy the general constraints. The basis is very ill-conditioned.
-
Not enough integer workspace for the basis factors. Increase
leniz and rerun
e04nkf/e04nka.
-
Not enough real workspace for the basis factors. Increase
lenz and rerun
e04nkf/e04nka.
-
The basis is singular after
attempts to factorize it (adding slacks where necessary). Either the problem is badly scaled or the value of the optional parameter
LU Factor Tolerance (
) is too large.
-
Not enough integer workspace to start solving the problem. Increase
leniz to at least
miniz and rerun
e04nkf/e04nka.
-
Not enough real workspace to start solving the problem. Increase
lenz to at least
minz and rerun
e04nkf/e04nka.
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See
Section 3.7 in How to Use the NAG Library and its Documentation for further information.
7
Accuracy
e04nkf/e04nka implements a numerically stable active-set strategy and returns solutions that are as accurate as the condition of the problem warrants on the machine.
8
Parallelism and Performance
e04nkf/e04nka makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
This section contains a description of the printed output.
9.1
Description of the Printed Output
This section describes the intermediate printout and final printout produced by
e04nkf/e04nka. The intermediate printout is a subset of the monitoring information produced by the routine at every iteration (see
Section 13). You can control the level of printed output (see the description of the optional parameter
Print Level). Note that the intermediate printout and final printout are produced only if
(the default for
e04nkf, by default no output is produced by
e04nka).
The following line of summary output (
characters) is produced at every iteration. In all cases, the values of the quantities printed are those in effect
on
completion of the given iteration.
Itn |
is the iteration count.
|
Step |
is the step taken along the computed search direction.
|
Ninf |
is the number of violated constraints (infeasibilities). This will be zero during the optimality phase.
|
Sinf/Objective |
is the value of the current objective function. If is not feasible, Sinf gives the sum of the magnitudes of constraint violations. If is feasible, Objective is the value of the objective function. The output line for the final iteration of the feasibility phase (i.e., the first iteration for which Ninf is zero) will give the value of the true objective at the first feasible point. During the optimality phase, the value of the objective function will be nonincreasing. During the feasibility phase, the number of constraint infeasibilities will not increase until either a feasible point is found, or the optimality of the multipliers implies that no feasible point exists.
|
Norm rg |
is , the Euclidean norm of the reduced gradient (see Section 11.3). During the optimality phase, this norm will be approximately zero after a unit step. For FP and LP problems, Norm rg is not printed.
|
The final printout includes a listing of the status of every variable and constraint.
The following describes the printout for each variable. A full stop (.) is printed for any numerical value that is zero.
Variable |
gives the name of the variable. If , a default name is assigned to the th variable, for . If , the name supplied in is assigned to the th variable.
|
State |
gives the state of the variable (LL if nonbasic on its lower bound, UL if nonbasic on its upper bound, EQ if nonbasic and fixed, FR if nonbasic and strictly between its bounds, BS if basic and SBS if superbasic).
A key is sometimes printed before State.
Note that unless the optional parameter ( ) is specified, the tests for assigning a key are applied to the variables of the scaled problem.
A |
Alternative optimum possible. The variable is nonbasic, but its reduced gradient is essentially zero. This means that if the variable were allowed to start moving away from its bound, there would be no change in the value of the objective function. The values of the other free variables might change, giving a genuine alternative solution. However, if there are any degenerate variables (labelled D), the actual change might prove to be zero, since one of them could encounter a bound immediately. In either case, the values of the Lagrange multipliers might also change.
|
D |
Degenerate. The variable is basic or superbasic, but it is equal (or very close) to one of its bounds.
|
I |
Infeasible. The variable is basic or superbasic and is currently violating one of its bounds by more than the value of the Feasibility Tolerance.
|
N |
Not precisely optimal. The variable is nonbasic or superbasic. If the value of the reduced gradient for the variable exceeds the value of the optional parameter Optimality Tolerance, the solution would not be declared optimal because the reduced gradient for the variable would not be considered negligible.
|
|
Value |
is the value of the variable at the final iteration.
|
Lower Bound |
is the lower bound specified for the variable. None indicates that .
|
Upper Bound |
is the upper bound specified for the variable. None indicates that .
|
Lagr Mult |
is the Lagrange multiplier for the associated bound. This will be zero if State is FR. If is optimal, the multiplier should be non-negative if State is LL, non-positive if State is UL and zero if State is BS or SBS.
|
Residual |
is the difference between the variable Value and the nearer of its (finite) bounds and . A blank entry indicates that the associated variable is not bounded (i.e., and ).
|
The meaning of the printout for linear constraints is the same as that given above for variables, with ‘variable’ replaced by ‘constraint’,
replaced by
,
replaced by
,
and
are replaced by
and
respectively, and with the following change in the heading:
Constrnt |
gives the name of the linear constraint.
|
Note that movement off a constraint (as opposed to a variable moving away from its bound) can be interpreted as allowing the entry in the Residual column to become positive.
Numerical values are output with a fixed number of digits; they are not guaranteed to be accurate to this precision.
10
Example
This example minimizes the quadratic function
, where
subject to the bounds
and to the linear constraints
The initial point, which is infeasible, is
The optimal solution (to five figures) is
One bound constraint and four linear constraints are active at the solution. Note that the Hessian matrix
is positive semidefinite.
10.1
Program Text
Note: the following programs illustrate the use of e04nkf and e04nka.
Program Text (e04nkfe.f90)
Program Text (e04nkae.f90)
10.2
Program Data
Program Data (e04nkfe.d)
Program Data (e04nkae.d)
10.3
Program Results
Program Results (e04nkfe.r)
Program Results (e04nkae.r)
Note: the remainder of this document is intended for more advanced users. Section 11 contains a detailed description of the algorithm which may be needed in order to understand Sections 12 and 13. Section 12 describes the optional parameters which may be set by calls to e04nlf/e04nla and/or e04nmf/e04nma. Section 13 describes the quantities which can be requested to monitor the course of the computation.
11
Algorithmic Details
This section contains a detailed description of the method used by e04nkf/e04nka.
11.1
Overview
e04nkf/e04nka is based on an inertia-controlling method that maintains a Cholesky factorization of the reduced Hessian (see below). The method is similar to that of
Gill and Murray (1978), and is described in detail by
Gill et al. (1991). Here we briefly summarise the main features of the method. Where possible, explicit reference is made to the names of variables that are arguments of the routine or appear in the printed output.
The method used has two distinct phases: finding an initial feasible point by minimizing the sum of infeasibilities (the
feasibility phase), and minimizing the quadratic objective function within the feasible region (the
optimality phase). The computations in both phases are performed by the same subroutines. The two-phase nature of the algorithm is reflected by changing the function being minimized from the sum of infeasibilities (the printed quantity
Sinf; see
Section 13) to the quadratic objective function (the printed quantity
Objective; see
Section 13).
In general, an iterative process is required to solve a quadratic program. Given an iterate
in both the original variables
and the slack variables
, a new iterate
is defined by
where the
step length
is a non-negative scalar (the printed quantity
Step; see
Section 13), and
is called the
search direction. (For simplicity, we shall consider a typical iteration and avoid reference to the index of the iteration.) Once an iterate is feasible (i.e., satisfies the constraints), all subsequent iterates remain feasible.
11.2
Definition of the Working Set and Search Direction
At each iterate
, a
working set of constraints is defined to be a linearly independent subset of the constraints that are satisfied ‘exactly’ (to within the value of the optional parameter
Feasibility Tolerance). The working set is the current prediction of the constraints that hold with equality at a solution of the LP or QP problem. Let
denote the number of constraints in the working set (including bounds), and let
denote the associated
by
working set matrix consisting of the
gradients of the working set constraints.
The search direction is defined so that constraints in the working set remain
unaltered for any value of the step length. It follows that
must satisfy the identity
This characterisation allows
to be computed using any
by
full-rank matrix
that spans the null space of
. (Thus,
and
.) The null space matrix
is defined from a sparse
factorization of part of
(see
(6) and
(7)). The direction
will satisfy
(3) if
where
is any
-vector.
The working set contains the constraints and a subset of the upper and lower bounds on the variables . Since the gradient of a bound constraint or is a vector of all zeros except for in position , it follows that the working set matrix contains the rows of and the unit rows associated with the upper and lower bounds in the working set.
The working set matrix
can be represented in terms of a certain column partition of the matrix
by (conceptually) partitioning the constraints
so that
where
is a square nonsingular basis and
,
and
are the basic, superbasic and nonbasic variables respectively. The nonbasic variables are equal to their upper or lower bounds at
, and the superbasic variables are independent variables that are chosen to improve the value of the current objective function. The number of superbasic variables is
(the printed quantity
Ns; see
Section 13). Given values of
and
, the basic variables
are adjusted so that
satisfies
(5).
If
is a permutation matrix such that
, then
satisfies
where
is the identity matrix with the same number of columns as
.
The null space matrix
is defined from a sparse
factorization of part of
. In particular,
is maintained in ‘reduced gradient’ form, using the LUSOL package (see
Gill et al. (1991)) to maintain sparse
factors of the basis matrix
that alters as the working set
changes. Given the permutation
, the null space basis is given by
This matrix is used only as an operator, i.e., it is never computed explicitly. Products of the form
and
are obtained by solving with
or
. This choice of
implies that
, the number of ‘degrees of freedom’ at
, is the same as
, the number of superbasic variables.
Let
and
denote the
reduced gradient and
reduced Hessian of the objective function:
where
is the objective gradient at
. Roughly speaking,
and
describe the first and second derivatives of an
-dimensional
unconstrained problem for the calculation of
. (The condition estimator of
is the quantity
Cond Hz in the monitoring file output; see
Section 13.)
At each iteration, an upper triangular factor is available such that . Normally, is computed from at the start of the optimality phase and then updated as the QP working set changes. For efficiency, the dimension of should not be excessive (say, ). This is guaranteed if the number of nonlinear variables is ‘moderate’.
If the QP problem contains linear variables,
is positive semidefinite and
may be singular with at least one zero diagonal element. However, an inertia-controlling strategy is used to ensure that only the last diagonal element of
can be zero. (See
Gill et al. (1991) for a discussion of a similar strategy for indefinite quadratic programming.)
If the initial is singular, enough variables are fixed at their current value to give a nonsingular . This is equivalent to including temporary bound constraints in the working set. Thereafter, can become singular only when a constraint is deleted from the working set (in which case no further constraints are deleted until becomes nonsingular).
11.3
Main Iteration
If the reduced gradient is zero,
is a constrained stationary point on the working set. During the feasibility phase, the reduced gradient will usually be zero only at a vertex (although it may be zero elsewhere in the presence of constraint dependencies). During the optimality phase, a zero reduced gradient implies that
minimizes the quadratic objective function when the constraints in the working set are treated as equalities. At a constrained stationary point, Lagrange multipliers
are defined from the equations
A Lagrange multiplier
corresponding to an inequality constraint in the working set is said to be
optimal if
when the associated constraint is at its
upper bound, or if
when the associated constraint is at its
lower bound, where
depends on the value of the optional parameter
Optimality Tolerance. If a multiplier is nonoptimal, the objective function (either the true objective or the sum of infeasibilities) can be reduced by continuing the minimization with the corresponding constraint excluded from the working set. (This step is sometimes referred to as ‘deleting’ a constraint from the working set.) If optimal multipliers occur during the feasibility phase but the sum of infeasibilities is nonzero, there is no feasible point and the routine terminates immediately with
(see
Section 6).
The special form
(6) of the working set allows the multiplier vector
, the solution of
(9), to be written in terms of the vector
where
satisfies the equations
, and
denotes the basic elements of
. The elements of
are the Lagrange multipliers
associated with the equality constraints
. The vector
of nonbasic elements of
consists of the Lagrange multipliers
associated with the upper and lower bound constraints in the working set. The vector
of superbasic elements of
is the reduced gradient
in
(8). The vector
of basic elements of
is zero, by construction. (The Euclidean norm of
and the final values of
,
and
are the quantities
Norm rg,
Reduced Gradnt,
Obj Gradient and
Dual Activity in the monitoring file output; see
Section 13.)
If the reduced gradient is not zero, Lagrange multipliers need not be computed and the search direction is given by
(see
(7) and
(11)). The step length is chosen to maintain feasibility with respect to the satisfied constraints.
There are two possible choices for
, depending on whether or not
is singular. If
is nonsingular,
is nonsingular and
in
(4) is computed from the equations
where
is the reduced gradient at
. In this case,
is the minimizer of the objective function subject to the working set constraints being treated as equalities. If
is feasible,
is defined to be unity. In this case, the reduced gradient at
will be zero, and Lagrange multipliers are computed at the next iteration. Otherwise,
is set to
, the step to the ‘nearest’ constraint along
. This constraint is then added to the working set at the next iteration.
If
is singular, then
must also be singular, and an inertia-controlling strategy is used to ensure that only the last diagonal element of
is zero. (See
Gill et al. (1991) for a discussion of a similar strategy for indefinite quadratic programming.) In this case,
satisfies
which allows the objective function to be reduced by any step of the form
,
where
. The vector
is a direction of unbounded descent for the QP problem in the sense that the QP
objective is linear and decreases without bound along
. If no finite step of the form
(where
) reaches a constraint not in the working set, the QP problem is unbounded and the routine terminates immediately with
(see
Section 6). Otherwise,
is defined as the maximum feasible step along
and a constraint active at
is added to the working set for the next iteration.
11.4
Miscellaneous
If the basis matrix is not chosen carefully, the condition of the null space matrix
in
(7) could be arbitrarily high. To guard against this, the routine implements a ‘basis repair’ feature in which the LUSOL package (see
Gill et al. (1991)) is used to compute the rectangular factorization
returning just the permutation
that makes
unit lower triangular. The pivot tolerance is set to require
, and the permutation is used to define
in
(6). It can be shown that
is likely to be little more than unity. Hence,
should be well-conditioned
regardless of the condition of
. This feature is applied at the beginning of the optimality phase if a potential
ordering is known.
The EXPAND procedure (see
Gill et al. (1989)) is used to reduce the possibility of cycling at a point where the active constraints are nearly linearly dependent. Although there is no absolute guarantee that cycling will not occur, the probability of cycling is extremely small (see
Hall and McKinnon (1996)). The main feature of EXPAND is that the feasibility tolerance is increased at the start of every iteration. This allows a positive step to be taken at every iteration, perhaps at the expense of violating the bounds on
by a small amount.
Suppose that the value of the optional parameter
Feasibility Tolerance is
. Over a period of
iterations (where
is the value of the optional parameter
Expand Frequency), the feasibility tolerance actually used by the routine (i.e., the
working feasibility tolerance) increases from
to
(in steps of
).
At certain stages the following ‘resetting procedure’ is used to remove small constraint infeasibilities. First, all nonbasic variables are moved exactly onto their bounds. A count is kept of the number of nontrivial adjustments made. If the count is nonzero, the basic variables are recomputed. Finally, the working feasibility tolerance is reinitialized to .
If a problem requires more than iterations, the resetting procedure is invoked and a new cycle of iterations is started. (The decision to resume the feasibility phase or optimality phase is based on comparing any constraint infeasibilities with .)
The resetting procedure is also invoked when the routine reaches an apparently optimal, infeasible or unbounded solution, unless this situation has already occurred twice. If any nontrivial adjustments are made, iterations are continued.
The EXPAND procedure not only allows a positive step to be taken at every iteration, but also provides a potential choice of constraints to be added to the working set. All constraints at a distance (where ) along from the current point are then viewed as acceptable candidates for inclusion in the working set. The constraint whose normal makes the largest angle with the search direction is added to the working set. This strategy helps keep the basis matrix well-conditioned.
12
Optional Parameters
Several optional parameters in e04nkf/e04nka define choices in the problem specification or the algorithm logic. In order to reduce the number of formal arguments of e04nkf/e04nka these optional parameters have associated default values that are appropriate for most problems. Therefore, you need only specify those optional parameters whose values are to be different from their default values.
The remainder of this section can be skipped if you wish to use the default values for all optional parameters.
The following is a list of the optional parameters available. A full description of each optional parameter is provided in
Section 12.1.
Optional parameters may be specified by calling one, or both, of the routines
e04nlf/e04nla and
e04nmf/e04nma before a call to
e04nkf/e04nka.
e04nlf/e04nla reads options from an external options file, with
Begin and
End as the first and last lines respectively and each intermediate line defining a single optional parameter. For example,
Begin
Print Level = 5
End
The call
Call e04nlf (ioptns, inform)
can then be used to read the file on unit
ioptns.
inform will be zero on successful exit.
e04nlf/e04nla should be consulted for a full description of this method of supplying optional parameters.
e04nmf/e04nma can be called to supply options directly, one call being necessary for each optional parameter. For example,
Call e04nmf ('Print Level = 5')
e04nmf/e04nma should be consulted for a full description of this method of supplying optional parameters.
All optional parameters not specified by you are set to their default values. Optional parameters specified by you are unaltered by e04nkf/e04nka (unless they define invalid values) and so remain in effect for subsequent calls unless altered by you.
12.1
Description of the Optional Parameters
For each option, we give a summary line, a description of the optional parameter and details of constraints.
The summary line contains:
- the keywords, where the minimum abbreviation of each keyword is underlined (if no characters of an optional qualifier are underlined, the qualifier may be omitted);
- a parameter value,
where the letters , and denote options that take character, integer and real values respectively;
- the default value is used whenever the condition is satisfied and where the symbol is a generic notation for machine precision (see x02ajf);
Keywords and character values are case and white space insensitive.
Check Frequency | | Default |
Every th iteration after the most recent basis factorization, a numerical test is made to see if the current solution satisfies the linear constraints . If the largest element of the residual vector is judged to be too large, the current basis is refactorized and the basic variables recomputed to satisfy the constraints more accurately. If , the default value is used. If , the value is used and effectively no checks are made.
Note that this option does not apply when
(see
Section 5).
If , an internal Crash procedure is used to select an initial basis from various rows and columns of the constraint matrix . The value of determines which rows and columns are initially eligible for the basis, and how many times the Crash procedure is called. If , the all-slack basis is chosen. If , the Crash procedure is called once (looking for a triangular basis in all rows and columns of the linear constraint matrix ). If , the Crash procedure is called twice (looking at any equality constraints first followed by any inequality constraints). If or , the default value is used.
If , certain slacks on inequality rows are selected for the basis first. (If , numerical values are used to exclude slacks that are close to a bound.) The Crash procedure then makes several passes through the columns of , searching for a basis matrix that is essentially triangular. A column is assigned to ‘pivot’ on a particular row if the column contains a suitably large element in a row that has not yet been assigned. (The pivot elements ultimately form the diagonals of the triangular basis.) For remaining unassigned rows, slack variables are inserted to complete the basis.
Crash Tolerance | | Default |
This value allows the Crash procedure to ignore certain ‘small’ nonzero elements in the constraint matrix while searching for a triangular basis. For each column of , if is the largest element in the column, other nonzeros in that column are ignored if they are less than (or equal to) .
When , the basis obtained by the Crash procedure may not be strictly triangular, but it is likely to be nonsingular and almost triangular. The intention is to obtain a starting basis with more column variables and fewer (arbitrary) slacks. A feasible solution may be reached earlier for some problems. If or , the default value is used.
This special keyword may be used to reset all optional parameters to their default values.
Expand Frequency | | Default |
This option is part of an anti-cycling procedure (see
Section 11.4) designed to allow progress even on highly degenerate problems.
For LP problems, the strategy is to force a positive step at every iteration, at the expense of violating the constraints by a small amount. Suppose that the value of the optional parameter
Feasibility Tolerance is
. Over a period of
iterations, the feasibility tolerance actually used by
e04nkf/e04nka (i.e., the
working feasibility tolerance) increases from
to
(in steps of
).
For QP problems, the same procedure is used for iterations in which there is only one superbasic variable. (Cycling can only occur when the current solution is at a vertex of the feasible region.) Thus, zero steps are allowed if there is more than one superbasic variable, but otherwise positive steps are enforced.
Increasing the value of
helps reduce the number of slightly infeasible nonbasic basic variables (most of which are eliminated during the resetting procedure). However, it also diminishes the freedom to choose a large pivot element (see optional parameter
Pivot Tolerance).
If , the default value is used. If , the value is used and effectively no anti-cycling procedure is invoked.
Factorization Frequency | | Default |
If
, at most
basis changes will occur between factorizations of the basis matrix. For LP problems, the basis factors are usually updated at every iteration. For QP problems, fewer basis updates will occur as the solution is approached. The number of iterations between basis factorizations will therefore increase. During these iterations a test is made regularly according to the value of optional parameter
Check Frequency to ensure that the linear constraints
are satisfied. If necessary, the basis will be refactorized before the limit of
updates is reached. If
, the default value is used.
Feasibility Tolerance | | Default |
If , defines the maximum acceptable absolute violation in each constraint at a ‘feasible’ point (including slack variables). For example, if the variables and the coefficients in the linear constraints are of order unity, and the latter are correct to about five decimal digits, it would be appropriate to specify as . If , the default value is used.
e04nkf/e04nka attempts to find a feasible solution before optimizing the objective function. If the sum of infeasibilities cannot be reduced to zero, the problem is assumed to be infeasible. Let Sinf be the corresponding sum of infeasibilities. If Sinf is quite small, it may be appropriate to raise by a factor of or . Otherwise, some error in the data should be suspected. Note that the routine does not attempt to find the minimum value of Sinf.
If the constraints and variables have been scaled (see
Scale Option), then feasibility is defined in terms of the scaled problem (since it is more likely to be meaningful).
Infinite Bound Size | | Default |
If , defines the ‘infinite’ bound in the definition of the problem constraints. Any upper bound greater than or equal to will be regarded as (and similarly any lower bound less than or equal to will be regarded as ). If , the default value is used.
Infinite Step Size | | Default |
If , specifies the magnitude of the change in variables that will be considered a step to an unbounded solution. (Note that an unbounded solution can occur only when the Hessian is not positive definite.) If the change in during an iteration would exceed the value of , the objective function is considered to be unbounded below in the feasible region. If , the default value is used.
Iteration Limit | | Default |
The value of specifies the maximum number of iterations allowed before termination. Setting and means that the workspace needed to start solving the problem will be computed and printed, but no iterations will be performed. If , the default value is used.
List | | Default for e04nkf |
Nolist | | Default for e04nka |
Normally each optional parameter specification is printed as it is supplied. Optional parameter
Nolist may be used to suppress the printing and optional parameter
List may be used to restore printing.
LU Factor Tolerance | | Default |
LU Update Tolerance | | Default |
The values of
and
affect the stability and sparsity of the basis factorization
, during refactorization and updates respectively. The lower triangular matrix
is a product of matrices of the form
where the multipliers
will satisfy
. The default values of
and
usually strike a good compromise between stability and sparsity. For large and relatively dense problems, setting
and
to
(say) may give a marked improvement in sparsity without impairing stability to a serious degree.
Note that for band matrices it may be necessary to set in the range in order to achieve stability. If or , the default value is used.
LU Singularity Tolerance | | Default |
If , defines the singularity tolerance used to guard against ill-conditioned basis matrices. Whenever the basis is refactorized, the diagonal elements of are tested as follows. If or , the th column of the basis is replaced by the corresponding slack variable. If , the default value is used.
This option specifies the required direction of the optimization. It applies to both linear and nonlinear terms (if any) in the objective function. Note that if two problems are the same except that one minimizes
and the other maximizes
, their solutions will be the same but the signs of the dual variables
and the reduced gradients
(see
Section 11.3) will be reversed.
Monitoring File | | Default |
If
and
(see
Print Level), monitoring information produced by
e04nkf/e04nka is sent to a file with logical unit number
. If
and/or
, the default value is used and hence no monitoring information is produced.
Optimality Tolerance | | Default |
If , is used to judge the size of the reduced gradients . By definition, the reduced gradients for basic variables are always zero. Optimality is declared if the reduced gradients for any nonbasic variables at their lower or upper bounds satisfy , and if for any superbasic variables. If , the default value is used.
Partial Price | | Default |
Note that this option does not apply to QP problems.
This option is recommended for large FP or LP problems that have significantly more variables than constraints (i.e., ). It reduces the work required for each pricing operation (i.e., when a nonbasic variable is selected to enter the basis). If , all columns of the constraint matrix are searched. If , and are partitioned to give roughly equal segments , for (modulo ). If the previous pricing search was successful on , the next search begins on the segments . If a reduced gradient is found that is larger than some dynamic tolerance, the variable with the largest such reduced gradient (of appropriate sign) is selected to enter the basis. If nothing is found, the search continues on the next segments , and so on. If , the default value is used.
Pivot Tolerance | | Default |
If , is used to prevent columns entering the basis if they would cause the basis to become almost singular. If , the default value is used.
Print Level | | Default for e04nkf
Default for e04nka
|
The value of
controls the amount of printout produced by
e04nkf/e04nka, as indicated below. A detailed description of the printed output is given in
Section 9.1 (summary output at each iteration and the final solution) and
Section 13 (monitoring information at each iteration). Note that the summary output will not exceed
characters per line and that the monitoring information will not exceed
characters per line. If
, the default value is used.
The following printout is sent to the current advisory message unit (as defined by
x04abf):
|
Output |
|
No output. |
|
The final solution only. |
|
One line of summary output for each iteration (no printout of the final solution). |
|
The final solution and one line of summary output for each iteration. |
The following printout is sent to the logical unit number defined by the optional parameter
Monitoring File:
|
Output |
|
No output. |
|
The final solution only. |
|
One long line of output for each iteration (no printout of the final solution). |
|
The final solution and one long line of output for each iteration. |
|
The final solution, one long line of output for each iteration, matrix statistics (initial status of rows and columns, number of elements, density, biggest and smallest elements, etc.), details of the scale factors resulting from the scaling procedure (if or (see the description of the optional parameter Scale Option), basis factorization statistics and details of the initial basis resulting from the Crash procedure (if ; see Section 5). |
If
and the unit number defined by optional parameter
Monitoring File is the same as that defined by
x04abf, then the summary output is suppressed.
Rank Tolerance | | Default |
This option enables you to scale the variables and constraints using an iterative procedure due to
Fourer (1982), which attempts to compute row scales
and column scales
such that the scaled matrix coefficients
are as close as possible to unity. This may improve the overall efficiency on some problems. (The lower and upper bounds on the variables and slacks for the scaled problem are redefined as
and
respectively, where
if
.)
If , no scaling is performed. If , all rows and columns of the constraint matrix are scaled. If , an additional scaling is performed that may be helpful when the solution is large; it takes into account columns of that are fixed or have positive lower bounds or negative upper bounds. If or , the default value is used.
Scale Tolerance | | Default |
Note that this option does not apply when .
If , is used to control the number of scaling passes to be made through the constraint matrix . At least (and at most ) passes will be made. More precisely, let denote the largest column ratio (i.e., in some sense) after the th scaling pass through . The scaling procedure is terminated if for some . Thus, increasing the value of from to (say) will probably increase the number of passes through .
If or , the default value is used.
Superbasics Limit | | Default |
Note that this option does not apply to FP or LP problems.
The value of specifies ‘how nonlinear’ you expect the QP problem to be. If , the default value is used.
13
Description of Monitoring Information
This section describes the intermediate printout and final printout which constitutes the monitoring information produced by
e04nkf/e04nka. (See also the description of the optional parameters
Monitoring File and
Print Level.) You can control the level of printed output.
When
or
and
, the following line of intermediate printout (
characters) is produced at every iteration on the unit number specified by optional parameter
Monitoring File. Unless stated otherwise, the values of the quantities printed are those in effect
on
completion of the given iteration.
Itn |
is the iteration count.
|
pp |
is the partial price indicator. The variable selected by the last pricing operation came from the ppth partition of and . Note that pp is reset to zero whenever the basis is refactorized.
|
dj |
is the value of the reduced gradient (or reduced cost) for the variable selected by the pricing operation at the start of the current iteration.
|
+S |
is the variable selected by the pricing operation to be added to the superbasic set.
|
-S |
is the variable chosen to leave the superbasic set.
|
-BS |
is the variable removed from the basis (if any) to become nonbasic.
|
Step |
is the value of the step length taken along the current search direction . The variables have just been changed to . If a variable is made superbasic during the current iteration (i.e., +S is positive), Step will be the step to the nearest bound. During the optimality phase, the step can be greater than unity only if the reduced Hessian is not positive definite.
|
Pivot |
is the th element of a vector satisfying whenever (the th column of the constraint matrix ) replaces the th column of the basis matrix . Wherever possible, Step is chosen so as to avoid extremely small values of Pivot (since they may cause the basis to be nearly singular). In extreme cases, it may be necessary to increase the value of the optional parameter Pivot Tolerance to exclude very small elements of from consideration during the computation of Step.
|
Ninf |
is the number of violated constraints (infeasibilities). This will be zero during the optimality phase.
|
Sinf/Objective |
is the value of the current objective function. If is not feasible, Sinf gives the sum of the magnitudes of constraint violations. If is feasible, Objective is the value of the objective function. The output line for the final iteration of the feasibility phase (i.e., the first iteration for which Ninf is zero) will give the value of the true objective at the first feasible point. During the optimality phase, the value of the objective function will be nonincreasing. During the feasibility phase, the number of constraint infeasibilities will not increase until either a feasible point is found, or the optimality of the multipliers implies that no feasible point exists.
|
L |
is the number of nonzeros in the basis factor . Immediately after a basis factorization , this entry contains lenL. Further nonzeros are added to L when various columns of are later replaced. (Thus, L increases monotonically.)
|
U |
is the number of nonzeros in the basis factor . Immediately after a basis factorization , this entry contains lenU. As columns of are replaced, the matrix is maintained explicitly (in sparse form). The value of U may fluctuate up or down; in general, it will tend to increase.
|
Ncp |
is the number of compressions required to recover workspace in the data structure for . This includes the number of compressions needed during the previous basis factorization. Normally, Ncp should increase very slowly. If it does not, increase leniz and lenz by at least and rerun e04nkf/e04nka (possibly using ; see Section 5).
|
Norm rg |
is , the Euclidean norm of the reduced gradient (see Section 11.3). During the optimality phase, this norm will be approximately zero after a unit step. For FP and LP problems, Norm rg is not printed.
|
Ns |
is the current number of superbasic variables. For FP and LP problems, Ns is not printed.
|
Cond Hz |
is a lower bound on the condition number of the reduced Hessian (see Section 11.2). The larger this number, the more difficult the problem. For FP and LP problems, Cond Hz is not printed.
|
When
and
, the following lines of intermediate printout (
characters) are produced on the unit number specified by optional parameter
Monitoring File whenever the matrix
or
is factorized. Gaussian elimination is used to compute an
factorization of
or
, where
is a lower triangular matrix and
is an upper triangular matrix for some permutation matrices
and
. The factorization is stabilized in the manner described under the optional parameter
LU Factor Tolerance (
).
Factorize |
is the factorization count.
|
Demand |
is a code giving the reason for the present factorization as follows:
Code |
Meaning |
|
First factorization. |
|
The number of updates reached the value of the optional parameter Factorization Frequency. |
|
The number of nonzeros in the updated factors has increased significantly. |
|
Not enough storage to update factors. |
|
Row residuals too large (see the description for the optional parameter Check Frequency). |
|
Ill-conditioning has caused inconsistent results. |
|
Iteration |
is the iteration count.
|
Nonlinear |
is the number of nonlinear variables in the current basis (not printed if is factorized).
|
Linear |
is the number of linear variables in (not printed if is factorized).
|
Slacks |
is the number of slack variables in (not printed if is factorized).
|
Elems |
is the number of nonzeros in (not printed if is factorized).
|
Density |
is the percentage nonzero density of (not printed if is factorized). More precisely, .
|
Compressns |
is the number of times the data structure holding the partially factorized matrix needed to be compressed, in order to recover unused workspace. Ideally, it should be zero. If it is more than or , increase leniz and lenz and rerun e04nkf/e04nka (possibly using ; see Section 5).
|
Merit |
is the average Markowitz merit count for the elements chosen to be the diagonals of . Each merit count is defined to be , where and are the number of nonzeros in the column and row containing the element at the time it is selected to be the next diagonal. Merit is the average of m such quantities. It gives an indication of how much work was required to preserve sparsity during the factorization.
|
lenL |
is the number of nonzeros in .
|
lenU |
is the number of nonzeros in .
|
Increase |
is the percentage increase in the number of nonzeros in and relative to the number of nonzeros in . More precisely, .
|
m |
is the number of rows in the problem. Note that .
|
Ut |
is the number of triangular rows of at the top of .
|
d1 |
is the number of columns remaining when the density of the basis matrix being factorized reached .
|
Lmax |
is the maximum subdiagonal element in the columns of . This will not exceed the value of the optional parameter LU Factor Tolerance.
|
Bmax |
is the maximum nonzero element in (not printed if is factorized).
|
BSmax |
is the maximum nonzero element in (not printed if is factorized).
|
Umax |
is the maximum nonzero element in , excluding elements of that remain in unchanged. (For example, if a slack variable is in the basis, the corresponding row of will become a row of without modification. Elements in such rows will not contribute to Umax. If the basis is strictly triangular then none of the elements of will contribute and Umax will be zero.)Ideally, Umax should not be significantly larger than Bmax. If it is several orders of magnitude larger, it may be advisable to reset the optional parameter LU Factor Tolerance to some value nearer unity. Umax is not printed if is factorized.
|
Umin |
is the magnitude of the smallest diagonal element of (not printed if is factorized).
|
Growth |
is the value of the ratio Umax/Bmax, which should not be too large. Providing Lmax is not large (say, ), the ratio is an estimate of the condition number of . If this number is extremely large, the basis is nearly singular and some numerical difficulties might occur. (However, an effort is made to avoid near-singularity by using slacks to replace columns of that would have made Umin extremely small and the modified basis is refactorized.)
Growth is not printed if is factorized. |
Lt |
is the number of triangular columns of at the left of .
|
bp |
is the size of the ‘bump’ or block to be factorized nontrivially after the triangular rows and columns of have been removed.
|
d2 |
is the number of columns remaining when the density of the basis matrix being factorized has reached .
|
When
and
, the following lines of intermediate printout (
characters) are produced on the unit number specified by optional parameter
Monitoring File whenever
(see
Section 5). They refer to the number of columns selected by the Crash procedure during each of several passes through
, whilst searching for a triangular basis matrix.
Slacks |
is the number of slacks selected initially.
|
Free cols |
is the number of free columns in the basis, including those whose bounds are rather far apart.
|
Preferred |
is the number of ‘preferred’ columns in the basis (i.e., for some ). It will be a subset of the columns for which was specified.
|
Unit |
is the number of unit columns in the basis.
|
Double |
is the number of double columns in the basis.
|
Triangle |
is the number of triangular columns in the basis.
|
Pad |
is the number of slacks used to pad the basis (to make it a nonsingular triangle).
|
When
and
, the following lines of intermediate printout (
characters) are produced on the unit number specified by optional parameter
Monitoring File. They refer to the elements of the
names array (see
Section 5).
Name |
gives the name for the problem (blank if problem unnamed).
|
Status |
gives the exit status for the problem (i.e., Optimal soln, Weak soln, Unbounded, Infeasible, Excess itns, Error condn or Feasble soln) followed by details of the direction of the optimization (i.e., (Min) or (Max)).
|
Objective |
gives the name of the free row for the problem (blank if objective unnamed).
|
RHS |
gives the name of the constraint right-hand side for the problem (blank if objective unnamed).
|
Ranges |
gives the name of the ranges for the problem (blank if objective unnamed).
|
Bounds |
gives the name of the bounds for the problem (blank if objective unnamed).
|
When
or
and
, the following lines of final printout (
characters) are produced on the unit number specified by optional parameter
Monitoring File.
Let
denote the
th column of
, for
. The following describes the printout for each column (or variable). A full stop (.) is printed for any numerical value that is zero.
Number |
is the column number . (This is used internally to refer to in the intermediate output.)
|
Column |
gives the name of .
|
State |
gives the state of the variable (LL if nonbasic on its lower bound, UL if nonbasic on its upper bound, EQ if nonbasic and fixed, FR if nonbasic and strictly between its bounds, BS if basic and SBS if superbasic).
A key is sometimes printed before State.
Note that unless the optional parameter is specified, the tests for assigning a key are applied to the variables of the scaled problem.
A |
Alternative optimum possible. The variable is nonbasic, but its reduced gradient is essentially zero. This means that if the variable were allowed to start moving away from its bound, there would be no change in the value of the objective function. The values of the other free variables might change, giving a genuine alternative solution. However, if there are any degenerate variables (labelled D), the actual change might prove to be zero, since one of them could encounter a bound immediately. In either case, the values of the Lagrange multipliers might also change.
|
D |
Degenerate. The variable is basic or superbasic, but it is equal (or very close) to one of its bounds.
|
I |
Infeasible. The variable is basic or superbasic and is currently violating one of its bounds by more than the value of the Feasibility Tolerance.
|
N |
Not precisely optimal. The variable is nonbasic or superbasic. If the value of the reduced gradient for the variable exceeds the value of the optional parameter Optimality Tolerance, the solution would not be declared optimal because the reduced gradient for the variable would not be considered negligible.
|
|
Activity |
is the value of at the final iterate.
|
Obj Gradient |
is the value of at the final iterate. For FP problems, is set to zero.
|
Lower Bound |
is the lower bound specified for the variable. None indicates that .
|
Upper Bound |
is the upper bound specified for the variable. None indicates that .
|
Reduced Gradnt |
is the value of at the final iterate (see Section 11.3). For FP problems, is set to zero.
|
m + j |
is the value of .
|
Let
denote the
th row of
, for
. The following describes the printout for each row (or constraint). A full stop (.) is printed for any numerical value that is zero.
Number |
is the value of . (This is used internally to refer to in the intermediate output.)
|
Row |
gives the name of .
|
State |
gives the state of (LL if active on its lower bound, UL if active on its upper bound, EQ if active and fixed, BS if inactive when is basic and SBS if inactive when is superbasic).
A key is sometimes printed before State.
Note that unless the optional parameter is specified, the tests for assigning a key are applied to the variables of the scaled problem.
A |
Alternative optimum possible. The variable is nonbasic, but its reduced gradient is essentially zero. This means that if the variable were allowed to start moving away from its bound, there would be no change in the value of the objective function. The values of the other free variables might change, giving a genuine alternative solution. However, if there are any degenerate variables (labelled D), the actual change might prove to be zero, since one of them could encounter a bound immediately. In either case, the values of the Lagrange multipliers might also change.
|
D |
Degenerate. The variable is basic or superbasic, but it is equal (or very close) to one of its bounds.
|
I |
Infeasible. The variable is basic or superbasic and is currently violating one of its bounds by more than the value of the Feasibility Tolerance.
|
N |
Not precisely optimal. The variable is nonbasic or superbasic. If the value of the reduced gradient for the variable exceeds the value of the optional parameter Optimality Tolerance, the solution would not be declared optimal because the reduced gradient for the variable would not be considered negligible.
|
|
Activity |
is the value of at the final iterate.
|
Slack Activity |
is the value by which the row differs from its nearest bound. (For the free row (if any), it is set to Activity.)
|
Lower Bound |
is the lower bound specified for the variable. None indicates that .
|
Upper Bound |
is the upper bound specified for the variable. None indicates that .
|
Dual Activity |
is the value of the dual variable (the Lagrange multiplier for ; see Section 11.3). For FP problems, is set to zero.
|
i |
gives the index of the th row.
|
Numerical values are output with a fixed number of digits; they are not guaranteed to be accurate to this precision.