ktahar / ocaml-lp

LP and MIP modeling in OCaml
MIT License
27 stars 1 forks source link

GLPK assumes that variables are positive #1

Closed Drup closed 2 years ago

Drup commented 2 years ago

As said in the title, if no bounds are given, GLPK assumes that it's [0,+inf[. I'm not sure how the other solver behaves. It might be worth putting explicit ]-inf,+inf[ bounds by default to ensure consistent behaviour across solvers.

ktahar commented 2 years ago

Most of the solvers assumes [0, +inf) bounds if it's not given, as well as GLPK. e.g. CPLEX and Gurobi. Non-negative variable looks like the default in mathematical programming context.

Thus, Lp.var defaults the bounds to [0, +inf). I added comments on this at 2ee56e7994f46a97536e11c27456663d930e1579. Thank you for pointing out.

Drup commented 2 years ago

Fair enough, the documentation makes this clear :+1: