LinQuadOptInterface.jl icon indicating copy to clipboard operation
LinQuadOptInterface.jl copied to clipboard

Reconsider holding the objective constant outside of the solver

Open rdeits opened this issue 7 years ago • 4 comments

Currently, LQOI essentially keeps the constant part of the objective for itself, storing it in a field of the optimizer rather than actually passing it to the solver. However, there are situations (like https://github.com/JuliaOpt/Gurobi.jl/issues/111 ) where it's useful to actually have that constant exposed to the solver.

Exposing the objective constant to the solver would require that all the wrapped solvers support that:

  • [x] Gurobi: supported: http://www.gurobi.com/documentation/7.0/refman/objcon.html
  • [x] GLPK: supported: http://www.chiark.greenend.org.uk/doc/glpk-doc/glpk.pdf (call glp_set_obj_coef with j=0 to set the constant term)
  • [x] Xpress: supported: https://www.artelys.com/uploads/pdfs/Xpress/Xpress_Optimizer_2447PS.pdf (see page 499, column -1 refers to the constant in the objective)
  • [x] Cplex: supported: https://www.ibm.com/support/knowledgecenter/ko/SSSA5P_12.6.2/ilog.odms.studio.help/CPLEX/ReleaseNotes/topics/releasenotes1262/PLUGINS_ROOT/ilog.odms.cplex.help/refcallablelibrary/cpxapi/chgobjoffset.html

rdeits avatar Jul 31 '18 16:07 rdeits

I think this could also be done in a compatible way by doing the following:

  • Create new functions in the LQOI solver interface set_constant_objective and get_constant_objective, with default definitions that just access the .objective_constant field.
  • In each solver, implement those interface functions using the internal APIs
  • Once all the solvers are updated, delete the objective_constant field from LQOI

rdeits avatar Jul 31 '18 18:07 rdeits

I agree it easier, it will make a lot easier sending informartion like b&b cut off to speed up prunning. Lets do it!

joaquimg avatar Jul 31 '18 19:07 joaquimg

we can close?

joaquimg avatar Sep 05 '18 02:09 joaquimg

No. Once this LQOI is tagged, we should remove lines like https://github.com/JuliaOpt/LinQuadOptInterface.jl/blob/b553df3dde540981c702943b420e26716145715d/src/solver_interface.jl#L393 and remove the objective_constant field.

odow avatar Sep 05 '18 04:09 odow