Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Different solution of a CP model

    Posted 09/10/15 05:30 AM

    Originally posted by: Mintch Zulitch


    Hi everyone,

    I've developed a CPLEX model for the magic square problem "USING CP".

    As we know, for example for N=4, we might have 3 or 4 matrices that are magic squares. (Note that parameter N is the dimension of a square matrix)

    Now, the question is how is it possible to obtain all possible solutions when I run the model?

    pp: model in the attachment


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Different solution of a CP model

    Posted 09/10/15 06:49 PM

    Hi,

    let me give you an example:

    using CP;

     dvar int x in 0..10;
     subject to
     {
     x<=5;
     }
     
     execute
     {
     writeln(x);
     }

     main {
      cp.param.SearchType=24;
      thisOplModel.generate();
      cp.startNewSearch();

      var k=1;
      while (cp.next()) {
          writeln(k,"th solution");
          thisOplModel.postProcess();
          k++;             
      };
      cp.endSearch();
     
    }

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Different solution of a CP model

    Posted 09/11/15 01:29 AM

    Originally posted by: Mintch Zulitch


    very thanks


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Different solution of a CP model

    Posted 09/28/15 05:44 AM

    Originally posted by: Mintch Zulitch


    Hi,
    thanks for your help.
    This piece of code generates about 4000 matrices which 1000 matrices are original and the others are the same as 1000 and they are repetitive.
    So, how can I publish only original ones not the repetitive solutions.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Different solution of a CP model

    Posted 09/28/15 06:14 AM

    Hi,

    after

    cp.param.SearchType=24;

    you should write

    cp.param.workers=1;

    regards


     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer