The recurring shapes that larger optimization models are made of: transportation and network flow, blending, and plans over several periods. Each rests on a balance constraint at every node.
Slides¶
Present full screen Download the PDF
Click or tap the slide to move forward, its left edge to go back; the arrow keys work too.
Reading¶
Modeling Patterns: Networks, Blends and Time builds three models for Qahwa House in PuLP. A delivery network from two roasteries through a Jeddah hub to six branches, where the best plan sends Dammam’s coffee 1,350 km to Jeddah and beats a “cheapest route first” rule by 339 SAR a month. A house blend in which Colombia, the all-rounder, has no place. And a Ramadan roasting plan that cannot be made month by month.
Lab 11: Logistics network model¶
In January 2026 Qahwa House opens branches in Makkah and Madinah. How should coffee travel from the Riyadh and Dammam roasteries to the six branches, by van or through the Jeddah hub? You build the van-only transportation model, add the hub with its flow balance and capacity, compare the result with a planner’s rule and read a shadow price. Then you blend the house coffee at the lowest cost, for one kilogram and for a month’s purchase.
Open the lab, then use its Open in Colab button. Its first cell installs PuLP.
Data: qahwa
_network _lanes .csv (17 lanes, with distance and freight cost per kg) and qahwa _blend _beans .csv (5 green-bean origins: price, cupping scores and monthly availability). The notebook downloads them by itself. Submit before the next lab session. The solutions are for checking your work afterwards.
Next week¶
Integer and nonlinear models: yes-or-no decisions, fixed costs, set covering and portfolio risk.