Declaring SOS members
Describes routines and methods for declaring a special ordered set.
CPLEX 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.
In the Java API, use the interfaces IloSOS1 or IloSOS2 , or use the methods IloCplex.addSOS1 or addSOS2.
In the .NET API, use the interfaces ISOS1 or ISOS2 , or use the methods CplexModeler.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 CPLEX File Format Reference Manual.
Use SOS declarations within an MPS file (that is, one in MPS format with the file extension .mps ). If you already have MPS files with SOS information, you may prefer this option, but keep in mind that this way of declaring an SOS supports the fewest number of digits of precision in the data. Conventions for declaring SOS information in MPS files are documented in the CPLEX File Format Reference Manual.
Members of an SOS should be given unique weights that in turn define the order of the variables in the set. (These unique weights are also called reference row values.) Each of those ways of declaring SOS members allows you to specify weights.
The SOS example, Example: SOS Type 1 for sizing a warehouse, used the coefficients of the warehouse capacity constraint to assign weights.