Balanced territory clustering
route-optimization_territory-clusterSplit stops into k balanced, compact territories with capacitated k-means and imbalance limits. Price $0.03 USDC. POST /api/v1/route-optimization/territory-cluster. An unpaid call returns the x402 payment terms and does not run.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"stops": "<stops>",
"k": "<k>"
},
"name": "route-optimization_territory-cluster"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | Yes | k, integer, from 1 to 500. Required. | |
| seed | No | seed, integer, from -9007199254740991 to 9007199254740991. Optional. | |
| stops | Yes | stops, array. Required. | |
| balanceBy | No | balanceBy, string, one of count, weight. Optional. | |
| maxImbalance | No | maxImbalance, number, from 0 to 1. Optional. | |
| matrixFromPoints | No | matrixFromPoints, string, one of euclidean, haversine. Optional. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sources | No | sources. Array. | |
| imbalance | No | imbalance. Number. | |
| withinSse | No | withinSse. Number. | |
| limitations | No | limitations. Array. | |
| territories | No | territories. Array. |