Originally posted by: AnirudhSubramanyam
I don't believe you can use CPLEX to do what you want to do. I'm assuming you're solving a mixed integer linear program.
According to the description given here: CPXXsetsolvecallbackfunc(), "CPLEX calls the solve callback before CPLEX solves the subproblem currently associated with the current node. The user can choose to solve the subproblem in the solve callback instead by setting the user action argument of the callback. The optimization that the user provides to solve the subproblem must provide a CPLEX solution. That is, the Callable Library routine CPXXgetstat/CPXgetstat must return a nonzero value."
By referring to the subproblem as "the subproblem", it seems to me that CPLEX already knows what the subproblem is, i.e. when you call mipopt(), it is assumed that the subproblem is the LP relaxation of the problem. I don't believe CPLEX gives you any facility to set/change/define this subproblem anywhere. This is apparent because a user-defined lower bounding problem/subproblem would not be able to cause the routine CPXXgetstat to return a nonzero value.
Moreover, even if you were able to inject a solution to CPLEX through the solve callback, the solution that you would be injecting would be an integer solution (because you're solving a Lagrangean Dual problem, which is an MILP). CPLEX would then automatically pass control to a lazyconstraint callback or an incumbent callback and not to the branch callback. Thus, you would never be able to effectuate your branching rule.
That said, it's a fairly simple task to write your own branch-and-bound code and you can always use CPLEX to solve any LPs or MILPs that arise as subproblems in your main algorithm.
Anirudh
#CPLEXOptimizers#DecisionOptimization