Path Finding Algorithms Flashcards

1
Q

Dijkstra’s Algorithm

A

Dijkstra’s Algorithm: Finds shortest path between 2 nodes in weighted graph
- Implemented using priority queue, w/ smallest distances being stored at front of list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A* Algorithm

A

A* Algorithm: General path-finding algorithm, has 2 cost functions:
1) First cost function, actual cost between 2 nodes (same cost as in Dijkstra’s algorithm)
2) Second cost function, approximate cost from node x to final node (called heuristic), aims to make shortest path finding process more efficient
- Approximate cost might be estimate of length between x & final node, calculated using trigonometry
- When calculating the distance between 2 nodes, approximate cost is added onto actual cost
- Used to determine which node is visited next
- Differs from Dijkstra’s algorithm, as a node w/ a lower actua cost may be rejected in favour of node w/ lower total cost
- Meant to reduce total time taken to find shortest path

How well did you know this?
1
Not at all
2
3
4
5
Perfectly