Question: Weekly Problems - > Week 1 0 : Shortest Path This problem builds on top of our previous problem where we completed Dijkstra's algorithm for
Weekly Problems Week : Shortest Path
This problem builds on top of our previous problem where we completed Dijkstra's algorithm for the graph below given vertex as the source.
Recall that the vertexSet represents the graph:public class FHgraph
the graph data is all here
protected HashSet FHvertex vertexSet;
public graph methods
public boolean dijkstraE x
public boolean showDistancesToE x
public boolean showShortestPathE x E x
Below is a reminder of the attributes in the FHvertex class:
After completing Dijkstra's algorithm from source A the dist and nextInPath attributes of a reachable FHvertex are set.
class FHvertex
omitted class variables
attributes
public HashSet Pair adjList
new HashSet Pair ;
public E data;
public double dist;
public FHvertex nextInPath; for clientspecific info
Problem
What is the output of showDistancesToE x method?
Note: display your response similar to the previous problem.
Problem
Choose three FHvertex objects.
What is the output of showShortestPathA youVertextChoice for each?
For problem show a visual representation of the partiallyProcessedVerts for every iteration of the while loop in dijkstra method.
The attributes dist and cost for every vertex.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
