Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CP Optimizer : How to get all possible solution

    Posted 01/10/19 03:23 AM

    Originally posted by: ORA17


    Hi,

    I am new in IBM CP Optimizer. I have a set of constraints. I need all possible solutions satisfying given set of constraints. I am working with .NET Concert technology.

     

    How can I achieve all possible solutions by CP Optimizer satisfying set of constraints?

    Is CP optimizer fast enough to produce 1 or more billion solutions? 


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CP Optimizer : How to get all possible solution



  • 3.  Re: CP Optimizer : How to get all possible solution

    Posted 01/10/19 10:16 PM

    Originally posted by: ORA17


    Thanks AlexFleischer for your prompt reply.

     

    Can I get all solutions at a time without iteration.

     

    I want to avoid this:

    while(cp.Next())

    {

    Post process

    }

     

    Because it's getting too slow when we have large number of solutions in the pool e.g. billions solution.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: CP Optimizer : How to get all possible solution

    Posted 01/11/19 06:01 AM

    Hi,

    if you use Linear Programming you could use solution pools : https://www.ibm.com/developerworks/community/forums/html/topic?id=d8d12e36-3150-4e1c-a956-d707d17f274c&ps=25

    Or if you do not want loops you could write something like

    using CP;

    int nbMax=20;

    dvar int x[1..nbMax] in 0..2;
    dvar int y[1..nbMax] in 0..2;
    dvar int+ nb in 0..nbMax;

    maximize nb;

    subject to
    {
      forall(i in 1..nbMax-1)
         (i<=nb-1) => ((x[i]<x[i+1]) || (x[i]==x[i+1]) && (y[i]<y[i+1]))  ;

      forall(i in 1..nbMax) (i<=nb) => x[i]+y[i]<=3;
    }

    range r=1..nb;

    execute
    {
       for(var i in r) writeln(x[i]," ",y[i]);
    }

    which gives

    0 0
    0 1
    0 2
    1 0
    1 1
    1 2
    2 0
    2 1

    I do not recommend that

    regards

     

    https://www.linkedin.com/pulse/what-optimization-how-can-help-you-do-more-less-zoo-buses-fleischer/

     


    #CPLEXOptimizers
    #DecisionOptimization