cuopt-routing-api-python
FeaturedVehicle routing (VRP, TSP, PDP) with cuOpt — Python API only. Use when the user is building or solving routing in Python.
AI & Automation 3,042 stars
352 forks Updated today Apache-2.0
Install
Quality Score: 99/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# cuOpt Routing — Python API
This skill is **Python only**. Routing has no C API in cuOpt.
## Required questions
Ask these if not already clear:
1. **Problem type** — TSP, VRP, or PDP?
2. **Locations** — How many? Depot(s)? Cost or distance between pairs (matrix or derived)?
3. **Orders / tasks** — Which locations must be visited? Demand or service per stop?
4. **Fleet** — Number of vehicles, capacity per vehicle (and per dimension if multiple), start/end locations?
5. **Constraints** — Time windows (earliest/latest arrival), service times, precedence (order A before B)?
## Minimal VRP Example
```python
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()
```
## Adding Constraints
```python
# 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_prece...
Details
- Author
- NVIDIA
- Repository
- NVIDIA/skills
- Created
- 5 months ago
- Last Updated
- today
- Language
- Python
- License
- Apache-2.0
Similar Skills
Semantically similar based on skill content — not just same category
API & Backend Featured
cuopt-server-api-python
cuOpt REST server — start server, endpoints, Python/curl client examples. Use when the user is deploying or calling the REST API.
3,042 Updated today
NVIDIA AI & Automation Featured
cuopt-install
Install cuOpt for Python, C, or server via pip, conda, or Docker; verify the install. For building cuOpt from source, see cuopt-developer.
3,042 Updated today
NVIDIA AI & Automation Featured
cuopt-numerical-optimization-api
LP, MILP, and QP (beta) with cuOpt — Python, C, and CLI. Use when the user is solving LP, MILP, or QP with any cuOpt interface.
3,042 Updated today
NVIDIA