Introduction
origin
routeplanner.gw.bolthub.ai/origin/v1/routes/clusterSplits a set of stops into balanced groups, using straight-line distance by default or real road-network distance when requested. Useful for building delivery territories or zones, or for dividing a large job across vehicles. Returns each group with its stop ids, load totals, and centroid, plus any stops that could not be placed.
Either set how many groups you want, or send vehicles with capacities so the groups respect them (send one or the other, not both). You can pick a grouping strategy, balance the workload evenly across groups, and provide an optional depot. Road-aware grouping supports up to 50 stops; straight-line grouping supports larger sets.
Request body
stops (array, required) - The stops to group, as latitude/longitude points (two or more). Each may carry demand (items, weight, volume), a priority, and a time window.num_clusters (integer) - How many groups to split the stops into. Provide this or vehicles, not both.vehicles (array) - A fleet to pack the stops into, each with an optional capacity and stop limit. Provide this or num_clusters, not both.strategy (string: balanced | fill_vehicle_first | min_vehicles | zone_based | time_window | fairness) - How to group the stops (for example, balanced even distribution, or filling each vehicle in turn).balance_workload (boolean) - Distribute the stops more evenly across the groups.depot (object) - Optional common start location for the groups.road_aware (boolean) - Group by real road-network distance instead of straight-line. Supports up to 50 stops./origin/v1/routes/cluster