Back to course home
0% completed
Vote For New Content
Graph Representations
Graphs can be represented in multiple ways depending on the use case. The two most common methods are:
- Adjacency Matrix
- Adjacency List
Let’s break down both approaches with examples for undirected and directed graphs.
1 Adjacency Matrix
An adjacency matrix is a 2D array (or matrix) used to represent the presence or absence of edges between vertices.
- The matrix is of size
N × N, whereNis the number of vertices. - Each cell
(i, j)indicates whether there’s an edge from vertexito vertexj.
.....
.....
.....
Like the course? Get enrolled and start learning!