[prev] 30 [next]

Adjacency Matrix Representation

Edges represented by a V × V matrix

[Diagram:Pic/adjmatrix.png]

  • easily implemented as 2-dimensional array
  • can represent graphs, digraphs and weighted graphs
    • graphs: symmetric boolean matrix
    • digraphs: non-symmetric boolean matrix
    • weighted: non-symmetric matrix of weight values

  • disadvantage: if few edges (sparse) ⇒ memory-inefficient