knapsack
Mathematical Programming with Python
https://people.sc.fsu.edu/~jburkardt/classes/...
python_2025/knapsack/knapsack.html


knapsack: the Knapsack Problem seeks to maximize the value of loot taken by a burglar whose knapsack has a weight limit. We seek solutions by random sampling, brute force check of all possibilities, ranking the items greedily adding the next best item, or using dynamic programming. For the brute force approach, Python's itertools() library will generate all subsets for us.

Lecture notes:


Last revised on 27 February 2025.