Edge list

An array of pairs of vertex numbers. A third number can be added to represent weighted edges.

[ [0,1], [0,6], [0,8], [1,4], [1,6], [1,9], [2,4], [2,6], [3,4] ]

Adjacency list

For each vertex i, store an array of the vertices adjacent to it.

Adjacency list

Adjacency map

Similar to an adjacency list except the list of neighbors is stored in a hash table instead of an array. This has much better performance than an adjacency list.

Adjacency matrix

Two dimensional array that tells you whether an edge between vertexes.

This isn’t the most space efficient. So adjacency lists & adjacency maps are more practical in the real world. Adjacency matrix