Deep dive · Operations research
Red Leg Brewing is a veteran-owned brewery in Colorado Springs that promises next-day delivery to its wholesale accounts. We turned a year of its sales and visitation data into two answers: which accounts actually deserve a sales visit, and what order the truck should drive - delivered to the brewery as a USAFA Operations Research capstone.
12 mo
2024 sales + visit data (Ekos)
20-25
delivery stops per day
30%
accounts with untapped growth
25%
visits to limited-opportunity accounts
k = 3
K-means performance clusters
The brewery serves its region on fixed, geography-based delivery runs, and sales reps visit accounts on a fixed schedule - checking stock, promoting seasonal releases, and building the relationships that drive reorders. But demand shifts week to week, visits are triggered by recent invoices, and the next-day delivery promise means routing has to stay flexible without constant manual planning.
Two questions, then: which of the wholesale accounts genuinely reward attention, and how should each day's 20-25 stops be ordered so the truck spends its time delivering instead of driving?
Daily routing is a traveling-salesman problem with a twist: some stops carry hard delivery windows and some carry none. We solved it with a genetic algorithm - each candidate route is an individual in a population, routes evolve through crossover (recombining segments of two parents) and mutation (swapping stop order), and a fitness function scores total travel distance plus penalties for arriving outside a window. Constrained stops get priority through the window penalties; flexible stops get optimized purely on geography.
The system is Python and open-source libraries only - no commercial routing API, no usage fees, no vendor lock-in. A script ingests the day's sales from EKOS, the brewery's order-management system (an integration we automated to kill manual data entry), evaluates delivery eligibility, and emits an optimized Google Maps link with the stops in the right order.
Design constraint
It had to live inside the brewery's existing tools: update the delivery table, get back a Google Maps link. The driver installs nothing.
K-means clustering (k = 3) on invoice frequency and revenue split the account base into low performers, stable performers, and a third cluster containing exactly one account: a unique contract whose revenue spikes would have distorted every comparison, so it was fenced off and analyzed separately.
The low-performing cluster was split again into two subclusters - consistently low versus showing real improvement in some months. Engagement was measured as invoices per visit rather than raw dollars: bulk orders, seasonality, and account type (a restaurant, a liquor store, a golf course) make revenue too noisy to compare across accounts, while invoice counts track actual ordering behavior.
Visit effort was misaligned with performance. Both low-performing subclusters received similar visit counts despite a large revenue gap between them, and the single contract account drew the most visits of anyone despite being stable enough to need the fewest.
Headline finding
30% of accounts showed significant untapped growth potential, while 25% of current sales visits targeted accounts with limited opportunities.
Replace the fixed visit schedule with dynamic, performance-driven scheduling: shift capacity away from the stable contract and the unresponsive low performers, toward the high-potential accounts that reward attention. Let the genetic algorithm re-route daily as demand shifts. The brewery added roughly 150 wholesale customers in a year; the point of both models is that the distribution operation scales with that growth instead of being replanned by hand.