Graph models

Build networks, attach meaning to edges, and compare the storage choices that power graph algorithms.

What information does each connection carry?

Choose by the decision you want to understand

Each lesson names the situation it fits and the behavior worth watching.

Graph visualizer preview
Start hereConnect and traverse

Graph

Choose it when
Directed and undirected relationships
Watch for
Traversal order depends on the frontier and visited state.
Explore Graph
Weighted Graph visualizer preview
IntermediateAttach edge cost

Weighted Graph

Choose it when
Routes, distances, and network cost
Watch for
The cheapest next connection may differ from the nearest-looking one.
Explore Weighted Graph
Adjacency Matrix and List visualizer preview
IntermediateChoose a storage model

Adjacency Matrix and List

Choose it when
Comparing dense and sparse graphs
Watch for
One edge updates the visual network, matrix cell, and list entry together.
Explore Adjacency Matrix and List