listing continued thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )thegraph addedge( )/ad /ae /be /cf /dg /eg /fh /gh thegraph topo()/do the sort /end main(/end class topoapp ///////////////////////////////////////////////////////////////in the next we'll see what happens when edges are given weight as well as direction connectivity in directed graphs we've seen how in non-directed graph you can find all the vertices that are connected by doing depth-first or breadth-first search when we try to find all the connected vertices in directed graphthings get more complicated you can' just start from randomly selected vertex and expect to reach all the other connected vertices consider the graph in figure if you start on ayou can get to but not to any of the other vertices if you start on byou can' get to dand if you start on cyou can' get anywhere the meaningful question about connectivity iswhat vertices can you reach if you start on particular vertexb figure directed graph