Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Solver failure status 1

    Posted 01/08/12 08:30 AM

    Originally posted by: anahana


    Hi,

    I'm using the class IloDispatcherTabuSearch to solve a number of VRP problems, the method does not improve any solution presented to it as Solver fails to find a solution using the goal passed to it. I used the method getFailureStatus() to print out the failure, and I got a 1, which I suppose corresponds to searchFailedNormally?

    I tried this for many instances and many combinations of the tenure size and the nhood that TS uses, and I always get the same result; Solver fails to find any solution using the goal. Any idea why?

    Here's the TS code just in case (the constructor for Solver is implemented exactly the same as in the examples presented in the documentation):

    double RoutingSolver::improveWithTabu(IloInt _tenureSize, IloNHood _nhood)
    {
    //declarations
    IloNum timeLimit = 5; //time in seconds
    IloNum BSF = 0;

    IloRoutingSolution rsol = _solution.makeClone(_env);
    IloRoutingSolution best = _solution.makeClone(_env);
    IloDispatcherTabuSearch dts(_env, _tenureSize);
    IloSearchSelector sel = IloMinimizeVar(_env, _cost);
    IloGoal move = IloSingleMove(_env, rsol, _nhood, dts, sel, _instantiateCost);
    move = move && IloStoreBestSolution(_env, best);

    //start timer
    IloTimer timer(_env);
    timer.start();

    //optimization loop
    while(timer.getTime() <= timeLimit)
    {
    if(_solver.solve(move))
    {
    IloRestoreSolution(_env, best);
    cout << best.getObjectiveValue() << endl;
    }
    else
    {
    cout << _solver.getFailureStatus() << endl;
    if(dts.complete())
    break;
    }
    }

    //store solution
    IloGoal restoreSolution = IloRestoreSolution(_env, best) && _instantiateCost;
    _solver.solve(restoreSolution);

    //copy best to BSF
    BSF = best.getObjectiveValue();

    rsol.end();
    best.end();
    dts.end();

    return BSF;
    }
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Solver failure status 1

    Posted 01/09/12 03:20 PM

    Originally posted by: SystemAdmin


    Hi anahana,

    Just to be sure, can you get a first solution before moving to the improve pass with Tabu?
    When do you get the error "Solver fails to find any solution using he goal"?

    Cheers,

    Amelie.
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Solver failure status 1

    Posted 01/09/12 05:25 PM

    Originally posted by: anahana


    Hi Amelie,

    Yes, I do get a first solution, then I move to improve with TS. I get the failure exactly at the "cout << _solver.getFailureStatus() << endl;" statement is. Which outputs the value of 1, which I assume corresponds to: "searchFailedNormally". Any thoughts?

    Regards,
    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Solver failure status 1

    Posted 01/10/12 04:36 AM

    Originally posted by: SystemAdmin


    Another check, where does this message "Solver fails to find any solution using the goal" come from?
    Is it a message you send or is it send by the CP libraries?
    #CPOptimizer
    #DecisionOptimization


  • 5.  Re: Solver failure status 1

    Posted 01/10/12 06:57 AM

    Originally posted by: anahana


    I do not get such a message, this was a statement that I was writing in my question. The only thing I get is the failure status number, which is 1.
    #CPOptimizer
    #DecisionOptimization


  • 6.  Re: Solver failure status 1

    Posted 01/10/12 07:43 AM

    Originally posted by: anahana


    Not sure if this helps, but I just noticed something, first let me explain the context:

    Since I'm trying to solve multiple instances of the VRP, I'm creating multiple instances of RoutingModel and RoutingSolver within a for-loop. If I also create a new instance for IloEnv for each of the RoutingModel and RoutingSolver instances within that loop, and call TS, it fails to improve any solution; however, if I do not create instances of IloEnv, TS finds better solutions and works just fine. I'm not sure why creating instances of IloEnv affects TS.

    Regards,
    #CPOptimizer
    #DecisionOptimization