Google OR-Tools: Minimize Total Time

Viewed 478

I am working on a VRPTW and want to minimize the total time (travel time + waiting time) cumulated for all vehicles. So if we have 2 vehicles one that starts at time 0 and returns at time 50 and one that starts at time 25 and returns at time 100, then the objective value would be 50+75=125. Currently I have implemented the following code:

    for i in range(data['num_vehicles']):
        routing.AddVariableMinimizedByFinalizer(
            time_dimension.CumulVar(routing.End(i))) 

However, this seems like it is only minimizing the time we arrive back at the depot. Also it results in very high waiting times. How do I implement it correctly in Google OR tools?

1 Answers
Related