ILOG CPLEX 11.0 User's Manual > Discrete Optimization > Solving Mixed Integer Programming Problems (MIP) > Using the MIP Solution

This section discusses the optimal solution or the best feasible solution, if no optimum has been proved. For information about managing the entire pool of feasible solutions, see Solution Pool: Generating and Keeping Multiple Solutions.

After you have solved a MIP, you will usually want to make use of the solution in some way. If you are interested only in the values of the variables at the optimum, then you can perform some simple steps to get that information:

After your program has placed the solution values into arrays in this way, it can print the values to the screen, write the values to a file, perform computations using the values, and so forth.

In the Interactive Optimizer, you can print the nonzero solution values to the screen with the command display solution variables. A copy of this information goes to the log file, named cplex.log by default. Thus one way to print your solution to a file is to temporarily rename the log file. For example, the following series of commands in the Interactive Optimizer will place the solution values of all variables whose values are not zero into a file named solution.asc:

set logfile solution.asc 
display solution variables
set logfile cplex.log

Further solution information, such as the optimal values of the slack variables for the constraints, can be written to a file in the SOL format. See the description of this file format in the ILOG CPLEX File Formats Reference Manual in SOL File Format: Solution Files.

For any of the MIP problem types, the following additional solution information is available in the Interactive Optimizer through options of the display command after optimization has produced a solution:

If you request other solution information than these items for a MIP, an error status will be issued. For example, in the Interactive Optimizer, you would get the following message:

Not available for mixed integer problems-
use CHANGE PROBLEM to change the problem type

Such post-solution information does not have the same meaning in a mixed integer program (MIP) as in a linear program (LP) because of the special nature of the integer variables in the MIP. The reduced costs, dual values, and sensitivity ranges give you information about the effect of making small changes in problem data so long as feasibility is maintained. Integer variables, however, lose feasibility if a small change is made in their value, so this post-solution information cannot be used to evaluate changes in problem data in the usual way of continuous models.

Integer variables often represent major structural decisions in a model, and many continuous variables of the model may be related to these major decisions. With that observation in mind, if you take the integer variable solution values as given, then you can obtain useful post-solution information, applying only to the continuous variables, in the usual way. This is the idea behind the so-called "fixed MIP" problem, a form of the MIP problem where all of the discrete variables are placed at values corresponding to the MIP solution, and thus it is a continuous problem though not strictly a relaxation of the MIP.

If you wish to access dual information in such a problem, first optimize your MILP problem to create the fixed MILP problem; then re-optimize it, like this: