graphs boolean isedge/edge from row to column in adjmat for(int row= row<nvertsrow++/for each vertexisedge false/check edges for(int col= col<nvertscol++ifadjmat[row][col /if edge to /anotherisedge truebreak/this vertex /has successor /try another if!isedge /if no edgesreturn row/has no successors return - /no such vertex /end nosuccessors(deleting vertex is straightforward except for few details the vertex is removed from the vertexlist[arrayand the vertices above it are moved down to fill up the vacant position likewisethe row and column for the vertex are removed from the adjacency matrixand the rows and columns above and to the right are moved down and to the left to fill the vacancies these tasks are carried out by the deletevertex()moverowup()and movecolleft(methodswhich you can examine in the complete listing for topo java (listing it' actually more efficient to use the adjacency-list representation of the graph for this algorithmbut that would take us too far afield the main(routine in this program calls on methodssimilar to those we saw earlierto create the same graph shown in figure the addedge(methodas we notedinserts single number into the adjacency matrix because this is directed graph here' the code for main()public static void main(string[argsgraph thegraph new graph()thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/