Skip to content

MicroSims

Every chapter ships with at least one MicroSim: a small, self-contained interactive simulation that runs right in your browser. Drag sliders, click nodes, and step through algorithms to watch the math come alive. Nothing to install.

How to use a MicroSim

Each MicroSim is embedded directly in its chapter, next to the concept it illustrates. Use the on-screen sliders, buttons, and drop-downs to explore — you cannot break anything, so experiment freely. Click Open full screen under any sim below to run it on its own page.

There are 36 MicroSims across the book, listed by chapter below.

Chapter 0: Math and Programming Prerequisites

Matrix × Graph Explorer

Matrix × Graph Explorer screenshot

Compare raw (A·x), mean (D⁻¹A·x), and symmetric (D⁻½AD⁻½x) aggregation on a small graph and see why GCN uses symmetric normalization.

Open full screen

Chapter 1: Introduction to Graphs and Networks

Graph Property Explorer

Graph Property Explorer screenshot

Add and remove nodes and edges and watch degree, neighbors, and graph structure update live.

Open full screen

Chapter 2: Graph Properties and Traditional ML Features

WL Color Refinement Simulator

WL Color Refinement Simulator screenshot

Step through Weisfeiler-Lehman color refinement on two graphs side by side and see when they become distinguishable.

Open full screen

PageRank Power Iteration Simulator

PageRank Power Iteration Simulator screenshot

Watch PageRank scores converge through power iteration; node size encodes rank and a slider controls the damping factor.

Open full screen

Chapter 4: Node Embeddings: DeepWalk and node2vec

node2vec Biased Random Walk Explorer

node2vec Biased Random Walk Explorer screenshot

Trace a biased random walk; the p (return) and q (in-out) sliders shift the walk between BFS-like and DFS-like exploration.

Open full screen

Chapter 5: Label Propagation and Semi-Supervised Learning

Label Propagation Step-by-Step Simulator

Label Propagation Step-by-Step Simulator screenshot

Seed a few labels, then step through propagation rounds and watch labels diffuse across the graph.

Open full screen

SIR Epidemic Dynamics on Network Structures

SIR Epidemic Dynamics on Network Structures screenshot

Run an SIR epidemic over different network structures and see how topology drives how fast an infection spreads.

Open full screen

Chapter 6: GNN Foundations: Message Passing and GCN

GCN Message Passing Visualizer

GCN Message Passing Visualizer screenshot

Click a node and watch messages aggregate from its neighbors across 1, 2, and 3 GCN layers.

Open full screen

Spectral vs. Spatial GNN Explorer

Spectral vs. Spatial GNN Explorer screenshot

Connect the spectral (eigenvalue) and spatial (message-passing) views of graph convolution.

Open full screen

Chapter 7: GNN Design Space: GraphSAGE and GAT

GAT Attention Weight Visualizer

GAT Attention Weight Visualizer screenshot

Hover a node to see its softmax attention weights; edge thickness encodes how much each neighbor contributes.

Open full screen

GNN Design Space Interactive Comparison

GNN Design Space Interactive Comparison screenshot

Compare GNN design-space choices (aggregation, layers, skip connections) and their effect on accuracy.

Open full screen

Chapter 8: GNN Training, Augmentation, and Practical Tips

GNN Training Dynamics MicroSim

GNN Training Dynamics MicroSim screenshot

Watch loss and accuracy curves evolve over epochs and toggle train/validation/test splits.

Open full screen

Chapter 9: Theory of GNNs: Expressiveness and the WL Test

WL Refinement MicroSim

WL Refinement MicroSim screenshot

Run the WL isomorphism test and see the canonical cases where two non-isomorphic graphs fool 1-WL.

Open full screen

Chapter 10: Designing Powerful Encoders: GIN and Beyond

GIN vs. GCN Expressiveness MicroSim

GIN vs. GCN Expressiveness MicroSim screenshot

On a 3-regular graph pair, GCN assigns identical embeddings while GIN tells the graphs apart.

Open full screen

Chapter 11: Graph Transformers

Graph Transformer Attention Heatmap

Graph Transformer Attention Heatmap screenshot

Explore full graph-transformer attention as a heatmap and per-node query/key/value vectors.

Open full screen

Chapter 12: Knowledge Graph Embeddings

TransE Embedding Geometry

TransE Embedding Geometry screenshot

Drag head, relation, and tail vectors in 2D; a triple is valid when h + r ≈ t (TransE).

Open full screen

Chapter 13: Reasoning over Knowledge Graphs

Query2Box Multi-Hop Traversal

Query2Box Multi-Hop Traversal screenshot

Walk a Query2Box multi-hop query through projection and intersection over a knowledge graph.

Open full screen

Chapter 14: Knowledge Graph Foundation Models

Cross-KG Structure Transfer

Cross-KG Structure Transfer screenshot

Project entity and relation vectors to 2D and explore zero-shot transfer across knowledge graphs.

Open full screen

Chapter 15: Heterogeneous Graphs

Typed Node and Edge Explorer

Typed Node and Edge Explorer screenshot

Toggle node and edge types on and off and trace metapaths through a heterogeneous graph.

Open full screen

Chapter 16: GNNs for Recommender Systems

User-Item Graph with Multi-Hop Propagation Visualization

User-Item Graph with Multi-Hop Propagation Visualization screenshot

Propagate over a user-item bipartite graph and see how multi-hop signal powers recommendations.

Open full screen

Chapter 17: Relational Deep Learning

Relational Schema to Heterogeneous Graph

Relational Schema to Heterogeneous Graph screenshot

Turn three relational tables (Users, Products, Purchases) into a typed heterogeneous graph.

Open full screen

Chapter 18: Community Structure in Networks

Girvan-Newman Step-by-Step on the Karate Club Graph

Girvan-Newman Step-by-Step on the Karate Club Graph screenshot

Run Girvan-Newman edge-betweenness splitting on the Karate Club graph and watch communities emerge.

Open full screen

Louvain Two-Phase Iteration Explorer

Louvain Two-Phase Iteration Explorer screenshot

Step through the two phases of Louvain modularity optimization and watch the score climb.

Open full screen

Chapter 19: Frequent Subgraph Mining

Motif Z-Score Explorer

Motif Z-Score Explorer screenshot

Census 3- and 4-node subgraphs and compare counts against a random null model to get motif Z-scores.

Open full screen

SPMiner Order Embedding Space

SPMiner Order Embedding Space screenshot

Explore an order-embedding space where subgraph containment becomes a geometric relationship.

Open full screen

Chapter 20: Scaling GNNs to Billion-Node Graphs

SIGN Architecture vs. Neighbor Sampling Architecture

SIGN Architecture vs. Neighbor Sampling Architecture screenshot

Contrast precompute-then-train (SIGN) against neighbor sampling for scaling GNNs to large graphs.

Open full screen

Chapter 21: Deep Generative Models for Graphs

Drug Discovery GNN Pipeline

Drug Discovery GNN Pipeline screenshot

Step through a molecular-graph GNN pipeline from molecule to property prediction.

Open full screen

Chapter 22: Temporal and Dynamic Graphs

Traffic Forecasting Architecture — MicroSim

Traffic Forecasting Architecture — MicroSim screenshot

See how a spatio-temporal GNN forecasts traffic by combining road structure with time.

Open full screen

Chapter 23: LLMs and GNNs: Text-Attributed Graphs and Joint Training

LLM+GNN Pipeline Explorer (Full Version)

LLM+GNN Pipeline Explorer (Full Version) screenshot

Explore how text-attributed graphs combine LLM text encoders with GNN message passing.

Open full screen

LLM+GNN Pipeline — Text-to-Prediction

LLM+GNN Pipeline — Text-to-Prediction screenshot

Follow one node from raw text → LLM embedding → GNN aggregation → final prediction, with dimension bars at each stage.

Open full screen

Chapter 24: Advanced GNN Topics: In-Context Learning and Uncertainty

Contrastive Loss Surface Explorer

Contrastive Loss Surface Explorer screenshot

Move augmentation strength and temperature across the NT-Xent loss landscape and read the operating point.

Open full screen

Graph Contrastive Learning — Two-View Pipeline

Graph Contrastive Learning — Two-View Pipeline screenshot

Build two augmented views of a graph and pull matching node embeddings together while pushing others apart.

Open full screen

DGI vs. Contrastive Learning — Concept Map

DGI vs. Contrastive Learning — Concept Map screenshot

Compare DGI and graph contrastive learning against the three core self-supervised-learning properties.

Open full screen

Chapter 25: Agents and Graphs

Multi-Hop KG Reasoning Agent

Multi-Hop KG Reasoning Agent screenshot

Watch an agent answer a multi-hop question over a knowledge graph, tracing retrieved nodes and confidence per hop.

Open full screen

Agent Tool-Use Graph — Interactive Planner

Agent Tool-Use Graph — Interactive Planner screenshot

Run an agent's tool-use plan as a dependency graph; independent tools fire in parallel waves.

Open full screen

Chapter 26: Conclusion — The GNN Design Space and Open Problems

GNN Architecture Family Tree

GNN Architecture Family Tree screenshot

Browse an interactive taxonomy of GNN architectures with 'extends / inspired by' lineage edges.

Open full screen