solve_vehicle_routing_problem
Optimize vehicle routes to efficiently distribute resources across multiple locations. Input locations, vehicles, and constraints to generate optimal routing solutions.
Instructions
Solve Vehicle Routing Problem (VRP) to optimize routes for multiple vehicles.
Args:
locations: List of location dictionaries with name, coordinates, and demand
vehicles: List of vehicle dictionaries with capacity constraints
distance_matrix: Optional pre-calculated distance matrix
time_matrix: Optional pre-calculated time matrix
depot: Index of depot location (default: 0)
time_limit_seconds: Maximum solving time in seconds (default: 30.0)
Returns:
Optimization result with routes for all vehicles
Input Schema
Name | Required | Description | Default |
---|---|---|---|
depot | No | ||
distance_matrix | No | ||
locations | Yes | ||
time_limit_seconds | No | ||
time_matrix | No | ||
vehicles | Yes |
Input Schema (JSON Schema)
{
"properties": {
"depot": {
"default": 0,
"title": "Depot",
"type": "integer"
},
"distance_matrix": {
"anyOf": [
{
"items": {
"items": {
"type": "number"
},
"type": "array"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Distance Matrix"
},
"locations": {
"items": {
"additionalProperties": true,
"type": "object"
},
"title": "Locations",
"type": "array"
},
"time_limit_seconds": {
"default": 30,
"title": "Time Limit Seconds",
"type": "number"
},
"time_matrix": {
"anyOf": [
{
"items": {
"items": {
"type": "integer"
},
"type": "array"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Time Matrix"
},
"vehicles": {
"items": {
"additionalProperties": true,
"type": "object"
},
"title": "Vehicles",
"type": "array"
}
},
"required": [
"locations",
"vehicles"
],
"type": "object"
}