Knapsack Problem

Creator
Creator
Alan JoAlan Jo
Created
Created
2023 Oct 19 6:12
Editor
Editor
Alan JoAlan Jo
Edited
Edited
2023 Dec 18 5:29
Refs
One of the most popular decision-making problems. Many real-world applications can be modeled as a knapsack problem. What will you put into your knapsack (bag) so that the sum of product values are maximized? Combinations are and it is hard constraint.
 
Knapsack Problems
 
 
 

Problem Modeling

Maximize subject to where and
  • - knapsack capacity limit
  • weight of product
  • means we choose product
  • - number of items
 

Dynamic Programming

V[i, w] represents the optimal solution of a subproblem for products to and the maximum weight of
Given products and weight is the solution
notion image
-
Pseudo polynomial complexity
. Each product creates linear time complexity
 
 
 
 
 
 

Recommendations