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).
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:
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.
read
command with an option to indicate the file type.
importModel()
method in the Concert Technology Library or use a copy routine from the Callable Library. Table 5.1 summarizes the available routines and their purpose.