How to Represent Graphs as Data Structures

Learn how graphs are stored and read on computers.

Graph data storage uses particular formats on a computer (or any machine). Let's see what some of these are.

Adjacency matrix

We can store graphs as adjacency matrices. These matrices are a neat way to represent graphs as a square matrix in which we denote the presence of an edge by 11 and the absence of one by 00.

Get hands-on with 1200+ tech skills courses.