Originally posted by: SystemAdmin
>
>
> i've got a problem implementint step 3 of following "road map"
>
> 1) create continuous linear programm with concert technology c++ api
> 2) start solving with cplex solver using my own goal
> 3) on some nodes of the search tree (and all subnodes) convert a set of variables from float to binary
Well, the immediate problem here is that there is no search tree if you are a solving an LP. Search trees only occur with discrete problems.
You can implement an algorithm like this by doing all the housekeeping (maintaining a tree) in your own code, and just use CPLEX to solve node LPs. A more general framework like MINTO or Symphony might be able to support something like this (I'm not positive) using CPLEX to solve the LPs.
> 4) solve the mixed integer program at this nodes' position with BranchAsCplex(getEnv())
>
> my problem is, that i couldn't figure out a way to add an iloconversion object to the currently
> processed node because of the model received from getModel() being the initial model.
You are not allowed to add conversions to a MIP while solution is in progress. You are allowed to add cuts, though. So let's assume that what you are actually solving is a MIP. For instance, suppose we start with an MILP
min c'x
s.t. Ax >= b
x >= 0
and add to it a bunch of binary variables y that initially appear in neither the objective nor the constraints. At least some of the x variables will need to be integer; otherwise there will be no search tree. Now, at some node, suppose that you decide that continuous variable x_j really needs to be binary. Choose the first unused y variable (call it y_k) and add a local cut
x_j = y_k
to the current node with a cut callback. Note that each y variable should only be used once within any subtree of the problem. (The C and C++ APIs let you attach your own data to each node, which in this case could be a list of available binary variables. In Java you would need to maintain the list externally, I think.) This effectively forces x_j to be either 0 or 1, although technically it remains continuous (and branching will be on y_k rather than on x_j).
/Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
#CPLEXOptimizers#DecisionOptimization