solve_traveling_salesman_problem
Find the shortest route visiting all specified locations using the Traveling Salesman Problem solver. Supports custom distance matrix, start location, return-to-start, and time limit.
Instructions
Solve Traveling Salesman Problem (TSP) to find the shortest route visiting all locations.
Args:
locations: List of location dictionaries with name and coordinates
distance_matrix: Optional pre-calculated distance matrix
start_location: Index of starting location (default: 0)
return_to_start: Whether to return to starting location (default: True)
time_limit_seconds: Maximum solving time in seconds (default: 30.0)
Returns:
Optimization result with route and total distance
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": {
"locations": "<locations>"
},
"name": "solve_traveling_salesman_problem"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| locations | Yes | ||
| distance_matrix | No | ||
| start_location | No | ||
| return_to_start | No | ||
| time_limit_seconds | No |