Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

pinkspace's blog

By pinkspace, history, 16 hours ago, In English

Hi everyone,

Previously I learned about the Dependent Knapsack Problem on Trees, which the dependency graph of items form a tree. For a general dependency graph, we can bunch all items in the same SCC into a single item, which results in a DAG. Is there an efficient solution to this Dependent Knapsack Problem on DAGs? If it does, is it possible to come up with an $$$O(NW)$$$ solution? I searched the problem and didn't find much useful information.

A possible problem statement: We have a knapsack that can hold a maximum weight $$$W$$$. There are $$$N$$$ items to choose from, each item $$$i$$$ has its own weight $$$w_i$$$, value $$$v_i$$$ and a set of dependencies $$$S_i$$$. To choose item $$$i$$$, we must choose (all elements/at least one element) in $$$S_i$$$ if $$$S_i$$$ is non-empty. What is the maximum total value we can get in our knapsack?

  • Vote: I like it
  • +6
  • Vote: I do not like it