Operations Optimisation in Python: Production Mix (LP) and Depot Network (MILP) with scipy

<p>Kaveri Crunch Foods makes five snacks in one plant near Mysuru and ships them through leased depots to distributors across Karnataka. Every week Meghana Rao, the operations planner, decides how many tonnes of each snack to make and which depots serve whom, today in a spreadsheet by feel. Your job is to replace the feel with models that can prove their answer is the best one.</p><p>You get your own copy of the plant's data: prices and costs, resource use per tonne, capacities, contracts and market caps, five candidate depots and fourteen distributors with road distances. You build each model yourself, lesson by lesson, in Python with <code>scipy.optimize</code>. Then you give the same job to your AI assistant (ChatGPT, Claude, Gemini or Copilot) and check what it gives back. Bartman runs your script in a sealed sandbox and checks every answer against the true optimum of <em>your</em> data, which it computes itself.</p><ul><li>Write an optimisation model in words first: decision variables, objective, constraints. Compute contribution margins in the right unit.</li><li>Solve the <strong>production mix</strong> as a linear program with <code>linprog</code>: it minimises, its default bounds drop your contracts, and a wrong model still "terminates successfully".</li><li>Read <strong>shadow prices</strong> with the right sign, check complementary slackness, and decide an overtime offer by re-solving rather than trusting a dual beyond its range.</li><li>Choose <strong>depots</strong> with a mixed-integer program in <code>milp</code>: binary open/close decisions, single sourcing, capacity tied to the open decision, a delivery radius.</li><li>Re-solve for the Diwali peak, draw a depot-load chart, and hand the whole weekly plan to your AI as a brief.</li></ul><p>Every learner gets different data, so answers can't be copied. Each check explains what went wrong without giving the answer away, and the classic mistakes (maximising with a minimiser, the wrong sign on a dual, an open decision tied to nothing, a forgotten capacity) are recognised and named.</p>

Tools: Python, pandas, NumPy, SciPy, linprog, milp, HiGHS, Linear Programming, Mixed-Integer Programming, Shadow Prices, matplotlib, AI Assistants for Python