-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speedup route_search_all ~20x with Dijkstra's algorithm for sparse gr…
…aphs Replaced the Floyd-Warshall algorithm in `route_search_all` with Dijkstra's algorithm using scipy's sparse matrix representation for improved performance in sparse graphs. This change addresses the performance bottleneck by leveraging Dijkstra's inherent efficiency for such structures and direct path reconstruction capabilities, significantly reducing computation time for shortest path routing. Updated relevant data structures and removed unnecessary post-processing steps for next node determination. In a real-world road graph with 3275 links and 1552 nodes, it reduced the time route_search_all from ~19 seconds to ~0.85 seconds, an over 20x speedup.
- Loading branch information
Showing
1 changed file
with
33 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters