Save
Computer Science
algorithms
optimisation algorithms
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
willow
Visit profile
Cards (19)
What is Dijkstra’s shortest path algorithm used for?
Calculating the
shortest
path
between points
View source
What do nodes represent in weighted graphs?
Labelled
circles
also known as
vertices
View source
What do edges represent in weighted graphs?
Connections
between
nodes
with a
weight
View source
What is the least cost path in shortest path problems?
The best way to get from one
node
to another
View source
How is the shortest path calculated?
By adding up individual
weights
from
edges
View source
What does the shortest path consist of?
Sequence of
nodes
visited for
minimum
cost
View source
What information does Dijkstra's algorithm produce for each node?
Node
label
,
cost
, previous node label
View source
What is the initial cost of all nodes in Dijkstra's algorithm?
Infinity
, indicating costs not calculated
View source
What is the cost of the start node A in Dijkstra's algorithm?
0
, as it is the starting point
View source
What is the purpose of the unvisited list in Dijkstra's algorithm?
To track
nodes
that have not been
visited
View source
What happens when a node is added to the visited list?
It cannot be revisited in the
algorithm
View source
What does the algorithm do after picking the current node?
Examines reachable
unvisited
nodes
from it
View source
What is updated for neighbors in the current node?
The
cost
for all neighbors is updated
View source
What is the process repeated until in Dijkstra's algorithm?
Until the desired end
node
is reached
View source
What is a limitation of Dijkstra's algorithm?
It can be inefficient for
specific
targets
View source
What does Dijkstra's algorithm not consider?
Direction
or
proximity
of nodes
View source
What is an alternative to Dijkstra's algorithm?
A*
pathfinding algorithm
View source
What are the steps involved in Dijkstra's shortest path algorithm?
Initialize costs of all
nodes
to
infinity
.
Create
unvisited
list with nodes and costs.
Set
start node
cost to 0.
Create an empty visited list.
Pick the node with the lowest cost.
Examine reachable unvisited nodes.
Update costs for
neighbors
.
Add current node to visited list.
Repeat until the end node is reached.
View source
What are the strengths and weaknesses of Dijkstra's algorithm?
Strengths:
Finds shortest path efficiently for all nodes.
Works well with
weighted graphs
.
Weaknesses:
Inefficient for specific target searches.
Does not consider direction or proximity.
View source