[prev] 39 [next]

Adjacency Matrix Representation (cont)

A storage optimisation: store only top-right part of matrix.

[Diagram:Pic/graphRep2.png]

New storage cost: V-1 int ptrs + V(V-1)/2 ints   (but still O(V2))

Requires us to always use edges (v,w) such that v < w.