NAG FL Interface
h02ddf (handle_​solve_​minlp)

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 and to Section 12 for a detailed description of the specification of the optional parameters.
Settings help

FL Name Style:


FL Specification Language:


1 Purpose

h02ddf is a solver from the NAG optimization modelling suite for Mixed Integer Nonlinear Programming (MINLP) problems.

2 Specification

Fortran Interface
Subroutine h02ddf ( handle, objfun, objgrd, confun, congrd, monit, nvar, x, rinfo, stats, iuser, ruser, cpuser, ifail)
Integer, Intent (In) :: nvar
Integer, Intent (Inout) :: iuser(*), ifail
Real (Kind=nag_wp), Intent (Inout) :: x(nvar), ruser(*)
Real (Kind=nag_wp), Intent (Out) :: rinfo(100), stats(100)
Type (c_ptr), Intent (In) :: handle, cpuser
External :: objfun, objgrd, confun, congrd, monit
C Header Interface
#include <nag.h>
void  h02ddf_ (void **handle,
void (NAG_CALL *objfun)(const Integer *nvar, const double x[], double *fx, Integer *inform, Integer iuser[], double ruser[], void **cpuser),
void (NAG_CALL *objgrd)(const Integer *nvar, const double x[], const Integer *nnzfd, double fdx[], Integer *inform, Integer iuser[], double ruser[], void **cpuser),
void (NAG_CALL *confun)(const Integer *nvar, const double x[], const Integer *ncnln, double gx[], Integer *inform, Integer iuser[], double ruser[], void **cpuser),
void (NAG_CALL *congrd)(const Integer *nvar, const double x[], const Integer *nnzgd, double gdx[], Integer *inform, Integer iuser[], double ruser[], void **cpuser),
void (NAG_CALL *monit)(const Integer *nvar, const double x[], Integer *inform, const double rinfo[], const double stats[], Integer iuser[], double ruser[], void **cpuser),
const Integer *nvar, double x[], double rinfo[], double stats[], Integer iuser[], double ruser[], void **cpuser, Integer *ifail)
The routine may be called by the names h02ddf or nagf_mip_handle_solve_minlp.

3 Description

h02ddf solves Mixed Integer Nonlinear Programming (MINLP) problems using a modified Sequential Quadratic Programming (SQP) method. The problem is assumed to be stated in the following general form:
minimize x {Rnc,Zni} f(x) subject to lgg(x)ug, 12 xTQix + riTx + si0 ,   1imQ, lBBxuB, lxxux, (1)
where
h02ddf serves as a solver for problems stored as a handle. The handle points to an internal data structure which defines the problem and serves as a means of communication for routines in the NAG optimization modelling suite. First, the problem handle is initialized, typically by calling e04raf. Then some of the components of the model need to be defined by calling one or more of the following routines based on the component type:
When the nonlinear objective function f(x) is specified using e04rgf, objfun and objgrd will be used to compute values and gradients of the objective function. Similarly, confun and congrd will be used to compute values and gradients of the nonlinear constraint functions g(x) specified by e04rkf.
No assumptions are made regarding f(x) except that it is twice continuously differentiable with respect to continuous elements of x. It is not assumed that integer variables are relaxable. In other words, problem functions are evaluated only at integer points.
Partial derivatives of f(x) and g(x) are not required for the ni integer variables. They can hence be omitted entirely when specifying the sparsity pattern of the derivatives in calls to e04rgf and e04rkf, respectively. Gradients with respect to integer variables are approximated by difference formulae and those provided by the user will be ignored.
Once the problem is fully described, the handle may be passed to the solver h02ddf. When the handle is no longer needed, e04rzf should be called to destroy it and deallocate the memory held within. There are other ways that the problem model can be defined and/or updated, see Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.
The algorithm behaviour can be modified by various optional parameters (see Section 12) which can be set by e04zmf and e04zpf anytime between the initialization of the handle and a call to the solver. Once the solver has finished, options or the model may be modified for the next solve. The solver may be called repeatedly with various starting points and/or optional parameters. Option getter e04znf can be called to retrieve the current value of any option.
The optional parameter Task may be used to switch the problem to maximization.
Several options may have a significant impact on the performance of the solver. Even if the defaults were chosen to suit the majority of problems, it is recommended that you experiment in order to find the most suitable set of options for a particular problem, see Sections 11 and 12 for further details.

3.1 Alternative solvers

h02ddf is a generic solver which can solve a great variety of integer problems, however, a dedicated solver might work better in the following case.

4 References

Exler O, Lehmann T and Schittkowski K (2013) A comparative study of SQP-type algorithms for nonlinear and nonconvex mixed-integer optimization Mathematical Programming Computation 4 383–412
Mann A (1986) GAMS/MINOS: Three examples Department of Operations Research Technical Report Stanford University
Powell M J D (1983) On the quadratic programming algorithm of Goldfarb and Idnani Report DAMTP 1983/Na 19 University of Cambridge, Cambridge
Yuan Y-x and Sun W (2006) Optimization Theory and Methods Springer–Verlag

5 Arguments

1: handle Type (c_ptr) Input
On entry: the handle to the problem. It needs to be initialized (e.g., by e04raf) and to hold a problem formulation compatible with h02ddf. It must not be changed between calls to the NAG optimization modelling suite.
2: objfun Subroutine, supplied by the NAG Library or the user. External Procedure
objfun must calculate the value of the nonlinear objective function f(x) at a specified value of the n-element vector of x variables. If there is no nonlinear objective (e.g., e04ref or e04rff was called to define a linear or quadratic objective function), objfun will never be called by h02ddf and objfun may be the dummy routine h02ddv. (h02ddv is included in the NAG Library.)
The specification of objfun is:
Fortran Interface
Subroutine objfun ( nvar, x, fx, inform, iuser, ruser, cpuser)
Integer, Intent (In) :: nvar
Integer, Intent (Inout) :: inform, iuser(*)
Real (Kind=nag_wp), Intent (In) :: x(nvar)
Real (Kind=nag_wp), Intent (Inout) :: ruser(*)
Real (Kind=nag_wp), Intent (Out) :: fx
Type (c_ptr), Intent (In) :: cpuser
C Header Interface
void  objfun (const Integer *nvar, const double x[], double *fx, Integer *inform, Integer iuser[], double ruser[], void **cpuser)
1: nvar Integer Input
On entry: n, the current number of decision variables x in the model.
2: x(nvar) Real (Kind=nag_wp) array Input
On entry: the vector x of variable values at which the objective function is to be evaluated.
3: fx Real (Kind=nag_wp) Output
On exit: the value of the objective function at x.
4: inform Integer Input/Output
On entry: a non-negative value.
On exit: must be set to a value describing the action to be taken by the solver on return from objfun. Specifically, if the value is negative, then the value of fx will be discarded and the solver will terminate immediately with ifail=21 or 25 (the same will happen if fx is Infinity or NaN); otherwise, the solver will proceed normally.
5: iuser(*) Integer array User Workspace
6: ruser(*) Real (Kind=nag_wp) array User Workspace
7: cpuser Type (c_ptr) User Workspace
objfun is called with the arguments iuser, ruser and cpuser as supplied to h02ddf. You should use the arrays iuser and ruser, and the data handle cpuser to supply information to objfun.
objfun must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which h02ddf is called. Arguments denoted as Input must not be changed by this procedure.
3: objgrd Subroutine, supplied by the NAG Library or the user. External Procedure
objgrd must calculate the values of the nonlinear objective function gradients f x at a specified value of the n-element vector of x variables. If there is no nonlinear objective (e.g., e04ref or e04rff was called to define a linear or quadratic objective function), objgrd will never be called by h02ddf and objgrd may be the dummy subroutine h02ddw. (h02ddw is included in the NAG Library.)
The specification of objgrd is:
Fortran Interface
Subroutine objgrd ( nvar, x, nnzfd, fdx, inform, iuser, ruser, cpuser)
Integer, Intent (In) :: nvar, nnzfd
Integer, Intent (Inout) :: inform, iuser(*)
Real (Kind=nag_wp), Intent (In) :: x(nvar)
Real (Kind=nag_wp), Intent (Inout) :: fdx(nnzfd), ruser(*)
Type (c_ptr), Intent (In) :: cpuser
C Header Interface
void  objgrd (const Integer *nvar, const double x[], const Integer *nnzfd, double fdx[], Integer *inform, Integer iuser[], double ruser[], void **cpuser)
1: nvar Integer Input
On entry: n, the current number of decision variables x in the model.
2: x(nvar) Real (Kind=nag_wp) array Input
On entry: the vector x of variable values at which the objective function gradient is to be evaluated.
3: nnzfd Integer Input
On entry: the number of nonzero elements in the sparse gradient vector of the objective function, as was set in a previous call to e04rgf.
4: fdx(nnzfd) Real (Kind=nag_wp) array Input/Output
On entry: the elements should only be assigned and not referenced.
On exit: the values of the nonzero elements in the sparse gradient vector of the objective function, in the order specified by idxfd in a previous call to e04rgf. fdx(i) will store the gradient element f xj , where j=idxfd(i).
5: inform Integer Input/Output
On entry: a non-negative value.
On exit: must be set to a value describing the action to be taken by the solver on return from objgrd. Specifically, if the value is negative the solution of the current problem will terminate immediately with ifail=21 or 25 (the same will happen if fdx contains Infinity, NaN, or unassigned elements); otherwise, computations will continue.
6: iuser(*) Integer array User Workspace
7: ruser(*) Real (Kind=nag_wp) array User Workspace
8: cpuser Type (c_ptr) User Workspace
objgrd is called with the arguments iuser, ruser and cpuser as supplied to h02ddf. You should use the arrays iuser and ruser, and the data handle cpuser to supply information to objgrd.
objgrd must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which h02ddf is called. Arguments denoted as Input must not be changed by this procedure.
4: confun Subroutine, supplied by the NAG Library or the user. External Procedure
confun must calculate the values of the mg-element vector g i(x) of nonlinear constraint functions at a specified value of the n-element vector of x variables. If no nonlinear constraints were registered in this handle, confun will never be called by h02ddf and confun may be the dummy subroutine h02ddx. (h02ddx is included in the NAG Library.)
The specification of confun is:
Fortran Interface
Subroutine confun ( nvar, x, ncnln, gx, inform, iuser, ruser, cpuser)
Integer, Intent (In) :: nvar, ncnln
Integer, Intent (Inout) :: inform, iuser(*)
Real (Kind=nag_wp), Intent (In) :: x(nvar)
Real (Kind=nag_wp), Intent (Inout) :: ruser(*)
Real (Kind=nag_wp), Intent (Out) :: gx(ncnln)
Type (c_ptr), Intent (In) :: cpuser
C Header Interface
void  confun (const Integer *nvar, const double x[], const Integer *ncnln, double gx[], Integer *inform, Integer iuser[], double ruser[], void **cpuser)
1: nvar Integer Input
On entry: n, the current number of decision variables x in the model.
2: x(nvar) Real (Kind=nag_wp) array Input
On entry: the vector x of variable values at which the constraint functions are to be evaluated.
3: ncnln Integer Input
On entry: mg, the number of nonlinear constraints, as specified in an earlier call to e04rkf.
4: gx(ncnln) Real (Kind=nag_wp) array Output
On exit: the mg values of the nonlinear constraint functions at x.
5: inform Integer Input/Output
On entry: a non-negative value.
On exit: must be set to a value describing the action to be taken by the solver on return from confun. Specifically, if the value is negative, then the value of gx will be discarded and the solver will terminate immediately with ifail=21 or 25 (the same will happen if gx contains Infinity or NaN); otherwise, the solver will proceed normally.
6: iuser(*) Integer array User Workspace
7: ruser(*) Real (Kind=nag_wp) array User Workspace
8: cpuser Type (c_ptr) User Workspace
confun is called with the arguments iuser, ruser and cpuser as supplied to h02ddf. You should use the arrays iuser and ruser, and the data handle cpuser to supply information to confun.
confun must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which h02ddf is called. Arguments denoted as Input must not be changed by this procedure.
5: congrd Subroutine, supplied by the NAG Library or the user. External Procedure
congrd must calculate the nonzero values of the sparse Jacobian of the nonlinear constraint functions gi x at a specified value of the n-element vector of x variables. If there are no nonlinear constraints (e.g., e04rkf was never called with the same handle or it was called with ncnln =0), congrd will never be called by h02ddf and congrd may be the dummy subroutine h02ddy. (h02ddy is included in the NAG Library.)
The specification of congrd is:
Fortran Interface
Subroutine congrd ( nvar, x, nnzgd, gdx, inform, iuser, ruser, cpuser)
Integer, Intent (In) :: nvar, nnzgd
Integer, Intent (Inout) :: inform, iuser(*)
Real (Kind=nag_wp), Intent (In) :: x(nvar)
Real (Kind=nag_wp), Intent (Inout) :: gdx(nnzgd), ruser(*)
Type (c_ptr), Intent (In) :: cpuser
C Header Interface
void  congrd (const Integer *nvar, const double x[], const Integer *nnzgd, double gdx[], Integer *inform, Integer iuser[], double ruser[], void **cpuser)
1: nvar Integer Input
On entry: n, the current number of decision variables x in the model.
2: x(nvar) Real (Kind=nag_wp) array Input
On entry: the vector x of variable values at which the Jacobian of the constraint functions is to be evaluated.
3: nnzgd Integer Input
On entry: is the number of nonzero elements in the sparse Jacobian of the constraint functions, as was set in a previous call to e04rkf.
4: gdx(nnzgd) Real (Kind=nag_wp) array Input/Output
On entry: the elements should only be assigned and not referenced.
On exit: the nonzero values of the Jacobian of the nonlinear constraints, in the order specified by irowgd and icolgd in an earlier call to e04rkf. gdx(i) will be the gradient gj xk , where j=irowgd(i) and k=icolgd(i).
5: inform Integer Input/Output
On entry: a non-negative value.
On exit: must be set to a value describing the action to be taken by the solver on return from congrd. Specifically, if the value is negative the solution of the current problem will terminate immediately with ifail=21 or 25 (the same will happen if gdx contains Infinity, NaN, or unassigned elements); otherwise, computations will continue.
6: iuser(*) Integer array User Workspace
7: ruser(*) Real (Kind=nag_wp) array User Workspace
8: cpuser Type (c_ptr) User Workspace
congrd is called with the arguments iuser, ruser and cpuser as supplied to h02ddf. You should use the arrays iuser and ruser, and the data handle cpuser to supply information to congrd.
congrd must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which h02ddf is called. Arguments denoted as Input must not be changed by this procedure.
6: monit Subroutine, supplied by the NAG Library or the user. External Procedure
monit is provided to enable you to monitor the progress of the optimization and optionally to terminate the solver early if necessary. It is invoked at the end of every ith major iteration where i is given by the MISQP Monitor Frequency (the default is 0, monit is not called).
monit may be the dummy subroutine h02ddu included in the NAG Library.
The specification of monit is:
Fortran Interface
Subroutine monit ( nvar, x, inform, rinfo, stats, iuser, ruser, cpuser)
Integer, Intent (In) :: nvar
Integer, Intent (Inout) :: inform, iuser(*)
Real (Kind=nag_wp), Intent (In) :: x(nvar), rinfo(100), stats(100)
Real (Kind=nag_wp), Intent (Inout) :: ruser(*)
Type (c_ptr), Intent (In) :: cpuser
C Header Interface
void  monit (const Integer *nvar, const double x[], Integer *inform, const double rinfo[], const double stats[], Integer iuser[], double ruser[], void **cpuser)
1: nvar Integer Input
On entry: n, the current number of decision variables x in the model.
2: x(nvar) Real (Kind=nag_wp) array Input
On entry: xi, the values of the decision variables x at the current iteration.
3: inform Integer Input/Output
On entry: a non-negative value.
On exit: must be set to a value describing the action to be taken by the solver on return from monit. Specifically, if the value is negative the solution of the current problem will terminate immediately with ifail=20; otherwise, computations will continue.
4: rinfo(100) Real (Kind=nag_wp) array Input
On entry: error measures and various indicators at the end of the current iteration as described in rinfo.
5: stats(100) Real (Kind=nag_wp) array Input
On entry: solver statistics at the end of the current iteration as described in stats.
6: iuser(*) Integer array User Workspace
7: ruser(*) Real (Kind=nag_wp) array User Workspace
8: cpuser Type (c_ptr) User Workspace
monit is called with the arguments iuser, ruser and cpuser as supplied to h02ddf. You should use the arrays iuser and ruser, and the data handle cpuser to supply information to monit.
monit must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which h02ddf is called. Arguments denoted as Input must not be changed by this procedure.
7: nvar Integer Input
On entry: n, the current number of decision variables x in the model.
8: x(nvar) Real (Kind=nag_wp) array Input/Output
On entry: x0, the initial estimates of the variables x.
On exit: the final values of the variables x.
9: rinfo(100) Real (Kind=nag_wp) array Output
On exit: error measures and various indicators at the end of the final iteration as given in the table below:
1 Objective function value f(x).
2100 Reserved for future use.
10: stats(100) Real (Kind=nag_wp) array Output
On exit: solver statistics at the end of the final iteration as given in the table below:
1 Number of function evaluations.
23 Reserved for future use.
4 Number of gradient evaluations.
5 Number of calls to the QP solver.
6 Reserved for future use.
7 Number of branch-and-bound nodes.
8 Total time spent in solver (including user-supplied function calls).
9 Total time spent evaluating objective function.
10 Total time spent evaluating objective gradient.
11 Total time spent evaluating constraint functions.
12 Total time spent evaluating constraint Jacobian.
13 Total number of inner iterations.
14 Total number of iterations.
15100 Reserved for future use.
11: iuser(*) Integer array User Workspace
12: ruser(*) Real (Kind=nag_wp) array User Workspace
13: cpuser Type (c_ptr) User Workspace
iuser, ruser and cpuser are not used by h02ddf, but are passed directly to objfun, objgrd, confun, congrd and monit and may be used to pass information to these routines. If you do not need to reference cpuser, it should be initialized to c_null_ptr.
14: ifail Integer Input/Output
On entry: ifail must be set to 0, −1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of −1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value −1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value −1 is recommended since useful values can be provided in some output arguments even when ifail0 on exit. 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:
Note: in some cases h02ddf may return useful information.
ifail=1
The supplied handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been properly initialized or it has been corrupted.
ifail=2
The problem is already being solved.
This solver does not support the model defined in the handle.
ifail=4
The information supplied does not match with that previously stored.
On entry, nvar=value must match that given during initialization of the handle, i.e., value.
ifail=7
The dummy confun routine was called but the problem requires these values. Please provide a proper confun routine.
The dummy congrd routine was called but the problem requires these derivatives. Please provide a proper congrd routine.
The dummy objfun routine was called but the problem requires these values. Please provide a proper objfun routine.
The dummy objgrd routine was called but the problem requires these derivatives. Please provide a proper objgrd routine.
ifail=11
On entry, there are no binary or integer variables.
ifail=18
Termination with zero integer trust region for integer variables; try a different starting value.
Optional parameter MISQP Integer Trust Radius=value.;
ifail=20
User requested termination during a monitoring step. inform was set to a negative value in monit.
ifail=21
The current starting point is unusable.
Either inform was set to a negative value within the user-supplied functions objfun, objgrd, confun or congrd, or the values returned contain Infinity, NaN, or unassigned elements.
ifail=22
Maximum number of iterations exceeded.
The MISQP Iteration Limit limit was exceeded before a solution with the requested accuracy could be found. Check the iteration log to be sure that progress was being made. If so, rerun the problem after increasing this optional parameter.
ifail=23
The solver terminated after the maximum time allowed was exhausted.
Maximum number of seconds exceeded. Use optional parameter Time Limit to change the limit.
ifail=24
More than the maximum number of feasible steps without improvement in the objective function. If the maximum number of feasible steps is small, say less than 5, try increasing it. Optional parameter MISQP Feasible Steps=value.;
The optimization failed due to numerical difficulties. Set optional parameter Print Level=3 for more information.;
ifail=25
Invalid number detected in user-supplied function.
Either inform was set to a negative value within the user-supplied functions objfun, objgrd, confun or congrd, or the values returned contain Infinity, NaN, or unassigned elements.
ifail=26
User-provided constraint gradient is likely to be incorrect. This error indicates that the user-supplied gradient vector gdx has entries that do not match with a finite-differences approximation of it.
User-provided objective gradient is likely to be incorrect. This error indicates that the user-supplied gradient vector fdx has entries that do not match with a finite-differences approximation of it.
ifail=51
Termination at an infeasible iterate; if the problem is feasible, try a different starting value.
The solver detected an infeasible problem.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

The accuracy of the solution is determined by optional parameter MISQP Stop Tolerance.

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
h02ddf 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

9.1 Description of the Printed Output

The solver can print information to give an overview of the problem and of the progress of the computation. The output may be sent to two independent streams (files) which are set by optional parameters Print File. Optional parameters Print Level, Print Solution and Print Options determine the exposed level of detail. This allows, for example, a detailed log file to be generated while the condensed information is displayed on the screen.
By default (Print File=6, Print Level=2), the following sections are printed to the standard output:
Header
The header is a message indicating the start of the solver. It should look like:
 ---------------------------------------------------
  H02DD, Mixed-integer nonlinear programming solver
 ---------------------------------------------------
Optional parameters list
The list shows all options of the solver, each displayed on one line. The output contains the option name, its current value and an indicator for how it was set. The options unchanged from the default setting are noted by ‘d’, options you set are noted by ‘U’, and options reset by the solver are noted by ‘S’. Note that the output format is compatible with the file format expected by e04zpf. The output might look as follows:
Begin of Options
    Print File                    =                   6     * d
    Print Level                   =                   2     * U
    Print Options                 =                 Yes     * U
    Print Solution                =                 All     * U

    Infinite Bound Size           =         1.00000E+20     * d
    Task                          =            Minimize     * d
    Stats Time                    =                 Yes     * U
    Time Limit                    =         1.00000E+06     * d
    Verify Derivatives            =                 Yes     * U

    ...
    Misqp Improved Bounds         =                  No     * d
    Misqp Integer Trust Radius    =         1.00000E+01     * d
    Misqp Iteration Limit         =                 500     * d
    Misqp Maximum Restarts        =                   2     * d
    Misqp Modify Hessian          =                 Yes     * d
    Misqp Monitor Frequency       =                   1     * U
    Misqp Node Selection          =         Depth First     * d
    Misqp Non Monotone            =                  10     * d
    ...
End of Options
Problem statistics
If Print Level2, statistics on the problem are printed. It should look as follows:
Problem Statistics
  No of variables                  8
    integer                        4
      inc. binary                  4
    free (unconstrained)           0
    bounded                        8
  No of lin. constraints           5
  No of nln. constraints           2
  Objective function       Nonlinear
Note: the list is showing that all four integer variables in the problem are binary..
Verification of derivatives
If Verify Derivatives=YES, then the user-supplied nonlinear objective gradient and constraint Jacobian are individually verified. Identified discrepancies will be indicated with BAD?. The output might look as follows:
 Verification of the objective gradients
   Col         X        DX         Gradient    Approximation  Test  Itns
     1  1.00E+00  2.43E-07   1.20000000E+01   1.20000000E+01    OK     1
     2  1.00E+00  1.98E-07   2.00000000E+01   2.00000000E+01    OK     1
     3  1.00E+00  1.54E-07   2.00000000E+01   2.00000000E+01    OK     1
 
   All     4 objective gradients out of the     4
   set in cols     1 through     8 seem to be ok.
 
   The largest relative error was    4.61E-11 in element     1
 
 
 Verification of the constraint gradients
   Col         X        DX   Row         Gradient    Approximation  Test  Itns
     1  1.00E+00  2.65E-06     1   8.00000000E+00   8.00000000E+00    OK     3
     2  1.00E+00  2.65E-06     1   9.00000000E+00   9.00000000E+00    OK     3
     3  1.00E+00  2.65E-06     1   1.10000000E+01   1.20000000E+01  BAD?     3  Linear or odd?
     4  1.00E+00  2.65E-06     1   7.00000000E+00   7.00000000E+00    OK     3
 
   There seem to be     1 incorrect constraint gradients out of the     8
   set in cols     1 through     8
 
   The largest relative error was    8.33E-02 in row    1, column    3
Major Iteration Log
This section describes the output to unit Print File if Print Level>1. One line of information is output every major iteration. Note that the printed objective function value may be scaled if MISQP Scale Objective=YES. The output might look as follows:
   Output in the following order:
 
     IT    - iteration number
     F     - objective function value
     MCV   - maximum constraint violation
     SIGMA - penalty parameter
     IL    - number inner loops
     DMAXC - maximum norm of continuous step D_C
     D1B   - 1-norm of binary step DELTA_B
     DMAXI - maximum norm of integer step D_I
 
   IT       F         MCV      SIGMA    IL   DMAXC      D1B      DMAXI
 -----------------------------------------------------------------------
    1  0.10000D+01  0.10D+01  0.10D+04   1  0.10D-02  0.20D+01  0.00D+00
    2  0.13846D+00  0.15D-15  0.10D+04   1  0.67D-03  0.10D+01  0.00D+00
    3  0.16239D+00  0.11D-37  0.10D+04   1  0.67D-03  0.20D+01  0.00D+00
    ...
Minor Iteration Log
If Print Level 3 , further information for every minor iteration will be printed.
Summary
Once the solver finishes, a detailed summary is produced:
 -------------------------------------------------------------------------------
 Status: converged, an optimal solution was found
 -------------------------------------------------------------------------------
 
 Objective function value at solution:  2.92500E+00
 
 Number of function evaluations:                 118
 Number of gradient evaluations:                  22
 Number of calls of QP solver:                    35
 Number of B&B nodes:                            183
Is starts with a status line of the overall result, followed by the final objective value. If Print Level2, it will additionally report objective and constraint function calls, the QP solver calls, and the number of branch-and-bound nodes. Optionally, if Stats Time=YES or CPU, some statistics on timings is displayed. It might look as follows:
 Timing:
   Total time spent                               0.19 sec
   Total time in objective function               0.00 sec (  1.5%)
   Total time in objective gradient               0.00 sec (  0.5%)
   Total time in constraint functions             0.00 sec (  2.6%)
   Total time in constraint Jacobian              0.00 sec (  0.0%)
Solution
If Print Solution=YES, the values of the primal variables x are printed. Information about the gradient of the variables is also available for continuous variables. The rightmost label indicates the integrality of the variable as specified by e04rcf; with I indicating an (non-binary) integer and B a binary variable. It might look as follows:
 Primal variables:
   idx   Lower bound       Value       Upper bound     Gradient
     1   0.00000E+00    3.75000E-01    1.00000E+06    1.95000E+00
     2   0.00000E+00    5.25000E-01    1.00000E+06    9.75000E+00
     3   0.00000E+00    1.00000E+00    1.00000E+00        NaN        I
     4   0.00000E+00    1.00000E+00    1.00000E+00        NaN        B
     5   0.00000E+00    1.00000E+00    1.00000E+00        NaN        B

10 Example

Select a portfolio of at most p assets from n available with expected return ρ, is fully invested and that minimizes
xTΣx subject to  rTx = ρ i=1 n xi = 1 xi yi i=1 n yi p xi 0 yi = 0 or 1  
where
This example is taken from Mann (1986) with
r = ( 89127 ) Σ = ( 43-10 3610 -11100 0000 ) p = 3 ρ = 10.  
Linear constraints are supplied through both e04rjf and confun for illustrative purpose.

10.1 Program Text

Program Text (h02ddfe.f90)

10.2 Program Data

None.

10.3 Program Results

Program Results (h02ddfe.r)

11 Algorithmic Details

Internally, all constraints in (1), except bound constraints, are rearranged into the forms below:
cj(x)=0, j=1,2,,me cj(x)0, j=me+1,me+2,,m  
with me equality constraints in a total of m constraint functions.
The method seeks to minimize the exact penalty function:
Pσ(x) = f(x) +σ g(x) (2)
where σ is adapted by the algorithm and g(x) is an m-dimensional vector given by:
g(x) = cj(x), j=1,2,,me = min(cj(x),0), j=me+1,me+2,,m.  
Successive quadratic approximations are applied under the assumption that integer variables have a smooth influence on the model functions, that is function values do not change drastically when incrementing or decrementing an integer value. In practice this requires integer variables to be ordinal not categorical. The algorithm is stabilised by a trust region method including Yuan's second order corrections, see Yuan and Sun (2006). The Hessian of the Lagrangian function is approximated by BFGS (see Section 11.4 in e04ucf/​e04uca) updates subject to the continuous and integer variables.
The mixed-integer quadratic programming subproblems of the SQP-trust region method are solved by a branch and cut method with continuous subproblem solutions obtained by the primal-dual method of Goldfarb and Idnani, see Powell (1983). Different strategies are available for selecting a branching variable: and a node from where branching, that is the generation of two new subproblems, begins:
This implementation is based on the algorithm MISQP as described in Exler et al. (2013).

12 Optional Parameters

Several optional parameters in h02ddf define choices in the problem specification or the algorithm logic. In order to reduce the number of formal arguments of h02ddf 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 optional parameters can be changed by calling e04zmf anytime between the initialization of the handle by e04raf and the call to the solver. Modification of the arguments during intermediate monitoring stops is not allowed. Once the solver finishes, the optional parameters can be altered again for the next solve.
The option values may be retrieved by e04znf.
The following is a list of the optional parameters available. A full description of each optional parameter is provided in Section 12.1.

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:
All options accept the value DEFAULT to return single options to their default states.
Keywords and character values are case and white space insensitive.
Defaults
This special keyword may be used to reset all optional parameters to their default values. Any value given with this keyword will be ignored.
Infinite Bound SizerDefault =1020
This 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 -). Note that a modification of this optional parameter does not influence constraints which have already been defined; only the constraints formulated after the change will be affected.
Constraint: Infinite Bound Size1000.
MISQP Branching RuleaDefault =MAXIMUM
This option specifies the branching rule for branch-and-bound search.
MISQP Branching Rule=MAXIMUM
Maximum fractional branching.
MISQP Branching Rule=MINIMUM
Minimum fractional branching.
MISQP Continuous Trust RadiusrDefault =10.0
This parameter sets the initial continuous trust region radius, Δ0c; the initial trial step dRnc for the SQP approximation must satisfy d Δ0c.
Constraint: MISQP Continuous Trust Radius>0.0.
MISQP DescentrDefault =0.05
This sets the initial descent parameter, δ.
Larger values of δ allow penalty parameter σ to increase faster, which can lead to faster convergence.
Constraint: 0.0<MISQP Descent<1.0.
MISQP Descent FactorrDefault =0.1
This parameter defines the factor for decreasing the internal descent parameter, δ, between iterations.
Constraint: 0.0<MISQP Descent Factor<1.0.
MISQP Feasible StepsiDefault =10
This parameter defines the maximum number of feasible steps without improvements.
Feasibility is measured by g(x)εtol, where εtol is defined by the optional parameter MISQP Stop Tolerance.
Constraint: MISQP Feasible Steps>1.
MISQP Improved BoundsaDefault =NO
When MISQP Node Selection=BEST OF ALL, this option specifies whether to calculate improved bounds.
Constraint: MISQP Improved Bounds=YES or NO.
MISQP Integer Trust RadiusrDefault =10.0
This parameter sets the initial integer trust region radius, Δ0i; the initial trial step eRni for the SQP approximation must satisfy eΔ0i.
Constraint: MISQP Integer Trust Radius1.0.
MISQP Iteration LimitiDefault =500
This parameter sets the maximum number of iterations to be performed by h02ddf. Setting the option too low might lead to ifail=22.
Constraint: MISQP Iteration Limit1.
MISQP Maximum RestartsiDefault =2
This parameter defines the maximum number of restarts that allow the mixed integer SQP algorithm to return to a better solution.
Setting a value higher than the default might lead to better results at the expense of function evaluations.
Constraint: 0<MISQP Maximum Restarts15.
MISQP Modify HessianaDefault =YES
This option specifies whether to modify the Hessian approximation in an attempt to get more accurate search directions. Calculation time is increased when the number of integer variables is large.
Constraint: MISQP Modify Hessian=YES or NO.
MISQP Monitor FrequencyiDefault =0
This parameter specifies the frequency on which to call the monitor routine monit. If zero, the monitor routine will not be called.
Constraint: MISQP Monitor Frequency0.
MISQP Node SelectionaDefault =DEPTH FIRST
This option specifies the node selection strategy for branch-and-bound search.
MISQP Node Selection=BEST OF ALL
Large tree search; this method is the slowest as it solves all subproblem QPs independently.
MISQP Node Selection=BEST OF TWO
Uses warm starts and less memory.
MISQP Node Selection=DEPTH FIRST
Uses more warm starts. If warm starts are applied, they can speed up the solution of mixed integer subproblems significantly when solving almost identical QPs.
MISQP Non MonotoneiDefault =10
This parameter defines the maximum number of successive iterations considered for the non-monotone trust region algorithm, allowing the penalty function to increase.
Constraint: 0<MISQP Non Monotone<100.
MISQP PenaltyrDefault =1000.0
This sets the initial penalty parameter, σ.
Constraint: MISQP Penalty0.0.
MISQP Penalty FactorrDefault =10.0
This parameter defines the factor for increasing the internal penalty parameter, σ, when the trust regions cannot be enlarged at a trial step.
Constraint: MISQP Penalty Factor>1.0.
MISQP QP AccuracyrDefault =10-10
This parameter defines the termination tolerance of the relaxed quadratic program subproblems.
Constraint: MISQP QP Accuracy>0.0.
MISQP Scale Continuous VarsaDefault =YES
This option specifies whether to internally scale continuous variable values.
Constraint: MISQP Scale Continuous Vars=YES or NO.
MISQP Scale ObjectiveaDefault =YES
This option specifies whether to internally scale objective function values greater than MISQP Scale Objective Bound.
Constraint: MISQP Scale Objective=YES or NO.
MISQP Scale Objective BoundrDefault =1.0
When MISQP Scale Objective=YES, absolute objective function values greater than this parameter are internally scaled.
Constraint: MISQP Scale Objective Bound>0.0.
MISQP Stop TolerancerDefault = max(10-5,ε)
This parameter sets the requested accuracy for determining feasible points during iterations and for halting the method when the predicted improvement in objective function is less than MISQP Stop Tolerance.
Constraint: MISQP Stop Tolerance0.0.
MISQP Subproblem Max NodesiDefault =500
This parameter defines the maximum number of branch-and-bound steps for solving the mixed integer quadratic problems.
Constraint: MISQP Subproblem Max Nodes>1.
MISQP Warm StartsiDefault =100
This parameter defines the maximum number of warm starts within the mixed integer QP solver. See MISQP Node Selection.
Constraint: MISQP Warm Starts0.
Print FileiDefault =advisory message unit number
If i0, the unit number for the primary output of the solver. If Print File=−1, the primary output is completely turned off independently of other settings. The default value is the advisory message unit number as defined by x04abf at the time of the optional parameters initialization, e.g., at the initialization of the handle. The following information is output to the unit:
Constraint: Print File-1.
Print LeveliDefault =2
This parameter defines how detailed information should be printed by the solver to the primary output.
i Output
0 No output from the solver
1 Only the final status and the objective value
2 Problem statistics, one line per iteration showing the progress of the solution with respect to the convergence measures, final status and statistics
3, 4, 5 As level 2 and additionally inner iteration log with further details.
Constraint: 0Print Level5.
Print OptionsaDefault =YES
If Print Options=YES, a listing of optional parameters will be printed to the primary output.
Constraint: Print Options=YES or NO.
Print SolutionaDefault =NO
If Print Solution=YES, the final values of the solution vector are printed on the primary and secondary outputs.
Constraint: Print Solution=YES or NO.
Stats TimeaDefault =NO
This parameter allows you to turn on timings of various parts of the algorithm to give a better overview of where most of the time is spent. This might be helpful for a choice of different solving approaches. It is possible to choose between CPU and wall clock time. Choice YES is equivalent to WALL CLOCK.
Constraint: Stats Time=YES, NO, CPU or WALL CLOCK.
TaskaDefault =MINIMIZE
This parameter specifies the required direction of the optimization. If Task=FEASIBLE POINT, the objective function (if set) is ignored and the algorithm stops as soon as a feasible point is found. If no objective function is set, Task reverts to FEASIBLE POINT automatically.
Constraint: Task=MINIMIZE, MAXIMIZE or FEASIBLE POINT.
Time LimitrDefault =106
This parameter specifies a limit in seconds that the solver can use to solve one problem. If during the convergence check this limit is exceeded, the solver will terminate with ifail=23 error message.
Constraint: Time Limit>0.
Verify DerivativesaDefault =NO
This parameter specifies whether the routine should perform numerical checks on the consistency of the user-supplied gradient functions objgrd and congrd. If any discrepancies are found, ifail=26 is returned. It is recommended that such checks are enabled when first developing the formulation of the problem, however, the verification process results in a significant increase in the number of the function evaluations and thus it shouldn't be used in production code.
Constraint: Verify Derivatives=YES or NO.