Organization of the course
The course at a glance
10 application chapters · 3 tools chapters · QP and NLP · one Colab notebook per chapter · reproducible Python/Gurobi code. The full list is in the syllabus. The course follows LP Modelling, from which it takes the notation, the general solver commands and the sensitivity protocol.
Download as PDF
- 📘 Full lecture notes — models, worked examples, case studies, sensitivity analysis
- 📊 Lecture slides — one deck per chapter, on the downloads page
Getting started
Nothing to install: every chapter has its notebook that opens in Colab and runs in the browser.
Essential path in four sessions
| Content | Learning objectives | |
|---|---|---|
| Lab 1 | Markowitz | build a convex QP; trace a frontier; discuss the fragility of the estimates |
| Lab 2 | Production with smoothing | add a quadratic term to a linear model; read and verify the multipliers of a QP |
| Lab 3 | Pricing or budget | model nonlinear functions; study concavity; verify the KKT conditions numerically |
| Lab 4 | Project of your choice | supply chain, location, EV charging, queues, SVM or least squares; management presentation |
The most common mistakes
- Reading
.Xor.Piwithout checkingm.Status. - Forgetting
lb=-GRB.INFINITYon free variables (\(b\) of the SVM, the residuals of least squares). - Using the multiplier of a QP for a large increment: it is exact only at the margin.
- Forgetting
NonConvex = 2with bilinear terms, or believing a problem convex when it is not. - Updating the RHS of a constraint with constants on the left.
- Optimizing a single objective when there are two.
- Choosing the hyperparameters by looking at the test set.
- Reporting six decimal digits of estimates that wobble at the second.
Reproducibility
python3 -m pip install gurobipy matplotlib pandas
python3 python/run_all.py # regenerates results, figures and notebooks
The solutions of the exercises are handed out in class.