Skip to content
Snippets Groups Projects
Commit 47a11270 authored by ravi's avatar ravi
Browse files

Minor changes

parent 6bd2aeb0
Branches
Tags
No related merge requests found
...@@ -93,6 +93,9 @@ object Knapscak { ...@@ -93,6 +93,9 @@ object Knapscak {
} }
} ensuring(_ => items.size <= 10 ==> time <= 500 * (w - i + 1)) } ensuring(_ => items.size <= 10 ==> time <= 500 * (w - i + 1))
/**
* Computes the list of optimal solutions of all weights up to 'w'
*/
def knapSackSol(w: BigInt, items: IList) = { def knapSackSol(w: BigInt, items: IList) = {
require(w >= 0 && items.size <= 10) // the second requirement is only to keep the bounds linear for z3 to work require(w >= 0 && items.size <= 10) // the second requirement is only to keep the bounds linear for z3 to work
bottomup(0, w, items) bottomup(0, w, items)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment