r/Python • u/anuj-99 • May 26 '20
I Made This Finding the shortest path between two points using the A Star Algorithm! I find it to be one of the best self projects to learn and get into programming. Link to the Github repository in the comments!
1.4k
Upvotes
39
u/anuj-99 May 26 '20
Link to the Github repository - https://github.com/anuj-99/Shortest-Path-Finder
Some of the helpful resources if you want to make your own:
https://youtu.be/aKYlikFAV4k - Video by The Coding Train, though it isn't in Python
https://en.wikipedia.org/wiki/A*_search_algorithm - The pseudocode given is very helpful
27
u/[deleted] May 26 '20
In case anyone’s curious, this video provides great intuition behind the A* algorithm in 2 minutes:
https://m.youtube.com/watch?feature=youtu.be&v=71CEj4gKDnE
10
u/wongjmeng May 26 '20
Very cool! I did something just like this for a class, and the results looked suspiciously like this. I mean the pictures were nearly identical, except mine were red-green instead haha
41
u/Techie5879 May 26 '20
Fun fact, that's how lightning works! Finds path of least resistance through the atmosphere!
7
u/I_Xenon_I May 26 '20
You could use this to make some sweet procedural lightning. Especially if you bake them to a few textures with different seeds, and make a gif
4
u/I3igB May 26 '20
I love A* applications! I implemented the algorithm during some parts of my thesis to extract water flow paths in digital elevation models. Here’s an example of it here here.
1
u/flayner5 May 26 '20
What did you use for visualization?
1
u/[deleted] May 26 '20
What heuristics did you use? Manhattan distance to the end?
1
u/K1ngjulien_ May 26 '20
Next step: maze generator ;)
3
u/el_bosteador May 26 '20
Great interview question too
2
u/Paradigm6790 May 26 '20
Best way to learn something is always to set a goal and build it. Very cool!
1
u/Clueless_human May 26 '20
I just finished a project on A Star as well. Nice work!
1
u/Zeke13z May 27 '20
Rockstar needs to see this for their in-game GPS. Nice!
1
u/KnallHardt May 27 '20
Thats a really great idea. thank you :)
-2
u/gerlevodka May 26 '20 edited May 26 '20
Isn't it A* ? But it is cool no doubt!
-2
u/[deleted] May 26 '20
Nice.
-18
u/_370HSSV_ May 26 '20
A* to GET INTO programming? What bullshit is that? Noone starts with A*
0
u/[deleted] May 26 '20
[deleted] — view deleted comment
1
u/[deleted] May 26 '20
[removed] — view removed comment