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¶
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.
Chapter 1: Introduction to Graphs and Networks¶
Graph Property Explorer¶
Add and remove nodes and edges and watch degree, neighbors, and graph structure update live.
Chapter 2: Graph Properties and Traditional ML Features¶
WL Color Refinement Simulator¶
Step through Weisfeiler-Lehman color refinement on two graphs side by side and see when they become distinguishable.
Chapter 3: Link Analysis and PageRank¶
PageRank Power Iteration Simulator¶
Watch PageRank scores converge through power iteration; node size encodes rank and a slider controls the damping factor.
Chapter 4: Node Embeddings: DeepWalk and node2vec¶
node2vec Biased Random Walk Explorer¶
Trace a biased random walk; the p (return) and q (in-out) sliders shift the walk between BFS-like and DFS-like exploration.
Chapter 5: Label Propagation and Semi-Supervised Learning¶
Label Propagation Step-by-Step Simulator¶
Seed a few labels, then step through propagation rounds and watch labels diffuse across the graph.
SIR Epidemic Dynamics on Network Structures¶
Run an SIR epidemic over different network structures and see how topology drives how fast an infection spreads.
Chapter 6: GNN Foundations: Message Passing and GCN¶
GCN Message Passing Visualizer¶
Click a node and watch messages aggregate from its neighbors across 1, 2, and 3 GCN layers.
Spectral vs. Spatial GNN Explorer¶
Connect the spectral (eigenvalue) and spatial (message-passing) views of graph convolution.
Chapter 7: GNN Design Space: GraphSAGE and GAT¶
GAT Attention Weight Visualizer¶
Hover a node to see its softmax attention weights; edge thickness encodes how much each neighbor contributes.
GNN Design Space Interactive Comparison¶
Compare GNN design-space choices (aggregation, layers, skip connections) and their effect on accuracy.
Chapter 8: GNN Training, Augmentation, and Practical Tips¶
GNN Training Dynamics MicroSim¶
Watch loss and accuracy curves evolve over epochs and toggle train/validation/test splits.
Chapter 9: Theory of GNNs: Expressiveness and the WL Test¶
WL Refinement MicroSim¶
Run the WL isomorphism test and see the canonical cases where two non-isomorphic graphs fool 1-WL.
Chapter 10: Designing Powerful Encoders: GIN and Beyond¶
GIN vs. GCN Expressiveness MicroSim¶
On a 3-regular graph pair, GCN assigns identical embeddings while GIN tells the graphs apart.
Chapter 11: Graph Transformers¶
Graph Transformer Attention Heatmap¶
Explore full graph-transformer attention as a heatmap and per-node query/key/value vectors.
Chapter 12: Knowledge Graph Embeddings¶
TransE Embedding Geometry¶
Drag head, relation, and tail vectors in 2D; a triple is valid when h + r ≈ t (TransE).
Chapter 13: Reasoning over Knowledge Graphs¶
Query2Box Multi-Hop Traversal¶
Walk a Query2Box multi-hop query through projection and intersection over a knowledge graph.
Chapter 14: Knowledge Graph Foundation Models¶
Cross-KG Structure Transfer¶
Project entity and relation vectors to 2D and explore zero-shot transfer across knowledge graphs.
Chapter 15: Heterogeneous Graphs¶
Typed Node and Edge Explorer¶
Toggle node and edge types on and off and trace metapaths through a heterogeneous graph.
Chapter 16: GNNs for Recommender Systems¶
User-Item Graph with Multi-Hop Propagation Visualization¶
Propagate over a user-item bipartite graph and see how multi-hop signal powers recommendations.
Chapter 17: Relational Deep Learning¶
Relational Schema to Heterogeneous Graph¶
Turn three relational tables (Users, Products, Purchases) into a typed heterogeneous graph.
Chapter 18: Community Structure in Networks¶
Girvan-Newman Step-by-Step on the Karate Club Graph¶
Run Girvan-Newman edge-betweenness splitting on the Karate Club graph and watch communities emerge.
Louvain Two-Phase Iteration Explorer¶
Step through the two phases of Louvain modularity optimization and watch the score climb.
Chapter 19: Frequent Subgraph Mining¶
Motif Z-Score Explorer¶
Census 3- and 4-node subgraphs and compare counts against a random null model to get motif Z-scores.
SPMiner Order Embedding Space¶
Explore an order-embedding space where subgraph containment becomes a geometric relationship.
Chapter 20: Scaling GNNs to Billion-Node Graphs¶
SIGN Architecture vs. Neighbor Sampling Architecture¶
Contrast precompute-then-train (SIGN) against neighbor sampling for scaling GNNs to large graphs.
Chapter 21: Deep Generative Models for Graphs¶
Drug Discovery GNN Pipeline¶
Step through a molecular-graph GNN pipeline from molecule to property prediction.
Chapter 22: Temporal and Dynamic Graphs¶
Traffic Forecasting Architecture — MicroSim¶
See how a spatio-temporal GNN forecasts traffic by combining road structure with time.
Chapter 23: LLMs and GNNs: Text-Attributed Graphs and Joint Training¶
LLM+GNN Pipeline Explorer (Full Version)¶
Explore how text-attributed graphs combine LLM text encoders with GNN message passing.
LLM+GNN Pipeline — Text-to-Prediction¶
Follow one node from raw text → LLM embedding → GNN aggregation → final prediction, with dimension bars at each stage.
Chapter 24: Advanced GNN Topics: In-Context Learning and Uncertainty¶
Contrastive Loss Surface Explorer¶
Move augmentation strength and temperature across the NT-Xent loss landscape and read the operating point.
Graph Contrastive Learning — Two-View Pipeline¶
Build two augmented views of a graph and pull matching node embeddings together while pushing others apart.
DGI vs. Contrastive Learning — Concept Map¶
Compare DGI and graph contrastive learning against the three core self-supervised-learning properties.
Chapter 25: Agents and Graphs¶
Multi-Hop KG Reasoning Agent¶
Watch an agent answer a multi-hop question over a knowledge graph, tracing retrieved nodes and confidence per hop.
Agent Tool-Use Graph — Interactive Planner¶
Run an agent's tool-use plan as a dependency graph; independent tools fire in parallel waves.
Chapter 26: Conclusion — The GNN Design Space and Open Problems¶
GNN Architecture Family Tree¶
Browse an interactive taxonomy of GNN architectures with 'extends / inspired by' lineage edges.



































