Originally posted by: MarekGrzes
Hello,
I am looking into class MyBranch in the above file. I would like to use something similar to prune nodes. Is BranchCallback a good place to do pruning of nodes? In my case variables are 0-1, and in some cases one or two values should be pruned, i.e., both var=0 and var=1 should be pruned, whereas sometimes one or two of them should be considered.
What I concluded from the analysis of that example, is that if, e.g., var=0 should be pruned, then I can just skip makeBranch with IloCplex.BranchDirection.Down. If both values should be pruned I simply do not execute makeBranch at all. Is that correct?
The above would be good for binary variables only because having multiple values I may not be able to determince whether going IloCplex.BranchDirection.Down will have any valid variable/value pairs on integer variables. Is there any way to prune specific variable/value pairs? That is, let's say that I would like to know that the next assignment done by cplex is a specific variable/value pair, and I want to check that particular pair whether it should be rejected or not (I would like to work on one pait in the callback). This is imprtant for me, because my check is time consuming. Will I need another callback to do that? Having only binary variables, I can use the method that I mentioned above (assuming that it is correct), but I would like to know how it could be done for non-binary integer variables.
In my implementation of BranchCallback I do not want to change the order in which variables and values are ordered be cplex by defaul. The only thing is that I would like to prune some variable/value pairs once they are assigned. This means that I would like cplex to decide which variable is selected, and then I would like to prune some of its values (can I do it in BranchCallback). Perhaps if I could work with variable/value pairs (as I asked in the paragraph above), it would be easier.
Cheers,
Marek
#CPLEXOptimizers#DecisionOptimization