As a user, I would like to find the shortest and the fastest routes in the graph. For the shortest path, the Bread First Search algorithm should be used. For the fastest path, we should use Dijkstra's algorithm.
Example
Given
Graph Schema
Vertex
Edges
A
[B:5, H:2]
B
[A:5, C:7]
C
[B:7, D:3, G:4]
D
[C: 20, E: 4]
E
[F: 5]
F
[G: 6]
G
[C: 4]
H
[G: 3]
When
we use the Breadth-First Search algorithm for the first route.
and
we use Dijkstra's algorithm for the second route.
Then
the first route is the shortest
and
the second route is the fastest
Where
The results for this graph are presented in the table
Story
As a user, I would like to find the shortest and the fastest routes in the graph. For the shortest path, the Bread First Search algorithm should be used. For the fastest path, we should use Dijkstra's algorithm.
Example
Given
Graph Schema
When
we use the Breadth-First Search algorithm for the first route. and we use Dijkstra's algorithm for the second route.
Then
the first route is the shortest and the second route is the fastest
Where
The results for this graph are presented in the table