inf( ( ( ( (dthe shortest path from to non-tree vertex is to vertex cso is added to the tree next time through the shortest-path arrayonly the distance to is considered it can be shortened by going via cso we have the entries shown in table table step the shortest-path array inf( ( ( ( (cnow the last vertexeis added to the treeand you're done the shortest-path array shows the shortest distances from to all the other vertices the tree consists of all the vertices and the edges abaddcand ceshown with thick lines you can work backward to reconstruct the sequence of vertices along the shortest path to any vertex for the shortest path to efor examplethe parent of eshown in the array in parenthesesis the predecessor of cagain from the arrayis dand the predecessor of is so the shortest path from to follows the route - - - experiment with other graphs using graphdwstarting with small ones you'll find that after while you can predict what the algorithm is going to doand you'll be on your way to understanding dijkstra' algorithm java code the code for the shortest-path algorithm is among the most complex in this bookbut even so it' not beyond mere mortals we'll look first at helper class and then at the chief method that executes the algorithmpath()and finally at two methods called by path(to carry out specialized tasks the spath array and the distpar class as we've seenthe key data structure in the shortest-path algorithm is an array that keeps track of the minimum distances from the starting vertex to the other vertices (destination verticesduring the execution of the algorithm these distances are changeduntil at the end they hold the actual shortest distances from the start in the example codethis array is called spath[(for shortest pathsas we've seenit' important to record not only the minimum distance from the starting