Determining Problem Type and Variable Type in MIPs

When you enter a problem in the Interactive Optimizer, ILOG CPLEX determines the problem type from the available information. If there are no binary variables, no general variables, and no SOS, ILOG CPLEX treats the problem type as LP. Before any variables can be changed to binary or general type (that is, restricted to integer values), the problem type must be changed to MIP. Reading an SOS description automatically changes the problem type to MIP.

Changing Problem Type

If you are licensed to use the ILOG CPLEX Mixed Integer Optimizer, then you will see additional change options in the Interactive Optimizer. To change the problem type to MIP, use the command change problem mip.

The command change problem shows you the type of the current problem and prompts you to indicate the type of problem you would like it to be. In other words, with this command, you can change the current MIP problem to its continuous relaxation or to its fixed MIP. Its continuous relaxation is a linear program in which all its variables are continuous (rather than restricted to integer values). Its fixed MIP is the linear program in which the integer variables are fixed at the values they attained in the best integer solution.

Since a continuous relaxation of a MIP and the fixed MIP are both linear programs, all the features of the ILOG CPLEX Interactive Optimizer are available to them, including information about the quality of solutions and about sensitivity analysis. The original variable bounds and their types are restored when the problem type is changed back to MIP.

Changing Variable Type

The command change type adds (or removes) the restriction on a variable that it must be an integer. In the Interactive Optimizer, when you enter the command change type, the system prompts you to enter the variable that you want to change, and then it prompts you to enter the type (c for continuous, b for binary, i for general integer, s for semi-continuous, n for semi-integer).

You can change a variable to binary even if its bounds are not 0 (zero) and 1 (one). However, in such a case, the system issues a warning message at optimization, and the optimization may terminate with a bound violation.

Consequently, in the example that we mentioned (see Sample: Stating a MIP Problem), if we want to make x4 a binary variable, we should first change the bounds on x4 to 0 and 1; then we can safely change its type to binary.

If you change a variable's type to be semi-continuous or semi-integer, make sure to create both a lower bound and an upper bound for it. These variable types specify that at an optimal solution the value for the variable must be either exactly zero or else be between the lower and upper bounds (and further subject to the restriction that the value be an integer, in the case of semi-integer variables).

By the way, if its type has been changed to MIP, a problem may be a mixed integer problem, even if all its variables are continuous.

Modifying Relaxed and Fixed Problems

The change command in the Interactive Optimizer does not apply to the continuous relaxation of a MIP; nor does it apply to the fixed MIP. If you want to interactively modify and re-solve a relaxed or fixed version of a MIP, then you should follow these steps:

  1. Write out the relaxed or fixed version to a file.
  2. Read back in the relaxed or fixed version.

If you simply change the problem type to LP, all the MIP-related information will be discarded. After this modification, you will not be able to restore the original MIP problem.


Previous Page: Displaying MIP Problems  Return to Top Next Page: Using the Mixed Integer Optimizer