ds4dm/Tulip.jl

Are models with Rational arithmetic supposed to be supported?

Closed this issue · 3 comments

Trying to create an optimizer like so fails because Rational{BigInt} doesn't have an eps method (needed for some parameter default values): Tulip.Optimizer{Rational{BigInt}}(). Specifying parameters as keyword arguments doesn't help.

That said, I don't know if Rational arithmetic is even supposed to work for Tulip.

I stopped (trying to) support Rational arithmetic because of the absence of eps method, lots of numerical issues (even on tiny problems), and the fact that things like sqrt(x::Rational) return floating-point values (since they are not defined on rationals).

If you want to solve an LP to high (but >0) precision, I recommend using high-precision floating point arithmetic like Float128 or Double64 from Quadmath and DoubleFloats, respectively, or BigFloat.
FYI, compared to Float64, Double64 is about 4x slower, Float128 is 10x slower (but has more exponent range than Double64), and BigFoat is much much slower (depending on what precision you set). The former is also a good avenue if you have a numerically challenging problem and you're OK with the extra computing time.

If you want to solve an LP exactly over the rational numbers, an interior-point algorithm is probably not the best approach. There are simplex-based tools (not in Julia) that support doing that, such as QSOpt and SoPlex.

OK then, thanks for the information.

For future reference, https://github.com/JuliaPolyhedra/CDDLib.jl provides a simplex implementation in rational arithmetic.