mknapsack icon indicating copy to clipboard operation
mknapsack copied to clipboard

Check problem size limitations for all algorithms

Open jmyrberg opened this issue 3 years ago • 3 comments

Ensure correct errors are thrown regarding problem size limitations before trying to solve it within Fortran

jmyrberg avatar Aug 07 '22 14:08 jmyrberg

It would be nice if it were possible to increase the limits slightly, at least for the "mtm" method for multiple knapsack. Finding a solution with 10 knapsacks and 85 items and profits of 1 took ~1.1 seconds to solve 1000 times (I placed it in a loop to better eliminate noise). Later on, I will likely need ~15-20 knapsacks, and it seems impossible to change the limit without forking and changing both the Fortran and Python.

Would it be reasonable to allow users to use up to 20-25 knapsacks, but display a warning to stdout (on by default but disabled if the user passes warnings=False) in case the user needs more than 10 knapsacks?

Theelx avatar Sep 12 '23 17:09 Theelx

It would be nice if it were possible to increase the limits slightly, at least for the "mtm" method for multiple knapsack. Finding a solution with 10 knapsacks and 85 items and profits of 1 took ~1.1 seconds to solve 1000 times (I placed it in a loop to better eliminate noise). Later on, I will likely need ~15-20 knapsacks, and it seems impossible to change the limit without forking and changing both the Fortran and Python.

Would it be reasonable to allow users to use up to 20-25 knapsacks, but display a warning to stdout (on by default but disabled if the user passes warnings=False) in case the user needs more than 10 knapsacks?

I have no objections in increasing the limits. However, if I remember correctly, I actually tried it, but it wasn’t as easy as I thought on the Fortran side, and thus left the code as-is. If you’re willing to have a go on this, feel free to fork and make a PR 🙂

jmyrberg avatar Sep 15 '23 19:09 jmyrberg

#51

Theelx avatar Sep 26 '23 16:09 Theelx