Graph

Graphs are usually stored in two ways - in a metric or in a set of nodes where each item has a references to a node it is connected with. Nice summary is in this video.

Adjacency Matrix

Adjacency List

Adjacency matrix is bad for sparse graphs and good for dense graphs. The opposite of adjacency list.

Last updated