Shares
print sharing button Print
twitter sharing button Tweet
facebook sharing button Share
whatsapp sharing button Share
pinterest sharing button Pin
email sharing button Email
pocket sharing button Share
qzone sharing button Share
arrow_left sharing button
arrow_right sharing button

Adjacency list representation of graph

<<Previous - Graph Adjacency Matrix

Next - Shortest Path Algorithms >>





Adjacency List Representation

Suppose a graph is sparse, then an adjacency list is the better solution for graph representation. In adjacency list representation, for each vertex, we maintain a list of all adjacent vertices. If the edges have weights, then this extra information is also stored in the list cells. Memory space required for adjacency list is O(|E|+|V|) where E represent the number of edges and V represent the number of vertices.

Adjacency List Representation of Directed Graph



<< Previous - Graph Adjacency Matrix

Next - Shortest Path Algorithms >>










Adjacency list representation of graph

<<Previous - Graph Adjacency Matrix

Next - Shortest Path Algorithms >>





Adjacency List Representation

Suppose a graph is sparse, then an adjacency list is the better solution for graph representation. In adjacency list representation, for each vertex, we maintain a list of all adjacent vertices. If the edges have weights, then this extra information is also stored in the list cells. Memory space required for adjacency list is O(|E|+|V|) where E represent the number of edges and V represent the number of vertices.

Adjacency List Representation of Directed Graph



<< Previous - Graph Adjacency Matrix

Next - Shortest Path Algorithms >>