How to Represent Graphs as Data Structures
Learn how graphs are stored and read on computers.
We'll cover the following...
We'll cover the following...
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
Press + to interact
Here's an adjacency matrix of an undirected graph:
...