Side-by-side comparison of linear programming (LP) and mixed-integer programming (MIP) in Python (PuLP) and R (lpSolve / ompr).
The same problems are solved in both languages. Because LP is mathematically well-defined, every paired example produces the same answer — the comparison is about how each ecosystem gets there.
Python
pip install pulp pandas
python py_code/glasses.pyR
install.packages(c("lpSolve", "linprog", "ompr", "ompr.roi", "ROI.plugin.glpk", "Rsymphony"))
source("Rcode/glasses.R")- Getting Started — new to LP or to this project, start here
- Examples — all 11 problems explained with the key LP concept each one demonstrates
- Python vs R Comparison — ergonomics, syntax, solver ecosystem, and when each shines
- Credits — original sources this project is based on
py_code/ # Python (PuLP)
Rcode/ # R (lpSolve / ompr / Rsymphony)
data/ # shared CSV inputs
docs/ # extended documentation