Depot / hub location (p-median)
route-optimization_depot-location-optimizeChoose p hub locations from candidates to minimise demand-weighted distance, optionally capacitated. Price $0.04 USDC. POST /api/v1/route-optimization/depot-location-optimize. 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": {
"demand": "<demand>",
"candidates": "<candidates>",
"p": "<p>"
},
"name": "route-optimization_depot-location-optimize"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| p | Yes | p, integer, from 1 to 100. Required. | |
| demand | Yes | demand, array. Required. | |
| matrix | No | matrix, object. Optional. | |
| candidates | Yes | candidates, array. Required. | |
| capacities | No | capacities, value. Optional. | |
| matrixFromPoints | No | matrixFromPoints, string, one of euclidean, haversine. Optional. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | method. String. | |
| optimal | No | optimal. Boolean. | |
| sources | No | sources. Array. | |
| selected | No | selected. Array. | |
| objective | No | objective. Number. | |
| allocation | No | allocation. Array. | |
| limitations | No | limitations. Array. |