Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  set variables (dvar's) in OPL with CP Optimizer?

    Posted 12/01/10 01:21 AM

    Originally posted by: AshishS


    Hi,

    This question must have a simple answer that I can't seem to extract from the documentation of CPLEX Optimization Studio 12.2:

    Does OPL (with CP Optimizer as the solver) support decision variables that are sets? Something akin to IloIntSetVar in the old CP Solver's Concert library.

    Thanks in advance!

    Ashish
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: set variables (dvar's) in OPL with CP Optimizer?

    Posted 12/01/10 05:18 AM
    Hi

    OPL does not support IloIntSetVar directly but you could use binary decision variables instead.
    Let me give you an example.
    
    using CP;   
    {
    
    int
    } possibleSet=
    {1,2,6
    };   dvar 
    
    boolean isPresent[possibleSet];   subject to 
    { isPresent[1]==
    
    true; 
    //means 1 is in the set isPresent[2]==
    
    false; 
    //means 2 is not in the set  
    }
    


    Alex
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: set variables (dvar's) in OPL with CP Optimizer?

    Posted 12/01/10 12:26 PM

    Originally posted by: AshishS


    Thanks, Alex, for the prompt reply! What you suggest is a neat idea -- using an arbitrary possibleSet to index into a dvar boolean array. Presumably, one would then model set operations such as union, intersection, subset, etc., explicitly by "flattening out" the dvar boolean array representation of the set (e.g., A == B union C would be written as: forall (i in possibleSet) a[i] == b[i] || c[i]).

    However, this won't quite serve my current need, I think, as the possible set I have is very large (1..10000). This means that every single set constraint I want to model will flatten out to 10000 or more individual constraints, which is what I wanted to avoid in the first place.

    The other issue is that for many set constraints, it is known that propagating them as an actual set (with, say, bounds consistency) filters much more than propagating their decomposed/flattened version.

    Hopefully there will be a better solution for set variables in OPL.

    Ashish
    #CPOptimizer
    #DecisionOptimization