Representing Graphs

There are usually two standard ways to represent a graph G = (V, E) in a computer program:

  • As a collection of adjacency lists
  • As an adjacency matrix

You can use either way to represent both directed and undirected graphs. We'll start by looking at the adjacency list representation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.2.240