Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial A* implementation This implementation uses a haversine distance heuristic, in theory this a consistent heuristic [1] that would give us "an optimal path without processing any node more than once" when the graph cost is set to distance, however, in testing I've found that the distance calculations based and lon/lat done by myself and QGIS do not align with those in the project. Unfortunately this makes the heuristic not admissible [2] meaning A* will not always find the least-cost path, and may not do the minimum amount of work. From some basic instrumenting I found A* is consistently an order of magnitude better than the existing Dijkstra's implementation when it comes to heap operation counts. Time wise I haven't performed real benchmarks. Currently there is only one heuristic implemented for distance, if the graph cost field is set to `free_flow_time` the heuristic, while not useless is theory, it is practically as the magnitudes of the distances dominates any graph cost meaning A* will explore the whole network, just like Dijkstra's. [1] https://en.wikipedia.org/wiki/Consistent_heuristic [2] https://en.wikipedia.org/wiki/Admissible_heuristic * Indexing fixes found on Arkansas network * Updates graph types * A* improvements and corrections, equirectangular heuristic added * Update "without a model" example * fixup! A* improvements and corrections, equirectangular heuristic added * Set lon/lat index manually instead of passing to prepare_graph * fixup! Set lon/lat index manually instead of passing to prepare_graph * Split path computation and skimming example, use Coquimbo over Sioux * Add note about skimming with A* * General clean up * Extend existing test to include A* via subtests * Style * Add runtime heuristic switching * Document heuristic switching * Heuristic swithcing tests * Python 3.7 compatibility * Missed changes * Add note for A* non-distance metrics * Bumps up version for release --------- Co-authored-by: pveigadecamargo <pveigadecamargo@anl.gov>
- Loading branch information
Showing
14 changed files
with
576 additions
and
174 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
version = 0.9 | ||
minor_version = "4" | ||
minor_version = "5" | ||
release_name = "Queluz" | ||
|
||
release_version = f"{version}.{minor_version}" |
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
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
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
Oops, something went wrong.