graph thegraph new graph()thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addvertex(' ')/ thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )(start for mst/ab /ac /ad /ae /bc /bd /be /cd /ce /de the graph that results is the one shown in figure when the mst(method has done its workonly four edges are leftas shown in figure here' the output from the mst java programminimum spanning treeab bc cd de as we notedthis is only one of many possible minimum scanning trees that can be created from this graph using different starting vertexfor examplewould result in different tree so would small variations in the codesuch as starting at the end of the vertexlist[instead of the beginning in the getadjunvisitedvertex(method the minimum spanning tree is easily derived from the depth-first search because the dfs visits all the nodesbut only once it never goes to node that has already been visited when it looks down an edge that has visited node at the endit doesn' follow that edge it never travels any edges that aren' necessary thusthe path of the dfs algorithm through the graph must be minimum spanning tree the mst java program listing shows the mst java program it' similar to dfs javaexcept for the mst(method and the graph created in main(listing the mst java program /mst java /demonstrates minimum spanning tree /to run this programc>java mstapp ///////////////////////////////////////////////////////////////