Save
A-level Computer Science
School Notes
Dijkstra’s Algorithm and A*
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Ana Saker
Visit profile
Cards (20)
What does Dijkstra’s algorithm find in a weighted graph?
The
shortest path
between
two
nodes
View source
How can graphs be used in real life?
To
model
networks
and
represent
entities
View source
In a network scenario, what does Dijkstra’s algorithm determine?
The
optimal
route
for
forwarding
packets
View source
What data structure is commonly used to implement Dijkstra’s algorithm?
A
priority queue
View source
What is stored at the front of the priority queue in Dijkstra’s algorithm?
The
smallest distances
View source
What is the first step in using Dijkstra’s algorithm?
Start
from
the
root node
(A)
Add
distances
to
neighbouring nodes
(B, C, D)
Mark
unreachable
nodes
with
∞
View source
What should you fill in the ‘Node’ column when demonstrating Dijkstra’s algorithm?
Nodes
connected
to the
root
node
View source
What does the ‘Total distance’ column represent in Dijkstra’s algorithm?
The
sum
of
distances
from the
root node
View source
Why is it important to keep track of visited nodes in Dijkstra’s algorithm?
To
avoid
going
back
on the
path
already
taken
View source
What happens in Step 2 of Dijkstra’s algorithm?
Remove
the
first
node
from the
queue
Traverse
connected
nodes
without
backtracking
Update
distances
if a
shorter
path
is
found
View source
What is the significance of the priority queue in Dijkstra’s algorithm?
It
orders
nodes
by
their
distance
from
the
root
View source
How does Dijkstra’s algorithm update the cost associated with a node?
By comparing new paths to
existing
costs
View source
What is the final step in Dijkstra’s algorithm?
Confirm the
shortest path
by tracing back
The shortest path found is ADE
The
total cost
is
11
View source
What is the first cost function in the A* algorithm?
The
actual
cost
between
two
nodes
View source
What is the purpose of the heuristic in the A* algorithm?
To
make
the
shortest path
finding
more
efficient
View source
How is the total cost calculated in the A* algorithm?
By
adding
the
approximate cost
to the
actual cost
View source
What is the difference in node selection between Dijkstra’s and A* algorithms?
Dijkstra’s
selects
nodes
with
lower
actual cost
A*
selects
nodes
with
lower
total cost
A*
aims
to
reduce
total time taken
View source
What is required when using the A* algorithm compared to Dijkstra’s algorithm?
An
extra
column
for
heuristic costs
The
same
method
as
Dijkstra’s
algorithm
Selection
of the
lowest
total
cost
route
View source
How do heuristics affect the A* algorithm's efficiency?
They
allow
quicker
path
finding
View source
What is the relationship between the heuristic and the actual cost in the A* algorithm?
The
heuristic
is
added
to the
actual
cost
View source