-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
pathfinding part 1 #3069
pathfinding part 1 #3069
Conversation
Deploying excaliburjs with Cloudflare Pages
|
|
||
### Dijkstra's Algorithm | ||
|
||
Dijkstra's Algorithm is an algorithm for finding the shortest path through a graph that presents weighting (distances) between |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, algorithm is used twice in the sentence
|
||
![Graph Network](./img/image-2.png) | ||
|
||
Edsger Dijkstra, in Amsterdam, was sipping coffee at a cafe in Amserdam in 1956, and was working through a mental exercise regarding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, Amsterdam is used twice in the sentence
Let's declare A our starting node and update our results object with this current information. Since we are starting at node A, we then | ||
review A's connected neighbors, in this example its nodes B and C. | ||
|
||
![alt text](./img/image-3.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add alt text
|
||
With that update, we can move node A from unvisited to visited list, and we have this new state. | ||
|
||
![alt text](./img/image-4.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add alt text
|
||
We continue to repeat this algorithm until we have visited all nodes. | ||
|
||
Quick iteration: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what Quick Iteration
means
In this article, we reviewed a brief history of Dijkstra's Algorithm, then we created and example graph network and stepped through it | ||
using the algorithm, and then was able to use it to determine the shortest path of nodes. | ||
|
||
This algorithm I have found is more expensive than A\*, but is a nice tool to use when you don't understand the shape and size of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to have this benefit at the beginning of the article as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the only one that i waffled on regarding making a change...
sometimes, I need just to understand if that path is clear between one tile and another. Sometimes you can have a graph node tree, and | ||
need to understand the cheapest decision. These are the kinds of challenges where one could use a pathfinding algorithm to solve. | ||
|
||
![alt text](./img/image-1.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add alt ext
|
||
Node B is closer to Source than node D, so we visit it next. | ||
|
||
![alt text](./img/image-6.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add alt text
|
||
D is the only unvisited neighbor, and we hit a dead end on this branch, so D gets visited, but with no updates to the results table | ||
|
||
![alt text](./img/image-7.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add alt text
blog entry for pathfinding part 1