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
- Learning objectives
- Graphs, formally
- Adjacency lists
- Adjacency matrices
- Choosing a representation
Before you start
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or explore the curriculum.