Vrpy not accomplish the Time Windows Constraints
See original GitHub issueI am trying to solve a CVRPTW on a graph with 54 nodes and 353 edges, as you can see it is a little size problem, and all the edges have a time window, a demand and a service time as the next image:

However, when I try to solve the problem with the exact algorithm the best routes are not satisfying the time windows constraint, as an example (even when this happens with many nodes) the previous node 36 has the time window [8 , 14] and when I look at the prob.arrival_time attribute the arrival time at the node is 15.3 (out of the TW) as shown in the next image

You can reproduce the problem with the next graph in the zip and this code:
from networkx import read_gpickle
import vrpy
G = read_gpickle('graph_vrpy,test')
len(G.nodes)
prob = vrpy.VehicleRoutingProblem(G, load_capacity=80)
#prob = VehicleRoutingProblem(G, load_capacity=100)
prob.time_windows = True
prob.solve(exact=True)
prob.best_routes
prob.arrival_time
G.nodes['36']
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Vehicle Routing Problems — VRPy 0.1.0 documentation
Taking into account duration constraints requires setting time attributes on ... This means that if a vehicle arrives at a node before the...
Read more >Cannot Get Optimal Solution with 16 nodes of VRP with Time ...
The solver find difficult to get the optimality. Does the time windows width become more complex as they are getting bigger? I have...
Read more >Program does not respect time window constraint for each ...
My inputs are like this, I am trying to make a code with starting and ending points to control the routing from a...
Read more >Algorithms for the Vehicle Routing and Scheduling Problems ...
This paper considers the design and analysis of algorithms for vehicle routing and scheduling problems with time window constraints.
Read more >VRPy: A Python package for solving a range of vehicle routing ...
the CVRP with time windows (Cordeau & Québec), 2000), ... We do not claim to outperform OR-Tools, but aim to have results of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

And… Going back to the beginning, @tomatoes-prog is correct. With the previous arrival_time version, without the
min, cspy works withdirection="forward"and not with"both". Performance-wise"forward"seems to be faster so it’s not really a problem, I just need to double check the backward REF.PS. Sorry for committing to master
Can confirm, only for arrival times though… I’ve just added another condition there