Decision Optimization

Decision Optimization

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


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

How to access objective function value of a candidate integer solution in a lazy callback?

  • 1.  How to access objective function value of a candidate integer solution in a lazy callback?

    Posted 06/15/18 01:47 AM

    Originally posted by: UserCplex


    Hello,

    In a lazy callback at some MIP node, CPLEX obtains a candidate integer feasible solution on applying some heuristic. This integer feasible objective function value is different from that node's LP relaxation solution value.

    I am able to query the variable values associated with this candidate integer feasible solution in the lazy callback via 

     

    status = CPXgetcallbacknodex(env, cbdata, wherefrom, cutinfo->x, 0, cutinfo->numcols - 1);

     

    However, I am currently looping through cutinfo->x currently to figure out the objective function value related to this candidate integer solution. Is there a cplex function that provides this value directly?

     

    I have looked at the following threads:

    https://www.ibm.com/developerworks/community/forums/html/topic?id=a82ef24b-161d-4704-a4f9-74084a0d5999

    but 

    status = CPXgetcallbackinfo(env, cbdata, wherefrom, CPX_CALLBACK_INFO_BEST_INTEGER, &cbackobj);

    returns garbage values in double cbackobj;

     

    status = CPXgetcallbacknodeinfo(env, cbdata, wherefrom, 0, CPX_CALLBACK_INFO_NODE_OBJVAL, &cbackobj);

    returns the LP relaxed solution objective function value at the current node, and not that of the candidate integer feasible solution.

     

    status = CPXgetcallbacknodeinfo(env, cbdata, wherefrom, 0, CPX_CALLBACK_INFO_NODE_ESTIMATE, &cbackobj);

    returns garbage values in cbackobj.

     

    Thanks in advance.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How to access objective function value of a candidate integer solution in a lazy callback?

    Posted 06/15/18 01:54 AM

    Originally posted by: UserCplex


    Just figured it out.

    It is:

     

    status = CPXgetcallbacknodeobjval(env, cbdata, wherefrom, &cbackobj);


    #CPLEXOptimizers
    #DecisionOptimization