Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 777 Bytes

README.md

File metadata and controls

13 lines (10 loc) · 777 Bytes

0/1 Knapsack Problem Solver

This project contains a C++, a Rust, and a Python implementation of the 0/1 Knapsack Problem solver. The 0/1 Knapsack problem is a classic algorithmic problem in the field of computer science and operations research. It involves a set of items, each with a weight and a value, and the goal is to determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. The programs will read the input data from a file that has an outline like the one shown below:

[number_of_items] [knapsack_capacity] [profit_1] [weight_1] [profit_2] [weight_2] ...

It will output the maximum total profit that can be obtained for each section of input data.