🔰 Wikipedia
🐻 Youtube
Link01

2.1.6.1.1. What is 0/1 Knapsack Problem?

  • Given a knapsack with maximum capacity WW , and a set SS consisting of nn items
  • Each item ii has some weight wiw_i and benefit value bib_i(all wiw_i, bib_i and WW are integer values)
  • Problem: How to pack the knapsack to achieve maximum total value of packed items?

2.1.6.1.2. Solution

  • brute-force approach

  • dynamic programming

2.1.6.1.3. Code

https://gist.github.com/BiruLyu/b7ef86cee3a17427dd4f24e064f9d271

2.1.6.1.4. Related Topics

Fractional Knapsack Problem

results matching ""

    No results matching ""