Question: I need to come up with Dijstrak's ShortestPath Algorithm in this method (in Java): public Shortest_Path_Info[] shortest_Path(String label){... I need to use a minBinHeap and

I need to come up with Dijstrak's ShortestPath Algorithm in this method (in Java):

public Shortest_Path_Info[] shortest_Path(String label){...

I need to use a minBinHeap and a queue. There is an edge class, as well as a node class (vertices class), the node class contains what you would expect as well as HashMaps containing the incoming and outgoing vertices, to be used for looking at the adjacent nodes:

HashMap adjListIn = new HashMap();

HashMap adjListOut= new HashMap();

The Shortest_Path_Info class just contains:

private String destination; private long weight;

and the appropriate constructor to set these values, as well as getters and setters.

Basically I need to write the method to implement Djikstra's Algorithm and return an array of these Shortest_Path_Info objects.

Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!