[OS] Duplicate linear objective coefficients

Tony Kelman kelman at berkeley.edu
Wed Jan 21 14:09:26 EST 2015


I’m in the process of writing an interface between the JuMP (http://jump.readthedocs.org) modeling language for Julia (http://julialang.org) and Optimization Services, writing OSiL files to access solvers such as Bonmin and Couenne that are otherwise difficult to access from high-level languages right now because they only have C++ API’s. The end result once I get everything working should be similar to the prototype nonlinear Matlab interface I sent to this list in October 2013, but much higher-performance thanks to Julia’s just-in-time compilation, and fully open-source.

I have a question about linear objective coefficients in OSiL. As far as I can read the OSiL.xsd schema, there don’t appear to be any assumptions or requirements that the indices of objective coefficients be sorted or unique. Depending on the modeling language, it may potentially be simpler to write the interface in such a way that the generated OSiL file directly translates objective coefficients without combining duplicates or sorting indices. I will have to do some testing, but should OSiL files with this irregular set of objective coefficients be valid and work correctly, or be checked and verified against?

Based on the current code, it looks like any solvers that use OSInstance::getDenseObjectiveCoefficients() could interpret an objective with duplicate coefficients incorrectly. The dense coefficients are all initialized to zero, but the = at https://projects.coin-or.org/OS/browser/trunk/OS/src/OSCommonInterfaces/OSInstance.cpp?rev=4915#L2218 means only the last objective coefficient with a given index will be seen by the solver, rather than combining values with the same index. Would it make sense to change that = to a += ?

Thanks,
Tony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/os/attachments/20150121/7129c817/attachment.html>


More information about the OS mailing list