NAG CL Interface
h02bbc (ilp_dense)
1
Purpose
h02bbc solves ‘zeroone’, ‘general’, ‘mixed’ or ‘all’ integer linear and quadratic programming problems using a branch and bound method. The function may also be used to find either the first integer solution or the optimum integer solution. It is not intended for large sparse problems.
2
Specification
void 
h02bbc (Integer n,
Integer m,
const double a[],
Integer tda,
const double bl[],
const double bu[],
const Nag_Boolean intvar[],
const double cvec[],
const double h[],
Integer tdh,
void 
(*qphess)(Integer n,
Integer jthcol,
const double h[],
Integer tdh,
const double x[],
double hx[],
Nag_Comm *comm),


double x[],
double *objf,
Nag_H02_Opt *options,
Nag_Comm *comm,
NagError *fail) 

The function may be called by the names: h02bbc, nag_mip_ilp_dense or nag_ip_bb.
3
Description
h02bbc is capable of solving certain types of integer programming (IP) problems using a branch and bound (BB) method, see
Taha (1987). In order to describe these types of integer programs and to briefly state the BB method, we define the following problem.
where
$A$ is an
$m$ by
$n$ matrix and
$f\left(x\right)$ may be specified in a variety of ways depending upon the particular problem to be solved. The available forms for
$f\left(x\right)$ are listed in
Table 1 below. For the moment, however, we assume that
$f\left(x\right)={c}^{\mathrm{T}}x$ so that
(1) is a linear programming (LP) problem.
If, in
(1), it is required that some (or all) of the variables take integer values, then the integer program is of type
mixed (or
all) general IP problem. If, additionally, the integer variables are restricted to take only 01 values (i.e.,
${l}_{j}=0$ and
${u}_{j}=1$) then the integer program is of type mixed (or all)
zeroone IP problem.
h02bbc does not treat the all integer or zeroone cases specially; therefore, since the mixed integer general IP case is the most general, we shall refer to
(1), together with whatever integrality restrictions are applied, as a mixed integer linear programming (MILP) problem, with the assumption that the special cases are included in this.
The BB method applies directly to these integer programs. The general idea of BB is to solve the problem without the integrality restrictions as an LP problem (first or
root node). If in the optimal solution an integer variable
${x}_{k}$ takes a noninteger value
${x}_{k}^{*}$, two LP subproblems or
nodes are created by
branching, imposing
${x}_{k}\le \left[{x}_{k}^{*}\right]$ and
${x}_{k}\ge \left[{x}_{k}^{*}\right]+1$ respectively, where
$\left[{x}_{k}^{*}\right]$ denotes the integer part of
${x}_{k}^{*}$. This method of branching continues until the first integer solution (
bound) is obtained. The hanging nodes are then solved and investigated in order to prove the optimality of the solution. The algorithm is described in more detail in
Section 12.
The same method may also be applied when the objective function $f\left(x\right)$ takes other forms. An important assumption for the method to be theoretically valid is that each subproblem is solved to global optimality. This is the case when, for example, $f\left(x\right)$ is a quadratic function which has a positive (semi)definite Hessian. For such $f\left(x\right)$ the subproblems of the BB search are quadratic programming (QP) problems, which can, in principle, be solved to global optimality. With a quadratic objective function, the problem becomes a mixed integer quadratic programming (MIQP) problem.
h02bbc is able to solve problems in which
$f\left(x\right)$ is a linear or quadratic function, defined in a variety of ways as described in
Table 1 below. The subproblems are solved using the algorithm of
e04nfc.
Problem Type 
$f\left(x\right)$ 
Matrix $H$ 
MILP 
${c}^{\mathrm{T}}x$ 
Not applicable 
MIQP1 
$\phantom{{c}^{\mathrm{T}}x+}\frac{1}{2}{x}^{\mathrm{T}}Hx$ 
symmetric 
MIQP2 
${c}^{\mathrm{T}}x+\frac{1}{2}{x}^{\mathrm{T}}Hx$ 
symmetric 
MIQP3 
$\phantom{{c}^{\mathrm{T}}x+}\frac{1}{2}{x}^{\mathrm{T}}{H}^{\mathrm{T}}Hx$ 
$m$ by $n$ upper trapezoidal 
MIQP4 
${c}^{\mathrm{T}}x+\frac{1}{2}{x}^{\mathrm{T}}{H}^{\mathrm{T}}Hx$ 
$m$ by $n$ upper trapezoidal 
Table 1
3.1
Suitability of BB Method for MIQP Problems
The BB method is applicable to an IP problem whenever the global optimum may reliably be found for each subproblem, and this is theoretically true for an MILP problem. However, this may not be true for an MIQP problem in which the Hessian is not positive (semi)definite; in such a case the subproblems may have solutions which are locally but not globally optimal and, in general, it is not possible to ensure that a QP subproblem solver will always find the global optimum when local optima are present. For problems of type MIQP3 and MIQP4, it is a consequence of the way the Hessian is defined that it must be positive (semi)definite, but no such guarantee holds for problems of type MIQP1 or MIQP2.
h02bbc does not check if the Hessian is positive (semi)definite. This provides for the possibility that you have special knowledge about the problem, for example that an indefinite Hessian is positive (semi)definite on the feasible region defined by the problem constraints (in which case the problem has no local optima). Alternatively, you may wish to use
h02bbc as a
heuristic, with the understanding that if a solution is obtained, it may not be the true global optimum of the MIQP problem, or that no solution might be found even though one does exist. If you wish to check whether the Hessian of a problem of type MIQP1 or MIQP2 is positive (semi)definite, and therefore whether any solution obtained can be relied upon, one way this may be achieved is to analyse its eigenvalues (for example using
f08fac): the Hessian is positive semidefinite if and only if all of its eigenvalues are
$\ge 0$.
3.2
Maximization Problems
h02bbc attempts to solve a
minimization problem of the form
(1) (together with the integrality requirements). In principle, a
maximization problem can be solved by minimizing
$f\left(x\right)$, i.e., reversing the sign of the objective function. This is always valid in the case of an MILP problem, as long as the resulting problem is not unbounded, and simply involves reversing the signs of the coefficients of
$c$ (the elements of the input argument array
cvec, see
Section 4). In the case of an MIQP problem some care must be taken since reversing the sign of a positive (semi)definite Hessian will make it negative (semi)definite and viceversa. Recall that the theoretical validity of the BB method, applied to an MIQP problem, effectively requires that the Hessian be positive (semi)definite on the feasible region defined by the problem constraints.
Assuming these considerations to be taken into account, a maximization problem of type MIQP1 can be solved by reversing the signs of the elements of $H$; type MIQP2 problems require the signs of the coefficients of $c$ to be reversed also. Problem types MIQP3 and MIQP4 have a positive (semi)definite Hessian by definition, so it would not normally make sense to solve these as maximization problems. Hence, h02bbc does not allow you to reverse the sign of the quadratic objective term for these problem types.
4
References
Dakin R J (1965) A tree search algorithm for mixed integer programming problems Comput. J. 8 250–255
Mitra G (1973) Investigation of some branch and bound strategies for the solution of mixed integer linear programs Math. Programming 4 155–170
Taha H A (1987) Operations Research: An Introduction Macmillan, New York
Williams H P (1993) Model Building in Mathematical Programming (3rd Edition) Wiley
5
Arguments

1:
$\mathbf{n}$ – Integer
Input

On entry: $n$, the number of variables.
Constraint:
${\mathbf{n}}>0$.

2:
$\mathbf{m}$ – Integer
Input

On entry: $m$, the number of general linear constraints.
Constraint:
${\mathbf{m}}\ge 0$.

3:
$\mathbf{a}\left[{\mathbf{m}}\times {\mathbf{tda}}\right]$ – const double
Input

Note: the $\left(i,j\right)$th element of the matrix $A$ is stored in ${\mathbf{a}}\left[\left(i1\right)\times {\mathbf{tda}}+j1\right]$.
On entry: the
$\mathit{i}$th row of
a must contain the coefficients of the
$\mathit{i}$th general linear constraint, for
$\mathit{i}=1,2,\dots ,m$.
If
${\mathbf{m}}=0$, the array
a is not referenced and may be
NULL.

4:
$\mathbf{tda}$ – Integer
Input

On entry: the stride separating matrix column elements in the array
a.
Constraint:
if ${\mathbf{m}}>0$, ${\mathbf{tda}}\ge {\mathbf{n}}$

5:
$\mathbf{bl}\left[{\mathbf{n}}+{\mathbf{m}}\right]$ – const double
Input

6:
$\mathbf{bu}\left[{\mathbf{n}}+{\mathbf{m}}\right]$ – const double
Input

On entry:
bl must contain the lower bounds and
bu the upper bounds, for all the constraints in the following order. The first
$n$ elements of each array must contain the bounds on the variables, and the next
$m$ elements the bounds for the general linear constraints (if any). To specify a nonexistent lower bound (i.e.,
${l}_{j}=\infty $), set
${\mathbf{bl}}\left[j1\right]\le {\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$, and to specify a nonexistent upper bound (i.e.,
${u}_{j}=+\infty $), set
${\mathbf{bu}}\left[j1\right]\ge {\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$, where
${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ is one of the optional parameters (default value
${10}^{20}$, see
Section 11.2). To specify the
$j$th constraint as an equality, set
${\mathbf{bl}}\left[j1\right]={\mathbf{bu}}\left[j1\right]=\beta $, say, where
$\left\beta \right<{\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$.
Constraint:
${\mathbf{bl}}\left[\mathit{j}\right]\le {\mathbf{bu}}\left[\mathit{j}\right]$, for $\mathit{j}=0,1,\dots ,{\mathbf{n}}+{\mathbf{m}}1$.

7:
$\mathbf{intvar}\left[{\mathbf{n}}\right]$ – const Nag_Boolean
Input

On entry: indicates which are the integer variables in the problem. For example, if
${x}_{j}$ is an integer variable then
${\mathbf{intvar}}\left[j1\right]$ must be set to
$1$, and 0 otherwise. The degenerate case, in which all elements of
intvar are zero, is allowed. In this case,
h02bbc solves a single LP or QP problem (depending on the problem type as specified by the optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{prob}}$, see
Section 11.2).
Constraint:
${\mathbf{intvar}}\left[\mathit{j}\right]=0\text{or}1$, for $\mathit{j}=0,1,\dots ,{\mathbf{n}}1$.

8:
$\mathbf{cvec}\left[{\mathbf{n}}\right]$ – const double
Input

On entry: the coefficients
${c}_{j}$ of the explicit linear term of the objective function when the problem is of type MILP, MIQP2 or MIQP4. The default problem type is MILP; other problem types can be specified using the optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{prob}}$, see
Section 11.2.
If the problem is of type MIQP1 or MIQP3,
cvec is not referenced and may be
NULL.

9:
$\mathbf{h}\left[{\mathbf{n}}\times {\mathbf{tdh}}\right]$ – const double
Input

On entry:
h may be used to store the quadratic term
$H$ of the MIQP objective function if desired. The elements of
h are accessed only by the function
qphess; thus,
h is not accessed if the problem is of the type MILP (the default) and may be
NULL.
The number of rows of
h is denoted by
${n}_{H}$ and its default value is equal to
$n$. (The optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{hrows}}$ may be used to specify a value of
${n}_{H}<n$; see
Section 11.2).
If the problem is of type MIQP1 or MIQP2, the first
${n}_{H}$ rows and columns of
h must contain the leading
${n}_{H}$ by
${n}_{H}$ rows and columns of the symmetric Hessian matrix. Only the diagonal and upper triangular elements of the leading
${n}_{H}$ rows and columns of
h are referenced. The remaining elements need not be assigned.
For problems of type MIQP3 and MIQP4, the first
${n}_{H}$ rows of
h must contain an
${n}_{H}$ by
$n$ upper trapezoidal factor of the Hessian matrix. The factor need not be of full rank, i.e., some of the diagonals may be zero. However, as a general rule, the larger the dimension of the leading nonsingular submatrix of
$H$, the fewer iterations will be required. Elements outside the upper trapezoidal part of the first
${n}_{H}$ rows of
$H$ are assumed to be zero and need not be assigned.
In some cases, you need not use
h to store
$H$ explicitly (see the specification of function
qphess).

10:
$\mathbf{tdh}$ – Integer
Input

On entry: the stride separating matrix column elements in the array
h.
Constraint:
${\mathbf{tdh}}\ge {\mathbf{n}}$ or at least the value of the optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{hrows}}$ if it is set. This constraint is enforced only for problems of type MIQP in which the
qphess argument is null.

11:
$\mathbf{qphess}$ – function, supplied by the user
External Function

In general, you need not provide a version of
qphess, because a ‘default’ function is included in the NAG Library. If the default function is required then the NAG defined null function pointer,
NULLFN, should be supplied in the call to
h02bbc. The algorithm of
h02bbc requires only the product of
$H$ and a vector
$x$; and in some cases you may obtain increased efficiency by providing a version of
qphess that avoids the need to define the elements of the matrix
$H$ explicitly.
qphess is not referenced for problems of type MILP (the default), in which case
qphess should be replaced by
NULLFN.
The specification of
qphess is:
void 
qphess (Integer n,
Integer jthcol,
const double h[],
Integer tdh,
const double x[],
double hx[],
Nag_Comm *comm)



1:
$\mathbf{n}$ – Integer
Input

On entry: $n$, the number of variables.

2:
$\mathbf{jthcol}$ – Integer
Input

On entry:
jthcol specifies whether or not the vector
$x$ is a column of the identity matrix.
 ${\mathbf{jthcol}}=j>0$
 The vector $x$ is the $j$th column of the identity matrix, and hence $Hx$ is the $j$th column of $H$, which can sometimes be computed very efficiently and qphess may be coded to take advantage of this. However special code is not necessary because $x$ is always stored explicitly in the array x.
 ${\mathbf{jthcol}}=0$
 $x$ has no special form.

3:
$\mathbf{h}\left[{\mathbf{n}}\times {\mathbf{tdh}}\right]$ – const double
Input

On entry: the matrix
$H$ of the QP objective function. The matrix element
${H}_{ij}$ is contained in
${\mathbf{h}}\left[\left(i1\right)\times tdh+j1\right]$ for
$i=1,2,\dots ,n$ and
$j=1,2,\dots ,n$. In some situations, it may be desirable to compute
$Hx$ without accessing
h – for example, if
$H$ is sparse or has special structure. (This is illustrated in the function
qphess in
Section 10.) The arguments
h and
tdh may then refer to any convenient array.

4:
$\mathbf{tdh}$ – Integer
Input

On entry: the stride separating matrix column elements in the array
h.

5:
$\mathbf{x}\left[{\mathbf{n}}\right]$ – const double
Input

On entry: the vector $x$.

6:
$\mathbf{hx}\left[{\mathbf{n}}\right]$ – double
Output

On exit: the product $Hx$.

7:
$\mathbf{comm}$ – Nag_Comm *

Pointer to structure of type Nag_Comm; the following members are relevant to
qphess.
 flag – IntegerInput/Output

On entry:
qphess is called with
$\mathbf{comm}\mathbf{\to}\mathbf{flag}$ set to a nonnegative number.
On exit: if
qphess resets
$\mathbf{comm}\mathbf{\to}\mathbf{flag}$ to some negative number then
h02bbc will terminate immediately with the error indicator
NE_USER_STOP. If
fail is supplied to
h02bbc,
${\mathbf{fail}}\mathbf{.}\mathbf{errnum}$ will be set to your setting of
$\mathbf{comm}\mathbf{\to}\mathbf{flag}$.
 first – Nag_BooleanInput

On entry: will be set to Nag_TRUE on the first call to
qphess and Nag_FALSE for all subsequent calls.
 nf – IntegerInput

On entry: the number of calls made to
qphess including the current one.
 user – double *
 iuser – Integer *
 p – Pointer

The type Pointer will be void * with a C compiler that defines void * and char * otherwise.
Before calling
h02bbc these pointers may be allocated memory and initialized with various quantities for use by
qphess when called from
h02bbc.
Note: qphess should not return floatingpoint NaN (Not a Number) or infinity values, since these are not handled by
h02bbc. If your code inadvertently
does return any NaNs or infinities,
h02bbc is likely to produce unexpected results.
Note:
qphess should be tested separately before being used in conjunction with
h02bbc. The input arrays
h and
x must
not be changed by
qphess.

12:
$\mathbf{x}\left[{\mathbf{n}}\right]$ – double
Input/Output

On entry: an initial estimate of the solution of the first subproblem (the problem as described in
Section 3).
If optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{branch\_dir}}=\mathrm{Nag\_Branch\_InitX}$ (which is not the default value), then the initial values in
x of the integer variables influence the branching procedure in the BB algorithm. Typically, an estimate of the values of the integer variables in the IP solution would be provided in this case. See
Section 11.2 for details.
On exit: with
${\mathbf{fail}}\mathbf{.}\mathbf{code}=\mathrm{NE\_NOERROR}$,
x contains a solution which will be an estimate of either the optimum integer solution or the first integer solution, depending on the value of optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{first\_soln}}$. If
${\mathbf{fail}}\mathbf{.}\mathbf{code}={\mathbf{NW\_MIP\_MAX\_NODES\_INT\_SOL}}$,
NW_MIP_MAX_DEPTH_INT_SOL,
NW_MIP_MAX_ITER_INT_SOL,
or
NE_MIP_HESS_TOO_BIG_INT_SOL
then
x contains a solution which may not be the optimal IP solution because
h02bbc was unable to investigate all of the nodes. See
Section 6 for more details.

13:
$\mathbf{objf}$ – double *
Output

On exit: with
${\mathbf{fail}}\mathbf{.}\mathbf{code}=\mathrm{NE\_NOERROR}$,
NW_MIP_MAX_NODES_INT_SOL,
NW_MIP_MAX_DEPTH_INT_SOL,
NW_MIP_MAX_ITER_INT_SOL, or
NE_MIP_HESS_TOO_BIG_INT_SOL,
objf contains the value of the objective function for the IP solution.

14:
$\mathbf{options}$ – Nag_H02_Opt *
Input/Output

On entry/exit: a pointer to a structure of type Nag_H02_Opt whose members are optional parameters for
h02bbc. These structure members offer the means of adjusting some of the argument values of the algorithm and on output will supply further details of the results. A description of the members of
options is given below in
Section 11.
The
options structure also allows names to be assigned to the variables and constraints of the problem, which are then used in solution output. In particular, if the problem is defined by an MPSX file, the function
h02buc may be used to read the file, and to store the variable and constraint names in
options for use by
h02bbc.
If any of these optional parameters are required then the structure
options should be declared and initialized by a call to
h02xxc and supplied as an argument to
h02bbc. However, if the optional parameters are not required the NAG defined null pointer,
H02_DEFAULT, can be used in the function call.

15:
$\mathbf{comm}$ – Nag_Comm *
Input/Output

Note: comm is a NAG defined type (see
Section 3.1.1 in the Introduction to the NAG Library CL Interface).
On entry/exit: structure containing pointers for communication to the usersupplied function,
qphess, and the optional userdefined printing function. See the description of
qphess and
Section 11.3.1 for details. If you do not need to make use of this communication feature the null pointer
NAGCOMM_NULL may be used in the call to
h02bbc;
comm will then be declared internally for use in calls to usersupplied functions.

16:
$\mathbf{fail}$ – NagError *
Input/Output

The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
6
Error Indicators and Warnings
 NE_2_INT_ARG_LT

On entry, ${\mathbf{tda}}=\u2329\mathit{\text{value}}\u232a$ while ${\mathbf{n}}=\u2329\mathit{\text{value}}\u232a$. These arguments must satisfy ${\mathbf{tda}}\ge {\mathbf{n}}$.
On entry, ${\mathbf{tdh}}=\u2329\mathit{\text{value}}\u232a$ while ${\mathbf{n}}=\u2329\mathit{\text{value}}\u232a$. These arguments must satisfy ${\mathbf{tdh}}\ge {\mathbf{n}}$.
On entry, ${\mathbf{tdh}}=\u2329\mathit{\text{value}}\u232a$ while ${\mathbf{options}}\mathbf{.}{\mathbf{hrows}}=\u2329\mathit{\text{value}}\u232a$. These arguments must satisfy ${\mathbf{tdh}}\ge {\mathbf{options}}\mathbf{.}{\mathbf{hrows}}$.
 NE_ALLOC_FAIL

Dynamic memory allocation failed.
 NE_BAD_PARAM

On entry, argument ${\mathbf{options}}\mathbf{.}{\mathbf{branch\_dir}}$ had an illegal value.
On entry, argument ${\mathbf{options}}\mathbf{.}{\mathbf{nodsel}}$ had an illegal value.
On entry, argument ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}$ had an illegal value.
On entry, argument ${\mathbf{options}}\mathbf{.}{\mathbf{prob}}$ had an illegal value.
On entry, argument ${\mathbf{options}}\mathbf{.}{\mathbf{varsel}}$ had an illegal value.
 NE_BOUND

The lower bound for variable $\u2329\mathit{\text{value}}\u232a$ (array element ${\mathbf{bl}}\left[\u2329\mathit{\text{value}}\u232a\right]$) is greater than the upper bound.
 NE_BOUND_LCON

The lower bound for linear constraint $\u2329\mathit{\text{value}}\u232a$ (array element ${\mathbf{bl}}\left[\u2329\mathit{\text{value}}\u232a\right]$) is greater than the upper bound.
 NE_CVEC_NULL

${\mathbf{options}}\mathbf{.}{\mathbf{prob}}=\u2329\mathit{\text{value}}\u232a$ but argument ${\mathbf{cvec}}=\text{}$ NULL.
 NE_H_NULL

${\mathbf{options}}\mathbf{.}{\mathbf{prob}}=\u2329\mathit{\text{value}}\u232a$,
qphess is
NULL but argument
h is also
NULL. If the default function for
qphess is to be used for this problem then an array must be supplied in argument
h.
 NE_INT_ARG_LT

On entry, ${\mathbf{m}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{m}}\ge 0$.
On entry, ${\mathbf{n}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{n}}\ge 1$.
 NE_INTERNAL_ERROR

An internal error has occurred in this function. Check the function call
and any array sizes. If the call is correct then please contact
NAG for
assistance.
 NE_INVALID_INT_RANGE_1

Value $\u2329\mathit{\text{value}}\u232a$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{hrows}}$ is not valid. Correct range is ${\mathbf{n}}\ge {\mathbf{options}}\mathbf{.}{\mathbf{hrows}}\ge 0$.
Value $\u2329\mathit{\text{value}}\u232a$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{max\_depth}}$ is not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{max\_depth}}\ge 2$.
Value $\u2329\mathit{\text{value}}\u232a$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}$ is not valid. Correct range is ${\mathbf{n}}\ge {\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}\ge 1$.
Value $\u2329\mathit{\text{value}}\u232a$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{max\_iter}}$ is not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{max\_iter}}\ge 0$.
Value $\u2329\mathit{\text{value}}\u232a$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}$ is not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}=\mathtt{ALL\_NODES}$ or ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}\ge 1$.
 NE_INVALID_REAL_RANGE_F

Value $\u2329\mathit{\text{value}}\u232a$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{feas\_tol}}$ is not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{feas\_tol}}>0.0$.
Value $\u2329\mathit{\text{value}}\u232a$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ is not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}>0.0$.
Value $\u2329\mathit{\text{value}}\u232a$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}$ is not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}\ge 0.0$.
 NE_INVALID_REAL_RANGE_FF

Value $\u2329\mathit{\text{value}}\u232a$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{int\_tol}}$ is not valid. Correct range is $0.0<{\mathbf{options}}\mathbf{.}{\mathbf{int\_tol}}<1.0$.
Value $\u2329\mathit{\text{value}}\u232a$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{rank\_tol}}$ is not valid. Correct range is $0.0\le {\mathbf{options}}\mathbf{.}{\mathbf{rank\_tol}}<1.0$.
 NE_MIP_HESS_TOO_BIG_INT_SOL

Reduced Hessian exceeds assigned dimension during BB tree search. ${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}=\u2329\mathit{\text{value}}\u232a$. An IP solution was found.
This error can only occur with MIQP problems. Whilst attempting to solve a node during the BB tree search, the QP algorithm needed to expand the reduced Hessian when it was already at its maximum dimension, as specified by the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}$. No further nodes were examined. An IP solution was found but it may not be optimal.
The value of the argument ${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}$ is too small. Rerun h02bbc with a larger value. The IP objective obtained should be assigned to ${\mathbf{options}}\mathbf{.}{\mathbf{int\_obj\_bound}}$ to aid the BB tree search in the repeated run.
 NE_MIP_HESS_TOO_BIG_NO_INT_SOL

Reduced Hessian exceeds assigned dimension during BB tree search. ${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}=\u2329\mathit{\text{value}}\u232a$. No IP solution was found.
This error can only occur with MIQP problems. Whilst attempting to solve a node during the BB tree search, the QP algorithm needed to expand the reduced Hessian when it was already at its maximum dimension, as specified by the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}$. No further nodes were examined. No IP solution was found amongst the nodes examined.
The value of the argument ${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}$ is too small. Rerun h02bbc with a larger value.
 NE_MIP_ROOT_HESS_TOO_BIG

Reduced Hessian exceeds assigned dimension at root node. ${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}=\u2329\mathit{\text{value}}\u232a$.
This error can only occur with MIQP problems. Whilst attempting to solve the root node, the QP algorithm needed to expand the reduced Hessian when it was already at its maximum dimension, as specified by the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}$.
The value of the argument ${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}$ is too small. Rerun h02bbc with a larger value.
 NE_MIP_ROOT_INFEAS

The root node of the BB tree is infeasible.
A feasible point could not be found for the original LP or QP problem, i.e., it was not possible to satisfy all the constraints to within the feasibility tolerance (determined by optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{feas\_tol}}$). If the data for the constraints are accurate only to the absolute precision
$\sigma $, you should ensure that the value of the feasibility tolerance is greater than
$\sigma $. For example, if all elements of
$A$ are of order unity and are accurate only to three decimal places, the feasibility tolerance should be at least
${10}^{3}$ (see
Section 9).
 NE_MIP_ROOT_MAX_ITER

The maximum number of iterations (determined by optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{max\_iter}}$) was reached before normal termination occurred for the original LP or QP problem (see
Section 9).
The maximum number of iterations, $\u2329\mathit{\text{value}}\u232a$, was performed before normal termination occurred for the root node of the BB tree.
 NE_MIP_ROOT_UNBOUNDED

The root node of the BB tree appears to be unbounded.
See
Section 12 for advice.
 NE_NAME_TOO_LONG

The character string pointed to by ${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}\left[\u2329\mathit{\text{value}}\u232a\right]$ is too long. It should be no longer than 8 characters.
 NE_NOT_APPEND_FILE

Cannot open file $\u2329\mathit{string}\u232a$ for appending.
 NE_NOT_CLOSE_FILE

Cannot close file $\u2329\mathit{string}\u232a$.
 NE_OPT_NOT_INIT

Options structure not initialized.
 NE_PRIORITY_NULL

${\mathbf{options}}\mathbf{.}{\mathbf{varsel}}=\mathrm{Nag\_Use\_Priority}$ but ${\mathbf{options}}\mathbf{.}{\mathbf{priority}}$ is NULL.
 NE_USER_STOP

User requested termination, user flag value
$\text{}=\u2329\mathit{\text{value}}\u232a$.
This exit occurs if you set
$\mathbf{comm}\mathbf{\to}\mathbf{flag}$ to a negative value in
qphess. If
fail is supplied the value of
${\mathbf{fail}}\mathbf{.}\mathbf{errnum}$ will be the same as your setting of
$\mathbf{comm}\mathbf{\to}\mathbf{flag}$.
 NE_WRITE_ERROR

Error occurred when writing to file $\u2329\mathit{string}\u232a$.
 NW_MIP_MAX_DEPTH_INT_SOL

An IP solution was found but the search has been terminated because the maximum allowed tree depth (as determined by optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{max\_depth}}$) has been reached.
Increase ${\mathbf{options}}\mathbf{.}{\mathbf{max\_depth}}$ and rerun h02bbc. The IP objective obtained should be assigned to ${\mathbf{options}}\mathbf{.}{\mathbf{int\_obj\_bound}}$ to aid the BB tree search in the repeated run.
 NW_MIP_MAX_DEPTH_NO_INT_SOL

The maximum allowed tree depth (as determined by optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{max\_depth}}$) has been reached before any integer solution has been found.
Increase ${\mathbf{options}}\mathbf{.}{\mathbf{max\_depth}}$ and rerun h02bbc.
 NW_MIP_MAX_ITER_INT_SOL

The IP solution found may not be the optimum. The search had to be terminated in at least one branch of the BB tree because the iteration limit was reached.
It was not possible to solve at least one node of the BB tree, which means that the tree search could not be completed. An IP solution was found but a better one may be present in the unsearched portion of the tree. See
Section 9 for more information.
 NW_MIP_MAX_ITER_NO_INT_SOL

No IP solution was found but the search had to be terminated in at least one branch of the BB tree because the iteration limit was reached.
It was not possible to solve at least one node of the BB tree, which means that the tree search could not be completed. No IP solution was found but one may be present in the unsearched portion of the tree. See
Section 9 for more information.
 NW_MIP_MAX_NODES_INT_SOL

The IP solution found is the best for the number of nodes (as determined by optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}$) investigated in the BB tree.
Increase ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}$ and rerun h02bbc. The IP objective obtained should be assigned to ${\mathbf{options}}\mathbf{.}{\mathbf{int\_obj\_bound}}$ to aid the BB tree search in the repeated run.
 NW_MIP_MAX_NODES_NO_INT_SOL

No integer solution was found for the number of nodes (as determined by ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}$) investigated in the BB tree.
Increase ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}$ and rerun h02bbc.
 NW_MIP_NO_INT_SOL

No feasible IP solution was found, i.e., it was not possible to satisfy all the integer variables to within optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{int\_tol}}$.
It may be appropriate to increase ${\mathbf{options}}\mathbf{.}{\mathbf{int\_tol}}$ and rerun h02bbc.
 NW_OVERFLOW_WARN

Serious illconditioning in the working set after adding constraint
$\u2329\mathit{\text{value}}\u232a$. Overflow may occur in subsequent iterations.
If overflow occurs preceded by this warning then serious illconditioning has probably occurred in the working set when adding a constraint during the solution of a node in the BB tree. It may be possible to avoid the difficulty by increasing the magnitude of the optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{feas\_tol}}$ and rerunning the program. If the problem recurs even after this change, see
Section 9.
7
Accuracy
h02bbc 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
h02bbc is not threaded in any implementation.
The root node may not have an optimum solution, i.e.,
h02bbc terminates with
${\mathbf{fail}}\mathbf{.}\mathbf{code}={\mathbf{NE\_MIP\_ROOT\_UNBOUNDED}}$,
NE_MIP_ROOT_INFEAS,
NE_MIP_ROOT_MAX_ITER,
NE_MIP_ROOT_HESS_TOO_BIG or overflow may occur. In this case, you are recommended to relax the integer restrictions of the problem and try to find the optimum LP or QP solution by using
e04mfc (for LP) or
e04nfc (for QP) instead.
In the BB method, it is possible for a node to terminate without finding a solution. For example, this may occur due to the number of iterations exceeding the maximum allowed. Therefore the BB tree search for that particular branch cannot be continued and if an IP solution is found, the final solution reported is not necessarily the optimum IP solution (${\mathbf{fail}}\mathbf{.}\mathbf{code}={\mathbf{NW\_MIP\_MAX\_ITER\_INT\_SOL}}$). Similarly, if no IP solution is found, it is not necessarily the case that no IP solution exists (${\mathbf{fail}}\mathbf{.}\mathbf{code}={\mathbf{NW\_MIP\_MAX\_ITER\_NO\_INT\_SOL}}$).
10
Example
One of the applications of integer programming is to the socalled diet problem. Given the nutritional content of a selection of foods, the cost of each food, the amount available of each food and the consumer's minimum daily energy requirements, the problem is to find the cheapest combination. This gives rise to the following problem:
The rows of $A$ correspond to energy, protein and calcium and the columns of $A$ correspond to oatmeal, chicken, eggs, milk, pie and bacon respectively.
The following program solves the above problem to obtain the optimal integer solution and then examines the effect of decreasing the energy required to 1970 units. The example involves a number of calls to h02bbc illustrating the use of some of the optional parameters.
The data is read and the options structure initialized. All options are left at their default values except: the ${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}$ member is assigned to the local char * array, crnames, the elements of which point to strings containing the variable and constraint names; and ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln}$.
h02bbc is called to obtain the optimal IP solution of the problem, and then the lower bound on the minimum energy constraint (i.e., the first general constraint) is reduced. Since the problem is now less constrained than the original IP problem, the objective function value returned in objf from the original problem provides an upper bound for the objective of the optimal IP solution of the modified problem. Optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{int\_obj\_bound}}$ is initialized to this value with a small number added to ensure that it is a strict upper bound on the optimal objective of the modified problem. Also, the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{nodsel}}=\mathrm{Nag\_Deep\_Search}$ to modify the way h02bbc selects nodes during the tree search. The results from this show that the value assigned to ${\mathbf{options}}\mathbf{.}{\mathbf{int\_obj\_bound}}$ allow a number of nodes to be cut off (indicated by CO in the printout) before the first IP solution is found.
Next, the effect of supplying branching directions is illustrated. The optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{branch\_dir}}=\mathrm{Nag\_Branch\_InitX}$ to instruct
h02bbc to branch according to the values of the integer variables provided in the initial
x argument. In this case
x contains the optimal IP solution from the last call of
h02bbc. The results show that these values allow
h02bbc to find and confirm the optimal IP solution quickly.
The final two calls to
h02bbc show its use in solving an MIQP problem. First,
h02bbc is called with the
intvar argument set to an array
intvar2 which specifies all variables to be noninteger. This solves the root LP problem of the adjusted diet problem (as solved in the previous three calls to
h02bbc). Let
${x}^{*}$ be the solution to this LP problem. Then, retaining the same constraints, the linear objective is replaced by the quadratic objective
which measures, to within a constant, the sum of squares deviation of
$x$ from
${x}^{*}$. That is, the problem is to find the IP solution which most closely approximates (in the least squares sense) the LP solution. Before solving this problem, the memory assigned to the pointers in the
options structure is freed by
h02xzc and the structure is reinitialized by
h02xzc. Then optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{prob}}=\mathrm{Nag\_MIQP2}$ and
${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}$ is assigned as before; otherwise, default options are used. The quadratic term of the objective is supplied via the function
qphess which does not require explicit storage for the matrix
$H$.
h02bbc is called to solve the MIQP problem, and finally
h02xzc is called to free the memory in
options.
10.1
Program Text
10.2
Program Data
10.3
Program Results
11
Optional Parameters
A number of optional input and output arguments to
h02bbc are available through the structure argument
options, type Nag_H02_Opt. An argument may be selected by assigning an appropriate value to the relevant structure member; those arguments not selected will be assigned default values. If no use is to be made of any of the optional parameters you should use the NAG defined null pointer,
H02_DEFAULT, in place of
options when calling
h02bbc the default settings will then be used for all arguments.
Before assigning values to
options directly the structure
must be initialized by a call to the function
h02xxc. Values may then be assigned to the structure members in the normal C manner.
Option settings may also be read from a text file using the function
h02xyc in which case initialization of the
options structure will be performed automatically if not already done. Any subsequent direct assignment to the
options structure must
not be preceded by initialization.
If assignment of functions and memory to pointers in the
options structure is required, then this must be done directly in the calling program; they cannot be assigned using
h02xyc.
11.1
Optional Parameter Checklist and Default Values
For easy reference, the following list shows the members of
options which are valid for
h02bbc together with their default values where relevant. The number
$\epsilon $ is a generic notation for
machine precision (see
X02AJC).
Nag_MIP_ProbType prob 
$\mathrm{Nag\_MILP}$ 
Boolean list 
Nag_TRUE 
Nag_PrintType print_level 
Nag_Soln_Iter 
char outfile[80] 
stdout 
void (*print_fun)() 
NULL 
Integer max_iter 
$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(50,5\left({\mathbf{n}}+{\mathbf{m}}\right)\right)$ 
Integer max_nodes 
ALL_NODES 
Boolean first_soln 
Nag_FALSE 
Integer max_depth 
$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(10,3{\mathbf{n}}/2\right)$ 
double int_tol 
${10}^{5}$ 
double int_obj_bound 
${10}^{20}$ 
double soln_tol 
$\sqrt{\epsilon}$ 
Nag_Node_Selection nodsel 
Nag_MinObj_Search 
Nag_Var_Selection varsel 
Nag_First_Int 
Nag_Branch_Direction branch_dir 
Nag_Branch_Left 
double *priority 
NULL 
double feas_tol 
$\sqrt{\epsilon}$ 
double inf_bound 
${10}^{20}$ 
double rank_tol 
$100\epsilon $ 
Integer hrows 
0 or n 
Integer max_df 
n 
char **crnames 
NULL 
double *lower 
size ${\mathbf{n}}+{\mathbf{m}}$ 
double *upper 
size ${\mathbf{n}}+{\mathbf{m}}$ 
double *lambda 
size ${\mathbf{n}}+{\mathbf{m}}$ 
Integer *state 
size ${\mathbf{n}}+{\mathbf{m}}$ 
11.2
Description of the Optional Parameters
prob – Nag_MIP_ProbType   Default $\text{}=\mathrm{Nag\_MILP}$ 
On entry: specifies the type of objective function to be minimized during the optimality phase. The following are the five possible values of
${\mathbf{options}}\mathbf{.}{\mathbf{prob}}$ and the size of the arrays
h and
cvec that are required to define the objective function:
$\mathrm{Nag\_MILP}$ 
h not referenced, ${\mathbf{cvec}}\left[{\mathbf{n}}\right]$; 
$\mathrm{Nag\_MIQP1}$ 
${\mathbf{h}}\left[\left({\mathbf{n}}\right)\times {\mathbf{tdh}}+{\mathbf{tdh}}\right]$ symmetric, cvec not referenced; 
$\mathrm{Nag\_MIQP2}$ 
${\mathbf{h}}\left[\left({\mathbf{n}}\right)\times {\mathbf{tdh}}+{\mathbf{tdh}}\right]$ symmetric, ${\mathbf{cvec}}\left[{\mathbf{n}}\right]$; 
$\mathrm{Nag\_MIQP3}$ 
${\mathbf{h}}\left[\left({\mathbf{n}}\right)\times {\mathbf{tdh}}+{\mathbf{tdh}}\right]$ upper trapezoidal, cvec not referenced; 
$\mathrm{Nag\_MIQP4}$ 
${\mathbf{h}}\left[\left({\mathbf{n}}\right)\times {\mathbf{tdh}}+{\mathbf{tdh}}\right]$ upper trapezoidal, ${\mathbf{cvec}}\left[{\mathbf{n}}\right]$. 
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{prob}}=\mathrm{Nag\_MILP}$, $\mathrm{Nag\_MIQP1}$, $\mathrm{Nag\_MIQP2}$, $\mathrm{Nag\_MIQP3}$ or $\mathrm{Nag\_MIQP4}$.
list – Nag_Boolean   Default $\text{}=\mathrm{Nag\_TRUE}$ 
On entry: if ${\mathbf{options}}\mathbf{.}{\mathbf{list}}=\mathrm{Nag\_TRUE}$ the argument settings in the call to h02bbc will be printed.
print_level – Nag_PrintType   Default $\text{}=\mathrm{Nag\_Soln\_Iter}$ 
On entry: the level of results printout produced by
h02bbc. The following values are available:
$\mathrm{Nag\_NoPrint}$ 
No output. 
$\mathrm{Nag\_Soln}$ 
The final IP solution. 
$\mathrm{Nag\_Soln\_Root}$ 
The root node and final IP solution. 
$\mathrm{Nag\_Iter}$ 
One line of output for each node investigated. 
$\mathrm{Nag\_Soln\_Iter}$ 
The final IP solution and one line of output for each node. 
$\mathrm{Nag\_Soln\_Root\_Iter}$ 
The root node and final IP solution and one line of output for each node. 
Details of each level of results printout are described in
Section 11.3.
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_NoPrint}$, $\mathrm{Nag\_Soln}$, $\mathrm{Nag\_Soln\_Root}$, $\mathrm{Nag\_Iter}$, $\mathrm{Nag\_Soln\_Iter}$ or $\mathrm{Nag\_Soln\_Root\_Iter}$.
outfile – const char[80]   Default $\text{}=\mathtt{stdout}$ 
On entry: the name of the file to which results should be printed. If ${\mathbf{options}}\mathbf{.}{\mathbf{outfile}}\left[0\right]=\text{'}\text{0}\text{'}$ then the stdout stream is used.
print_fun – pointer to function   Default $\text{}=\text{}$ NULL 
On entry: printing function defined by you; the prototype of
${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ is
void (*print_fun)(const Nag_Search_State *st, Nag_Comm *comm);
See
Section 11.3.1 below for further details.
max_iter – Integer   Default $\text{}=\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(50,5\left({\mathbf{n}}+{\mathbf{m}}\right)\right)$ 
On entry: the limit on the number of iterations for each node.
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{max\_iter}}\ge 0$.
max_nodes – Integer   Default $\text{}=\mathtt{ALL\_NODES}$ 
On entry: the maximum number of nodes that are to be searched in order to find a solution (optimum integer solution). If ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}$ is not set, or is set equal to the symbol ALL_NODES, and the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{first\_soln}}=\mathrm{Nag\_FALSE}$ (the default), then the BB tree search is continued until all the nodes have been investigated.
Constraints:
 ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}>0$ or;
 ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}=\mathtt{ALL\_NODES}$.
first_soln – Nag_Boolean   Default $\text{}=\mathrm{Nag\_FALSE}$ 
On entry: specifies whether to terminate the BB tree search after the first integer solution (if any) is obtained. If ${\mathbf{options}}\mathbf{.}{\mathbf{first\_soln}}=\mathrm{Nag\_TRUE}$ then the BB tree search is terminated at node $k$ say, which contains the first integer solution. For optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}\ne $ ALL_NODES this applies only if $k\le {\mathbf{options}}\mathbf{.}{\mathbf{max\_nodes}}$.
max_depth – Integer   Default $\text{}=\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(10,3{\mathbf{n}}/2\right)$ 
On entry: the maximum depth of the BB tree used for branch and bound.
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{max\_depth}}\ge 2$.
int_tol – double   Default $\text{}={10}^{5}$ 
On entry: the integer feasibility tolerance; i.e., an integer variable is considered to take an integer value if its violation does not exceed ${\mathbf{options}}\mathbf{.}{\mathbf{int\_tol}}$. For example, if the integer variable ${x}_{j}$ is of order unity then ${x}_{j}$ is considered to be integer if $\left(1{\mathbf{options}}\mathbf{.}{\mathbf{int\_tol}}\right)\le {x}_{j}\le \left(1+{\mathbf{options}}\mathbf{.}{\mathbf{int\_tol}}\right)$.
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{int\_tol}}>0.0$.
int_obj_bound – double   Default $\text{}={10}^{20}$ 
On entry: specifies an initial bound on the optimum integer solution. You should supply a value for this argument only if a valid strict upper bound for the IP problem is available. Supplying too small a value will result in
h02bbc not finding an IP solution. If a valid value is provided then this may help to reduce the number of nodes searched in the BB tree (see
Section 12.3).
The default value, ${10}^{20}$, is equivalent to no such bound being available.
soln_tol – double   Default $\text{}=\sqrt{\epsilon}$ 
On entry: specifies a tolerance on the optimal IP solution, i.e., an IP solution returned by
h02bbc as optimal may have an objective function value which is as much as
${\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}$ greater than that associated with the true optimal IP solution. By setting
${\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}$ to a nonzero value, the size of the BB search tree may be reduced at the expense of obtaining a (possibly) inferior solution (see
Section 12.3).
This argument only takes effect after the first IP solution has been found. It therefore has no effect if optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{first\_soln}}=\mathrm{Nag\_TRUE}$ and need not be taken into account when setting optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{int\_obj\_bound}}$.
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}\ge 0.0$.
nodsel – Nag_Node_Selection   Default $\text{}=\mathrm{Nag\_MinObj\_Search}$ 
On entry: specifies how nodes are selected during the BB tree search (see
Section 12.2). The selection is made from those nodes which are still ‘active’, i.e., those which either have not yet been solved, or which have been solved but not yet branched from. If the node selected has not been solved then it will be solved next; otherwise, it is branched from and one of the resulting child nodes will be solved next. In the latter case, the choice of which child node is solved first is determined by the value of optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{branch\_dir}}$ (see below). The possible values of
${\mathbf{options}}\mathbf{.}{\mathbf{nodsel}}$ and their meanings are described below.
$\mathrm{Nag\_MinObj\_Search}$ 
selects the node with smallest objective function value. A node which has not yet been solved is assigned its parent's objective function value as the basis for its selection. 
$\mathrm{Nag\_Deep\_Search}$ 
selects the deepest node in the BB tree. When selecting a node for branching and there is more than one candidate at the deepest level, preference is given to the node which was solved earliest. This type of node selection is affected by the value of ${\mathbf{options}}\mathbf{.}{\mathbf{branch\_dir}}$ (see below). 
$\mathrm{Nag\_Broad\_Search}$ 
selects the shallowest node in the tree. This has the effect of searching across the tree (rather than down as for $\mathrm{Nag\_Deep\_Search}$). 
$\mathrm{Nag\_DeepMinObj\_Search}$ 
as $\mathrm{Nag\_Deep\_Search}$ until the first integer solution is found and as $\mathrm{Nag\_MinObj\_Search}$ thereafter. 
$\mathrm{Nag\_DeepBroad\_Search}$ 
as $\mathrm{Nag\_Deep\_Search}$ until the first integer solution is found and as $\mathrm{Nag\_Broad\_Search}$ thereafter. 
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{nodsel}}=\mathrm{Nag\_MinObj\_Search}$, $\mathrm{Nag\_Deep\_Search}$, $\mathrm{Nag\_Broad\_Search}$, $\mathrm{Nag\_DeepMinObj\_Search}$ or $\mathrm{Nag\_DeepBroad\_Search}$.
varsel – Nag_Var_Selection   Default $\text{}=\mathrm{Nag\_First\_Int}$ 
On entry: specifies how
h02bbc selects the variable to branch on, when an unbranched node has been chosen according to optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{nodsel}}$. Let
${x}^{*}$ denote the solution associated with the selected node. Integer variables are scanned in order of their index in
$x$, and any which are integral to within the optional tolerance argument
${\mathbf{options}}\mathbf{.}{\mathbf{int\_tol}}$ are ignored. The following values of
${\mathbf{options}}\mathbf{.}{\mathbf{varsel}}$ are available.
$\mathrm{Nag\_First\_Int}$ 
select the first integer variable ${x}_{i}$ such that ${x}_{i}^{*}$ is noninteger. 
$\mathrm{Nag\_Nearest\_Half}$ 
select the integer variable ${x}_{i}$ such that $\left{x}_{i}^{*}\left[{x}_{i}^{*}\right]\right$ is nearest to $0.5$, where $\left[{x}_{i}^{*}\right]$ denotes the integer part of ${x}_{i}^{*}$. That is, ${x}_{i}$ is the integer variable such that ${x}_{i}^{*}$ is farthest from having an integer value. 
$\mathrm{Nag\_Use\_Priority}$ 
branch on the integer variable selected according to the set of priorities provided in optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{priority}}$ (see below). 
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{varsel}}=\mathrm{Nag\_First\_Int}$, $\mathrm{Nag\_Nearest\_Half}$ or $\mathrm{Nag\_Use\_Priority}$.
branch_dir – Nag_Branch_Direction   Default $\text{}=\mathrm{Nag\_Branch\_Left}$ 
On entry: specifies which node to solve first when two nodes are created by a branching operation. This option is unlikely to have much effect when optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{nodsel}}=\mathrm{Nag\_MinObj\_Search}$ or
$\mathrm{Nag\_Broad\_Search}$, since the overall order in which parts of the tree are examined will remain the same. However, when
${\mathbf{options}}\mathbf{.}{\mathbf{nodsel}}=\mathrm{Nag\_Deep\_Search}$,
${\mathbf{options}}\mathbf{.}{\mathbf{branch\_dir}}$ will influence the path taken by
h02bbc as the tree is descended. Similarly, this argument will affect the initial deep search when
${\mathbf{options}}\mathbf{.}{\mathbf{nodsel}}=\mathrm{Nag\_DeepMinObj\_Search}$ or
$\mathrm{Nag\_DeepBroad\_Search}$. The following values of
${\mathbf{options}}\mathbf{.}{\mathbf{branch\_dir}}$ are available.
$\mathrm{Nag\_Branch\_Left}$ 
solve the ‘left’ node first, i.e., that which was formed by reducing the upper bound on the branching variable. 
$\mathrm{Nag\_Branch\_Right}$ 
solve the ‘right’ node first, i.e., that which was formed by increasing the lower bound on the branching variable. 
$\mathrm{Nag\_Branch\_InitX}$ 
branch according to the initial values of the integer variables, as supplied in the argument x to h02bbc. Let ${x}^{0}$ be the initial solution as supplied by you, and let $i$ be the index of the integer variable currently being branched on. Then if ${z}_{i}^{0}$ is the nearest integer to ${x}_{i}^{0}$ which satisfies the initial bounds on $x$, h02bbc will first branch towards ${z}_{i}^{0}$ and solve this subproblem. This value of ${\mathbf{options}}\mathbf{.}{\mathbf{branch\_dir}}$ would be appropriate, in conjunction with a deep search (as defined by ${\mathbf{options}}\mathbf{.}{\mathbf{nodsel}}$), if you can provide in x a good estimate of an integer solution to the IP problem. 
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{branch\_dir}}=\mathrm{Nag\_Branch\_Left}$, $\mathrm{Nag\_Branch\_Right}$ or $\mathrm{Nag\_Branch\_InitX}$.
priority – double   Default $\text{}=\text{}$ NULL 
On entry: if
${\mathbf{options}}\mathbf{.}{\mathbf{varsel}}=\mathrm{Nag\_Use\_Priority}$ then for each integer variable
${x}_{i}$,
${\mathbf{options}}\mathbf{.}{\mathbf{priority}}\left[i1\right]$ must contain the priority the variable should be given when
h02bbc selects a variable to branch on (
${x}_{\mathit{i}}$ is an integer variable if
${\mathbf{intvar}}\left[\mathit{i}1\right]=\mathrm{Nag\_TRUE}$, for
$\mathit{i}=1,2,\dots ,n$). For example, if
${x}_{k}$ and
${x}_{l}$ are integer variables and
${\mathbf{options}}\mathbf{.}{\mathbf{priority}}\left[l1\right]>{\mathbf{options}}\mathbf{.}{\mathbf{priority}}\left[k1\right]$, then variable
${x}_{l}$ will be selected in preference to
${x}_{k}$. Variables with equal priorities are selected according to their indices (i.e.,
${x}_{k}$ is selected if
$k<l$ and
${\mathbf{options}}\mathbf{.}{\mathbf{priority}}\left[k1\right]={\mathbf{options}}\mathbf{.}{\mathbf{priority}}\left[l1\right]$).
With some problems of type MILP, setting
${\mathbf{options}}\mathbf{.}{\mathbf{priority}}$ to
cvec might be effective, since the objective coefficient of a variable could be regarded as a measure of the importance of the variable in the problem.
If ${x}_{i}$ is not an integer variable (i.e., ${\mathbf{intvar}}\left[i1\right]=\mathrm{Nag\_FALSE}$), ${\mathbf{options}}\mathbf{.}{\mathbf{priority}}\left[i1\right]$ is not referenced. If optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{varsel}}\ne \mathrm{Nag\_Use\_Priority}$ then ${\mathbf{options}}\mathbf{.}{\mathbf{priority}}$ is not referenced.
feas_tol – double   Default $\text{}=\sqrt{\epsilon}$ 
On entry: the maximum acceptable absolute violation in each constraint at a ‘feasible’ point (feasibility tolerance); i.e., a constraint is considered satisfied if its violation does not exceed ${\mathbf{options}}\mathbf{.}{\mathbf{feas\_tol}}$.
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{feas\_tol}}>0.0$.
inf_bound – double   Default $\text{}={10}^{20}$ 
On entry: ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ defines the ‘infinite’ bound in the definition of the problem constraints. Any upper bound greater than or equal to ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ will be regarded as $+\infty $ (and similarly any lower bound less than or equal to ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ will be regarded as $\infty $).
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}>0.0$.
rank_tol – double   Default $\text{}=100\epsilon $ 
This argument is not used for problems of type MILP.
On entry:
${\mathbf{options}}\mathbf{.}{\mathbf{rank\_tol}}$ enables you to control the condition number of the triangular matrix factor
$R$ which arises in solving a QP subproblem (see
Section 12 in
e04nfc for details). If
${\rho}_{i}$ denotes the function
${\rho}_{i}=\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left\{\left{R}_{11}\right,\left{R}_{22}\right,\dots ,\left{R}_{ii}\right\right\}$, the dimension of
$R$ is defined to be smallest index
$i$ such that
$\left{R}_{i+1,i+1}\right\le {\mathbf{options}}\mathbf{.}{\mathbf{rank\_tol}}\times \left{\rho}_{i+1}\right$.
Constraint:
$0.0\le {\mathbf{options}}\mathbf{.}{\mathbf{rank\_tol}}<1.0$.
hrows – Integer   Default $\text{}=0$ or n 
On entry: specifies
${n}_{H}$, the number of rows of the quadratic term
$H$ of the QP objective function. For the default MILP problem type,
${\mathbf{options}}\mathbf{.}{\mathbf{hrows}}$ is not used and its value is set to zero. For MIQP problem types, the default value of
${\mathbf{options}}\mathbf{.}{\mathbf{hrows}}$ is
n, the number of variables. However, a value of
${\mathbf{options}}\mathbf{.}{\mathbf{hrows}}$ less than
n is appropriate for problems of type MIQP3 or MIQP4 when
$H$ is an upper trapezoidal matrix with
${n}_{H}$ rows. Similarly,
${\mathbf{options}}\mathbf{.}{\mathbf{hrows}}$ may be used to define the dimension of a leading block of nonzeros in the Hessian matrices for problems of type MIQP1 or MIQP2, in which case the last
${\mathbf{n}}{n}_{H}$ rows and columns of
$H$ are assumed to be zero.
Constraint:
$0\le {\mathbf{options}}\mathbf{.}{\mathbf{hrows}}\le {\mathbf{n}}$.
max_df – Integer   Default $\text{}={\mathbf{n}}$ 
On entry: places a limit on the storage allocated for the triangular factor
$R$ of the reduced Hessian
${H}_{r}$ of QP subproblems (see
Section 12 in
e04nfc for details). Ideally,
${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}$ should be set slightly larger than the value of
${n}_{r}$ (the number of rows and columns of
${H}_{r}$) expected at the solution. It need not be larger than
${m}_{n}+1$, where
${m}_{n}$ is the number of variables that appear nonlinearly in the quadratic objective function. For many problems it can be much smaller than
${m}_{n}$.
For quadratic problems, a minimizer may lie on any number of constraints, so that
${n}_{r}$ may vary between
$1$ and
$n$. The default value is therefore normally
n but if the optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{hrows}}$ is specified then the default value of
${\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}$ is set to the value in
${\mathbf{options}}\mathbf{.}{\mathbf{hrows}}$.
Constraint:
$1\le {\mathbf{options}}\mathbf{.}{\mathbf{max\_df}}\le {\mathbf{n}}$.
crnames – char **   Default $\text{}=\text{}$ NULL 
On entry: if
${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}$ is not
NULL then it must point to an array of
${\mathbf{n}}+{\mathbf{m}}$ character strings, with maximum string length
$8$, containing the names of the variables and constraints of the problem. Thus,
${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}\left[j1\right]$ contains the name of the
$j$th variable,
$j=1,2,\dots ,{\mathbf{n}}$, and
${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}\left[{\mathbf{n}}+i1\right]$ contains the names of the
$i$th constraint,
$i=1,2,\dots ,{\mathbf{m}}$. If supplied, the names are used in the solution output (see
Section 11.3 and
Section 11.3).
If a problem is defined by an MPSX file, it may be read by calling
h02buc prior to calling
h02bbc. In this case,
h02buc may optionally be used to allocate memory to
${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}$ and to read the variable and constraint names defined in the MPSX file into
${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}$. In this case, the memory freeing function
h02xzc should be used to free the memory pointed to by
${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}$ on return from
h02bbc. You should
not use the standard C function
free() for this purpose.
lower – double   Default $\text{}={\mathbf{n}}+{\mathbf{m}}$ 
On entry: ${\mathbf{n}}+{\mathbf{m}}$ values of memory will be automatically allocated by h02bbc and this is the recommended method of use of ${\mathbf{options}}\mathbf{.}{\mathbf{lower}}$. However you may supply memory from the calling program.
On exit: the lower bounds imposed at the point returned in
x. If no IP solution was found
${\mathbf{options}}\mathbf{.}{\mathbf{lower}}$ contains the same bounds as supplied in
bl. The first
n elements contain the lower bounds on the variables, and the next
m elements contain the lower bounds for the general linear constraints (if any).
upper – double   Default $\text{}={\mathbf{n}}+{\mathbf{m}}$ 
On entry: ${\mathbf{n}}+{\mathbf{m}}$ values of memory will be automatically allocated by h02bbc and this is the recommended method of use of ${\mathbf{options}}\mathbf{.}{\mathbf{upper}}$. However you may supply memory from the calling program.
On exit: the upper bounds imposed at the point returned in
x. If no IP solution was found
${\mathbf{options}}\mathbf{.}{\mathbf{upper}}$ contains the same bounds as supplied in
bu. The first
n elements contain the upper bounds on the variables, and the next
m elements contain the upper bounds for the general linear constraints (if any).
state – Integer   Default $\text{}={\mathbf{n}}+{\mathbf{m}}$ 
On entry: ${\mathbf{n}}+{\mathbf{m}}$ values of memory will be automatically allocated by h02bbc and this is the recommended method of use of ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$. However you may supply memory from the calling program.
On exit: the status of the constraints in the working set at the point returned in
x. The significance of each possible value of
${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j\right]$ is as follows:
${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j\right]$

Meaning 
$2$ 
The constraint violates its lower bound by more than the feasibility tolerance. 
$1$ 
The constraint violates its upper bound by more than the feasibility tolerance. 
$\phantom{}0$ 
The constraint is satisfied to within the feasibility tolerance, but is not in the working set. 
$\phantom{}1$ 
This inequality constraint is included in the working set at its lower bound. 
$\phantom{}2$ 
This inequality constraint is included in the working set at its upper bound. 
$\phantom{}3$ 
This constraint is included in the working set as an equality. This value of ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ can occur only when ${\mathbf{bl}}\left[j\right]={\mathbf{bu}}\left[j\right]$. 
$\phantom{}4$ 
This corresponds to optimality being declared with ${\mathbf{x}}\left[j\right]$ being temporarily fixed at its current value. This value of ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ can only occur if the optimal solution is not unique. 
lambda – double   Default $\text{}={\mathbf{n}}+{\mathbf{m}}$ 
On entry: ${\mathbf{n}}+{\mathbf{m}}$ values of memory will be automatically allocated by h02bbc and this is the recommended method of use of ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}$. However you may supply memory from the calling program.
On exit: the values of the Lagrange multipliers for each constraint with respect to the current working set at the point returned in
x. The first
n elements contain the multipliers (reduced costs) for the bound constraints on the variables, and the next
m elements contain the multipliers (shadow costs) for the general linear constraints (if any). If
${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j\right]=0$,
${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}\left[j\right]$ is zero. If
$x$ is optimal,
${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}\left[j\right]$ should be nonnegative if
${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j\right]=1$, nonpositive if
${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j\right]=2$ and zero if
${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j\right]=4$.
11.3
Description of Printed Output
The level of printed output can be controlled with the structure members
${\mathbf{options}}\mathbf{.}{\mathbf{list}}$ and
${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}$ (see
Section 11.2).
If ${\mathbf{options}}\mathbf{.}{\mathbf{list}}=\mathrm{Nag\_TRUE}$ then the argument values to h02bbc are listed, whereas the printout of results is governed by the value of ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}$. The default of ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln\_Iter}$ provides intermediate and final results.
If
${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Iter}$,
$\mathrm{Nag\_Soln\_Iter}$ or
$\mathrm{Nag\_Soln\_Root\_Iter}$, the following line of summary output is produced at the end of every node. It gives the outcome of forcing an integer variable with a noninteger value to take a value within its specified lower and upper bounds.
Node No 
is the current node number of the BB tree being investigated. 
Parent Node 
is the parent node number of the current node. 
Obj Value 
is the final objective function value. If a node does not have a feasible solution then Infeasible is printed instead of the objective function value. If a node whose optimum solution exceeds the best integer solution so far is encountered (i.e., it does not pay to explore the subproblem any further), then its objective function value is printed together with a CO (Cut Off). 
Varbl Chosen 
is the index of the integer variable chosen for branching. 
Value Before 
is the noninteger value of the integer variable chosen. 
Lower Bound 
is the lower bound value that the integer variable is allowed to take. 
Upper Bound 
is the upper bound value that the integer variable is allowed to take. 
Value After 
is the value of the integer variable after the current optimization. 
Depth 
is the depth of the BB tree at the current node. 
If ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln\_Root}$ or $\mathrm{Nag\_Soln\_Root\_Iter}$, the root node solution is output before the BB search is commenced. If ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln}$, $\mathrm{Nag\_Soln\_Iter}$, $\mathrm{Nag\_Soln\_Root}$ or $\mathrm{Nag\_Soln\_Root\_Iter}$ the final IP solution or, if none was found, the root node solution is output.
The following describes the printout for each variable and constraint for both root node and final IP solution printout.
Varbl 
gives the name of variable $\mathit{j}$, for $\mathit{j}=1,2,\dots ,n$. If an options structure is supplied to h02bbc, and the ${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}$ member is assigned to an array of variable and constraint names (see Section 11.2 for details), the name supplied in ${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}\left[j1\right]$ is assigned to the $j$th variable. Otherwise, a default name is assigned to the variable. 
State 
gives the state of the variable (FR if neither bound is in the working set, EQ if a fixed variable, LL if on its lower bound, UL if on its upper bound, TF if temporarily fixed at its current value). If Value lies outside the upper or lower bounds by more than the feasibility tolerance, State will be ++ or  respectively. 
Value 
is the value of the variable at the final iteration. 
Lower Bound 
is the lower bound ${l}_{j}$ specified for the variable. (None indicates that ${l}_{j}\le {\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$, where ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ is the optional parameter.) For root node printout, ${l}_{j}={\mathbf{bl}}\left[j1\right]$; for IP solution printout, ${l}_{j}$ is the lower bound imposed at the node which provided the IP solution. 
Upper Bound 
is the upper bound ${u}_{j}$ specified for the variable. (None indicates that ${u}_{j}\ge {\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$.) For root node printout, ${u}_{j}={\mathbf{bu}}\left[j1\right]$; for IP solution printout, ${u}_{j}$ is the upper bound imposed at the node which provided the IP solution. 
Lagr Mult 
is the value of the Lagrange multiplier for the associated bound constraint. This will be zero if State is FR or TF. If $x$ is optimal, the multiplier should be nonnegative if State is LL, and nonpositive if State is UL. 
Residual 
is the difference between the variable Value and the nearer of its bounds ${l}_{j}$ and ${u}_{j}$. 
The meaning of the printout for general constraints is the same as that given above for variables, with ‘variable’ replaced by ‘constraint’,
$n$ replaced by
$m$,
${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}\left[j1\right]$ replaced by
${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}\left[n+j1\right]$,
${l}_{j}$ and
${u}_{j}$ replaced by
${l}_{n+i}$ and
${u}_{n+i}$ respectively, and with the following change in the heading:
Constr 
gives the name of constraint $i$, $i=1,2,\dots ,m$. If an options structure is supplied to h02bbc, and the ${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}$ member is assigned to an array of variable and constraint names (see Section 11.2 for details), the name supplied in ${\mathbf{options}}\mathbf{.}{\mathbf{crnames}}\left[n+i1\right]$ is assigned to the constraint. Otherwise, a default name is assigned to the constraint. 
Numerical values are output with a fixed number of digits; they are not guaranteed to be accurate to this precision.
If ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_NoPrint}$ then printout will be suppressed; you can print the final solution when h02bbc returns to the calling program.
11.3.1
Output of results via a userdefined printing function
You may also specify your own print function for output of iteration results and the final solution by use of the
${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ function pointer, which has prototype
void (*print_fun)(const Nag_Search_State *st, Nag_Comm *comm);
This section may be skipped if you wish to use the default printing facilities.
When a userdefined function is assigned to
${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ this will be called in preference to the internal print function of
h02bbc. Calls to the userdefined function are again controlled by means of the
${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}$ member. Information is provided through
st and
comm, the two structure arguments to
${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$.
If $\mathbf{comm}\mathbf{\to}\mathbf{node\_prt}=\mathrm{Nag\_TRUE}$ then the results from the most recently solved node are provided through st. Note that ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ will be called with $\mathbf{comm}\mathbf{\to}\mathbf{node\_prt}=\mathrm{Nag\_TRUE}$ only if ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Iter}$, $\mathrm{Nag\_Soln\_Iter}$ or $\mathrm{Nag\_Soln\_Root\_Iter}$. The following members of st are set:
 node_num – Integer

The current node number of the BB tree being investigated.
 parent_node – Integer

The parent node number of the current node.
 node_status – Nag_NodeStatus

The status of the current node. The possible values of
$\mathbf{st}\mathbf{\to}\mathbf{node\_status}$ and their meanings are as follows:
$\mathrm{Nag\_NS\_NotBranched}$ 
the node has been solved but the branch cannot yet be eliminated from the search. 
$\mathrm{Nag\_NS\_Integer}$ 
an integer solution was found at this node. There is no need to search this branch further. 
$\mathrm{Nag\_NS\_Bounded}$ 
the objective value exceeds the upper bound on the optimal IP solution. There is no need to search this branch further. 
$\mathrm{Nag\_NS\_Infeasible}$ 
the problem was infeasible at this node. There is no need to search this branch further. 
$\mathrm{Nag\_NS\_Terminated}$ 
the iteration limit was exceeded at this node. The search has to be terminated prematurely for this branch. 
 objf – double

If
$\mathbf{st}\mathbf{\to}\mathbf{node\_status}=\mathbf{Nag\_NS\_NotBranched}\text{,}\mathbf{Nag\_NS\_Integer}\text{ or}\mathbf{Nag\_NS\_Bounded}$, then
objf holds the objective value.
 branch_index – Integer

The index in $x$ of the variable chosen for branching.
 x_lo – double

The lower bound on the branching variable.
 x_up – double

The upper bound on the branching variable.
 x_before – double

The noninteger value of the branching variable before the node was solved.
 x_after – double

The value of the branching variable after the node was solved.
 depth – Integer

The depth of the BB tree at the current node.
If $\mathbf{comm}\mathbf{\to}\mathbf{rootnode\_sol\_prt}=\mathrm{Nag\_TRUE}$ then the solution of the root node is provided through st. Note that ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ will be called with $\mathbf{comm}\mathbf{\to}\mathbf{rootnode\_sol\_prt}=\mathrm{Nag\_TRUE}$ only if ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln\_Root}$ or $\mathrm{Nag\_Soln\_Root\_Iter}$. The following members of st are set:
 endstate – Nag_EndState

The state of termination of the subproblem solver at the root node. Some of these states result in immediate termination of the algorithm. If this is the case, then no valid solution is available. The other states allow the algorithm to proceed with the BB tree search. Possible values of
$\mathbf{st}\mathbf{\to}\mathbf{endstate}$ and their correspondence, if any, to the exit value of
fail from
h02bbc are:
 n – Integer

The number of variables.
 m – Integer

The number of linear constraints.
 objf – double

The value of the objective function.
 x – double

The components ${\mathbf{x}}\left[\mathit{j}1\right]$ of the solution $x$, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{n}$.
 ax – double

If $\mathbf{st}\mathbf{\to}\mathbf{m}>0$, $\mathbf{st}\mathbf{\to}\mathbf{ax}\left[\mathit{j}1\right]$ contains the components of the linear constraint vector, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{m}$.
 state – Integer

Contains the status of the
$\mathbf{st}\mathbf{\to}\mathbf{n}$ variables and
$\mathbf{st}\mathbf{\to}\mathbf{m}$ general linear constraints. See
Section 11.2 for a description of the possible status values.
 lambda – double

Contains the $\mathbf{st}\mathbf{\to}\mathbf{n}+\mathbf{st}\mathbf{\to}\mathbf{m}$ values of the Lagrange multipliers.
 bl – double

Contains the $\mathbf{st}\mathbf{\to}\mathbf{n}+\mathbf{st}\mathbf{\to}\mathbf{m}$ lower bounds on the variables.
 bu – double

Contains the $\mathbf{st}\mathbf{\to}\mathbf{n}+\mathbf{st}\mathbf{\to}\mathbf{m}$ upper bounds on the variables.
If $\mathbf{comm}\mathbf{\to}\mathbf{sol\_prt}=\mathrm{Nag\_TRUE}$ then the final IP solution is provided through st. Note that ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ will be called with $\mathbf{comm}\mathbf{\to}\mathbf{sol\_prt}=\mathrm{Nag\_TRUE}$ only if ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln}$, $\mathrm{Nag\_Soln\_Root}$, $\mathrm{Nag\_Soln\_Iter}$ or $\mathrm{Nag\_Soln\_Root\_Iter}$. If no IP solution was found then the root node solution is available. The $\mathbf{st}\mathbf{\to}\mathbf{endstate}$ member of st should be examined to determine the status of the solution. The following members of st are set:
 endstate – Nag_EndState

The state of termination of
h02bbc. Possible values of
$\mathbf{st}\mathbf{\to}\mathbf{endstate}$ and their correspondence to the exit value of
fail are shown below.
 n – Integer

The number of variables.
 m – Integer

The number of linear constraints.
 nnodes – Integer

The number of nodes examined during the BB tree search.
 objf – double

The value of the objective function.
 x – double

The components ${\mathbf{x}}\left[\mathit{j}1\right]$ of the solution $x$, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{n}$.
 ax – double

If $\mathbf{st}\mathbf{\to}\mathbf{m}>0$, $\mathbf{st}\mathbf{\to}\mathbf{ax}\left[\mathit{j}1\right]$ contains the components of the linear constraint vector, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{m}$.
 state – Integer

Contains the status of the
$\mathbf{st}\mathbf{\to}\mathbf{n}$ variables and
$\mathbf{st}\mathbf{\to}\mathbf{m}$ general linear constraints. See
Section 11.2 for a description of the possible status values.
 lambda – double

Contains the $\mathbf{st}\mathbf{\to}\mathbf{n}+\mathbf{st}\mathbf{\to}\mathbf{m}$ values of the Lagrange multipliers.
 bl – double

Contains the $\mathbf{st}\mathbf{\to}\mathbf{n}+\mathbf{st}\mathbf{\to}\mathbf{m}$ lower bounds on the variables.
 bu – double

Contains the $\mathbf{st}\mathbf{\to}\mathbf{n}+\mathbf{st}\mathbf{\to}\mathbf{m}$ upper bounds on the variables.
The relevant members of the structure
comm are:
 rootnode_sol_prt – Nag_Boolean

Will be Nag_TRUE when the print function is called with the solution of the root node.
 node_prt – Nag_Boolean

Will be Nag_TRUE when the print function is called with the result of the most recently solved node.
 sol_prt – Nag_Boolean

Will be Nag_TRUE when the print function is called with the final solution.
 user – double
 iuser – Integer
 p – Pointer

Pointers for communication of user information. If used they must be allocated memory either before entry to
h02bbc or during a call to
qphess or
${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$. The type Pointer will be
void * with a C compiler that defines
void * and
char * otherwise.
12
Further Description
This section provides further information about the BB algorithm used by h02bbc.
Further descriptions of the BB algorithm may be found in
Dakin (1965) and
Mitra (1973).
12.1
Overview
As outlined in
Section 3, the essence of the BB algorithm is to form a ‘tree’ of subproblems which are relatively easy to solve. The initial subproblem, the
root node of the tree, is a
relaxation of the IP problem, in that it is the IP problem with the integer restrictions removed. When that has been solved, two
child subproblems or
nodes are formed by selecting an integer variable
${x}_{k}$ which in the solution to the relaxed problem takes a noninteger value
${x}_{k}^{*}$, and
branching on that variable, i.e., imposing
${x}_{k}\le \left[{x}_{k}^{*}\right]$ for one node and
${x}_{k}\ge \left[{x}_{k}^{*}\right]+1$ for the other, where
$\left[{x}_{k}^{*}\right]$ denotes the integer part of
${x}_{k}^{*}$. One of these nodes is then solved. At this point, either a further branching operation is carried out from the node just solved, creating two new unsolved nodes (one of which is solved next), or the remaining unsolved child node is solved. Continuing in this way, the tree is developed – at each stage selecting an unsolved node to solve, or a solved node to branch from. The selection of the node and, in the case of a branching operation, the selection of the variable to branch on, is considered further in
Section 12.2.
The mechanism for forming the nodes on branching simply involves adjusting the lower or upper bound on the branching variable. Note that as the tree is descended, each child node inherits any bound adjustments made to its parent node, and so a child node is always more constrained than its parent.
If the procedure described above is continued, eventually a child must be created for which all of its integer variables are fixed at integer values, or which is infeasible. If the latter is true then the search down that branch of the tree may be terminated since any children of that node must also be infeasible (the child is always more constrained than the parent). If the former is true then we have an integer feasible solution for the IP problem, which may or may not be the optimum integer solution. For some applications of IP, it is sufficient to obtain any integer feasible solution and the search may terminate here, but usually the search must be continued, either to find a better integer solution, or to confirm that the optimal integer solution has been found. In
h02bbc the optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{first\_soln}}$ may be set to Nag_TRUE to request termination at the first integer solution (the default value is Nag_FALSE; see
Section 11.2).
Assuming that the optimal integer solution is required, the rest of the tree must be searched. The efficiency of the method relies on not having to examine every node of the tree which could, potentially, be formed by applying the procedure as described above. The method incorporates features which have the effect of eliminating certain portions of the tree from the search. As already explained, the search is terminated along a particular branch on encountering an infeasible node. Similarly, once an integer solution has been found, this can be used to eliminate parts of the search tree as follows. Suppose an integer feasible solution ${x}^{+}$ has been found, with an associated objective function value $f\left({x}^{+}\right)$. Now suppose during the search of the remainder of the tree, a node is encountered, whose objective function value exceeds $f\left({x}^{+}\right)$. In this case there is no need to examine any further down that branch of the tree since any children of that node will also have objective function values which exceed $f\left({x}^{+}\right)$. The quantity $f\left({x}^{+}\right)$ therefore acts as a bound on the optimal integer solution. This bound may be refined as better integer solutions are found. Finally, if an integer solution is found before all integer variables have been fixed by the branching process, simply because the unfixed integer variables happen to have integer values at the solution of a particular node, there is again no need to search further along that branch of the tree. Termination of the search at a node, whether through finding an integer solution there, detecting infeasibility, or bounding it based on a known integer solution, is known as fathoming the node.
12.2
Selection of Node and Branching Variable
Since each branching operation generates two unsolved nodes (subproblems), at a typical stage of the algorithm there will be a number of nodes which are either unsolved or which have been solved but have not yet been branched from. Therefore, when a node has been solved there is a choice to be made as to which node should be solved next, and this will either be an existing, unsolved node, or one which will be created by a branching operation.
If a node is selected to be branched from, there is a further choice to be made and that is the integer variable to be branched on.
Within
h02bbc these choices are controlled by the optional parameters
${\mathbf{options}}\mathbf{.}{\mathbf{nodsel}}$, which controls node selection, and
${\mathbf{options}}\mathbf{.}{\mathbf{varsel}}$, which controls branching variable selection. The default node selection behaviour is to choose the node with lowest objective value, if it has been solved, or lowest parent objective value if it is unsolved. By default the branching variable chosen is that with the smallest index in
$x$, selected from those integer variables taking noninteger values at the solution of the subproblem being branched from. Details of the available options are given in
Section 11.2.
These choices can help to improve the efficiency of the BB algorithm since they particularly influence how quickly the first integer feasible solution is obtained and its quality. A good integer solution obtained early in the search can eliminate a large portion of the remaining tree, by means of the bounding operation described in
Section 12.1). Unfortunately, there is no single strategy for making such choices which can be applied successfully to all IP problems – the best strategy is highly problem dependent and is usually obtained by experimentation.
12.3
Further Reducing the Size of the BB Search Tree
In addition to considering variations in the node and variable selection strategies, you may also consider setting some other arguments to help to reduce the number of nodes searched. Recall from
Section 12.1) that once the algorithm has found an IP solution, the objective function value associated with this is used as a bound to eliminate parts of the tree. Similarly, if you know from the outset a strict upper bound on the optimal solution, perhaps as a result of solving a related, more constrained problem, or obtained through analytical means, this may be supplied to
h02bbc as the optional parameter
${\mathbf{options}}\mathbf{.}{\mathbf{int\_obj\_bound}}$. This will be used by
h02bbc in the same way as a bound obtained by finding an IP solution except that it can be used to eliminate parts of the tree even before an integer solution is found.
Another argument which you might consider setting to reduce the size of the tree is ${\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}$. Again this is related to the bounding process, and applies when an integer solution has been found. When searching the remainder of the tree, instead of setting the bound to $f\left({x}^{+}\right)$, the objective function value associated with the integer solution most recently found, h02bbc sets the bound to $f\left({x}^{+}\right){\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}$. This means that integer solutions with objective values within ${\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}$ of any integer solution already found, cannot themselves be found. The idea here is to allow you to avoid further search for solutions which are not substantially better (as measured by ${\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}$) than the best solution found so far. Of course, a sensible choice for the value of ${\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}$ relies on your knowledge of the problem and requirements on the solution.
Further details of the optional parameters
${\mathbf{options}}\mathbf{.}{\mathbf{int\_obj\_bound}}$ and
${\mathbf{options}}\mathbf{.}{\mathbf{soln\_tol}}$ are given in
Section 11.2.
Finally, a very important factor which can have a large impact on the size of the search tree is the way the problem is modelled. Often, there is more than one way to formulate a problem as an IP model. A general aim is that the feasible region of the relaxed IP problem should be as close as possible to that of the IP problem itself. This has the effect of generating tight bounds in the BB procedure. Note that in order to achieve this aim, it may be necessary to introduce further constraints, which do not alter the IP solution but which help to reduce the feasible region of the subproblems. This is in contrast to standard LP, for example, in which fewer constraints are generally considered to be associated with an easier problem. There is of course a balance to be struck since adding constraints to an IP problem will make the subproblems harder to solve, despite, it is hoped, reducing the size of the tree. See
Williams (1993) for more information on formulating IP models.