[Lemon-user] Can the Cost type for CostScaling be floating point?
Lobron, David
dlobron at akamai.com
Thu May 25 19:10:10 CEST 2017
Thanks very much, Péter and Alpar! We will be running LEMON's CostScaling algorithm alongside the original cs2 implementation. So far, they seem to produce very similar results, but the LEMON code is much cleaner, so we are hoping to switch!
> As for floating-point calculations, I agree with Alpár's notes. The min-cost flow algorithms in LEMON currently do not support floating-point data and they do not use the Tolerance class. So you should keep your scaling code (or try to replace it with a better one).
That should be OK.
Even though LEMON requires integer types, the fact that it uses templates is still a big help to us, because we can define the "T" type as int64_t, which gives us much more room to scale (i.e., 63 bits rather than 31). The cs2 code uses a mix of types, and there's no typedef, so demand values have to be type "int", which will probably be signed 32-bit. C++ to the rescue! :-)
Thank you again,
--David
More information about the Lemon-user
mailing list