Two-bag 0-1 knapsack problem
ID: two-bag-0-1-knapsack-problem
Assign each item to neither bag or exactly one of two bags, respecting both capacities and maximizing total value. With nonnegative integer capacities , a dynamic programming state indexed by the item prefix and both capacities gives time complexity. Every transition uses the preceding item layer to prevent reuse of an item.
New to topics? Read the docs here!