

















l 
Assume
V = {1, 2, …, n}



l 
An adjacency matrix represents the graph as a



n x
n matrix A:




n 
A[i,
j] = 1 if edge (i, j)
Î E (or weight of edge)



= 0 if edge (i, j) Ï E




n 
Storage requirements: O(V^{2})






u 
A
dense representation




n 
But,
can be very efficient for small graphs




u 
Especially
if store just one bit/edge




u 
Undirected
graph: only need one diagonal of matrix



