0

Im trying to solve Vehicle Routing Problem with Time Windows using OR tool with C#. Is it possible to add loading time (fixed duration, that vehicle have to stay at the location after arrival) to every location (no depot, but location)?

Smyk L.
  • 42
  • 3

1 Answers1

3

You can just add the loading time to all arcs going out of the node.

In your time transit callback simply return the service time + the travel time. e.g.

int transitCallbackIndex = routing.RegisterTransitCallback(
        (long fromIndex, long toIndex) => {
        // Convert from routing variable Index to time matrix NodeIndex.
        var fromNode = manager.IndexToNode(fromIndex);
        var toNode = manager.IndexToNode(toIndex);
        return data.TimeMatrix[fromNode, toNode] + data.ServiceTime[fromNode]; }
        );
Mizux
  • 8,222
  • 7
  • 32
  • 48
Laurent Perron
  • 8,594
  • 1
  • 8
  • 22