Inspiration
India wastes ~₹1.5 lakh crore of food a year in the supply chain. The tool retail uses to fight it is a rule of thumb — "50% off after 6pm" — which destroys margin on stock that would have sold anyway, and still leaves stock unsold. The real problem is usually distribution, not price: one store drowns in strawberries while another runs out. A markdown cannot fix that.
What it does
FreshFlow decides, jointly and for every SKU in every store over a four-day horizon: what to mark down and by how much, what to move to a sister store, what to donate, and what to reorder. Then it reads the dual values of its own constraints and tells you which limit is binding and what one more unit of it is worth.
How we built it
Three layers. Gradient-boosted trees forecast demand and a stratified elasticity model turns that into a menu of demand-at-each-discount-tier. A mixed integer programme — 14,784 variables, 2,160 binaries, solved with CBC — picks the plan. The integer decisions are then fixed and the LP re-solved to extract shadow prices, which a language model turns into two or three actionable sentences. The LLM also compiles plain-English what-ifs into parameter diffs that the solver genuinely re-runs. It never does arithmetic.
Challenges we ran into
Two that mattered. First, elasticity in real POS history is confounded: markdowns happen because stock is near expiry, and near-expiry stock sells worse for reasons unrelated to price. Fitting naively under-estimated Dairy elasticity at 0.48 against a true 1.15; stratifying by days-to-expiry recovered 0.97. Second, an off-by-one in the inventory ageing constraint was silently deleting the most urgent stock bucket, which made the optimiser look worse than the baseline it was supposed to beat. Both were caught by benchmarking against a simulated policy rather than trusting the objective value.
Accomplishments that we're proud of
Every claim is a difference between two simulations run on identical stock, identical demand curves and identical costs — not a number the solver invented about itself. And the baseline is a strong opponent, not a straw man.
What we learned
Deep-discounting expensive perishables below cost destroys more value than donating them. The solver worked that out on its own, and it is counter to how most stores behave.
What's next for FreshFlow — Operations Research Meets Perishable Retail
Real vehicle routing for the transfer plan, stochastic demand for robustness under a bad weather day, and warm starts to bring the solve under ten seconds at chain scale.
Built With
- coin-or-cbc
- fastapi
- mixed-integer-programming
- operations-research
- pandas
- pulp
- python
- scikit-learn


Log in or sign up for Devpost to join the conversation.