teach-ict.com logo

THE education site for computer science and ICT

1. Introduction to Storing Graphs

In the previous section, we learned about how graph data structures are put together and what they're used for.

We also covered how programs algorithmically move through (traverse) graphs to search for the data they hold.

However, the whole time we imagined that graphs look like this:

In this section, we will discuss how computers store graph data in more efficient formats.

 

As a reminder:

  • Each connected item or node in a graph is called a vertex (plural: vertices).
  • Each line connecting two vertices is called an edge.
  • Graphs that allow travel along edges in only one direction are directed
  • Graphs that allow travel along edges in either direction are undirected
  • Graphs that impose a cost to travelling along edges are weighted