Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Strange behavior when adding mipstart and using solve callback

  • 1.  Strange behavior when adding mipstart and using solve callback

    Posted 04/01/15 08:28 AM

    Originally posted by: rocarvaj


    Dear all,
    I would like your opinion on a very strange behavior when adding a mipstart to CPLEX. I'm attaching a piece of code that I think isolates the problem. I will appreciate it if someone could see if she can replicate this.
     
    The code receives two arguments: A solution file (in this case solution.sol) and an instance file (pre_mip.lp). If you run the code, it reads the solution from the file and adds it as a mipstart. CPLEX says that the solution is feasible and it goes ahead and optimizes.
     
    Now, if you uncomment line 102 in main.cpp, a very simple solve callback is added. This solve callback just gets the seqnum of the current node (using CPXgetcallbacknodeinfo) and prints it. But when I run the code, CPLEX gives me a 1200 error (Index is outside range of valid values) coming from the CPXgetcallbacknodeinfo call.
     
    Furthermore, if you comment the LoadSolution function (which adds the mipstart), the solve callbacks works OK.
     
    I've seen the same behavior with both CPLEX 12.5 and 12.6.1.
     
    Thanks in advance!
    Rodolfo

    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Strange behavior when adding mipstart and using solve callback

    Posted 04/17/15 03:07 AM

    I reproduced your problem here. The issue is that the solve callback is invoked while processing the MIP start. At that point the MIP solve has not really started, hence there is no node setup yet. That is why there even is no node with index 0.

    A workaround would be to just ignore error 1200 when querying the sequence number and immediately return from the solve callback.


    #CPLEXOptimizers
    #DecisionOptimization