Modeling node–vehicle type compatibility in Routing Solver

36 views
Skip to first unread message

Yiyu Wang

unread,
Nov 16, 2025, 10:21:38 PM (13 days ago) Nov 16
to or-tools-discuss
Dear team,

I have a modeling question about the OR-Tools Routing Solver.

In my problem, I have several vehicle types (for example, UAV, ground vehicle, etc.), and each vehicle belongs to exactly one type.
Each location (node) also has a point type, such as “air-only”, “ground-only”, or “both”.

I would like to enforce a compatibility constraint:
for each node i, only certain vehicle types are allowed to visit it (e.g., air-only nodes can only be visited by UAV-type vehicles).

Before posting here, I looked through the documentation and examples but couldn't find a case that shows how to model this. I also tried a workaround by assigning a very large cost to edges that represent “incompatible” node–vehicle pairs to each vehicle's distance matrix, but the solver still uses those edges in some solutions, likely because this does not create a hard constraint.

So my questions are:
1. Does the Routing Solver support hard node–vehicle type compatibility constraints?
2. If yes, what is the recommended way to model them (e.g., AllowedVehiclesForIndex, filters, or other mechanisms)?

Thank you very much for your guidance.
Best regards

Corentin "Mizux" Le Molgat

unread,
Nov 17, 2025, 3:52:08 AM (13 days ago) Nov 17
to or-tools-discuss
Reply all
Reply to author
Forward
0 new messages