H02CEF (PDF version)
H Chapter Contents
H Chapter Introduction
NAG Library Manual

NAG Library Routine Document

H02CEF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.
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.

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

H02CEF obtains integer solutions to sparse linear programming and quadratic programming problems.

2  Specification

SUBROUTINE H02CEF ( N, M, NNZ, IOBJ, NCOLH, QPHX, A, HA, KA, BL, BU, START, NAMES, NNAME, CRNAME, NS, XS, INTVAR, LINTVR, MDEPTH, ISTATE, MINIZ, MINZ, OBJ, CLAMDA, STRTGY, IZ, LENIZ, Z, LENZ, MONIT, IFAIL)
INTEGER  N, M, NNZ, IOBJ, NCOLH, HA(NNZ), KA(N+1), NNAME, NS, INTVAR(LINTVR), LINTVR, MDEPTH, ISTATE(N+M), MINIZ, MINZ, STRTGY, IZ(LENIZ), LENIZ, LENZ, IFAIL
REAL (KIND=nag_wp)  A(NNZ), BL(N+M), BU(N+M), XS(N+M), OBJ, CLAMDA(N+M), Z(LENZ)
CHARACTER(1)  START
CHARACTER(8)  NAMES(5), CRNAME(NNAME)
EXTERNAL  QPHX, MONIT

3  Description

H02CEF is designed to obtain integer solutions to a class of quadratic programming problems addressed by E04NKF/E04NKA. Specifically it solves the following problem:
minimizexRnfx  subject to  l x Ax u, (1)
where x=x1,x2,,xnT is a set of variables (some of which may be required to be integer), A is an m by n matrix and the objective function fx 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 fx is maximized. The possible forms for fx are listed in Table 1, in which the prefixes LP and QP stand for ‘linear programming’ and ‘quadratic programming’ respectively, c is an n-element vector and H is the n by n second-derivative matrix 2fx (the Hessian matrix).
Problem type Objective function fx Hessian matrix H
LP cTx Not applicable
QP cTx+12xTHx Symmetric positive semidefinite
Table 1
For LP and QP problems, the unique global minimum value of fx is found. For QP problems, you must also provide a subroutine that computes Hx for any given vector x. (H need not be stored explicitly.)
(It is not expected that the feasibility problem of E04NKF/E04NKA would be relevant here.)
The routine employs a ‘Branch and Bound’ technique to enforce the integer constraints. In this technique the problem is first solved without the integer constraints. If a variable is found to be non-integral when it is required to have an integer value then two additional problems are constructed. One bounds the variable above by the nearest integer value below the optimal value previously obtained. The second problem is formed by bounding the variable below by the nearest integer value above the optimal value. This process is continued until an integer solution is found. At this point you may elect to stop, or may continue to search for better integer solutions by examining any other sub-problems that remain to be explained.
In practice the routine tries to compute an integer solution as quickly as possible using a depth-first approach, since this helps determine a realistic cut-off value. If we have a cut-off value, say the value of the function at this first integer solution, and any sub-problem, W say, has a solution value greater than this cut-off value, then subsequent sub-problems of W must have solutions greater than the value of the solution at W and therefore need not be computed. Thus a knowledge of a good cut-off value can result in fewer sub-problems being solved and thus speed up the operation of the routine. (See the description of MONIT in Section 5 for details of how you can supply your own cut-off value.)
Each sub-problem is solved using E04NKA. You are referred to the routine document for E04NKF/E04NKA for details of the algorithm used.

4  References

Gill P E, Hammarling S, Murray W, Saunders M A and Wright M H (1986) Users' guide for LSSOL (Version 1.0) Report SOL 86-1 Department of Operations Research, Stanford University
Gill P E and Murray W (1978) Numerically stable methods for quadratic programming Math. Programming 14 349–372
Gill P E, Murray W, Saunders M A and Wright M H (1986) Some theoretical properties of an augmented Lagrangian merit function Report SOL 86–6R Department of Operations Research, Stanford University
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
Hock W and Schittkowski K (1981) Test Examples for Nonlinear Programming Codes. Lecture Notes in Economics and Mathematical Systems 187 Springer–Verlag
Lawson C L, Hanson R J, Kincaid D R and Krogh F T (1979) Basic linear algebra supbrograms for Fortran usage ACM Trans. Math. Software 5 308–325
Murtagh B A and Saunders M A (1983) MINOS 5.0 user's guide Report SOL 83-20 Department of Operations Research, Stanford University

5  Parameters

1:     N – INTEGERInput
On entry: n, the number of variables (excluding slacks). This is the number of columns in the linear constraint matrix A.
Constraint: N1.
2:     M – INTEGERInput
On entry: m, the number of general linear constraints (or slacks). This is the number of rows in A, including the free row (if any; see IOBJ).
Constraint: M1.
3:     NNZ – INTEGERInput
On entry: the number of nonzero elements in A.
Constraint: 1NNZN×M.
4:     IOBJ – INTEGERInput
On entry: if IOBJ>0, row IOBJ of A is a free row containing the nonzero elements of the vector c appearing in the linear objective term cTx.
If IOBJ=0, 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 c=0.
Constraint: 0IOBJM.
5:     NCOLH – INTEGERInput
On entry: nH, the number of leading nonzero columns of the Hessian matrix H. For FP and LP problems, NCOLH must be set to zero.
Constraint: 0NCOLHN.
6:     QPHX – 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 Hx. If H has rows and columns consisting entirely of zeros, it is most efficient to order the variables x=yzT so that
Hx= H1 0 0 0 y z = H1y 0 ,  
where the nonlinear variables y appear first as shown. For LP problems, QPHX will never be called by H02CEF.
The specification of QPHX is:
SUBROUTINE QPHX ( NSTATE, NCOLH, X, HX)
INTEGER  NSTATE, NCOLH
REAL (KIND=nag_wp)  X(NCOLH), HX(NCOLH)
1:     NSTATE – INTEGERInput
On entry: if NSTATE=1, then H02CEF is calling QPHX for the first time on a sub-problem. This parameter setting allows you to save computation time if certain data must be read or calculated only once.
If NSTATE2, then H02CEF is calling QPHX for the last time. This parameter setting allows you to perform some additional computation on the final sub-problem solution. In general, the last call to QPHX is made with NSTATE=2+IFAIL (see Section 6).
Otherwise, NSTATE=0.
2:     NCOLH – INTEGERInput
On entry: this is the same parameter NCOLH as supplied to H02CEF.
3:     XNCOLH – REAL (KIND=nag_wp) arrayInput
On entry: the first NCOLH elements of the vector x.
4:     HXNCOLH – REAL (KIND=nag_wp) arrayOutput
On exit: the product Hx.
QPHX must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which H02CEF is called. Parameters denoted as Input must not be changed by this procedure.
7:     ANNZ – REAL (KIND=nag_wp) arrayInput
On entry: the nonzero elements of A, ordered by increasing column index. Note that multiple elements with the same row and column indices are not allowed.
On exit: used as internal workspace prior to being restored and hence is unchanged.
8:     HANNZ – INTEGER arrayInput
On entry: HAi must contain the row index of the nonzero element stored in Ai, for i=1,2,,NNZ. Note that the row indices for a column may be supplied in any order.
Constraint: 1HAiM, for i=1,2,,NNZ.
9:     KAN+1 – INTEGER arrayInput
On entry: KAj must contain the index in A of the start of the jth column, for j=1,2,,N. To specify the jth column as empty, set KAj=KAj+1. Note that the first and last elements of KA must be such that KA1=1 and KAN+1=NNZ+1.
Constraints:
  • KA1=1;
  • KAj1, for j=2,3,,N;
  • KAN+1=NNZ+1;
  • 0KAj+1-KAjM, for j=1,2,,N.
10:   BLN+M – REAL (KIND=nag_wp) arrayInput
On entry: l, 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 x, and the next M elements the bounds for the general linear constraints Ax (or slacks s) and the free row (if any). To specify a nonexistent lower bound (i.e., lj=-), set BLj-bigbnd, where bigbnd is the value of the optional parameter Infinite Bound Size (default value=1020). To specify the jth constraint as an equality, set BLj=BUj=β, say, where β<bigbnd. Note that the lower bound corresponding to the free row must be set to - and stored in BLN+IOBJ.
Constraint: if IOBJ>0, BLN+IOBJ-bigbnd
(See also the description for BU.)
11:   BUN+M – REAL (KIND=nag_wp) arrayInput
On entry: u, the upper 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 x, and the next M elements the bounds for the general linear constraints Ax (or slacks s) and the free row (if any). To specify a nonexistent upper bound (i.e., uj=+), set BUjbigbnd. Note that the upper bound corresponding to the free row must be set to + and stored in BUN+IOBJ.
On exit: used as internal workspace prior to being restored and hence is unchanged.
Constraints:
  • if IOBJ>0, BUN+IOBJbigbnd;
  • BLjBUj, for j=1,2,,N+M;
  • if BLj=BUj=β, β<bigbnd.
12:   START – CHARACTER(1)Input
On entry: indicates how a starting basis is to be obtained.
START='C'
An internal crash procedure will be used to choose an initial basis matrix B.
START='W'
A basis is already defined in ISTATE (probably from a previous call).
Constraint: START='C' or 'W'.
13:   NAMES5 – CHARACTER(8) arrayInput
On entry: a set of names associated with the so-called MPSX form of the problem.
NAMES1
Must contain the name for the problem (or be blank).
NAMES2
Must contain the name for the free row (or be blank).
NAMES3
Must contain the name for the constraint right-hand side (or be blank).
NAMES4
Must contain the name for the ranges (or be blank).
NAMES5
Must contain the name for the bounds (or be blank).
(These names are used in the monitoring file output; see Section 13.)
14:   NNAME – INTEGERInput
On entry: the number of column (i.e., variable) and row names supplied in the array NAMES.
NNAME=1
There are no names. Default names will be used in the printed output.
NNAME=N+M
All names must be supplied.
Constraint: NNAME=1 or N+M.
15:   CRNAMENNAME – CHARACTER(8) arrayInput
On entry: the optional column and row names.
If NNAME=1, CRNAME is not referenced and the printed output will use default names for the columns and rows.
If NNAME=N+M, 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 CRNAMEN+IOBJ.
16:   NS – INTEGERInput/Output
On entry: nS, the number of superbasics. For QP problems, NS need not be specified if START='C', but must retain its value from a previous call when START='W'. 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:   XSN+M – REAL (KIND=nag_wp) arrayInput/Output
On entry: the initial values of the variables and slacks x,s. (See the description for ISTATE.)
On exit: XSi contains the final value of xi, for i=1,2,,n.
18:   INTVARLINTVR – INTEGER arrayInput
On entry: specifies which components of the solution vector x are constrained to be integer. Specifically, if k elements of x are required to take integer values then INTVARi=li, for i=1,2,,k, where li is the integer index such that xli is integer. If k<LINTVR then INTVARk+1 must be set to -1 to signal the end of the integer variable indices.
The order in which the indices of those components of x required to be integer is presented determines the order in which the sub-problems are treated and solved. As such it can be a powerful tool to assist the routine in achieving a solution efficiently. The general advice is to enter the important integer variables in the model early in INTVAR; secondary or less important variables should be entered near the end of the list. However some experimentation might be required to find the optimal order.
19:   LINTVR – INTEGERInput
On entry: k, the number of components of x required to be integer. If k=0, then LINTVR must be set to 1 and INTVAR1 set to -1.
20:   MDEPTH – INTEGERInput
On entry: specifies the maximum depth the tree of sub-problems may be developed.
Suggested value: MDEPTH=2×N+20.
Constraint: MDEPTH>0.
21:   ISTATEN+M – INTEGER arrayInput/Output
On entry: if START='C', the first N elements of ISTATE and XS must specify the initial states and values, respectively, of the variables x. (The slacks s need not be initialized.) An internal crash procedure is then used to select an initial basis matrix B. The initial basis matrix will be triangular (neglecting certain small elements in each column). It is chosen from various rows and columns of columns of A-I. Possible values for ISTATEj are as follows:
ISTATEj State of XSj during crash procedure
0 or 1 Eligible for the basis
2 Ignored
3 Eligible for the basis (given preference over 0 or 1)
4 or 5 Ignored
If nothing special is known about the problem, or there is no wish to provide special information, you may set ISTATEj=0 and XSj=0.0, for j=1,2,,N. All variables will then be eligible for the initial basis. Less trivially, to say that the jth variable will probably be equal to one of its bounds, set ISTATEj=4 and XSj=BLj or ISTATEj=5 and XSj=BUj as appropriate.
Following the crash procedure, variables for which ISTATEj=2 are made superbasic. Other variables not selected for the basis are then made nonbasic at the value XSj if BLjXSjBUj, or at the value BLj or BUj closest to XSj.
If START='W', ISTATE and XS must specify the initial states and values, respectively, of the variables and slacks x,s. If H02CEF has been called previously with the same values of N and M, ISTATE already contains satisfactory information.
Constraints:
  • if START='C', 0ISTATEj5, for j=1,2,,N;
  • if START='W', 0ISTATEj3, for j=1,2,,N+M.
On exit: the final states of the variables and slacks x,s from the solution of the last sub-problem tackled. The significance of each possible value of ISTATEj is as follows:
ISTATEj State of variable j Normal value of XSj
0 Nonbasic BLj
1 Nonbasic BUj
2 Superbasic Between BLj and BUj
3 Basic Between BLj and BUj
If Ninf=0 (see Section 9.1), basic and superbasic variables may be outside their bounds by as much as the value of the optional parameter Feasibility Tolerance (default value=max10-6,ε, where ε is the machine precision). Note that unless the optional parameter Scale Option=0 (default value=2) is specified, the Feasibility Tolerance applies to the variables of the scaled problem. In this case, the variables of the original problem may be as much as 0.1 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 Feasibility Tolerance, and there may be some nonbasic variables for which XSj lies strictly between its bounds.
If Ninf>0, some basic and superbasic variables may be outside their bounds by an arbitrary amount (bounded by Sinf (see Section 9.1) if Scale Option=0).
22:   MINIZ – INTEGEROutput
On exit: the minimum value of LENIZ required to start solving the problem. If IFAIL=14, H02CEF 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.)
23:   MINZ – INTEGEROutput
On exit: the minimum value of LENZ required to start solving the problem. If IFAIL=15, H02CEF 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.)
24:   OBJ – REAL (KIND=nag_wp)Output
On exit: the value of the objective function.
If Ninf=0, OBJ includes the quadratic objective term 12xTHx (if any).
If Ninf >0, OBJ is just the linear objective term cTx (if any). For FP problems, OBJ is set to zero.
25:   CLAMDAN+M – 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.
26:   STRTGY – INTEGERInput
On entry: defines the branching strategy adopted by the routine.
STRTGY=0
Each sub-problem first explored imposes a tighter upper bound on the component of x.
STRTGY=1
Each sub-problem first explored imposes a tighter lower bound on the component of x.
STRTGY=2
Each branch explored imposes a tighter upper bound on the component of x if its fractional part is less than 0.5, otherwise it imposes a tighter lower bound.
STRTGY=3
Random choice is made between first exploring a tighter lower bound or a tighter upper bound sub-problem.
Constraint: STRTGY=0, 1, 2 or 3.
27:   IZLENIZ – INTEGER arrayWorkspace
28:   LENIZ – INTEGERInput
On entry: the dimension of the array IZ as declared in the (sub)program from which H02CEF is called.
Constraint: LENIZ1.
29:   ZLENZ – REAL (KIND=nag_wp) arrayWorkspace
30:   LENZ – INTEGERInput
On entry: the dimension of the array Z as declared in the (sub)program from which H02CEF is called.
Constraint: LENZ1.
The amounts of workspace provided (i.e., LENIZ and LENZ) and required (i.e., MINIZ and MINZ) are (by default) output on the current advisory message unit (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 1. (H02CEF will then terminate with IFAIL=14.)
31:   MONIT – SUBROUTINE, supplied by the NAG Library or the user.External Procedure
To provide feed-back on the progress of the branch and bound process. Additionally MONIT provides, via its parameter HALT, the ability to terminate the process. (You might choose to do this when an integer solution is found, rather than search for a better solution.) If you do not require any intermediate output then MONIT may be the dummy routine H02CEY.
The specification of MONIT is:
SUBROUTINE MONIT ( INTFND, NODES, DEPTH, OBJ, X, BSTVAL, BSTSOL, BL, BU, N, HALT, COUNT)
INTEGER  INTFND, NODES, DEPTH, N, COUNT
REAL (KIND=nag_wp)  OBJ, X(N), BSTVAL, BSTSOL(N), BL(N), BU(N)
LOGICAL  HALT
1:     INTFND – INTEGERInput
On entry: contains the number of integer solutions obtained so far.
2:     NODES – INTEGERInput
On entry: contains the number of nodes (sub-problems) solved so far.
3:     DEPTH – INTEGERInput
On entry: contains the depth reached in the tree of problems.
4:     OBJ – REAL (KIND=nag_wp)Input
On entry: contains the solution value to the sub-problem at this node.
5:     XN – REAL (KIND=nag_wp) arrayInput
On entry: contains the solution vector to the sub-problem at this node.
6:     BSTVAL – REAL (KIND=nag_wp)Input/Output
On entry: contains the value of the objective function corresponding to the best integer solution obtained so far. If no integer solution has been found BSTVAL contains the largest machine representable number (see X02ALF).
On exit: may be set to a cut-off value, if you are a sophisticated user, as follows. Before an integer solution has been found BSTVAL will be set by H02CEF to the largest machine representable number (see X02ALF). If you know that the solution being sought is a much smaller number, then BSTVAL may be set to this number as a cut-off value (see Section 3). Beware of setting BSTVAL too small, since then no integer solutions will be discovered. Also make sure that BSTVAL is set using a statement of the form
IF (INTFND.EQ.0) BSTVAL= cut-off value
on entry to MONIT. This statement will not prevent the normal operation of the algorithm when subsequent integer solutions are found. It would be a grievous mistake to unconditionally set BSTVAL and if you have any doubts whatsoever about the correct use of this parameter then you are strongly recommended to leave it unchanged.
7:     BSTSOLN – REAL (KIND=nag_wp) arrayInput
On entry: contains the value of the best integer solution obtained so far.
8:     BLN – REAL (KIND=nag_wp) arrayInput
On entry: contains the current lower bounds on the variables at this point.
9:     BUN – REAL (KIND=nag_wp) arrayInput
On entry: contains the current upper bounds on the variables at this point.
10:   N – INTEGERInput
On entry: contains the number of variables in the minimization problem.
11:   HALT – LOGICALInput/Output
On entry: will have the value .FALSE..
On exit: if HALT is set to .TRUE., E04NKF/E04NKA will be brought to a halt with IFAIL exit -1. This facility may be useful if you are content with any integer solution, or with any integer solution that fits certain criteria. Under these circumstances setting HALT=.TRUE. can save considerable unnecessary computation.
12:   COUNT – INTEGERUser Data
COUNT may be used to save the last value of INTFND. If a subsequent call of MONIT has a value of INTFND which is greater than COUNT, then you know that a new integer solution has been found at this node.
MONIT must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which H02CEF is called. Parameters denoted as Input must not be changed by this procedure.
32:   IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=-1
Halted at your request.
IFAIL=0
Successful exit.
IFAIL=1
Input parameter error immediately detected.
IFAIL=2
No integer solution found.
IFAIL=3
MDEPTH is too small.
IFAIL=4
The problem is unbounded (or badly scaled). The objective function is not bounded below in the feasible region.
IFAIL=5
The problem is infeasible. The general constraints cannot all be satisfied simultaneously to within the value of the optional parameter Feasibility Tolerance (default value=max10-6,ε, where ε is the machine precision).
IFAIL=6
Too many iterations. The value of the optional parameter Iteration Limit (default value=max50,5n+m) is too small.
IFAIL=7
The reduced Hessian matrix ZTHZ (see Section 11.2) exceeds its assigned dimension. The value of the optional parameter Superbasics Limit (default value=minnH+1,n) is too small.
IFAIL=8
The Hessian matrix H appears to be indefinite. Check that QPHX has been coded correctly and that all relevant elements of Hx have been assigned their correct values.
IFAIL=9
An input parameter is invalid for an internal call to E04NKF/E04NKA.
IFAIL=10
Numerical error in trying to satisfy the general constraints. The basis is very ill-conditioned.
IFAIL=11
Not enough integer workspace for the basis factors. Increase LENIZ and rerun H02CEF.
IFAIL=12
Not enough real workspace for the basis factors. Increase LENZ and rerun H02CEF.
IFAIL=13
The basis is singular after 15 attempts to factorize it (adding slacks where necessary). Either the problem is badly scaled or the value of the optional parameter LU Factor Tolerance (default value=100.0) is too large.
IFAIL=14
Not enough integer workspace to start solving the problem. Increase LENIZ to at least MINIZ and rerun H02CEF.
IFAIL=15
Not enough real workspace to start solving the problem. Increase LENZ to at least MINZ and rerun H02CEF.
IFAIL=16
An internal error has occurred. Contact NAG with details of your program.
IFAIL=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.8 in the Essential Introduction for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.7 in the Essential Introduction for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.6 in the Essential Introduction for further information.

7  Accuracy

H02CEF 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

H02CEF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
H02CEF 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.

9  Further Comments

This section contains a description of the printed output.

9.1  Description of the Printed Output

This section describes the (default) intermediate printout and final printout produced by H02CEF. 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 in Section 12.1). Note that the intermediate printout and final printout are produced only if Print Level10 (the default).
The following line of summary output (<80 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. If a constraint is added during the current iteration, Step will be the step to the nearest constraint. When the problem is of type LP, the step can be greater than one during the optimality phase.
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 x is not feasible, Sinf gives a weighted sum of the magnitudes of constraint violations. If x 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. Once optimal multipliers are obtained, the number of infeasibilities can increase, but the sum of infeasibilities will either remain constant or be reduced until the minimum sum of infeasibilities is found.
Norm rg is dS, 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 NNAME=1, a default name is assigned to the jth variable, for j=1,2,,n. If NNAME=N+M, the name supplied in CRNAMEj is assigned to the jth 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 to give some additional information about the state of a variable. Note that unless the optional parameter Scale Option=0 (default value=2) 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 to 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 to (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 optional parameter Feasibility Tolerance (default value=max10-6,ε, where ε is the machine precision).
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 (default value=max10-6,ε), 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 iterate.
Lower Bound is the lower bound specified for the variable. None indicates that BLj-bigbnd.
Upper Bound is the upper bound specified for the variable. None indicates that BUjbigbnd.
Lagr Mult is the Lagrange-multiplier for the associated bound. This will be zero if State is FR. If x 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 BLj and BUj. A blank entry indicates that the associated variable is not bounded (i.e., BLj-bigbnd and BUjbigbnd).
The meaning of the printout for linear constraints is the same as that given above for variables, with ‘variable’ replaced by ‘constraint’, n replaced by m, CRNAMEj replaced by CRNAMEn+j, BLj and BUj are replaced by BLn+j and BUn+j 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 fx=cTx+12xTHx, where
c=-200.0,-2000.0,-2000.0,-2000.0,-2000.0,400.0,400.0T  
H= 2 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 2 2 0 0 0 0 0 2 2 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 2 2 0 0 0 0 0 2 2  
subject to the bounds
000x10200 000x22500 400x30800 100x40700 000x51500 000x6 000x7  
to the linear constraints
x1 + x2 + x3 + x4 + x5 + x6 + x7 = 2000 0.15x1 + 0.04x2 + 0.02x3 + 0.04x4 + 0.02x5 + 0.01x6 + 0.03x7 60 0.03x1 + 0.05x2 + 0.08x3 + 0.02x4 + 0.06x5 + 0.01x6 100 0.02x1 + 0.04x2 + 0.01x3 + 0.02x4 + 0.02x5 40 0.02x1 + 0.03x2 + 0.01x5 30 1500 0.70x1 + 0.75x2 + 0.80x3 + 0.75x4 + 0.80x5 + 0.97x6 250 0.02x1 + 0.06x2 + 0.08x3 + 0.12x4 + 0.02x5 + 0.01x6 + 0.97x7 300  
and the variables x2, x3, x4, x5, x6, x7, are constrained to be integer.
The initial point, which is infeasible, is
x0=0.0,0.0,0.0,0.0,0.0,0.0,0.0T.  
The optimal solution (to five figures) is
x*=0.0,355.0,645.0,164.0,410.0,275.0,151.0T.  
One bound constraint and one linear constraint are active at the solution. Note that the Hessian matrix H is positive semidefinite.

10.1  Program Text

Program Text (h02cefe.f90)

10.2  Program Data

Program Data (h02cefe.d)

10.3  Program Results

Program Results (h02cefe.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 H02CFF and/or H02CGF. 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 H02CEF.

11.1  Overview

H02CEF employs a Branch and Bound technique (see Section 3) based on an inertia-controlling method to solve the sub-problems 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 parameters 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 x,s in both the original variables x and the slack variables s, a new iterate x-,s- is defined by
x- s- = x s +αp, (2)
where the step length α is a non-negative scalar (the printed quantity Step; see Section 13), and p 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 x,s, 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; see Section 12.1). The working set is the current prediction of the constraints that hold with equality at a solution of the LP or QP problem. Let mW denote the number of constraints in the working set (including bounds), and let W denote the associated mW by n+m working set matrix consisting of the mW 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 p must satisfy the identity
Wp=0. (3)
This characterisation allows p to be computed using any n by nZ full-rank matrix Z that spans the null space of W. (Thus, nZ=n-mW and WZ=0.) The null space matrix Z is defined from a sparse LU factorization of part of W (see (6) and (7) below). The direction p will satisfy (3) if
p=ZpZ, (4)
where pZ is any nZ-vector.
The working set contains the constraints Ax-s=0 and a subset of the upper and lower bounds on the variables x,s. Since the gradient of a bound constraint xjlj or xjuj is a vector of all zeros except for ±1 in position j, it follows that the working set matrix contains the rows of A-I and the unit rows associated with the upper and lower bounds in the working set.
The working set matrix W can be represented in terms of a certain column partition of the matrix A-I. As in Section 3 we partition the constraints Ax-s=0 so that
BxB+SxS+NxN=0, (5)
where B is a square nonsingular basis and xB, xS and xN are the basic, superbasic and nonbasic variables respectively. The nonbasic variables are equal to their upper or lower bounds at x,s, 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 nS (the printed quantity Ns; see Section 13). Given values of xN and xS, the basic variables xB are adjusted so that x,s satisfies (5).
If P is a permutation matrix such that A-IP=BSN, then the working set matrix W satisfies
WP= B S N 0 0 IN , (6)
where IN is the identity matrix with the same number of columns as N.
The null space matrix Z is defined from a sparse LU factorization of part of W. In particular, Z is maintained in ‘reduced gradient’ form, using the LUSOL package (see Gill et al. (1986)) to maintain sparse LU factors of the basis matrix B that alters as the working set W changes. Given the permutation P, the null space basis is given by
Z=P -B-1S I 0 . (7)
This matrix is used only as an operator, i.e., it is never computed explicitly. Products of the form Zv and ZTg are obtained by solving with B or BT. This choice of Z implies that nZ, the number of ‘degrees of freedom’ at x,s, is the same as nS, the number of superbasic variables.
Let gZ and HZ denote the reduced gradient and reduced Hessian of the objective function:
gZ=ZTg  and  HZ=ZTHZ, (8)
where g is the objective gradient at x,s. Roughly speaking, gZ and HZ describe the first and second derivatives of an nS-dimensional unconstrained problem for the calculation of pZ. (The condition estimator of HZ is the quantity Cond Hz in the monitoring file output; see Section 13.)
At each iteration, an upper triangular factor R is available such that HZ=RTR. Normally, R is computed from RTR=ZTHZ at the start of the optimality phase and then updated as the QP working set changes. For efficiency, the dimension of R should not be excessive (say, nS1000). This is guaranteed if the number of nonlinear variables is ‘moderate’.
If the QP problem contains linear variables, H is positive semidefinite and R 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 R can be zero. (See Gill et al. (1991) for a discussion of a similar strategy for indefinite quadratic programming.)
If the initial R is singular, enough variables are fixed at their current value to give a nonsingular R. This is equivalent to including temporary bound constraints in the working set. Thereafter, R can become singular only when a constraint is deleted from the working set (in which case no further constraints are deleted until R becomes nonsingular).

11.3  The Main Iteration

If the reduced gradient is zero, x,s 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 x 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
WTλ=gx. (9)
A Lagrange-multiplier λj corresponding to an inequality constraint in the working set is said to be optimal if λjσ when the associated constraint is at its upper bound, or if λj-σ when the associated constraint is at its lower bound, where σ depends on the value of the optional parameter Optimality Tolerance (see Section 12.1). 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 IFAIL=3 (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
d= g 0 - A -I Tπ= g-ATπ π , (10)
where π satisfies the equations BTπ=gB, and gB denotes the basic elements of g. The elements of π are the Lagrange-multipliers λj associated with the equality constraints Ax-s=0. The vector dN of nonbasic elements of d consists of the Lagrange-multipliers λj associated with the upper and lower bound constraints in the working set. The vector dS of superbasic elements of d is the reduced gradient gZ in (8). The vector dB of basic elements of d is zero, by construction. (The Euclidean norm of dS and the final values of dS, g 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 p=ZpZ (see (7) and (11)). The step length is chosen to maintain feasibility with respect to the satisfied constraints.
There are two possible choices for pZ, depending on whether or not HZ is singular. If HZ is nonsingular, R is nonsingular and pZ in (4) is computed from the equations
RTRpZ=-gZ, (11)
where gZ is the reduced gradient at x. In this case, x,s+p is the minimizer of the objective function subject to the working set constraints being treated as equalities. If x,s+p is feasible, α is defined to be unity. In this case, the reduced gradient at x-,s- will be zero, and Lagrange-multipliers are computed at the next iteration. Otherwise, α is set to αM, the step to the ‘nearest’ constraint along p. This constraint is added to the working set at the next iteration.
If HZ is singular, then R must also be singular, and an inertia-controlling strategy is used to ensure that only the last diagonal element of R is zero. (See Gill et al. (1991) for a discussion of a similar strategy for indefinite quadratic programming.) In this case, pZ satisfies
pZTHZpZ=0  and   gZTpZ0, (12)
which allows the objective function to be reduced by any step of the form x,s+αp, where α>0. The vector p=ZpZ is a direction of unbounded descent for the QP problem in the sense that the QP objective is linear and decreases without bound along p. If no finite step of the form x,s+αp (where α>0) reaches a constraint not in the working set, the QP problem is unbounded and the routine terminates immediately with IFAIL=2 (see Section 6). Otherwise, α is defined as the maximum feasible step along p and a constraint active at x,s+αp 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 Z 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. (1986)) is used to compute the rectangular factorization
B S T=LU, (13)
returning just the permutation P that makes PLPT unit lower triangular. The pivot tolerance is set to require PL PT ij 2, and the permutation is used to define P in (6). It can be shown that Z is likely to be little more than unity. Hence, Z should be well-conditioned regardless of the condition of W. This feature is applied at the beginning of the optimality phase if a potential B-S 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 Gill et al. (1986)). 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 x,s by a small amount.
Suppose that the value of the optional parameter Feasibility Tolerance is δ. Over a period of K iterations (where K is the value of the optional parameter Expand Frequency; see Section 12.1), the feasibility tolerance actually used by H02CEF (i.e., the working feasibility tolerance) increases from 0.5δ to δ (in steps of 0.5δ/K).
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 0.5δ.
If a problem requires more than K 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 H02CEF 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 ααM) along p 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 B well-conditioned.

12  Optional Parameters

Several optional parameters in H02CEF define choices in the problem specification or the algorithm logic. In order to reduce the number of formal parameters of H02CEF 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 H02CFF and H02CGF prior to a call to H02CEF.
H02CFF 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 H02CFF(IOPTNS,INFORM)
can then be used to read the file on unit IOPTNS. INFORM will be zero on successful exit. H02CFF should be consulted for a full description of this method of supplying optional parameters.
H02CGF can be called to supply options directly, one call being necessary for each optional parameter. For example,
CALL H02CGF ('Print Level = 5')
H02CGF 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 H02CEF (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:
Keywords and character values are case and white space insensitive.
Check FrequencyiDefault =60
Every ith iteration after the most recent basis factorization, a numerical test is made to see if the current solution x,s satisfies the linear constraints Ax-s=0. If the largest element of the residual vector r=Ax-s is judged to be too large, the current basis is refactorized and the basic variables recomputed to satisfy the constraints more accurately. If i<0, the default value is used. If i=0, the value i=99999999 is used and effectively no checks are made.
Crash OptioniDefault =2
Note that this option does not apply when START='W' (see Section 5).
If START='C', an internal crash procedure is used to select an initial basis from various rows and columns of the constraint matrix A-I. The value of i determines which rows and columns are initially eligible for the basis, and how many times the crash procedure is called. If i=0, the all-slack basis B=-I is chosen. If i=1, the crash procedure is called once (looking for a triangular basis in all rows and columns of the linear constraint matrix A). If i=2, the crash procedure is called twice (looking at any equality constraints first followed by any inequality constraints). If i<0 or i>2, the default value is used.
If i=1​ or ​2, certain slacks on inequality rows are selected for the basis first. (If i=2, numerical values are used to exclude slacks that are close to a bound.) The crash procedure then makes several passes through the columns of A, 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 TolerancerDefault =0.1
This value allows the crash procedure to ignore certain ‘small’ nonzero elements in the constraint matrix A while searching for a triangular basis. For each column of A, if amax is the largest element in the column, other nonzeros in that column are ignored if they are less than (or equal to) amax×r.
When r>0, 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 r<0 or r1, the default value is used.
Defaults
This special keyword may be used to reset all optional parameters to their default values.
Expand FrequencyiDefault =10000
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 i iterations, the feasibility tolerance actually used by H02CEF (i.e., the working feasibility tolerance) increases from 0.5δ to δ (in steps of 0.5δ/i).
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 i 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 the description of the optional parameter Pivot Tolerance).
If i<0, the default value is used. If i=0, the value i=99999999 is used and effectively no anti-cycling procedure is invoked.
Factorization FrequencyiDefault =100
If i>0, at most i 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 Ax-s=0 are satisfied. If necessary, the basis will be refactorized before the limit of i updates is reached. If i0, the default value is used.
Feasibility TolerancerDefault =max10-6,ε
If rε, r 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 r as 10-5. If r<ε, the default value is used.
H02CEF 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 r by a factor of 10 or 100. 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 the description of the optional parameter Scale Option), then feasibility is defined in terms of the scaled problem (since it is more likely to be meaningful).
Infinite Bound SizerDefault =1020
If r>0, r defines the ‘infinite’ bound bigbnd in the definition of the problem constraints. Any upper bound greater than or equal to bigbnd will be regarded as + (and similarly any lower bound less than or equal to -bigbnd will be regarded as -). If r0, the default value is used.
Infinite Step SizerDefault =maxbigbnd,1020
If r>0, r 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 x during an iteration would exceed the value of r, the objective function is considered to be unbounded below in the feasible region. If r0, the default value is used.
Iteration LimitiDefault =max50,5n+m
Iters
Itns
The value of i specifies the maximum number of iterations allowed before termination. Setting i=0 and Print Level>0 means that the workspace needed to start solving the problem will be computed and printed, but no iterations will be performed. If i<0, the default value is used.
List Default
Nolist
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 Tolerancer1Default =100.0
LU Update Tolerancer2Default =10.0
The values of r1 and r2 affect the stability and sparsity of the basis factorization B=LU, during refactorization and updates respectively. The lower triangular matrix L is a product of matrices of the form
1 0 μ 1  
where the multipliers μ will satisfy μri. The default values of r1 and r2 usually strike a good compromise between stability and sparsity. For large and relatively dense problems, setting r1 and r2 to 25 (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 r1 in the range 1r1<2 in order to achieve stability. If r1<1 or r2<1, the default value is used.
LU Singularity TolerancerDefault =ε0.67
If r>0, r defines the singularity tolerance used to guard against ill-conditioned basis matrices. Whenever the basis is refactorized, the diagonal elements of U are tested as follows. If ujjr or ujj<r×maxiuij, the jth column of the basis is replaced by the corresponding slack variable. If r0, the default value is used.
Minimize Default
Maximize
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 fx and the other maximizes -fx, their solutions will be the same but the signs of the dual variables πi and the reduced gradients dj (see Section 11.3) will be reversed.
Monitoring FileiDefault =-1
If i0 and Print Level>0, monitoring information produced by H02CEF is sent to a file with logical unit number i. If i<0 and/or Print Level=0, the default value is used and hence no monitoring information is produced.
Optimality TolerancerDefault =max10-6,ε
If rε, r is used to judge the size of the reduced gradients dj=gj-πTaj. 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 -r×max1,πdjr×max1,π, and if djr×max1,π for any superbasic variables. If r<ε, the default value is used.
Partial PriceiDefault =10
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., nm). It reduces the work required for each pricing operation (i.e., when a nonbasic variable is selected to enter the basis). If i=1, all columns of the constraint matrix A-I are searched. If i>1, A and -I are partitioned to give i roughly equal segments Aj,Kj, for j=1,2,,p (modulo p). If the previous pricing search was successful on Aj-1,Kj-1, the next search begins on the segments Aj,Kj. 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 Aj+1,Kj+1, and so on. If i0, the default value is used.
Pivot TolerancerDefault =ε0.67
If r>0, r is used to prevent columns entering the basis if they would cause the basis to become almost singular. If r0, the default value is used.
Print LeveliDefault =10
The value of i controls the amount of printout produced by H02CEF, 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 80 characters per line and that the monitoring information will not exceed 120 characters per line. If i<0, the default value is used. The following printout is sent to the current advisory message unit (as defined by X04ABF):
0i Output
00 No output.
01 The final solution only.
05 One line of summary output for each iteration (no printout of the final solution).
10 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 Monitoring File:
0i Output
00 No output.
01 The final solution only.
05 One long line of output for each iteration (no printout of the final solution).
10 The final solution and one long line of output for each iteration.
20 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 Scale Option=1 or 2), basis factorization statistics and details of the initial basis resulting from the crash procedure (if START='C'; see Section 5).
If Print Level>0 and the unit number defined by Monitoring File is the same as that defined by X04ABF, then the summary output is suppressed.
Rank TolerancerDefault =100ε
Scale OptioniDefault =2
This option enables you to scale the variables and constraints using an iterative procedure due to Fourer (see Hock and Schittkowski (1981)), which attempts to compute row scales ri and column scales cj such that the scaled matrix coefficients a-ij=aij×cj/ri are as close as possible to unity. This may improve the overall efficiency of the routine on some problems. (The lower and upper bounds on the variables and slacks for the scaled problem are redefined as l-j=lj/cj and u-j=uj/cj respectively, where cjrj-n if j>n.)
If i=0, no scaling is performed. If i=1, all rows and columns of the constraint matrix A are scaled. If i=2, an additional scaling is performed that may be helpful when the solution x is large; it takes into account columns of A-I that are fixed or have positive lower bounds or negative upper bounds. If i<0 or i>2, the default value is used.
Scale TolerancerDefault =0.9
Note that this option does not apply when Scale Option=0.
If 0<r<1, r is used to control the number of scaling passes to be made through the constraint matrix A. At least 3 (and at most 10) passes will be made. More precisely, let ap denote the largest column ratio (i.e., 'biggest'element 'smallest'element  in some sense) after the pth scaling pass through A. The scaling procedure is terminated if apap-1×r for some p3. Thus, increasing the value of r from 0.9 to 0.99 (say) will probably increase the number of passes through A. If r0 or r1, the default value is used.
Superbasics LimitiDefault =minnH+1,n
Note that this option does not apply to FP or LP problems.
The value of i specifies ‘how nonlinear’ you expect the QP problem to be. If i0, 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 H02CEF. (See also the description of the optional parameters Monitoring File and Print Level in Section 12.1.) You can control the level of printed output.
When Print Level=5 or 10 and Monitoring File0, the following line of intermediate printout (<120 characters) is produced at every iteration on the unit number specified by 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 A and -I. 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.
-B is the variable removed from the basis (if any) to become nonbasic.
-B is the variable chosen to leave the set of basics (if any) in a special basic  superbasic swap. The entry under -S has become basic if this entry is nonzero, and nonbasic otherwise. The swap is done to ensure that there are no superbasic slacks.
Step is the value of the step length α taken along the computed search direction p. The variables x have been changed to x+αp. 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 rth element of a vector y satisfying By=aq whenever aq (the qth column of the constraint matrix A-I) replaces the rth column of the basis matrix B. 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 (default value=ε0.67, where ε is the machine precision) to exclude very small elements of y 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 x is not feasible, Sinf gives a weighted sum of the magnitudes of constraint violations. If x 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. Once optimal multipliers are obtained, the number of infeasibilities can increase, but the sum of infeasibilities will either remain constant or be reduced until the minimum sum of infeasibilities is found.
L is the number of nonzeros in the basis factor L. Immediately after a basis factorization B=LU, this is lenL, the number of subdiagonal elements in the columns of a lower triangular matrix. Further nonzeros are added to L when various columns of B are later replaced. (Thus, L increases monotonically.)
U is the number of nonzeros in the basis factor U. Immediately after a basis factorization, this is lenU, the number of diagonal and superdiagonal elements in the rows of an upper triangular matrix. As columns of B are replaced, the matrix U 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 U. This includes the number of compressions needed during the previous basis factorization. Normally, Ncp should increase very slowly. If it does not, increase LENZ by at least L+U and rerun H02CEF (possibly using START='W'; see Section 5).
Norm rg is dS, 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 Print Level20 and Monitoring File0, the following lines of intermediate printout (<120 characters) are produced on the unit number specified by Monitoring File whenever the matrix B or BS= B S T is factorized. Gaussian elimination is used to compute an LU factorization of B or BS, where PLPT is a lower triangular matrix and PUQ is an upper triangular matrix for some permutation matrices P and Q. The factorization is stabilized in the manner described under the LU Factor Tolerance (default value=100.0; see Section 12.1).
Factorize is the factorization count.
Demand is a code giving the reason for the present factorization as follows:
Code Meaning
010 First LU factorization.
011 Number of updates reached the value of the optional parameter Factorization Frequency (default value=100).
012 Excessive nonzeros in updated factors.
017 Not enough storage to update factors.
010 Row residuals too large (see the description for the optional parameter Check Frequency).
011 Ill-conditioning has caused inconsistent results.
Iteration is the iteration count.
Nonlinear is the number of nonlinear variables in B (not printed if BS is factorized).
Linear is the number of linear variables in B (not printed if BS is factorized).
Slacks is the number of slack variables in B (not printed if BS is factorized).
Elems is the number of nonzeros in B (not printed if BS is factorized).
Density is the percentage nonzero density of B (not printed if BS is factorized). More precisely, Density=100×Elems/Nonlinear+Linear+Slacks2.
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 3 or 4, increase LENIZ and LENZ and rerun H02CEF (possibly using START='W'; see Section 5).
Merit is the average Markowitz merit count for the elements chosen to be the diagonals of PUQ. Each merit count is defined to be c-1r-1, where c and r 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 L.
lenU is the number of nonzeros in U.
Increase is the percentage increase in the number of nonzeros in L and U relative to the number of nonzeros in B. More precisely, Increase=100×lenL+lenU-Elems/Elems.
m is the number of rows in the problem. Note that m=Ut+Lt+bp.
Ut is the number of triangular rows of B at the top of U.
d1 is the number of columns remaining when the density of the basis matrix being factorized reached 0.3.
Lmax is the maximum subdiagonal element in the columns of L (not printed if BS is factorized). This will not exceed the value of the LU Factor Tolerance.
Bmax is the maximum nonzero element in B (not printed if BS is factorized).
BSmax is the maximum nonzero element in BS (not printed if B is factorized).
Umax is the maximum nonzero element in U, excluding elements of B that remain in U unchanged. (For example, if a slack variable is in the basis, the corresponding row of B will become a row of U without modification. Elements in such rows will not contribute to Umax. If the basis is strictly triangular, none of the elements of B 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 LU Factor Tolerance to a value near 1.0.
Umax is not printed if BS is factorized.
Umin is the magnitude of the smallest diagonal element of PUQ (not printed if BS is factorized).
Growth is the value of the ratio Umax/Bmax, which should not be too large.
Providing Lmax is not large (say <10.0), the ratio maxBmax,Umax/Umin is an estimate of the condition number of B. If this number is extremely large, the basis is nearly singular and some numerical difficulties could occur in subsequent computations. (However, an effort is made to avoid near singularity by using slacks to replace columns of B that would have made Umin extremely small, and the modified basis is refactorized.)
Growth is not printed if BS is factorized.
Lt is the number of triangular columns of B at the beginning of L.
bp is the size of the ‘bump’ or block to be factorized nontrivially after the triangular rows and columns have been removed.
d2 is the number of columns remaining when the density of the basis matrix being factorized reached 0.6.
When Print Level20 and Monitoring File0, the following lines of intermediate printout (<80 characters) are produced on the unit number specified by Monitoring File whenever START='C' (see Section 5). They refer to the number of columns selected by the crash procedure during each of several passes through A, 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.
Preferred is the number of ‘preferred’ columns in the basis (i.e., ISTATEj=3 for some jn).
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.
When Print Level20 and Monitoring File0, the following lines of intermediate printout (<80 characters) are produced on the unit number specified by Monitoring File. They refer to the elements of the NAMES array (see Section 5).
Name gives the name for the problem (blank if none).
Objective gives the name of the free row for the problem (blank if none).
RHS gives the name of the constraint right-hand side for the problem (blank if none).
Ranges gives the name of the ranges for the problem (blank if none).
Bounds gives the name of the bounds for the problem (blank if none).
When Print Level=1 or 10 and Monitoring File0, the following lines of final printout (<120 characters) are produced on the unit number specified by Monitoring File.
Let aj denote the jth column of A, for j=1,2,,n. 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 j. (This is used internally to refer to xj in the intermediate output.)
Column gives the name of xj.
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 to give some additional information about the state of xj. Note that unless the optional parameter Scale Option=0 (default value=2) 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 to 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 to (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 optional parameter Feasibility Tolerance (default value=max10-6,ε, where ε is the machine precision).
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 (default value=max10-6,ε), the solution would not be declared optimal because the reduced gradient for the variable would not be considered negligible.
Activity is the value of xj at the final iterate.
Obj Gradient is the value of gj at the final iterate. For FP problems, gj is set to zero.
Lower Bound is the lower bound specified for the variable. None indicates that BLj-bigbnd.
Upper Bound is the upper bound specified for the variable. None indicates that BUjbigbnd.
Reduced Gradnt is the value of dj at the final iterate (see Section 11.3). For FP problems, dj is set to zero.
m + j is the value of m+j.
Let vi denote the ith row of A, for i=1,2,,m. 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 n+i. (This is used internally to refer to si in the intermediate output.)
Row gives the name of νi.
State gives the state of the variable (LL if active on its lower bound, UL if active on its upper bound, EQ if active and fixed, BS if inactive when si is basic and SBS if inactive when si is superbasic).
A key is sometimes printed before State to give some additional information about the state of si. Note that unless the optional parameter Scale Option=0 (default value=2) 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 to 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 to (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 optional parameter Feasibility Tolerance (default value=max10-6,ε, where ε is the machine precision).
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 (default value=max10-6,ε), the solution would not be declared optimal because the reduced gradient for the variable would not be considered negligible.
Activity is the value of vi at the final iterate.
Slack Activity is the value by which vi 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 BLj-bigbnd.
Upper Bound is the upper bound specified for the variable. None indicates that BUjbigbnd.
i gives the index i of vi.
Numerical values are output with a fixed number of digits; they are not guaranteed to be accurate to this precision.

H02CEF (PDF version)
H Chapter Contents
H Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015