Since graphs are represented with vertices and edges, we have to consider both in representing the graph. There are several ways to represent a graph, but the most popular ones are as follows:
- Adjacency list
- Adjacency matrix
Since graphs are represented with vertices and edges, we have to consider both in representing the graph. There are several ways to represent a graph, but the most popular ones are as follows: