Skip to content

Filling the knapsack (exhaustively, which is very very slow)

Notifications You must be signed in to change notification settings

bjorne/knapsack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The knapsack is full!

[~/hack/knapsack]:$> python knapsack.py input/referenceExample.txt
solution of weight 9, value 29 found:
(3, 13), (1, 4), (5, 12)

[~/hack/knapsack]:$> time python knapsack.py input/small.txt
solution of weight 8, value 58 found:
(5, 33), (2, 17), (1, 8)

real	0m33.167s
user	0m32.237s
sys	    0m0.213s

# (clearly not optimal for n=20)

About

Filling the knapsack (exhaustively, which is very very slow)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages