solve_knapsack
Maximize item value under a weight capacity constraint by solving the 0/1 knapsack problem. Provide item values, weights, and capacity to get the optimal selection.
Instructions
Solve the classic 0/1 knapsack problem: maximize value subject to weight capacity constraint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| values | Yes | Value of each item | |
| weights | Yes | Weight of each item | |
| capacity | Yes | Maximum weight capacity of the knapsack |