Algorithm Deep Dive Computer Science

Converting between Edge list, Adjacency List and Adjacency Matrices

In graph theory, there are three common ways to represent a graph: edge list, adjacency list, and adjacency matrix. Each representation has its own advantages and disadvantages. Depending on the algorithm being applied on a graph, one representation might be more efficient than another. In such cases, we might need to convert from one graph representation to another. This article will cover how to convert between these different representations.