Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  SOS for Special Ordered Sets(SOS) constrains

    Posted 07/14/16 02:41 AM

    Originally posted by: ColumbiaSystemsandSecurityLabs


    Hi,

    I am trying to model a problem using a SOS1 constraint and encounter a number of  problems: 

    First, I can't understand what the weights in the cplex().SOS.add() method stand for. When I am trying to simply set the weights into the same value (1.0) I get an error saying that the weight should not be equal. 

     

    The second problem I am having, even If I set the weights to some random value, is that I am not able to enforce the variables in the SOS set to have positive values-- even after adding the corresponding constraints into the problem (i.e. sos_var >= 0). 

     

    Finally, a more general question: I am using the SOS constraints in order to model a simple piecewise linear function. The function is passing through the origin so SOS1 is sufficient. Is SOS the recommended (most efficient)  way of handling such constraints or is there some more efficient, alternative approach?

     

    Thanks! 

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: SOS for Special Ordered Sets(SOS) constrains

    Posted 07/14/16 06:03 AM

    Maybe the reference documentation for SOS1 can help you understand what the weights are. The weights define the order of the variables in the set (that is why they must be different for each variable).

    I am not clear what you mean by you "cannot enforce the variables to have positive values". Are you saying that CPLEX returns solutions with negative values for variables that have a lower bound of 0? Are these values really negative or are they just roundoff and are values like -eps (where eps is a very small value)?

    There is direct support for piecewise linear functions. You can find more information in the reference documentation. What API are you using (Java, C++, OPL)?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: SOS for Special Ordered Sets(SOS) constrains

    Posted 07/14/16 11:33 AM

    Originally posted by: ColumbiaSystemsandSecurityLabs


     

    The values look like -eps roundoffs. Based on what you are saying, I assume this roundoff -- which makes the value look negative --  is happening to enforce the order specified by the weights, right?

     

    We are using python. Is there direct support in the python API for piecewise linear function? Can you point us to the reference documentation?

     

     

    thanks!

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: SOS for Special Ordered Sets(SOS) constrains

    Posted 07/25/16 01:12 AM

    The round-off is not to enforce weights. The round-off is just numerical round-off that you get from finite precision arithmetic.

    There is no direct support for PWL in Python (yet), sorry. PWL support currently only exists for C++, Java, C#.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: SOS for Special Ordered Sets(SOS) constrains

    Posted 02/24/17 03:24 PM

    CPLEX 12.7 has been available for some time now, but in case someone finds this thread, it's worth noting that PWL support is now available for C and Python too.  See the release notes here.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer