Yiyu Wang
unread,Nov 16, 2025, 10:21:38 PM (13 days ago) Nov 16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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