Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Can I force the solution in a heuristic callback?

    Posted Tue July 10, 2012 08:36 PM

    Originally posted by: NDDS_Silvina_Lucero


    Hello everyone,
    Hi, I have a problem running an optimization.
    In the first linear relaxation the objective value is the optimal but the variables are non integers so I'm trying to implement an heuristic callback that takes the relaxation and set it to integer values using 'setSolution(...)'. The problem is that the heuristic's objective value is a bit less than the actual objective value, for instance: actual objective value is 770.1406387500001 and heuristic objective value is 770.1406387499999.
    But I would really like to use the heuristic solution. Is there a way to force the solution in an heuristic callback? and how can I be sure that cplex is using the values that I set through 'setSolution(...)' ?
    Thanks,

    Anivlis
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Can I force the solution in a heuristic callback?

    Posted Wed July 11, 2012 03:50 AM

    Originally posted by: SystemAdmin


    There is an overload of the setSolution() function that takes a last argument 'obj' (see the reference documentation here: C++, Java). This argument allows you to specify the objective function value of the solution you are setting. If you use this overload then CPLEX uses your solution exactly like you passed it and with the specified objective function value. This should do exactly what you want?
    You should be sure about what you are doing here since providing incorrect values here may result in wrong results.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Can I force the solution in a heuristic callback?

    Posted Wed July 11, 2012 06:47 PM

    Originally posted by: NDDS_Silvina_Lucero


    Thanks Daniel.

    I am using setSolution with the argument obj. I am setting the optimal solution but cplex doesn't stop. I want to finishing cplex after set solution because I know that is the optimal. I don't know what is the problem.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Can I force the solution in a heuristic callback?

    Posted Thu July 12, 2012 02:12 AM

    Originally posted by: SystemAdmin


    What is the gap after your solution was injected? Could you show us the log file output for your solve (and maybe indicate at which point your solution is injected).
    If nothing else helps you can call abort() in a callback to stop the optimization.
    #CPLEXOptimizers
    #DecisionOptimization