1

I'm looking into using GLPK to solve a ILP. Some of my constraints have the following form

I * W <= A

Where I is the variable and W and A are constants. W though, could be very, very large. An example value might be 2251799813685248, and may be even larger. Therefore, if GLPK uses standard primitives under the hood, there could be an issue.

So my question is, is GLPK subject to machine precision (i.e. 32 bit) or does GLPK use variable precision (i.e. mathematical ints without memory bound limits)? If not, are there any other open source packages that support variable precision?

HXSP1947
  • 1,311
  • 1
  • 16
  • 39
  • All those solvers are internally calculating with doubles (LP-relaxation) and some primitive-based type for integers (for the MIP branch-and-cut procedure). None of them will use GMP i would say. There are some sparse exceptions with other computational models (e.g. Soplex' support for rationals), but i don't think there is something (evolved) for arbitraryprecision integers (but maybe i'm wrong there). I think you should look more into *variable scaling* (which all of those solvers will do automatically for num reasons;hidden),but even building the constraint above i'm expecting a type-error. – sascha Jul 21 '19 at 20:50
  • Did you find any library that satisfies you needs? I'm also on the search for one. I'm thinking about modifying GLPK to use boost multi-precision types, but that will require migrate the code to C++. – Darien Pardinas Jan 10 '21 at 14:46
  • I ended up using Z3 which was able to do what I needed. – HXSP1947 Jan 30 '21 at 20:40

1 Answers1

0

If you configure --with-gmp when you build GLPK, it'll use the GNU Multiple-Precision library GMP; download, build that first. (configure -h:

--with-gmp: use GNU MP bignum library [[default=no]]

I don't know of a problem where GMP make a difference; please let us know.

denis
  • 21,378
  • 10
  • 65
  • 88