2.3.5 Path FInding Algorithms Flashcards

1
Q

What is Dijkstra’s algorithm?

A

A shortest path algorithm used to find the shortest distance between two nodes on a weighted graph

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

Outline the stages of Dijkstra’s algorithm.

A

Priority queue created from starting node
Distances added (0 to starting node, ∞ to others)
Remove front node and add to visited list
Update distances of each node connected to visited node
Sort priority queue
Repeats until all visited

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

What is the A* algorithm?

A

A general path-finding algorithm that uses heuristics to approximate the shortest path between two nodes on a weighted graph

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

Outline the stages of the A* algorithm.

A

Priority queue created from starting node
Distances from starting node, heuristic distances to end node and sum
Remove front node and add to visited list
Update all data for nodes connected to visited nodes
Sort priority queue
Repeats until all visited

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

How does the A* algorithm differ from Dijkstra’s algorithm?

A

A* algorithm has two cost functions:
Actual cost
Approximate cost

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

Why are heuristics used in the A* algorithm?

A

To calculate an approximate cost from the starting node to the final node
Aims to make finding path more efficient

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

State a disadvantage of using the A* algorithm.

A

The speed of the algorithm is constrained by the accuracy of the heuristic methods

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