User cut: current node objective

41 views
Skip to the first unread message

陈伟坤

unread,
19 Oct 2016, 09:11:2119/10/2016
to Gurobi Optimization
Dear all, 

       Recently, I want to add some special cuts by callback method. But I don't want to 
add user cut at every node. Instead, whether to add user cut or not depends on the node's
LP relaxation's objective. Also, I can use getNodeRel and then use the 
objective to calculate the current node's objective, but it costs much time. Can I get the current node's 
LP relaxation's objective directly by API?

       Thank you very much.

Bests, 
Weikun

Kostja Siefen

unread,
19 Oct 2016, 09:33:1619/10/2016
to Gurobi Optimization
Hi Weikun,

You can add (globally valid) user cuts at nodes in a MIPNODE callback using addCut() and parameter PreCrush=1. Please see the documentation for further details and take a look at the callback example for your API.
getNodeRel() is the correct function to retrieve the node solution if it is available (you need to check MIPNODE_STATUS which has to be OPTIMAL).
Calculating the objective function value needs to be done by yourself but this should be very quick operation.

Kostja
Reply all
Reply to author
Forward
0 new messages