ritchie@singapore:~/blog/matrix-graph$ bat explainer.md

Matrices represented as Graphs

Understanding the fundamental duality between linear algebra and graph theory

Conceptual Overview

Adjacency matrices and graphs are two ways of representing the same information. A graph shows nodes and their connections visually, while an adjacency matrix encodes this information numerically.

Interactive Visualization

Click on any cell in the matrix to toggle connections between nodes. Observe how changes in the matrix directly affect the graph structure.

Number of Nodes:
5

Adjacency Matrix

Graph Representation

How This Works

An adjacency matrix is a square matrix where rows and columns represent nodes in a graph:

  • Entry (i,j) = 1 means there's an edge from node i to node j
  • Entry (i,j) = 0 means there's no edge from node i to node j
  • Diagonal entries (i,i) = 1 represent self-loops

Matrix-Graph Duality

This duality enables us to:

  • Apply linear algebra techniques to solve graph problems
  • Visualize matrix operations as transformations on graphs
  • Represent complex relationships in a compact numerical format

Try creating different graph structures using the buttons above or by manually toggling connections in the matrix!

ritchie@singapore:~/blog/matrix-graph$ bat citation.md
ritchie@singapore:~/blog/matrix-graph$ |