Skip to content
CompletedExpanded rebuild of coursework

Operations & Optimization Analysis

A Streamlit app that solves a product-mix linear program with SciPy's HiGHS solver, with shadow prices, sensitivity sweeps, Goal Seek, and saved SQLite scenarios. An expanded rebuild of an Excel coursework project.

  • Python
  • SciPy (HiGHS)
  • pandas
  • SQL / SQLite
  • Plotly
  • Streamlit
  • Excel (openpyxl)
  • pytest
  • GitHub Actions
Dashboard of the Operations and Optimization app showing an optimal profit contribution of $134,524, a recommended production plan chart, and resource utilization.

Overview

An interactive web app for a fictional furniture maker, Juniper Oak Furniture Co. (all data is synthetic and labeled as such). It rebuilds Nate's Excel linear-programming coursework as a full application: change the inputs, re-solve, and see what limits profit and why.

Problem

A manufacturer with limited labor hours, machine hours, and material budget has to decide how many of each product to build to earn the most profit contribution.

Solution

A linear-programming model solved with HiGHS through SciPy's linprog. The solver's dual values become shadow prices, each checked against a re-solve with one more unit. Sensitivity ranges and Goal Seek come from repeated re-solves, scenarios are saved in SQLite, and CSV and Excel files can be imported and exported.

Key features

  • A product-mix linear program whose dual values become shadow prices, with plain-English bottleneck explanations.
  • Excel-style allowable ranges and Goal Seek, recovered with bisection and Brent's method over repeated solves.
  • Datasets, scenarios, and solver runs are stored in SQLite with parameterized reporting queries, and uploads are validated (size limits, spreadsheet-formula neutralization).

Architecture

  • optimizer/: the model, solver, sensitivity, and Goal Seek as plain Python with no Streamlit code, so it can be tested on its own.
  • data/: SQLite storage (datasets, scenarios, solver runs) and CSV/Excel import and export.
  • app_pages/ and ui/: eight Streamlit pages (Dashboard, Optimizer, Sensitivity, Scenarios, Goal Seek, Data & Files, SQL Reports, About) with Plotly charts.
  • Hosted free on Streamlit Community Cloud from this site's repository.

Try it or install it

  1. Try the live demo: no install needed.

  2. Run it locally with Python 3.13, from the root of the repository (Windows PowerShell shown).

    python -m venv apps\operations-optimization-analysis\.venv
    .\apps\operations-optimization-analysis\.venv\Scripts\Activate.ps1
    python -m pip install -r apps\operations-optimization-analysis\requirements.txt
    streamlit run apps/operations-optimization-analysis/app.py

Testing

  • 127 automated tests (pytest and Streamlit AppTest): hand-solved textbook problems, infeasible and unbounded cases, shadow-price sign checks, Goal Seek accuracy, upload validation, SQLite round trips, and CSV/Excel round trips.
  • Checked by hand in the browser: raising labor hours from 2,800 to 3,000 raised profit from $134,524 to $138,844, exactly the 200 × $21.60 the app's shadow price predicts.
  • The hosted app shows the same $134,524 optimal plan as the local one.

Screenshots & diagrams

Dashboard of the Operations and Optimization app showing an optimal profit contribution of $134,524, a recommended production plan chart, and resource utilization. (opens full size in a new tab)
Dashboard of the live app (screenshot taken 2026-11-24): the optimal plan, its gain over the recent mix, and which resources are binding. The Fork button and badge are Streamlit's own.
Optimizer page with editable labor hours, machine hours, material budget, rates, and a product table. (opens full size in a new tab)
Optimizer page of the live app (screenshot taken 2026-11-24): editable resources, costs, and products, with synthetic data labeled as such.

Limitations

  • All data is synthetic (a fictional furniture maker), and the app labels it that way.
  • Streamlit Community Cloud puts the app to sleep when nobody has used it for a while, so the first visit may need a click to wake it, and anything a visitor saves resets when it restarts.
  • Tested on Python 3.13 only.

Who did what

  • Original coursework: Nathanael Haig built the original Excel linear-programming model for a class.
  • This web rebuild: a portfolio project built by Nathanael Haig.