New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bin Packing (uses Linear Programming) #6763
Comments
comment:1
As the functions dealing with LP have not been reviewed, I prefer to rewrite the MIP class for Sage to make it easier to use. I will post a new version of the MIP patch as soon as possible, along with all the patches for functions using it. Sorry for the trouble, I'll try to make it quick ! Nathann |
This comment has been minimized.
This comment has been minimized.
comment:2
New version, ready for review !!!! Nathann |
comment:3
What is the output format? You should include several more examples. Also, unless success returns True, it's better to raise an error on failure than return False. |
comment:4
updated... This patch was 5 months old and was not working anymore ;-) Nathann |
comment:5
Thanks, that clarifies things more. I would raise a ValueError rather than a generic exception. Also, you still need more examples. (You never actually even show the output.) |
comment:6
Well, maybe you can help me for the output : I deliberately avoided to show it as a valid solution [A,B] could be returned [B, A], for example... It depends on the solvers you use, but also on the platform (hashing functions depend on it, I learnt that recently from William and it was breaking som eof my docstring). How do you think we could avoid it ? :-) Nathann |
comment:7
Sort the result before printing. |
comment:8
Done |
comment:9
Attachment: binpacking.patch.gz I think check should be added to make sure all weights are <= max. At the moment
causes infinite loop. Otherwise code seems fine. |
comment:10
Patch updated !! With a few other modifications, as this patch is one of the first LP patches Trac received, and is even older than the 8 months this ticket indicates... I'm not sorry to see it finally reviewed ! :-) By the way, if you like Linear Programming and have some time to spend on trac tickets... I desperately need some help with LP patches in the Graph Theory section ;-) Thank you very much ! Nathann |
comment:11
One last thing, I'm sorry I didn't catch it first time around. Documentation for the parameter 'k' claims function will return false if solution doesn't exist. Instead exception is raised if no solution exists. |
comment:12
Fixed. |
comment:13
Attachment: trac_6763.patch.gz Everything seems to be in order. Positive review. |
comment:14
Thank youuuuuuuuu :-) Nathann |
Merged: sage-4.4.4.alpha0 |
Reviewer: Joni Syri |
Author: Nathann Cohen |
This patch implements a solver for the Bin Packing problem using Linear Programming.. To test this you will have to first install GLPK and one patch, all available on ticket #6869 ;-)
I hope you will like the documentation, I tried to make it clean ;-)
Component: numerical
Author: Nathann Cohen
Reviewer: Joni Syri
Merged: sage-4.4.4.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/6763
The text was updated successfully, but these errors were encountered: