nverts for(int = <max_vertsj++/set adjacency for(int = <max_vertsk++/matrix to adjmat[ ][ /end constructor /public void addvertex(char lab/argument is label vertexlist[nverts++new vertex(lab)/public void addedge(int startint endadjmat[start][end adjmat[end][start /public void displayvertex(int vsystem out print(vertexlist[vlabel)//end class graph within the graph classvertices are identified by their index number in vertexlist we've already discussed most of the methods shown here to display vertexwe simply print out its one-character label the adjacency matrix (or the adjacency listprovides information that is local to given vertex specificallyit tells you which vertices are connected by single edge to given vertex to answer more global questions about the arrangement of the verticeswe must resort to various algorithms we'll begin with searches searches one of the most fundamental operations to perform on graph is finding which vertices can be reached from specified vertex for exampleimagine trying to find out how many towns in the united states can be reached by passenger train from kansas city (assuming that you don' mind changing trainssome towns could be reached others couldn' be reached because they didn' have passenger rail service possibly others couldn' be reachedeven though they had rail servicebecause their rail system (the narrow-gauge hayfork-hicksville rrfor exampledidn' connect