difference between SetAllowedVehiclesForIndex and VehicleVar(index).SetValues(vehicle_idx)

813 views
Skip to first unread message

Lingaswamy Dacharam

unread,
Dec 8, 2021, 5:01:38 AM12/8/21
to or-tools-discuss
Hello Guys,

Can anyone please explain the difference between these functions.
1.routing.VehicleVar(index).SetValues(vehicle_idx)
2.routing.SetAllowedVehiclesForIndex(vehicle_idx, index)

VehicleVar(index).SetValues(vehicle_idx) is working fine when we have less data(i.e no of nodes and no of. vehicles), if we increase the data(i.e no of nodes) solver is not giving output. however when I use SetAllowedVehiclesForIndex solver comes out with proper solution. I didn't understand why, I would like to know each function's functionalities and where we suppose to use according to it.

Thank you in advance,

Regards,
Lingaswamy

Lingaswamy Dacharam

unread,
Dec 9, 2021, 3:18:07 AM12/9/21
to or-tools-discuss
Can someone please help on this.

Laurent Perron

unread,
Dec 9, 2021, 3:35:00 AM12/9/21
to or-tools...@googlegroups.com
https://github.com/google/or-tools/blob/86d4c543f717fa8716a9d66c25143660668bf825/ortools/constraint_solver/routing.cc#L1809

SetAllowedVehiclesForIndex... -> fills the allowed_vehicles_[node] list.


so SetAllowedVehiclesForIndex(v, a); SetAllowedVehiclesForIndex(v, b); is equivalent to routing.VehicleVar(index).SetValues([a, b, -1]);


Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/b79d1cb0-ddda-471d-a634-e852ee557e2dn%40googlegroups.com.

Lingaswamy Dacharam

unread,
Dec 10, 2021, 12:32:39 AM12/10/21
to or-tools-discuss
Thank you, laurent
Reply all
Reply to author
Forward
0 new messages