Entering MIP Problems

You enter MIPs into ILOG CPLEX in the same way as LPs, as explained in Put Data in the Problem Object, with this additional consideration: you need to indicate which variables are binary, general integer, semi-continuous, and semi-integer, and which are contained in special ordered sets (SOS).

Concert Technology Library users can specify this information by passing a type value to the appropriate constructor when creating the variable. Use IloNumVar::Bool for binary variables, IloNumVar::Int for general integer variables, IloSemiContVar for semi-continuous variables, and IloSemiContVar::Int for semi-integer variables. SOS variables are created as instances of the class IloSOS1 or IloSOS2.

Callable Library users can specify this information through the CPXcopyctype() routine.

In the Interactive Optimizer, to indicate binary integers in the context of the enter command, type binaries on a separate line, followed by the designated binary variables. To indicate general integers, type generals on a separate line, followed by the designated general variables. To indicate semi-continuous variables, type semi-continuous on a separate line, followed by the designated variables. Semi-integer variables are indicated by being specified as both general integer and semi-continuous. The order of these three sections does not matter. To enter the general integer variable of the Sample: Stating a MIP Problem, you type this:

generals

x4

You may also read MIP data in from a formatted file, just as you do for linear programming problems. Chapter 8, More About Using ILOG CPLEX in this manual describes file formats briefly, and the ILOG CPLEX Reference Manual documents file formats, such as MPS, LP, and others.

Table 5.1 Callable Library Routines for Reading Formatted Files into MIP Applications

To read this format 
Use this Callable Library routine 
MPS, LP, or SAV file 
MST file containing MIP start values 
ORD file containing MIP priority order 
ORD file containing MIP branching directions 
SOS file 
MPS file containing SOS information 


Previous Page: Considering Preliminary Issues  Return to Top Next Page: Displaying MIP Problems