NAG FL Interface
h02bzf (ilp_​info)

1 Purpose

h02bzf extracts more information associated with the solution of an integer programming problem computed by h02bbf.

2 Specification

Fortran Interface
Subroutine h02bzf ( n, m, bl, bu, clamda, istate, iwork, liwork, rwork, lrwork, ifail)
Integer, Intent (In) :: n, m, iwork(liwork), liwork, lrwork
Integer, Intent (Inout) :: ifail
Integer, Intent (Out) :: istate(n+m)
Real (Kind=nag_wp), Intent (In) :: rwork(lrwork)
Real (Kind=nag_wp), Intent (Out) :: bl(n+m), bu(n+m), clamda(n+m)
C Header Interface
#include <nag.h>
void  h02bzf_ (const Integer *n, const Integer *m, double bl[], double bu[], double clamda[], Integer istate[], const Integer iwork[], const Integer *liwork, const double rwork[], const Integer *lrwork, Integer *ifail)
The routine may be called by the names h02bzf or nagf_mip_ilp_info.

3 Description

h02bzf extracts the following information associated with the solution of an integer programming problem computed by h02bbf. The upper and lower bounds used for the solution, the Lagrange-multipliers (costs), and the status of the variables at the solution.
In the branch and bound method employed by h02bbf, the arrays bl and bu are used to impose restrictions on the values of the integer variables in each sub-problem. That is, if the variable xj is restricted to take value vj in a particular sub-problem, then blj=buj=vj is set in the sub-problem. Thus, on exit from this routine, some of the elements of bl and bu which correspond to integer variables may contain these imposed values, rather than those originally supplied to h02bbf.

4 References

None.

5 Arguments

1: n Integer Input
On entry: this must be the same argument n as supplied to h02bbf.
Constraint: n>0.
2: m Integer Input
On entry: this must be the same argument m as supplied to h02bbf.
Constraint: m0.
3: bln+m Real (Kind=nag_wp) array Output
On exit: if h02bbf exits with ifail=0, 7 or 9, the values in the array bl contain the lower bounds imposed on the integer solution for all the constraints. 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).
4: bun+m Real (Kind=nag_wp) array Output
On exit: if h02bbf exits with ifail=0, 7 or 9, the values in the array bu contain the upper bounds imposed on the integer solution for all the constraints. 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).
5: clamdan+m Real (Kind=nag_wp) array Output
On exit: if h02bbf exits with ifail=0, 7 or 9, the values in the array clamda contain the values of the Lagrange-multipliers for each constraint with respect to the current working set. 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).
6: istaten+m Integer array Output
On exit: if h02bbf exits with ifail=0, 7 or 9, the values in the array istate indicate the status of the constraints in the working set at an integer solution. Otherwise, istate indicates the composition of the working set at the final iterate. The significance of each possible value of istatej is as follows.
istatej Meaning
-2 The constraint violates its lower bound by more than tolfes (the feasibility tolerance, see h02bbf).
-1 The constraint violates its upper bound by more than tolfes.
-0 The constraint is satisfied to within tolfes, but is not in the working set.
-1 This inequality constraint is included in the working set at its lower bound.
-2 This inequality constraint is included in the working set at its upper bound.
-3 This constraint is included in the working set as an equality. This value of istate can occur only when blj=buj.
-4 This corresponds to an integer solution being declared with xj being temporarily fixed at its current value. This value of istate can occur only when ifail=0, 7 or 9 on exit from h02bbf.
7: iworkliwork Integer array Communication Array
On entry: this must be the same argument iwork as supplied to h02bbf. It is used to pass information from h02bbf to h02bzf and therefore the contents of this array must not be changed before calling h02bzf.
8: liwork Integer Input
On entry: the dimension of the array iwork as declared in the (sub)program from which h02bzf is called.
9: rworklrwork Real (Kind=nag_wp) array Communication Array
On entry: this must be the same argument rwork as supplied to h02bbf. It is used to pass information from h02bbf to h02bzf and therefore the contents of this array must not be changed before calling h02bzf.
10: lrwork Integer Input
On entry: the dimension of the array rwork as declared in the (sub)program from which h02bzf is called.
11: 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 0 is recommended. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry, m=value.
Constraint: m0.
On entry, n=value.
Constraint: n>0.
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

Not applicable.

8 Parallelism and Performance

h02bzf is not threaded in any implementation.

9 Further Comments

None.

10 Example

One of the applications of integer programming is to the so-called 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 nutritional requirements, the problem is to find the cheapest combination. This gives rise to the following problem:
minimize
cTx  
subject to
Axb, 0xu,  
where
c= 3 24 13 9 20 19 T,x= x1,x2,x3,x4,x5,x6 T  
is integer,
A= 110 205 160 160 420 260 4 32 13 8 4 14 2 12 54 285 22 80 ,   b= 2000 55 800  
and
u= 4 3 2 8 2 2 T  
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 increasing the energy required to 2200 units.

10.1 Program Text

Program Text (h02bzfe.f90)

10.2 Program Data

Program Data (h02bzfe.d)

10.3 Program Results

Program Results (h02bzfe.r)