NAG Library Routine Document

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 <nagmk26.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)

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 – IntegerInput
On entry: this must be the same argument n as supplied to h02bbf.
Constraint: n>0.
2:     m – IntegerInput
On entry: this must be the same argument m as supplied to h02bbf.
Constraint: m0.
3:     bln+m – Real (Kind=nag_wp) arrayOutput
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) arrayOutput
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) arrayOutput
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 arrayOutput
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 arrayCommunication 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 – IntegerInput
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) arrayCommunication 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 – IntegerInput
On entry: the dimension of the array rwork as declared in the (sub)program from which h02bzf is called.
11:   ifail – IntegerInput/Output
On entry: ifail must be set to 0, -1 or 1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1 or 1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this argument, the recommended value is 0. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6
Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry,n0,
orm<0.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation 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,x6T  
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)