weighted graphs listing continued private final int infinity private vertex vertexlist[]/list of vertices private int adjmat[][]/adjacency matrix private int nverts/current number of vertices private int ntree/number of verts in tree private distpar spath[]/array for shortest-path data private int currentvert/current vertex private int starttocurrent/distance to currentvert /public graph(/constructor vertexlist new vertex[max_verts]/adjacency matrix adjmat new int[max_verts][max_verts]nverts ntree for(int = <max_vertsj++/set adjacency for(int = <max_vertsk++/matrix adjmat[ ][kinfinity/to infinity spath new distpar[max_verts]/shortest paths /end constructor /public void addvertex(char labvertexlist[nverts++new vertex(lab)/public void addedge(int startint endint weightadjmat[start][endweight/(directed/public void path(/find all shortest paths int starttree /start at vertex vertexlist[starttreeisintree truentree /put it in tree /transfer row of distances from adjmat to spath for(int = <nvertsj++