Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.22 KB

README.md

File metadata and controls

55 lines (37 loc) · 1.22 KB

Nextmv Python Gurobi Knapsack

Example for running a Python application on the Nextmv Platform using the Gurobi solver. We solve a knapsack Mixed Integer Programming problem.

If you have a Gurobi WSL license, remove the .template extension from the gurobi.lic.template file and replace the contents with your actual license key. Modify the app.yaml file to include the gurobi.lic in the files list.

  1. Install packages.

    • With pip

      pip install .
    • With uv

      uv sync
  2. Run the app.

    • With python

      cat input.json | python main.py
    • With uv

      cat input.json | uv run main.py

      Or with custom options:

      cat input.json | uv run main.py -duration 30

Alternatively, you may reference the main.ipynb Jupyter notebook which, in addition to running locally, showcases how to push the app and run it remotely.

Next steps

  • Open main.py and modify the model.
  • Visit our docs and blog. Need more assistance? Contact us!