Python Knapsack Profit Optimizer Script

Job ID: 39793382

Budget: $30 – $250 USD

I want a Python 3 script that takes a predefined list of tabletop-RPG items and calculates the single combination that yields the highest profit while never exceeding two hard limits I’ll pass in at run time: available gold and warehouse space. Profit is the only optimisation objective; space and funds are strict constraints.

Implementation requirements
• Use the 0/1 Knapsack algorithm (dynamic-programming or efficient variant of your choice).
• Input list of items available for selection will be generated by another python script I have already written.
• Command-line arguments should let me set max_gold and max_space.
• Output must display the chosen items, total cost, total space used, and net profit.
• The script should run with a single command, e.g.
python optimise_stock.py --gold 500 --space 30 --file items.csv

Deliverables
1. Clean, well-commented .py file compatible with Python 3.10+.
2. A brief README explaining the algorithm and how to run tests.
3. One sample execution using my item list that demonstrates correct optimisation.

Acceptance criteria
• For the supplied test list, the program’s result must match the mathematically maximal profit verified against an exhaustive search.
• No constraint violations (gold or space) are allowed.
• Code passes pylint/flake8 with no critical warnings.
• code is relatively computationally optimized to run quickly.

That’s the full scope; once the script meets these points I can integrate it directly into my game tools.