Graph Representation in Memory

From NovaOrdis Knowledge Base
Revision as of 21:24, 28 September 2021 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

Internal

Overview

TODO CLRS page 589, DDIA location 1392.

Adjacency Lists

Applies to directed and undirected graphs.

An adjacency list representation provides a memory-efficient way of representing sparse graphs, so it is usually the method of choice.

Continue CLRS page 590.

Adjacency Matrices

Applies to directed and undirected graphs.

Cases when adjacency matrix representation is preferred:

  • dense graphs.
  • When we need to tell quickly if there is an edge connecting two given vertices.

Continue CLRS page 590.