12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Declaring SOS Members<strong>ILOG</strong> <strong>CPLEX</strong> offers you several ways to declare an SOS in a problem:◆◆◆Use features of Concert Technology.●●●In the C++ API, use the classes IloSOS1, IloSOS2, or the methodsIloCplex::addSOS1 or addSOS2.In the Java API, use the interfaces IloSOS1 or IloSOS2, or use the methodsIloCplex.addSOS1 or addSOS2.In the .NET API, use the interfaces ISOS1 or ISOS2, or use the methodsCplexModeler.AddSOS1 or CplexModeler.AddSOS2.Use routines from the Callable Library, such as CPXaddsos or CPXcopysos.Use SOS declarations within an LP file (that is, one in LP format with the file extension.lp). Conventions for declaring SOS information in LP files are documented in the<strong>ILOG</strong> <strong>CPLEX</strong> File Format Reference <strong>Manual</strong>.◆ Use SOS declarations within an MPS file (that is, one in MPS format with the fileextension .mps). If you already have MPS files with SOS information, you may preferthis option, but keep in mind that this way of declaring an SOS supports the fewestnumber of digits of precision in the data. Conventions for declaring SOS information inMPS files are documented in the <strong>ILOG</strong> <strong>CPLEX</strong> File Format Reference <strong>Manual</strong>.Members of an SOS should be given unique weights that in turn define the order of thevariables in the set. (These unique weights are also called reference row values.) Each ofthose ways of declaring SOS members allows you to specify weights.The SOS example, Example: SOS Type 1 for Sizing a Warehouse on page 330, used thecoefficients of the warehouse capacity constraint to assign weights.Example: Using SOS and PriorityThese examples illustrate how to use SOS and priority orders.ilomipex3.cppThis example derives from ilomipex1.cpp. The differences between that simpler MIPexample and this one are:◆The problem solved is slightly different so the output is interesting. The actual SOS andpriority order that the example implements are arbitrary; they do not necessarilyrepresent good data for this problem.<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 331

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!