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)?
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]; }
);
Could you please share some sample or link? thank you
You have a distance matrix, or some function that returns the distance between 2 nodes. Add the loading time to that computed distance.