Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A star: functional programming with numba #119

Merged
merged 24 commits into from
Aug 17, 2020
Merged

Conversation

thuydotm
Copy link
Contributor

@thuydotm thuydotm commented Aug 15, 2020

  • separate snap option as snap_start and snap_goal
  • add connectivity option, can be either 4 or 8, defaulted as 8
  • warning if start or end at a non-crossable pixel (nan or a barrier)
  • raise error if start or goal location outside the surface graph
  • benchmark and numba-ize
  • add Pathfinding Supported Spatial Functions in README.md
  • add example to user_guide.ipynb

@thuydotm
Copy link
Contributor Author

thuydotm commented Aug 15, 2020

@brendancol Here the benchmark of A* pathfinding with the example of the city of Austin road network

# street_agg.shape = (600, 800)
%timeit path_agg = a_star_search(street_agg, start, goal, barriers=[0])
# 1. Old version using PriorityQueue:
11min 44s ± 21.5 s per loop (mean ± std. dev. of 7 runs, 1 loop each)
# 2. New version of functional programming with Numba
160 ms ± 32.1 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

The new version is ~3500 to 5700 times faster.

@brendancol
Copy link
Contributor

@thuydotm Wow!! So great!

@brendancol brendancol merged commit 716c468 into makepath:master Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants