Bohea

From chaotic backtracking to clean neighborhood sweeps 从混乱折返,到整齐的逐街区扫街

A vehicle-routing optimizer for multi-day delivery across Montreal — built on Google OR-Tools, with constraints that encode how good drivers actually work. 覆盖蒙特利尔的多日配送路径优化器——基于 Google OR-Tools,用约束把"好司机的开法"写进了数学。

PythonGoogle OR-ToolsConstraint Programming约束规划Folium / LeafletGIS VisualizationGIS 可视化

The problem问题

Naive shortest-path routing produces plans that look optimal on paper and feel insane behind the wheel: the route zig-zags between distant neighborhoods, doubles back late in the day, and lets the "return home" leg drag afternoon stops in random directions. Drivers ignore plans like that — which means the plan is worthless. 朴素的最短路径算法排出来的计划,纸面上最优,方向盘后面看简直是疯的:路线在相距很远的街区之间来回横跳,临近收工还要折返,"回家"这一段还会把下午的配送点拽向莫名其妙的方向。司机根本不会照着开——而司机不执行的计划,一文不值。

The constraint约束

The optimizer had to respect three things standard VRP formulations don't give you for free: 优化器必须满足三件标准 VRP 模型不会白送你的事:

The solution方案

Proof: see it, don't take my word for it证明:眼见为实,不用信我的话

Baseline route: chaotic criss-crossing paths across the city
Baseline (shortest-path): criss-crossing, backtracking, neighborhood-hopping. 基线(最短路径):纵横交错、来回折返、街区乱跳。
Optimized route: clean sequential sweeps through each district
Optimized: sequential district sweeps a real driver would actually follow. 优化后:逐街区顺序扫过,真实司机真的会照着开。

Delivered as a runnable repository — solver, mock-data generator, baseline-vs-optimized comparison script, interactive GIS map, and a print-ready PDF report. Anyone can reproduce every figure with two commands. 以可运行的代码仓库交付——求解器、模拟数据生成器、基线对比脚本、交互式 GIS 地图、可打印的 PDF 报告。任何人两条命令就能复现每一张图。

Where else this applies还能用在哪

Field-service scheduling, last-mile delivery, sales-territory planning, technician dispatch — any operation where "the math says drive across town twice" costs you real fuel and real morale. 上门服务排班、最后一公里配送、销售片区规划、技师派单——任何"数学说要横穿全城两趟"会烧掉真实油钱和士气的场景。

← All case studies← 全部案例