Adjacency matrix
A 2D array representation of graphs where rows and columns represent vertices and matrix values represent edges. Element (i, j) indicates edge weight or existence between vertices i and j. Adjacency matrices are simple for dense graphs and enable matrix operations.
Formula
Space = O(V²); Edge lookup = O(1)
Real World
The London Underground map can be stored as a 272×272 adjacency matrix where each cell records whether two stations are directly connected, making it instant to check if Bank and Waterloo share a line.
Exam Focus
For 'state one advantage' questions, pair your point with the graph type it suits — say 'efficient for dense graphs' not just 'fast lookup'.
How well did you know this?