Graph Representation in Memory

From NovaOrdis Knowledge Base
Revision as of 21:23, 28 September 2021 by Ovidiu (talk | contribs) (Created page with "=Internal= * Graphs <font color=darkgray>TODO CLRS page 589, DDIA location 1392.</font> ==Adjacency Lists== Applies...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

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.