directed graphsthe notion of connectedness has two distinct versionswe say that digraph is weakly connected if for every two vertices and there is either path from to or path from to we say it is strongly connected if there are paths leading both ways soin weakly connected digraphthere may be two vertices and such that there exists no path from to graph clearly has many properties similar to tree in factany tree can be viewed as simple graph of particular kindnamely one that is connected and contains no circles because graphunlike treedoes not come with natural 'starting pointfrom which there is unique path to each vertexit does not make sense to speak of parents and children in graph insteadif two vertices and are connected by an edge ewe say that they are neighboursand the edge connecting them is said to be incident to and two edges that have vertex in common (for exampleone connecting and and one connecting and care said to be adjacent implementing graphs all the data structures we have considered so far were designed to hold certain informationand we wanted to perform certain actions on them which mostly centred around inserting new itemsdeleting particular itemssearching for particular itemsand sorting the collection at no time was there ever connection between all the items representedapart from the order in which their keys appeared moreoverthat connection was never something that was inherent in the structure and that we therefore tried to represent somehow it was just property that we used to store the items in way which made sorting and searching quicker nowon the other handit is the connections that are the crucial information we need to encode in the data structure we are given structure which comes with specified connectionsand we need to design an implementation that efficiently keeps track of them array-based implementation the first underlying idea for array-based implementations is that we can conveniently rename the vertices of the graph so that they are labelled by non-negative integer indicessay from to if they do not have these labels already howeverthis only works if the graph is given explicitlythat isif we know in advance how many vertices there will beand which pairs will have edges between them then we only need to keep track of which vertex has an edge to which other vertexandfor weighted graphswhat the weights on the edges are for unweighted graphswe can do this quite easily in an two-dimensional binary array adjalso called matrix the so-called adjacency matrix in the case of weighted graphswe instead have an weight matrix weights the array/matrix representations for the two example graphs shown above are thena