#6749: [with patch, needs review] Knapsack algorithm
-------------------------+--------------------------------------------------
Reporter: ncohen | Owner: jkantor
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.1.2
Component: numerical | Keywords:
Reviewer: | Author:
Merged: |
-------------------------+--------------------------------------------------
Comment(by ncohen):
Excellent suggestion ! So :
* I fixed the grammar error ( sorry, I'm still learning english every
day ;-) )
* I Included the objective value in the output
But :
Actually, this objective value requires no computation at all as it is
automatically computed by the LP solver.. So as it can be useful anyway,
the function now returns a pair [value, list] ( where list is the value
the function returned previously ), and value=maximum useful value.
Besides, I added the flag value_only in case the use only needs the
optimal value and does not care about the assignment. This, because the LP
solvers can be forced not to return the assignment of the variables and
only the objective value, avoiding this way some computations.
Besides, this syntax makes knapsack consistant with the other optimization
functions I wrote for graphs, and I hope will all the LP functions we will
write in the future ;-)
To avoid mistakes, I updated both patches ( they were identical ), and the
new version obviously contains the old one, plus the update I just wrote !
Thank you for your review !
Nathann
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6749#comment:8>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---