This chapter describes the MIP user exit subroutines EKKBRNU, EKKCHNU, EKKCUTU, EKKEVNU, EKKHEUU, EKKNODU, and EKKSLVU, which you can use to affect the processing of a MIP problem. "Understanding Mixed-Integer User Exit Subroutines" has more information about how to use these subroutines. Sample subroutines appear in "Sample Mixed-Integer User Exit Subroutines".
[
EKKCHNU |
EKKCUTU |
EKKEVNU |
EKKHEUU |
EKKNODU |
EKKSLVU ]
[ Top of Page |
Bottom of Page ]
EKKBRNU - Branch User Exit Subroutine
EKKBRNU is called from EKKMSLV, and it allows you to override a branching choice.
Note: |
EKKBRNU can only be written in C or FORTRAN. EKKBRNU should not make any calls that could cause recursion errors. |
C | int ekkbrnu(double *dspace, int * mspace, int * reason, int * iarray, double * rarray, int * userrtcd); |
FORTRAN | EKKBRNU(dspace,mspace,reason,iarray,rarray, userrtcd) |
Specified as: a one-dimensional real array of doublewords.
Specified as: a one-dimensional array of fullword integers with twice the number of entries as dspace.
Note: |
mspace and dspace have the same starting location. |
If reason=1, the subroutine is being called before any set is processed, and iarray and rarray are not used.
If reason=2, the subroutine is being called before processing each set, and only: set number, type of set, priority, and number in set are valid in iarray and rarray.
If reason=3, the subroutine is being called after processing each variable in the set, and all of iarray and rarray are valid, and you may change pseudocosts (takes effect on the next branch).
If reason=4, the subroutine is being called after processing each set, and all of iarray and rarray are valid, and you may change variable number and priority (takes effect on next branch).
If reason=5, the subroutine is being called after processing all sets, and all of iarray and rarray are valid, and the set number is the chosen set, which you may now change.
Specified as: a fullword integer
The first element of iarray identifies the number of the set being processed.
The second element of iarray identifies the type of the set being processed, where:
Specified as: a one-dimensional array of integers.
The first element of rarray is the current value of the variable in the continuous solution.
The second element of rarray is the down pseudocost.
The third element of rarray is the up pseudocost for single variables. For sets
it is the reference row entry. When reason=4, it is the branch point for
special ordered sets.
The fourth element of rarray is the estimated degradation for the down branch.
The fifth element of rarray is the estimated degradation for the up branch.
Specified as: a one-dimensional array of doublewords.
Specified as: a one-dimensional integer array of fullwords.
Returned as: a one-dimensional real array of doublewords.
Returned as: a one-dimensional array of fullword integers with twice the number of entries as dspace.
Note: |
mspace and dspace have the same starting location. |
The first element of iarray is the number of the set being processed.
Note: |
If you set the first element of iarray to 0, the solution will be declared integer feasible. Similarly, if the solution has been declared integer feasible (the first element of iarray was set to 0 on entry), you can reset the first element of iarray to force further branching |
The fifth element of iarray is the variable column number of the current variable.
Returned as: a one-dimensional array of integers.
The second element of rarray is the down pseudocost.
The third element of rarray is the up pseudocost for single variables. For sets
it is the reference row entry. When reason=4, it is the branch point for
special ordered sets.
Note: |
If you set the second or third element of rarray, or both, they will be used on the next branch |
Returned as: a one-dimensional array of doublewords.
Returned as: a one-dimensional integer array of fullwords.
Refer to "Understanding Mixed-Integer User Exit Subroutines" for an example of the use of EKKBRNU, and to "Mixed-Integer User Exit EKKBRNU" and "Mixed-Integer User Exit EKKBRNU2" for sample subroutines.
[
EKKBRNU |
EKKCUTU |
EKKEVNU |
EKKHEUU |
EKKNODU |
EKKSLVU ]
[ Top of Page |
Bottom of Page ]
EKKCHNU - Choose Node User Exit Subroutine
EKKCHNU is called from EKKMSLV, and it allows you to modify the choice of nodes during branch-and-bound processing.
Note: |
EKKCHNU can only be written in C or FORTRAN. EKKCHNU should not make any calls that could cause recursion errors. |
C | int ekkchnu(double *dspace, int * mspace, int * reason, int * iarray, double * rarray, int * userrtcd); |
FORTRAN | EKKCHNU(dspace,mspace,reason,iarray,rarray, userrtcd) |
Specified as: a one-dimensional real array of doublewords.
Specified as: a one-dimensional integer array of fullwords with twice the number of entries as dspace.
Note: |
mspace and dspace have the same starting location. |
If reason=1, the subroutine is being called before going through the list of active nodes.
If reason=2, the subroutine is being called as each active node is processed.
If reason=3, the subroutine is being called after going through the list of active nodes.
Specified as: a fullword integer.
The value of the first element of iarray depends on the value of reason.
Specified as: a one-dimensional array of full word integers.
The first element of rarray is the estimated degradation.
The second element of rarray is the solution value of the parent node.
The third element of rarray is the value of the continuous variable in
the parent/reference value where the set was split.
The fourth element of rarray is the sum of integer infeasibilities.
Specified as: a one-dimensional array of doublewords.
Specified as: a fullword integer.
Note: |
If reason does not equal 1, userrtcd is ignored |
Returned as: a one-dimensional real array of doublewords.
Returned as: a one-dimensional integer array of fullwords with twice the number of entries as dspace.
Note: |
mspace and dspace have the same starting location. |
Returned as: a one-dimensional array of integers.
Returned as: a fullword integer.
Note: |
If reason does not equal 1, userrtcd is ignored |
This subroutine allows you to change the choice of the node using any criteria you want (for example, some rule balancing the objective with the number of integer infeasibilities).
Refer to "Understanding Mixed-Integer User Exit Subroutines" for an example of the use of EKKCHNU, and to "Mixed-Integer User Exit EKKCHNU" for a sample subroutine.
[
EKKBRNU |
EKKCHNU |
EKKEVNU |
EKKHEUU |
EKKNODU |
EKKSLVU ]
[ Top of Page |
Bottom of Page ]
EKKCUTU - Cut Generation User Exit Subroutine
EKKCUTU allows you to generate "cuts", or additional constraint rows, to a problem matrix. It is called during EKKMPRE preprocessing, or during supernode processing in EKKMSLV.
Note: |
EKKCUTU can be written in FORTRAN or C EKKCUTU should not make any calls that could cause recursion errors. |
C | int ekkcutu(double *dspace, int * mstatbin, int * mtobin, int * mcadd, int * mradd, double * deadd, int * nbin, int * nadd, int * naddmax, int * nrow, int * nrowmax); |
FORTRAN | EKKCUTU(dspace,mstatbin,mtobin,mcadd,mradd, deadd, nbin, nadd, naddmax,nrow,nrowmax) |
Specified as: a one-dimensional real array of doublewords.
If the pth element of mstatbin = 0, the pth 0-1 variable has not been fixed.
If the pth element of mstatbin = -1, the pth 0-1 variable has been fixed down to 0.
If the pth element of mstatbin = 1, the pth 0-1 variable has been fixed up to 1.
Specified as: a one-dimensional integer array of length nbin.
If the pth entry in mtobin = 0, & nbsp; the pth variable is continuous.
If the pth entry in mtobin is < 0, the pth variable is an integer variable
that is not a 0-1 variable.
If the pth entry in mtobin is > 0, the pth variable is a 0-1 integer variable.
In this case, the pth entry in mtobin is the FORTRAN index into the
mstatbin array of the entry corresponding to the pth problem variable.
Specified as: a one-dimensional integer array of fullwords of length Inumcols.
Specified as: a one-dimensional integer array of fullwords of maximum length naddmax.
Specified as: a one-dimensional integer array of fullwords of maximum length naddmax.
Specified as: a one-dimensional real array of doublewords of maximum length naddmax.
Specified as: a fullword integer.
Specified as: a fullword integer.
Specified as: a fullword integer.
Specified as: a fullword integer.
Specified as: a fullword integer.
Specified as: a one-dimensional integer array of fullwords.
Specified as: a one-dimensional integer array of fullwords.
Specified as: a one-dimensional real array of doublewords.
Specified as: a fullword integer.
Specified as: a fullword integer.
iadd mcadd(iadd) mradd(iadd) deadd(iadd) 1003 5 206 1 0 1004 407 206 2 0 1005 -2 206 2 0
The entries in mcadd indicate that x is variable 5, y is variable 407, and that the cut being added is an upper bound.
The entries in mradd indicate that this cut is constraint 206 (the first available place for a cut as indicated by nrow).
The entries in deadd indicate that the cut is 1x, 2y, and that the value of the right-hand side is 2.
On exit, nadd is changed to 1005, and nrow is changed to 206.
You can also call EKKCGET, EKKCSET, EKKIGET, EKKISET, EKKRGET, and EKKRSET for specifying informational variables (such as Ilogfreq).
Refer to "Understanding Mixed-Integer User Exit Subroutines" for an example of the use of EKKCUTU, and to "Mixed-Integer User Exit EKKCUTU" for a sample subroutine.
[
EKKBRNU |
EKKCHNU |
EKKCUTU |
EKKHEUU |
EKKNODU |
EKKSLVU ]
[ Top of Page |
Bottom of Page ]
EKKEVNU - Evaluate a Node User Exit Subroutine
EKKEVNU is called from EKKSLVU, which in turn is called from EKKMSLV, to evaluate a node in branch-and-bound processing.
Note: |
EKKEVNU can only be written in C or FORTRAN. EKKEVNU should not make any calls that could cause recursion errors. |
C | int ekkevnu(double *dspace, int * mspace, int * userrtcd); |
FORTRAN | EKKEVNU(dspace,mspace,userrtcd) |
Specified as: a one-dimensional real array of doublewords.
Specified as: a one-dimensional integer array of fullwords with twice the number of entries as dspace.
Note: |
mspace and dspace have the same starting location. |
Specified as: a fullword integer.
Returned as: a one-dimensional real array of doublewords.
Returned as: a one-dimensional integer array of fullwords with twice the number of entries as dspace.
Note: |
mspace and dspace have the same starting location. |
If userrtcd=0, processing continues.
If userrtcd=3, EKKMSLV returns as if Imaxnodes had been reache.
If userrtcd is not 0 and not 3, this node is regarded as infeasible.
Returned as: a fullword integer.
SUBROUTINE EKKEVNU(DSPACE,MSPACE,JRTCOD) INCLUDE (OSLI) REAL*8 DSPACE(*) INTEGER*4 MSPACE(*) INTEGER*4 JRTCOD CALL EKKSSLV(JRTCOD,DSPACE,2,1) CALL EKKIGET(IRTCOD,DSPACE,OSLI,OSLILN) C Set the user return code to 1 if the optimal solution was not found IF(IPROBSTAT NE 0) JRTCOD = 1 RETURN END
Refer to "Understanding Mixed-Integer User Exit Subroutines" for an example of the use of EKKEVNU, and to "Mixed-Integer User Exit EKKEVNU" for a sample subroutine.
[
EKKBRNU |
EKKCHNU |
EKKCUTU |
EKKEVNU |
EKKNODU |
EKKSLVU ]
[ Top of Page |
Bottom of Page ]
EKKHEUU - Heuristic Fixing User Exit Subroutine
EKKHEUU gives you control over the fixing of variables to their upper or lower bounds. It can be used to override the default choice of variables in EKKMPRE or EKKMSLV for supernode processing. This information can be used to analyze and prune nodes from the problem.
Note: |
EKKHEUU can only be written in C or FORTRAN. EKKHEUU should not make any calls that could cause recursion errors. |
C | int ekkheuu(double *dspace, int * mstatbin, int * mtobin, int * mfix, int * nbin, int * nfix1, int * nfix2, int * jtype); |
FORTRAN | EKKHEUU(dspace,mstatbin,mtobin,mfix,nbin, nfix1, nfix2,jtype) |
Specified as: a one-dimensional real array of doublewords.
If the pth element of mstatbin = -1, the pth 0-1 variable has been fixed to 0.
If the pth element of mstatbin = 0, the pth 0-1 variable has not been fixed.
If the pth element of mstatbin = 1, the pth 0-1 variable has been fixed to 1.
Specified as: a one-dimensional integer array of length nbin.
If the pth entry in mtobin = 0, the pth variable is continuous.
If the pth entry in mtobin is < 0, the pth variable is an integer variable,
but not a 0-1 variable.
If the pth entry in mtobin is > 0, the pth variable is a 0-1 integer variable,
and the value of the entry is the FORTRAN index of the entry corresponding
to the pth problem variable in the mstatbin array.
Specified as: a one-dimensional integer array of fullwords of length specified in the control variable inumcols.
Specified as: a fullword integer.
Specified as: a fullword integer.
Specified as: a fullword integer.
If jtype=1, EKKHEUU is being called during EKKMPRE preprocessing.
If jtype=2, EKKHEUU is being called during supernode processing from EKKMSLV.
Specified as: a fullword integer.
Returned as: a one-dimensional real array of doublewords.
If for some p, the pth element of mfix = -x, the xth 0-1 variable is set to 0,
and if the pth element of mfix = x, the xth 0-1 variable is set to +1.
Returned as: a one-dimensional real array of doublewords, with a length of nfix1 + nfix2.
Returned as: a fullword integer.
Returned as: a fullword integer.
You can also call EKKCGET, EKKCSET, EKKIGET, EKKISET, EKKRGET, and EKKRSET for specifying informational variables (such as Ilogfreq).
Refer to "Understanding Mixed-Integer User Exit Subroutines" for an example of the use of EKKHEUU, and to "Mixed-Integer User Exit EKKXHEUU" for a sample subroutine.
[
EKKBRNU |
EKKCHNU |
EKKCUTU |
EKKEVNU |
EKKHEUU |
EKKSLVU ]
[ Top of Page |
Bottom of Page ]
EKKNODU - Node User Exit Subroutine
EKKNODU is called from EKKMSLV It allows you to save extra information about a node before creating a node, and to restore that information when the node is created.
Note: |
EKKNODU can only be written in C or FORTRAN. EKKNODU should not make any calls that could cause recursion errors. |
C | int ekknodu(double *dspace, int * mspace, int * reason, int * iarray, double * darray, int * muser, int * nuser); |
FORTRAN | EKKNODU(dspace,mspace,reason,iarray,darray, muser, nuser) |
Specified as: a one-dimensional real array of doublewords.
Specified as: a one-dimensional integer array of fullwords with twice the number of entries as dspace.
Note: |
dspace and mspace have the same starting location. |
If reason=1, the subroutine is being called before the node has been created (that is, after EKKMSLV has called EKKBRNU).
If reason=2, the subroutine is being called after the node has been chosen, but before it has been processed (that is, after EKKMSLV has called EKKCHNU).
Specified as: a fullword integer.
The first element of iarray identifies the branch type being processed, where:
Specified as: a one-dimensional array of fullword integers, of length at least 3.
Specified as: a one-dimensional array of doublewords of length 1.
If reason=1, the user-created muser is saved.
If reason=2, the previously saved muser is restored.
Specified as: a one-dimensional real array of length nuser.
Specified as: a fullword integer 0
nuser
Imiplength, where Imiplength is an integer control variable.
Returned as: a one-dimensional real array of doublewords.
Returned as: a one-dimensional array of fullword integers with twice the number of entries as dspace.
Note: |
mspace and dspace have the same starting location. |
Note: The following subroutines can be called from EKKNODU:
You can also call EKKCGET, EKKCSET, EKKIGET, EKKISET, EKKRGET, and EKKRSET for specifying informational variables such as Ilogfreq.
Refer to "Understanding Mixed-Integer User Exit Subroutines" for an example of the use of EKKNODU, and to "Mixed-Integer User Exit EKKNODU" for a sample subroutine.
[
EKKBRNU |
EKKCHNU |
EKKCUTU |
EKKEVNU |
EKKHEUU |
EKKNODU ]
[ Top of Page |
Bottom of Page ]
EKKSLVU - Branch User Exit Subroutine
EKKSLVU is called from EKKMSLV, and it allows you to override the default solver routine.
Note: |
EKKSLVU can only be written in C or FORTRAN. EKKSLVU should not make any calls that could cause recursion errors. |
C | int ekkslvu(double *dspace, int * mspace, double * dobjval, int * jrtcod, int * jtype); |
FORTRAN | EKKSLVU(dspace,mspace,dobjval,jrtcod,jtype) |
Specified as: a one-dimensional real array of doublewords.
Specified as: a one-dimensional array of fullword integers with twice the number of entries as dspace.
Note: |
mspace and dspace have the same starting location. |
If jtype=1, the subroutine is being called to solve the problem with
the integrality constraints relaxed.
If jtype=2, the subroutine is being called to solve a node of the branch and bound tree.
If jtype=3, the subroutine is being called to do a final solve of the optimal node.
Returned as: a one-dimensional real array of doublewords.
Returned as: a one-dimensional array of fullword integers with twice the number of entries as dspace.
Note: |
mspace and dspace have the same starting location. |
Returned as: a doubleword real.
Returned as: a fullword integer.
Refer to "Understanding Mixed-Integer User Exit Subroutines" for an example of the use of EKKSLVU, and to "Sample User Exit Subroutine EXSLVU" for a sample subroutine.
[
Top of Page |
EKKBRNU |
EKKCHNU |
EKKCUTU |
EKKEVNU |
EKKHEUU ]
[
EKKNODU |
EKKSLVU |
Previous Page |
Next Page |
Table of Contents ]