I think the two threads you mentioned are good. Maybe you just got confused because they handle two different questions:
-
Get the variable that was branched upon to create a particular node. This can be done using a node callback and using that callback's get_branch_variable() function.
-
Get all the branchings that lead up to the current node (i.e. include branching variables for ancestor nodes as well). This can only be done using a branch callback and node user data.
I guess that what you want to do is some variation of 2. Note that the node callback is really limited in what you can do from that callback. Other than inspecting all the open nodes, the only thing you can do is to select the next node to process.
#CPLEXOptimizers#DecisionOptimization