vehicle-routing-solver
БесплатноБез исполняемых скриптовНе проверенVehicle routing problem solver for logistics optimization with time windows, capacity constraints, and multiple depots.
от a5c-ai★ 1 947 звёзд на GitHubОб этом скилле
vehicle-routing-solver
You are vehicle-routing-solver - a specialized skill for solving vehicle routing problems including capacity constraints, time windows, multiple depots, and pickup-delivery scenarios.
Overview
This skill enables AI-powered vehicle routing including:
- CVRP (Capacitated VRP) modeling
- VRPTW (VRP with Time Windows) handling
- Multi-depot routing optimization
- Pickup and delivery problem solving
- Route visualization and mapping
- Real-time route adjustment
- Driver assignment optimization
Prerequisites
- Python 3.8+ with OR-Tools installed
- Geographic data processing libraries
- Mapping API access (optional)
Capabilities
1. Capacitated VRP (CVRP)
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
def solve_cvrp(distance_matrix, demands, vehicle_capacities, depot=0):
"""
Solve Capacitated Vehicle Routing Problem
"""
manager = pywrapcp.RoutingIndexManager(
len(distance_matrix), len(vehicle_capacities), depot
)
routing = pywrapcp.RoutingModel(manager)
# Distance callback
def distance_callback(from_index, to_index):
from_node = manager.IndexToNode(from_index)
to_node = manager.IndexToNode(to_index)
return distance_matrix[from_node][to_node]
transit_callback_index = routing.RegisterTransitCallback(distance_callback)
routing.SetArcCostEvaluatorOfAllVehicles(transit_callback_index)
# Capacity constraint
def demand_callback(from_index):
from_node = manager.IndexToNode(from_index)
return demands[from_node]
demand_callback_index = routing.RegisterUnaryTransitCallback(demand_callback)
routing.AddDimensionWithVehicleCapacity(
demand_callback_index,
0, # null slack
vehicle_capacities,
True, # start cumul at zero
'Capacity'
)
# Solve
search_parameters = pywrapcp.DefaultRoutingSearchParameters()
search_parameters.first_solution_strategy = (
routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC
)
search_parameters.local_search_metaheuristic = (
routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH
)
search_parameters.time_limit.seconds = 30
solution = routing.SolveWithParameters(search_parameters)
return extract_routes(manager, routing, solution)
2. VRP with Time Windows (VRPTW)
def solve_vrptw(distance_matrix, time_matrix, time_windows,
demands, vehicle_capacities, depot=0):
"""
Solve VRP with Time Windows
"""
manager = pywrapcp.RoutingIndexManager(
len(distance_matrix), len(vehicle_capacities), depot
)
routing = pywrapcp.RoutingModel(manager)
# Distance callback
def distance_callback(from_index, to_index):
from_node = manager.IndexToNode(from_index)
to_node = manager.IndexToNode(to_index)
return distance_matrix[from_node][to_node]
transit_callback_index = routing.RegisterTransitCallback(distance_callback)
routing.SetArcCostEvaluatorOfAllVehicles(transit_callback_index)
# Time dimension with time windows
def time_callback(from_index, to_index):
from_node = manager.IndexToNode(from_index)
to_node = manager.IndexToNode(to_index)
return time_matrix[from_node][to_node]
time_callback_index = routing.RegisterTransitCallback(time_callback)
routing.AddDimension(
time_callback_index,
30, # allow waiting time
480, # max time per vehicle (8 hours)
False,
'Time'
)
time_dimension = routing.GetDimensionOrDie('Time')
# Add time window constraints
for location_idx, (early, late) in enumerate(time_windows):
if location_idx == depot:
continue
index = manager.NodeToIndex(location_idx)
time_dimension.CumulVar(index).SetRange(early, late)
# Minimize total time
for i in range(len(vehicle_capacities)):
routing.AddVariableMinimizedByFinalizer(
time_dimension.CumulVar(routing.Start(i))
)
routing.AddVariableMinimizedByFinalizer(
time_dimension.CumulVar(routing.End(i))
)
# Solve
search_parameters = pywrapcp.DefaultRoutingSearchParameters()
search_parameters.first_solution_strategy = (
routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC
)
solution = routing.SolveWithParameters(search_parameters)
return extract_routes_with_times(manager, routing, solution, time_dimension)
3. Multi-Depot VRP
def solve_multi_depot_vrp(distance_matrix, demands, depots,
vehicles_per_depot, vehicle_capacity):
"""
Solve VRP with multiple depots
"""
num_vehicles = sum(vehicles_per_depot)
# Create start and end indices for each vehicle
starts = []
ends = []
for depot_idx, depot in enumerate(depots):
for _ in range
Установить vehicle-routing-solver в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(*)ReadWriteEditGlobGrepWebFetchFAQ
Что делает скилл vehicle-routing-solver?
Vehicle routing problem solver for logistics optimization with time windows, capacity constraints, and multiple depots.
Как установить скилл vehicle-routing-solver?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл vehicle-routing-solver запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic