Skip to content

Kaoutar2Aqil/Knapsack-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Knapsack-

The knapsack problem is indeed a fundamental problem in optimization and constraint programming. It serves as a classic example to illustrate various techniques, including greedy algorithms, dynamic programming, and constraint programming.

Variables:

Let n be the number of items.
Let W be the maximum capacity of the knapsack.
Let w[i] be the weight of item i.
Let p[i] be the profit/value of item i.

Constraints:

The sum of the weights of the selected items must not exceed the capacity of the backpack.

Objective Function:

Maximize the total value of the selected objects, by adding the values ​​of the objects based on the binary variables.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages