Dijkstra and A* Flashcards

1
Q

Dijkstra purpose

A

Finds the shortest path from one node to all others

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

Dijkstra characteristics

A

Works with non negative weights

Needs graph, initial node, colection with visited nodes, collection of nodes to visit

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

Dijkstra node info

A

costSoFar -> minimum cost from initial node to current node

bestParent -> node from wich we get the costSoFar

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

Does dijkstra use an heuristic?

A

No

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

Dijkstra performance

A

O(N*b)
b -> average number of connections per node

Version of algo to target
O(b^(1+(C/£))
C
/£ -> expected depth of the solution

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

A* evaluation function

A

F(n) = g(n) + h(n)
g(n) -> cost of the given solution so far
h(n) -> heuristic function - estimated best cost from n to the solution

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

A* node info

A

costSoFar -> minimum cost from initial node to current node
bestParent -> node from wich we get the costSoFar
heuristic(targetNode) -> prediction of the cost from the node to the target node

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

How does A* solve ties?

A

Depends on how we organize the open list

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

How do we garantee that A* always finds the optimal path?

A

We can achieve that as long as the heuristic gives lower values that the true value

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

What is a consistent heuristic? Does A* need to always use consistent heuristics to find the optimal path?

A

It defends that its always better to go straight to a node thatn to go around
No

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

What is an admissible heuristic? Does A* need to always use admissible heuristics?

A

Heuristics that never overestimate the real remaining cost to reach the goal
No

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

What is the main difference between Dijkstra and A*?

A

In A* we use an heuristic to predict the cost from the current node to the goal node

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

Is there other algorithm that can expand fewer nodes and still ensure optimality than A*?

A

No

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

When is it ok to use non-admissible heuristics?

A

When the heuristic error is low

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

Why shold’t we use complex heuristic calculations?

A

Because it can easily dominate the pathfinding algorithm

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

What is purpose of the partial path in A*?

A

To give an early current best path so that we can start moving earlier
We can resume the A* later if we sabe the current Open and Closed data structures