Knapsack Problem

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2023 Oct 19 6:12
Editor
Edited
Edited
2024 Sep 25 14:23
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