[Coin-discuss] how to convert .MPS file to .LP in cplex

Matthew Saltzman mjs at clemson.edu
Tue Dec 23 11:32:52 EST 2008


On Sun, 2008-12-21 at 00:36 -0600, Chendong Li wrote:
> Hello.
> 
> How could I represent SOS2 in .lp file (to be solved in cplex 11.2)? 
> For example, to represent {d11, d12, d13} is SOS2, when I use 
> SOS2: d11, d12, d13
> cplex provides the warning: name "SOS2: d11, d12, d13" does not exist.
> Thank you! 
> 

Do you not have access to the manuals?  This is from the File Formats
section of the Reference Manual for CPLEX 10.2.

        This rule applies to the ILOG CPLEX MIP optimizer. To specify
        special ordered sets, use an SOS section, which is preceded by
        the SOS keyword. The SOS section should follow the Bounds,
        General, Binaries and Semi-Continuous sections. Special ordered
        sets of type 1 require that, of the variables in the set, one at
        most may be non-zero. Special ordered sets of type 2 require
        that at most two variables in the set may be non-zero, and if
        there are two nonzeros, they must be adjacent. Adjacency is
        defined by the weights, which must be unique within a set given
        to the variables. The sorted weights define the order of the
        special ordered set. For MIP branch and cut, the order is used
        to determine how the variables are branched upon. See the ILOG
        CPLEX User's Manual for more information. The set is specified
        by an optional set name followed by a colon and then either of
        the S1 or S2 keywords (specifying the type) followed by a double
        colon. The set member names are listed on this line or lines,
        with their weights. Variable names and weights are separated by
        a colon, for example:

                SOS 
                set1: S1::  x1:10  x2:13


> Have a great holiday!
> 
> Best,
> Chendong
> 
> 
> On Sun, Dec 14, 2008 at 12:13 AM, Matthew Saltzman <mjs at clemson.edu>
> wrote:
>         On Fri, 2008-12-12 at 14:05 -0600, Chendong Li wrote:
>         > Hi,
>         >
>         > What is the easiest way to convert .MPS file to .LP file in
>         CPLEX?
>         
>         
>         Read the file into CPLEX, then write it out in .lp format.
>         
>         See the read and write commands in the CPLEX docs.
>         
>         Note that certain .mps files need to be run through the
>         convert utility
>         provided with CPLEX before reading.  Particularly, if row,
>         column, or
>         section names contain blanks, this step is necessary.
>         
>         >
>         > Thanks,
>         >
>         >
>         > Chendong
>         > _______________________________________________

-- 
                Matthew Saltzman

Clemson University Math Sciences
mjs AT clemson DOT edu
http://www.math.clemson.edu/~mjs




More information about the Coin-discuss mailing list