久章智能JZLOG
解决方案 · Solution · WECHAT ARTICLE

Intelligent path planning system solution based on OR-Tools

This is a multi-factory logistics distribution path planning system solution based on Google OR-Tools.

This is a multi-factory logistics distribution path planning system solution based on Google OR-Tools.

The system uses the CVRPTW algorithm to solve the vehicle routing problem with capacity and time windows. It controls the solution within 20 minutes through partition clustering, solution time box and historical solution warm start, and uses Kubernetes to implement parallel computing in 20 factory areas. At the constraint level, a pluggable DSL engine is designed to support configuration management of constraints such as capacity, time window, and vehicle model restrictions.

A highlight of the solution is the optimization closed loop driven by historical data: learning driver experience paths through GPS trajectories, counterfactual deduction to quantify the benefits of constraint relaxation, and incorporating potential customers into simulation planning to assist in sales expansion.

1. Overall architecture design

2. Detailed explanation of sub-module scheme

1·Planning operation efficiency (one-click generation & parallel) algorithm body

OR-Tools RoutingModel + CVRPTW (vehicle routing problem with capacity and time window), using PATH_CHEAPEST_ARC first solution + GUIDED_LOCAL_SEARCH meta-heuristic.

20 minutes constraint reached

The POC stage can basically achieve solution within 20 minutes. If there is a situation where some orders are too large, consider the following ways to split and simplify:

20 factories in parallel

One click trigger

Scheduled tasks (T-1 22:00 the next day) automatically pull orders → verify integrity → schedule and solve → store results → push.

2 · Constraint configuration capabilities and intelligent paths

2.1 Constraint DSL engine

The abstract constraint is a pluggable component (strategy pattern), and the background configuration is:

2.2 Vehicle models avoid impassable roads

2.3 Historical driver route learning

3·Dynamic adjustment of orders

3.1 Multiple scene changes

3.2 Upstream and downstream balance

3.3 Wave shipment

4· Historical data diagnosis and optimization

4.1 Configuration deviation diagnosis

4.2 Quantification of Constraint Relaxation Gains

4.3 Real-time reminder of problematic lines

5·Standardized diagnostic reports

6 · Regional business analysis

7 · Pre-planning for sales customer expansion

3. Risks and Responses

1·20min timeout risk:

The first solution of the algorithm + time box + partition solution are combined to deal with it; extreme scenarios are downgraded to the greedy algorithm for solution.

2 · Road network data quality:

Truck traffic restrictions and incomplete bridge height data → Establish a closed loop of customer feedback, and the driver app will report and make additional entries.

3· The driver does not agree with the plan:

Introduce "experience path learning" and "soft constraint adjustment" to avoid being divorced from reality.

4 · Constraint conflicts:

The DSL engine must perform feasibility pre-checking and highlight conflicting constraints.

Machine-translated from the Chinese original 基于 OR-Tools 的智能路径规划系统方案 (published 2025-07-26). WeChat original ↗