chap graphs ( ( (cfigure two graph representations (aa directed graph (bthe adjacency matrix for the graph of ( (cthe adjacency list for the graph of (aexample the entry for vertex in figure (cstores and because there are two edges in the graph leaving vertex with one going to vertex and one going to vertex the list for vertex stores an entry for vertex because there is an edge from vertex to vertex but no entry for vertex because this edge comes into vertex rather than going out the storage requirements for the adjacency list depend on both the number of edges and the number of vertices in the graph there must be an array entry for each vertex (even if the vertex is not adjacent to any other vertex and thus has no elements on its linked list)and each edge must appear on one of the lists thusthe cost is th(| | |both the adjacency matrix and the adjacency list can be used to store directed or undirected graphs each edge of an undirected graph connecting vertices and is represented by two directed edgesone from to and one from to figure illustrates the use of the adjacency matrix and the adjacency list for undirected graphs