问题
I want to retrieve the value of Node and NodeID in CPLEX through callbacks in c++. I use getNodeid() in BranchCallback but it wasn't true.Because the value of this function is different from the value of NodeID in logfile.
回答1:
The value returned by getNodeId()
is different from what is displayed in the NodeID
column in the log.
getNodeId()
returns the sequence number of a node. That number is a unique id that is created/set when the node is created.NodeID
in the log returns the id of a node. The id is assigned when the node is processed. In a single-threaded run the root node has id 0, the next node processed has id 1, the next node has id 2 etc.
So the two values are unrelated.
来源:https://stackoverflow.com/questions/56997300/what-is-getnodeid-in-branchcallback