- Title: Dijkstra's Algorithm and A*
- Description: An example demonstrating Dijkstra's algorithm. A* approach also included.
- GM Version: :GM81:
- Registered: yes
- File Type: .gm81
- File Size: 23KB
- File Link: Dijkstra's, A*
- Required Extensions: None
- Required DLLs: None
The project contains 2 rooms. In the first room you construct your own graph and then find the shortest path between two nodes. In the second room it's a top-down stage where you can see this in action.
Note: A* is a much more efficient approach in path-finding than Dijkstra's, though they are very similar. A* approach takes into account an estimated distance between the available nodes and the target node before choosing a new node. You can find more about the A* approach here.
You can optimize the A* example included by using a sorted map instead of a priority queue along with a binary search algorithm, although it's not necessary.
On the left, an illustration of how Dijkstra's algorithm finds the shortest path and on the right the A* approach.
Free to use.