A* Algorithms Flashcards

1
Q

What does A* algorithm do?

A

Finds shortest path from starting point to goal on graph

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

7 steps of A* algorithm?

A

1 Initialisation
2 Cost calculation
3 Explore
4 Expand neighbours
5 Close node
6 Repeat
7 Reconstruct path

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

Initialisation

A
  • Start with open list and closed list
  • Add starting point to open list with initial cost of 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Formula for total cost: f(n)

A

Cost from start to node: g(n) + Estimated cost from node to goal: h(n)

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

Explore

A

While open list isn’t empty, select node with lowest f(n) (if it’s goal then reconstruct path and finish)

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

Expand neighbours

A
  • For each neighbour of current node calculate g(n)
  • If it’s lower then update costs and set current node as neighbour’s parent
  • Add neighbour to current list if not already present
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Close node

A

Move current node to closed list

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

Repeat

A

Go back to step 3 until goal is found or no paths remain

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