VRP with time window constraints - What unit of time?

63 views
Skip to first unread message

Hanna Hamilton

unread,
Jul 8, 2021, 1:50:37 AM7/8/21
to or-tools-discuss
Hi there - I am looking at the implementation here: https://developers.google.com/optimization/routing/vrptw

In the following lines of code, is there a certain unit of time that this implementation assumes (e.g. 30 minutes?)? I am wondering about this since I have my data in half hours, so I will need to make sure that everything is in half hours.

Also, what does "Don't force start cumul to zero." mean?

# Add Time Windows constraint.
    time = 'Time'
    routing.AddDimension(
        transit_callback_index,
        30,  # allow waiting time
        30,  # maximum time per vehicle
        False,  # Don't force start cumul to zero.
        time)
    time_dimension = routing.GetDimensionOrDie(time)


Thanks,
Hanna

Laurent Perron

unread,
Jul 8, 2021, 2:22:00 AM7/8/21
to or-tools-discuss
There is no definition of unit of time in the routing library.
You decide what 1 unit of time means.
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/7c3349f3-2735-4ce5-92e9-464d035cec07n%40googlegroups.com.

Mizux Seiha

unread,
Jul 8, 2021, 7:27:40 AM7/8/21
to or-tools-discuss
In AddDimension() if you set "force start cumul to zero" to TRUE it means the TW for each vehicle start node will be set to [0, 0] aka cumulVar for any start node is "forced" to zero...

This is useful for distance dimension or duration dimension BUT for time dimension you usually don't want this behavior, e.g. supposing you want your vehicle to start at 8h00am and not forcing it at 0h00am

Hanna Hamilton

unread,
Jul 8, 2021, 4:28:34 PM7/8/21
to or-tools-discuss
Okay, got it. Thanks!
Reply all
Reply to author
Forward
0 new messages