Each vehicle has specific "distaste" of certain delivery routes. We would like to exclude these specific nodes combinations from specific vehicles.
Let's say we have vehicles A and nodes to visit X, Y, Z And if vehicle A does not want [X, Y] and [X] routes we don't want to have these solutions:
Not OK:
- Vehicle A: [X, Y]
- Vehicle A: [Y, X] (any order)
- Vehicle A: [X]
These are OK:
- Vehicle A: [Y] ie. subset is fine
- Vehicle A: [X, Y, Z] ie. addition of another node is fine
- Vehicle A: [Z, Y, X]
- Vehicle A: [Z, A] and so on.
I understand there are
if nodes[node_index] according to criteria:
routing.SetAllowedVehiclesForIndex(list(allowed_vehicle_list)), node_index)
Or
routing.VehicleVar(index).SetValues([-1, 2,3,4])
But these completely exclude that vehicle visiting the node. Any idea how to exclude only certain "solution" for a number of vehicles?