About
## The problem it solves
**FreshRoute** is a decision-support platform for fresh-produce distributors. Roughly a third of perishable produce is lost between farm and market because today's routing ignores the decay clock - teams default to nearest-first or plain FEFO and never re-plan.
FreshRoute decides, **for every batch, every morning**: *ship it to a destination, or discount it to recover value before it spoils* - while respecting remaining shelf life, destination demand, transport time/cost, market prices and lane capacity, all simultaneously.
The engine is an LP/MILP optimizer (OR-Tools) that **maximizes net revenue subject to hard freshness constraints**, with a local clearance channel that rescues at-risk stock instead of letting it spoil. On a held-out hidden scenario it plans 46 batches / 25,350.9 kg into 87 dispatches and 20 discounts with **0 constraint violations** and Rs 572,204.63 net revenue - beating a documented FEFO + nearest-first baseline by **-58.8% spoilage** and a large net-revenue gain on the same cost model.
Every recommendation is explainable, and results are deterministic and reproducible (seeded scenarios, hash-pinned artifacts) - safe, plain-language decisions a team can actually act on.
## Challenges we ran into
We hit several real hurdles:
- **One batch, one decision, many constraints.** Making dispatch *and* discount a single feasible decision per batch forced us to model shelf life as a hard arrival-time constraint and to keep a separate clearance channel so unmet demand and spoilage are never double-counted. Getting the metric definitions right took the longest and changed the objective twice.
- **A frozen frontend/backend contract.** We built the dashboard and API in parallel, then integrated. The client types were the source of truth, so we re-shaped the API responses (config hash, enriched dispatch rows, event-driven `/replan`) to match exactly - and updated every test.
- **Reproducibility as a gate.** `runtime_ms` leaked into our result artifacts and broke byte-for-byte diffs; we strip non-deterministic fields and pin every artifact with a SHA-256 manifest so `pytest` fails on any drift.
- **Making robustness honest.** We refused to fabricate confidence intervals in the UI. We extracted the Monte-Carlo harness into a shared module and exposed it as a real `/robustness` endpoint so the dashboard band shows actual seeded P10-P90 numbers, falling back to a clearly-labelled illustrative range only when the endpoint is unavailable.
The "ah, that's why" moment: post-harvest loss is not a storage problem - it is a *decision* problem made every morning, and that is what we optimized.
Screenshots
Team
From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.








