ILOG CPLEX 11.0 File Formats > > ILOG CPLEX File Formats > SOL File Format: Solution Files

ILOG CPLEX enables you to read and write solution files, formatted in XML, for all problem types, for all application programming interfaces (APIs). These solution files, known as SOL files, carry the file extension .sol. The XML solution file format makes it possible for you to display and view these solution files in most browsers as well as to pass the solution to XML-aware applications. ILOG CPLEX also provides a stylesheet and schema in yourCplexinstallation/include/ilcplex to facilitate your use of this format in your applications.

ILOG CPLEX can also read SOL files as an advanced start. SOL files contain basis statuses, if they are available, and solution values. The basis statuses can be used for advanced starts with simplex optimizers; the solution values can be used for a crossover from a barrier solution or as a MIP start from a mixed integer solution. A mixed integer solution may be from a conventional MIP optimization or from a member of the solution pool.

SOL files differ from MST files when used as MIP starts: SOL files contain values for all variables, whereas MST files contain values only for variables that are needed to reconstruct a MIP solution (which in most cases means only the integer variables).

SOL files also carry an optional name attribute, useful when the problem has names. SOL files also include an index, corresponding to the constraint index or variable index of the problem.

The SOL header gives information about the status of the solution. For example, the optimization status appears as a string and the numeric value of the ILOG CPLEX symbolic constant.

The SOL quality gives information about the quality of the solution. For example, the maximum primal infeasibility, the values of the tolerance parameters in effect during the optimization, and other quality information appears in this part.

There are, of course, methods and routines for reading and writing SOL files.

Here is an example of a SOL file.

<?xml version = "1.0" standalone="yes"?>
<?xml-stylesheet 
href="https://www.ilog.com/products/cplex/xmlv1.0/solution.xsl" 
type="text/xsl"?>
<CPLEXSolution version="1.1">
 <header
   problemName="../../../examples/data/mexample.mps"
   solutionName="incumbent"
   solutionIndex="-1"
   objectiveValue="-122.5"
   solutionTypeValue="3"
   solutionTypeString="primal"
   solutionStatusValue="101"
   solutionStatusString="integer optimal solution"
   MIPNodes="0"
   MIPIterations="3"/>
 <quality
   epInt="1e-05"
   epRHS="1e-06"
   maxIntInfeas="0"
   maxPrimalInfeas="0"
   maxX="40"
   maxSlack="2"/>
 <linearConstraints>
  <constraint name="c1" index="0" slack="0"/>
  <constraint name="c2" index="1" slack="2"/>
  <constraint name="c3" index="2" slack="0"/>
 </linearConstraints>
 <variables>
  <variable name="x1" index="0" value="40"/>
  <variable name="x2" index="1" value="10.5"/>
  <variable name="x3" index="2" value="19.5"/>
  <variable name="x4" index="3" value="3"/>
 </variables>
</CPLEXSolution>