/skip starting vertex while(column nverts/go across columns /if this column' vertex already in treeskip it ifvertexlist[columnisintree column++continue/calculate distance for one spath entry /get edge from currentvert to column int currenttofringe adjmat[currentvert][column]/add distance from start int starttofringe starttocurrent currenttofringe/get distance of current spath entry int spathdist spath[columndistance/compare distance from start with spath entry if(starttofringe spathdist/if shorter/update spath spath[columnparentvert currentvertspath[columndistance starttofringecolumn++/end while(column nverts/end adjust_spath(/public void displaypaths(for(int = <nvertsj++/display contents of spath[system out print(vertexlist[jlabel "=")/bif(spath[jdistance =infinitysystem out print("inf")/inf else system out print(spath[jdistance)/ char parent vertexlistspath[jparentvert labelsystem out print("(parent "")/(asystem out println("")//end class graph ///////////////////////////////////////////////////////////////class pathapp