/knapsack-0-1

A python script I made to solve the knapsack 0/1 problem with both a dynamic approach and a greedy approach. Made for an algorithms course.

Primary LanguagePythonMIT LicenseMIT

Knapsack 0/1 Problem in Python

A python script I made to solve the knapsack 0/1 problem with both a dynamic approach and a greedy approach, made for an algorithms course. The item pool for the algorithms is randomly generated. At the end of the problem, the value, contents, and processing time is printed for each knapsack.

This project also contains a performance spreadsheet that comapres the performance of both the greedy and dynamic algorithms.