Skip to content

The knapsack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a value, 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.

Notifications You must be signed in to change notification settings

Rayen-cherni/Knapsack-problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Summary

The backpack algorithm is a problem combinatorial optimization. It models a situation analogous to filling a bag with back, which cannot support more than a certain weight, with all or part of a given set objects each having a weight and a value. Items put in the backpack must maximize the total value, without exceeding the maximum weight.

Solution

We noticed that the exact methods lead to the optimal solution, but they are too greedy in terms of computing time and memory space required. However, the approximate methods require reasonable research costs. But, they don't do not guarantee the optimality of the solution.

Here we will illustrate the principle of Dynamic Programming by a game implemented in Flutter application. I decided to create a game that combines fun with learning. Items appear on the game interface with values and weights. The user taps on the objects to add them to the urn / bag. We will not always be able to put all the objects in the bag because since the sum of the weights of the objects cannot exceed the maximum capacity. So the user will look for the best solution to maximize the objects. This game will be developed on Android and its use by users is almost immediate since the environment is simple and efficient.

Realization

Picture I

Picture II

Picture III

Realization

In computer research, the backpack problem and its derivatives are stillstudied a lot. There are many variations: multi-dimensional backpack (several weight per object), several objective functions,...etc. Many exact algorithms and approaches are proposed for this type of problem.

Further information

To get more information on the Bazart project you can contact me on LinkedIn or by Email [email protected].

About

The knapsack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a value, 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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages