What it does
Vehicle routing (VRP, TSP, PDP) with cuOpt — Python API only
Skills ZICQ category:Agent Workflows cuopt-routing-api-python
Vehicle routing (VRP, TSP, PDP) with cuOpt — Python API only. Use when the user is building or solving routing in Python.
Official URL:skills.sh
Intro in this page language first. The official description stays in its original wording; we do not rewrite SKILL.md.
Vehicle routing (VRP, TSP, PDP) with cuOpt — Python API only
the user is building or solving routing in Python
Per Agent Skills progressive disclosure: name and description load at startup (~100 tokens); the full SKILL.md body loads when the skill activates; scripts/, references/, and assets/ load only as needed. This file's sections: cuOpt Routing — Python API; Required questions; Minimal VRP Example; Adding Constraints; Time windows; Capacities. It includes spec-recommended sections: input/output examples.
File analysis: besides SKILL.md, the body references references/examples.md, references/server_examples.md, assets/vrp_basic/, assets/pdp_basic/, assets/README.md. Those resources load on demand.
cuOpt Routing — Python APIRequired questionsMinimal VRP ExampleAdding ConstraintsTime windowsCapacitiesPickup-delivery pairsPrecedenceSolution CheckingData Types (use explicit dtypes)Solver SettingsCommon Issues
· License:Apache-2.0
Source category:skills.sh agent-skill
namecuopt-routing-api-pythondescriptionreferences/examples.mdreferences/server_examples.mdassets/vrp_basic/assets/pdp_basic/assets/README.mdThese paths are extracted from the text. Check the upstream package to verify the files exist.
Invocation syntax and available tools depend on your Agent client. Client integration guide ↗
Choose the target agent and installation scope, keep referenced package files, then verify the skill appears in the client's catalog.
This skill references supporting files. Retrieve the complete directory from the source; copying SKILL.md alone may leave missing dependencies.
Copy these instructions to a compatible agent and confirm the target directory matches your client.
Install the agent skill "cuopt-routing-api-python" into my project. The full SKILL.md and official description are at https://zicq.com/en/skills/skl-092d9d8505306741-Cuopt-Routing-Api-Python.html Save it as .cursor/skills/cuopt-routing-api-python/SKILL.md or .claude/skills/cuopt-routing-api-python/SKILL.md and keep the frontmatter name and description exactly as-is. This skill also ships scripts/, references/, or assets/ — fetch the whole folder from https://github.com/nvidia/skills instead of creating only a SKILL.md.
Requires Node.js and npx. First inspect the repository's skill list to confirm the name.
npx skills add 'https://github.com/nvidia/skills' --list
npx skills add 'https://github.com/nvidia/skills' --skill 'cuopt-routing-api-python'
The CLI lets you choose the agent interactively. The default scope is the project; use -g for user scope. Confirm package availability with the discovery command, then use npx skills list to inspect installed skills.
This skill is Python only. Routing has no C API in cuOpt.
Ask these if not already clear:
import cudf
from cuopt import routing
cost_matrix = cudf.DataFrame([...], dtype="float32")
dm = routing.DataModel(n_locations=4, n_fleet=2, n_orders=3)
dm.add_cost_matrix(cost_matrix)
dm.set_order_locations(cudf.Series([1, 2, 3], dtype="int32"))
solution = routing.Solve(dm, routing.SolverSettings())
if solution.get_status() == 0:
solution.display_routes()
# Time windows
dm.add_transit_time_matrix(transit_time_matrix)
dm.set_order_time_windows(earliest_series, latest_series)
# Capacities
dm.add_capacity_dimension("weight", demand_series, capacity_series)
dm.set_order_service_times(service_times)
dm.set_vehicle_locations(start_locations, end_locations)
dm.set_vehicle_time_windows(earliest_start, latest_return)
# Pickup-delivery pairs
dm.set_pickup_delivery_pairs(pickup_indices, delivery_indices)
# Precedence
dm.add_order_precedence(node_id=2, preceding_nodes=np.array([0, 1]))
status = solution.get_status() # 0=SUCCESS, 1=FAIL, 2=TIMEOUT, 3=EMPTY
if status == 0:
route_df = solution.get_route()
total_cost = solution.get_total_objective()
else:
print(solution.get_error_message())
print(solution.get_infeasible_orders().to_list())
cost_matrix = cost_matrix.astype("float32")
order_locations = cudf.Series([...], dtype="int32")
demand = cudf.Series([...], dtype="int32")
ss = routing.SolverSettings()
ss.set_time_limit(30)
ss.set_verbose_mode(True)
ss.set_error_logging_mode(True)
| Problem | Fix |
|---------|-----|
| Empty solution | Widen time windows or check travel times |
| Infeasible orders | Increase fleet or capacity |
| Status != 0 with time windows | Add add_transit_time_matrix() |
| Wrong cost | Check cost_matrix is symmetric |
| compute_waypoint_sequence alters route_df | It replaces the location column with waypoint ids in place — pass route_df.copy() if you still need cost-matrix indices (e.g. when iterating per truck) |
When status != 0: print(solution.get_error_message()) and print(solution.get_infeasible_orders().to_list()) to see which orders are infeasible.
Data types: Use explicit dtypes (float32, int32) for matrices and series to avoid silent errors.
assets/ — vrp_basic, pdp_basic. See assets/README.md.For contribution or build-from-source, see the developer skill.
Agent Workflows
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that exte…
Agent Workflows
Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fl…
Agent Workflows
Orchestrate multi-agent teams with defined roles, task lifecycles, handoff protocols, and review workflows. Use when: (1) Setting up a team …
Agent Workflows
Spec-first, TDD, subagent-driven software development workflow. Use when: (1) building any new feature or app — triggers brainstorm → plan →…