A Streamlit application for balanced and unbalanced assignment problems. Dynamically configure 1–15 jobs and 1–15 tasks, edit the cost matrix, solve the minimum-cost one-to-one matching using the Hungarian algorithm, explore interactive visualizations, and export CSV/Excel results.
- Dynamic job/task dimensions and editable labels.
- Editable cost, time, distance, or penalty matrix.
- Balanced and rectangular/unbalanced models.
- Automatic zero-cost dummy rows/columns.
- Hungarian shortest-augmenting-path solver (O(n³)).
- Optimal assignments, unmatched jobs, and unfilled tasks.
- Original, row-reduced, and row/column-reduced heatmaps.
- Assignment map, selected-cost bar charts, cost-share pie chart, benchmark chart, and augmentation-stage view.
- CSV and multi-sheet Excel exports.
- Validation for non-numeric and non-finite values.
The matrix is padded to a square matrix of size max(number of jobs, number of tasks). If jobs exceed tasks, dummy task columns are added; if tasks exceed jobs, dummy job rows are added. Dummy costs default to zero. A job matched to a dummy task is unassigned; a task matched to a dummy job remains unfilled. Set non-zero dummy penalties in a future customized version if leaving an entity unmatched has a cost.
Minimize Z = sum(i,j) c[i,j] * x[i,j], subject to each job and each task being assigned at most once, with x[i,j] binary. For balanced complete assignment, row and column constraints are equalities.
Requires Python 3.10 or newer.
python -m venv .venv
# Activate the environment, then:
pip install -r requirements.txt
streamlit run app.pyOpen the local URL printed by Streamlit (normally http://localhost:8501).
- Push
app.py,requirements.txt, andREADME.mdto GitHub. - Sign in to Streamlit Community Cloud and create a new app.
- Select your repository, branch, and
app.pyas the entry point. - Deploy; dependencies are installed from
requirements.txt.
Interactive Streamlit application for balanced and unbalanced assignment problems using the Hungarian algorithm, featuring dynamic cost matrices, optimal matching, rich visual analytics, and CSV/Excel exports.
assignment-problem, hungarian-algorithm, operations-research, linear-assignment, optimization, streamlit, python, decision-science, cost-minimization, data-visualization
app.py— Streamlit UI, solver, charts, and exports.requirements.txt— runtime dependencies.README.md— project guide.
This is a single-objective minimization model with one-to-one matching. Costs may be finite negative, zero, or positive values. Dummy assignments have zero cost by default. Forbidden assignments, capacities, multiple assignments per job, precedence constraints, and non-assignment penalties are not currently included. The independent row/column minima are benchmarks only and may not be feasible one-to-one solutions. Verify model assumptions before operational use.
Add a license suitable for your intended distribution (for example, MIT).