Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Adding/removing constraints in CP model

    Posted 09/16/12 11:22 PM

    Originally posted by: Vgoel77


    I am implementing an iterative search algorithm where I repeatedly solve the same CP model. At each iteration, I might add a new constraint that ensures that the solve will generate a better solution than the one I already have. The solve is run with specified branch limits, so some times it may not be able to generate any solution. In that case, I will either a) remove the constraint that I added in the previous iteration and replace it with a weaker constraint, or b) increase the branch limit.

    I am wondering if I should/need to re-extract my model at every iteration. More specifically, I am wondering if I do not re-extract the model at every iteration, is CPO able to re-use some of the information it gathered during the solve in iteration k to improve its performance during the solve at iteration k+1 (since the models are either exactly the same with a larger branch limit; or the models differ by a couple of constraints only.

    The (pseudo-)code structure looks like this

    
    
    
    while (termination condition not met) 
    { cp.extract(model); foundSol = cp.solve();   
    
    if(foundSol) 
    { model.add(
    /* new tight constraint */); 
    } 
    
    else 
    { 
    
    if( condition ) 
    { 
    /* increase branch limit */ 
    } 
    
    else 
    { model.remove(
    /* constraint added at previous iteration */); model.add(
    /* new weak constraint */); 
    } 
    } 
    }
    


    Your feedback is appreciated
    Regards
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Adding/removing constraints in CP model

    Posted 09/17/12 03:41 AM

    Originally posted by: SystemAdmin


    If the model at an iteration i is close to the model at iteration i-1, it can be beneficial to restart from the solution found at i-1. Solution can be obtained by using the IloCP::storeSolution function and it can be used at iteration i with the IloCP::setStartingPoint function. When a staring solution is provided, the embedded search will first try to search "around" the given starting solution before progressively moving to a more regular search.

    Another remark : you do not need to call the extract() function. Changes in the model at automatically reflected in the engine when you call solve() or startNewSearch() but any change in the model will involve a re-extraction of it in any case.

    Regards,

    Philippe
    #CPOptimizer
    #DecisionOptimization