Install
openclaw skills install @ruiduobao/geoskill-logistics-optimizationVRP/TSP with time windows and capacity constraints to compute optimal routes and cost for logistics
openclaw skills install @ruiduobao/geoskill-logistics-optimizationSolves logistics distribution route optimization with two modes — TSP (traveling salesman) and VRP (capacitated vehicle routing) — and outputs the optimal routes and total cost.
TSP: nearest-neighbor heuristic + 2-opt local search to find the shortest tour that visits all nodes and returns to the start. VRP: a greedy "demand descending + nearest feasible vehicle" rule assigns customers to vehicles (capacity constraint), and each vehicle's route is then internally optimized with TSP; a time-window feasibility check is also provided. Distances support both Haversine (lon/lat) and Euclidean metrics.
pip install 'numpy' 'scipy' 'geopandas' 'shapely'
python geoskill-logistics-optimization.py --bbox 116.0 39.0 117.0 40.0 [other parameters]
python geoskill-logistics-optimization.py --bbox 116 39 117 40 --synthetic --mode tsp --output-dir ./out
python geoskill-logistics-optimization.py --bbox 116 39 117 40 --synthetic --mode vrp --capacity 12 --output-dir ./out
python geoskill-logistics-optimization.py --input nodes.geojson --mode vrp --capacity 15 --output-dir ./out
python geoskill-logistics-optimization.py --input nodes.geojson --mode tsp --metric euclidean --no-2opt --output-dir ./out
python geoskill-logistics-optimization.py --bbox 116 39 117 40 --synthetic --mode vrp --n-customers 30 --output-dir ./out
| File | Format | Description |
|---|---|---|
routes.geojson | GeoJSON | Per-vehicle routes (LineString, with load/mileage) |
nodes.geojson | GeoJSON | Depot and customer nodes (with demands) |
solution.json | JSON | Optimal solution (vehicle count/total mileage/per-route detail) |
output-manifest.json | JSON | Run manifest |
GeoJSON point features; the first point is the depot and the rest are customers; demand can be specified via the demand attribute. Alternatively, use --synthetic to generate physically consistent simulated data (fully offline).
--synthetic mode requires no network at all.MIT
求解物流配送路径优化,支持 TSP(旅行商)与 VRP(带容量车辆路径)两种模式,输出最优路径与总成本。
TSP:最近邻启发式 + 2-opt 局部搜索求访问所有节点并返回起点的最短回路。VRP:按“需求降序 + 最近可装车”贪心把客户分配到车辆(容量约束),每辆车内部再做 TSP 优化;另提供时间窗可行性检查。距离支持 Haversine(经纬度)与欧氏两种度量。
pip install 'numpy' 'scipy' 'geopandas' 'shapely'
python geoskill-logistics-optimization.py --bbox 116.0 39.0 117.0 40.0 [其他参数]
python geoskill-logistics-optimization.py --bbox 116 39 117 40 --synthetic --mode tsp --output-dir ./out
python geoskill-logistics-optimization.py --bbox 116 39 117 40 --synthetic --mode vrp --capacity 12 --output-dir ./out
python geoskill-logistics-optimization.py --input nodes.geojson --mode vrp --capacity 15 --output-dir ./out
python geoskill-logistics-optimization.py --input nodes.geojson --mode tsp --metric euclidean --no-2opt --output-dir ./out
python geoskill-logistics-optimization.py --bbox 116 39 117 40 --synthetic --mode vrp --n-customers 30 --output-dir ./out
| 文件 | 格式 | 说明 |
|---|---|---|
routes.geojson | GeoJSON | 各车辆路径(LineString,含载重/里程) |
nodes.geojson | GeoJSON | 仓库与客户节点(含需求) |
solution.json | JSON | 优化解(车辆数/总里程/各路线) |
output-manifest.json | JSON | 运行清单 |
GeoJSON 点要素,第一个点为仓库 depot,其余为客户;可用属性 demand 指定需求。 或使用 --synthetic 生成物理一致的模拟数据(完全离线)。
--synthetic 模式完全无网络。MIT