coin-or / CyLP

A Python interface to CLP, CBC, and CGL to solve LPs and MIPs.
Other
181 stars 68 forks source link

MILP in CBC: Use initial solution to start search from #43

Open samiit opened 7 years ago

samiit commented 7 years ago

I was wondering if it is possible to ask CBC to use a constraint satisfied solution as the initial integer solution, instead of starting from the continuous (relaxed) solution.

Does CyLP offer anything for doing this? Where in CBC code can we access change in order to implement this?

Thanks, Sam

dafinguzman commented 3 years ago

Hello, I have the same use case. Have you found out where in the code we could tweak something to make it work?

tkralphs commented 3 years ago

I had a quick look. It's a bit of a project, but doable. I don't think I'll get to it very soon, unfortunately. It looks like you would basically need to extend the interface to CbcModel, modifying the files cy/CyCbcModel* and cpp/ICbcModel*, but I'm not actually an expert on Cython. Thiere is a function in the Cbc C interface that illustrates how to load a solution into Cbc pretty straightforwardly.

https://github.com/coin-or/Cbc/blob/d377b61b7aded9ec412a2c41092451c277757d22/src/Cbc_C_Interface.cpp#L1360-L1380