Skip to content
Data Structures and Algorithms / Graphs: Representation, Traversal, and Decomposition

Graph Representations: Adjacency Lists vs. Matrices

Before any graph algorithm can run, the graph itself must be stored somehow — and, exactly as with the array-vs-linked-list choice in Topic 2, this is a real trade-off with no universally-best answer. This note builds the two standard representations — adjacency lists and adjacency matrices — and their operation-cost tables, so that choosing between them for a correlation-threshold graph, a settlement network, or a factor-dependency graph is a deliberate engineering decision rather than a default.

In this lesson

  1. Learning objectives
  2. Graphs, formally
  3. Adjacency lists
  4. Adjacency matrices
  5. Choosing a representation

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or explore the curriculum.