DeltaSteppingShortestPath unable to solve SSSP on a path with 3+ edges
See original GitHub issue * JGraphT version: 1.5.0 [also tested on 1.4.0]
* Java version (java -version)/platform: adopt-openjdk-15/windows [also tested on oracle 1.8.0_265/windows]
Issue DeltaSteppingShortestPath cannot solve the Shortest Path Problem on a Graph where the target vertex is 3 or more edges away from the source vertex.
Steps to reproduce (small coding example)
DirectedWeightedMultigraph<String, DefaultWeightedEdge> graph = new DirectedWeightedMultigraph<>(DefaultWeightedEdge.class);
graph.addVertex("v0");
graph.addVertex("v1");
graph.addVertex("v2");
graph.addVertex("v3");
graph.addEdge("v0", "v1");
graph.addEdge("v1", "v2");
graph.addEdge("v2", "v3");
new DeltaSteppingShortestPath<>(graph).getPath("v0", "v3") // this returns null
new DijkstraShortestPath<>(graph).getPath("v0", "v3") // this returns a non-null result
Expected behaviour DeltaSteppingShortestPath should find a similar solution to DijkstraShortestPath
Other information
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
(PDF) Delta-stepping: a parallelizable shortest path algorithm
Abstract and Figures. The single source shortest path problem for arbitrary directed graphs with n nodes, m edges and nonnegative edge weights ...
Read more >∆-stepping: a parallelizable shortest path algorithm
Our new algorithm, which we call Delta-stepping, can be implemented very efficiently in sequential and parallel setting for a large class of graphs....
Read more >Delta-stepping SSSP: from Vertices and Edges to GraphBLAS ...
We illustrate our approach by translating the delta-stepping single source shortest path algorithm from its canonical description to a GraphBLAS implementation, ...
Read more >bale/sssp.md at master · jdevinney/bale - GitHub
We are given the adjacency matrix for a graph with non-negative edge weights ... "Delta-stepping: a parallelizable shortest path algorithm" by U. Meyer...
Read more >Parallel single-source shortest path algorithm - Wikipedia
One of the generalizations of the shortest path problem is known as the single-source-shortest-paths (SSSP) problem, which consists of finding the shortest ...
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 FreeTop 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
Top GitHub Comments
I`ve fixed the bug in my local branch. I will submit a PR after #972 gets merged since I made my changes on top of those commits.
Basically, the problem goes as follows: the computation of the number of buckets is correct. However, the iteration over the bucket structure during shortest path computation is incorrect because every bucket is traversed only once. For it to be correct, the number of buckets should be equal to
ceil(L/delta)
whereL
is the maximum weight of the shortest path in the graph.In our implementation, we have the number of buckets computed as
and vertices are getting assigned to buckets as
therefore some buckets might be traversed multiple times. To fix this issue it is needed to start with the first non-empty bucket in every interaction, as shown here:
I guess we can close this now.