This repository contains a Python GUI code using PyQT6 to visualize and solve the Knapsack problem (Backpack problem)
Knapsack problem is a NP-difficult problem, we have a list of objects (weight, value) and we have a backpack with a maximum capacity. The goal is to fill the backpack with the objects that allow us to maximize the total value of the backpack.
We use dynamic programming to solve the problem in a linear time.
The code is a GUI tool to solve the problem, where we introduce the maximum capacity and list of objects (by either manually adding them or randomly generating them) then, when executed, get the table used by the algorithm and the objects chosen will be highlighted in green as well as the maximum gain.