Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Restart search engine

    Posted 06/21/17 10:04 AM

    Originally posted by: ahungsky


    Hi all,

     

    Does it exist some way to manually restart a search engine in CP Optimizer? I am looking for something like the obsolete function IloSolver::restartSearch(). Why this function is not used anymore?

     

    Thank you for your answer.

    A Hungsky


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Restart search engine

    Posted 06/22/17 09:21 AM

    Originally posted by: ol


    Hello,
    the API of CP Optimizer and the one of ILOG Solver are different. 
    Giving the user an access to a low-level API (like IloSolver::restartSearch() in ILOG Solver) is not compatible with both a quick evolution of a product, and a higher level API as in CP Optimizer.
    I am curious to understand your exact need. In general, storing solutions and setting starting points for the search are sufficient for most advanced usages.
    Do you define your own search goals or do you use automatic search?

    ol


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Restart search engine

    Posted 06/26/17 04:03 AM

    Originally posted by: ahungsky


    Hello Olivier,

    Thank you for your answer. I have my own search goals. My algorithm works as follows: Find a next solution. Check, if parameters are changed, start the dfs search from the root node. I would be appriciate for any sugestions.

    Best regards

    A Hungsky


    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Restart search engine

    Posted 06/26/17 06:18 AM

    Originally posted by: ol


    Hello,

    I anm not sure of what you called parameters, they modify the model, don't they? You could have a loop like this:

    parametersHaveChanged =True;
    while (parametersHaveChanged ) {
      cp(model);
      changesInParameters = False;
      cp.startNewSearch(goal);
      while (!parametersHaveChanged && cp.next()) {
        ... get the current solution
        ... parametersHaveChanged = getChanges() //modify model if a "parameter" changes
      }
      cp.end();
    }
    

    Regards,

    ol


    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: Restart search engine

    Posted 06/26/17 07:52 AM

    Originally posted by: ahungsky


    That is what I was looking for. Thank you.

    A Hungsky


    #CPOptimizer
    #DecisionOptimization


  • 6.  Re: Restart search engine

    Posted 06/26/17 11:06 AM

    Originally posted by: ahungsky


    I am sorry. It is not solved yet. I have found out the problem in the code. Before searching for solutions, I reduce the variables domain in order to make the search space smaller (as far as I know, in CP Optimizer I cannot modify the variable directly, therefore I use cp.propagate(MyConstraint)). But after calling the function IloCP::startNewSearch(goal), it reset the variables to the initial domain. Is there a way how to reduce the variable domain one time only before startNewSearch()?


    #CPOptimizer
    #DecisionOptimization


  • 7.  Re: Restart search engine

    Posted 06/27/17 04:42 AM

    Originally posted by: ol


    Hello,

    1/ the propagation between 2 different models cannot be shared, if you change the model with your parameters, the propagation on the model before the change may be invalid for the model after the change since a constraint that may have reduced some domains may have been removed.

    You could share propagation only if you can only add constraints by your parameters modification, in this case, you should estimate if the gain in performance is worth the complexity of writing a goal to handle the parameters.  

    2/ you do not need to call the function propagate() before startNewSearch(). This is already done at the root node of the search, and then this is maintained incrementally during the search. 

    Furthermore, propagate(constraint) do not add the constraint to the model, and do not keep the domain reductions. You need to call model.add(constraint).

    3/ You said "in CP Optimizer I cannot modify the variable directly"

    You can change the domain of the variable when declaring it.

    Or you can add a constraint to the model: model.add(x <= 5);

    But propagate(x<=5); will NOT do what you mean, it will not constraint x <=5 for the following search.

    Regards, 

    ol

     


    #CPOptimizer
    #DecisionOptimization