"Dijkstra's single-source shortest path algorithm returns a results grid that contains the lengths of the shortest paths

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

"Dijkstra's single-source shortest path algorithm returns a results grid that contains the lengths of the shortest paths

Post by answerhappygod »

"Dijkstra's single-source shortest path algorithm returns a
results grid that contains the lengths of the shortest paths from a
given vertex [the source vertex] to the other vertices reachable
from it. Develop a pseudocode algorithm that uses the
results grid to build and return the actual [shortest] path, as a
list of vertices, from the source vertex to a given [target]
vertex. (Hint: This algorithm starts with a given vertex [the
target vertex] in the grid's first column and gathers ancestor
[parent] vertices, until the source vertex is
reached.)"
*For your algorithm, assume that grid is the name of the results
grid produced by Dijkstra's single-source shortest path
algorithm.
*Each vertex is identified by its label/name, which is in column
1 of grid.
*As the first step of your algorithm, find the name of the
source vertex.
*Next, get the name of the target vertex from the user.
Pseudocode should avoid details through broad-stroke
statements. However, it must give enough information to outline the
overall strategy.
In addition to showing your algorithm, answer the
following questions: - In pseudocode, to find the source vertex,
you can simply write: find source vertex Without providing code,
explain how this would be accomplished in real code. - Did you run
into any challenges? If so, what were they and how did you solve
them? - Besides the given grid, did you have to use any other
collection? If so, which one and why? If not, why not?
--MUST HAVE A UNIQUE, INDIVIDUAL RESPONSE (please don't
copy from another site).--
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply