This Linear Algebra concept is the current idea: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.
Linear Algebra
Graph Basics: Adjacency, Degree, and Laplacian
Adjacency, degree, and Laplacian matrices turn a graph into linear algebra: rows name neighborhoods, and x^T L x measures how sharply a signal changes across edges.
Concept Structure
Graph Basics: Adjacency, Degree, and Laplacian
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learner Contract
What this page should let you do.
2 prerequisites listed; refresh them before leaning on the math or code.
Explain the mechanism, trace the main notation, and test one prediction in the live demo.
Read the intuition before the notation; the math should name a mechanism you already felt.
Follow this edge after making one prediction here; the next page should reuse the result, not restart the route.
Claim/source review status
Substantive review recorded
1/1 claims have bounded review metadata; still check caveats and source scope.Metadata-derived; review may be AI-assisted. Not a human certification.01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
A graph becomes useful to machine learning when we can compute with it.
The picture says which nodes are connected. The matrices say the same thing in a form a model can multiply, normalize, smooth, or pass messages through.
The adjacency matrix answers: who is connected to whom?
The degree matrix answers: how many neighbors does each node have?
The graph Laplacian answers a subtler question: if each node carries a value, how much does that value jump across edges?
Think of a signal placed on the graph: one number per node. If neighboring nodes have similar values, the graph sees the signal as smooth. If an edge connects very different values, that edge contributes a large penalty.
For graph neural networks, this is the first bridge from topology to computation. The adjacency matrix says where information can move. The degree matrix says how much neighbor mass surrounds a node. The Laplacian says which signals respect the graph's local structure and which ones fight it.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Let be an undirected unweighted graph with nodes
The adjacency matrix is
Because the graph is undirected, is symmetric.
The degree of node is
The degree matrix is diagonal:
The combinatorial graph Laplacian is
Now put a scalar signal on the graph:
The matrix-vector product has one row per node:
So compares node to its neighbors. If agrees with nearby values, the row is small. If disagrees sharply, the row is large.
The global smoothness energy is the quadratic form
For an undirected unweighted graph,
This identity is the key mechanism. The Laplacian turns local edge disagreements into a single scalar. Smooth graph signals have low energy. Signals that alternate across many edges have high energy.
The same matrices later support several ML operations:
- graph neural networks use adjacency-like neighborhoods for message passing;
- spectral clustering studies eigenvectors of Laplacian matrices;
- graph regularization penalizes functions that vary too much across nearby nodes.
Those later topics add normalization, weights, directed edges, and learned features. This page keeps the first invariant visible: graph structure becomes matrix arithmetic.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import numpy as np
edges = [(0,1), (0,2), (1,3), (2,3), (2,4), (3,4)]
n = 5
A = np.zeros((n, n), dtype=int)
for i, j in edges:
A[i, j] = A[j, i] = 1
D = np.diag(A.sum(axis=1))
L = D - A
signals = {
"smooth": np.array([1.0, 0.8, 0.4, 0.3, 0.0]),
"bridge_jump": np.array([1.0, 1.0, 1.0, -1.0, -1.0]),
"alternating": np.array([1.0, -1.0, -1.0, 1.0, 1.0]),
}
for name, x in signals.items():
quadratic = float(x @ L @ x)
edge_sum = sum((x[i] - x[j]) ** 2 for i, j in edges)
print(name, "x^T L x =", quadratic, "edge sum =", edge_sum)
The code computes the same quantity two ways. The matrix form and the edge-sum form agree because the Laplacian is storing local graph disagreements.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Pick which signal should have the largest Laplacian energy before revealing the matrix and edge ledger. The graph, matrices, and edge contributions are the same object viewed three ways.
Live Concept Demo
Explore Graph Basics: Adjacency, Degree, and Laplacian
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Commit to what Graph Basics: Adjacency, Degree, and Laplacian should make visible before reading the result.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
Adjacency, degree, and Laplacian matrices turn a graph into linear algebra: rows name neighborhoods, and x^T L x measures how sharply a signal changes across edges.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Graph Basics: Adjacency, Degree, and Laplacian should make visible.
Visual Inquiry
Make the image answer a mathematical question
Adjacency, degree, and Laplacian matrices turn a graph into linear algebra: rows name neighborhoods, and x^T L x measures how sharply a signal changes across edges.
Which visible object should carry the first intuition?
Pick the cue that should make Graph Basics: Adjacency, Degree, and Laplacian easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Grounds vertices, edges, adjacency, and degree as graph vocabulary.
Open sourceSupports adjacency matrix, degree matrix, graph Laplacian, and spectral graph context.
Open sourceReference tutorial for graph Laplacians, quadratic forms, and smoothness/clustering intuition.
Open sourceHigh-quality visual bridge from graph structure to node features and later message passing.
Open sourceClaim Review
Adjacency, degree, and Laplacian matrices turn a graph into linear algebra: rows name neighborhoods, and x^T L x measures how sharply a signal changes across edges.
Claims without a substantive review badge still need exact source-support review.
mit-6042-graph-theory, cs224w-spectral-clustering, von-luxburg-2007-spectral-clustering, distill-2021-gnn-intro
Use equations, runnable code, and demos to check whether the source support is operational.
The sources support the page's finite undirected graph matrices, degree counts, combinatorial Laplacian, row-wise Lx calculation, and edge-sum interpretation of x^T L x.
Sources: MIT 6.042J Mathematics for Computer Science: Graph Theory, Stanford CS224W: Spectral Clustering, A Tutorial on Spectral Clustering, A Gentle Introduction to Graph Neural NetworksUnweighted undirected teaching graph only; excludes normalized Laplacians, directed graph Laplacians, weighted edges, eigenvector clustering algorithms, graph Fourier analysis, and full GNN message passing.A bounded review summary is present; still check caveats and exact reference scope.Checked MIT graph notes for graph, adjacency, and degree vocabulary; checked Stanford CS224W spectral-clustering notes and von Luxburg's tutorial for adjacency/degree/Laplacian definitions and the Laplacian quadratic-form smoothness identity; used Distill's GNN intro only as a visual bridge to node features and later message passing. GPT Pro publication critique remains pending because 127.0.0.1:51672 is unavailable.
Reviewer: codex-local-source-review; reviewed 2026-07-02Source support candidates
course-notes 2010MIT 6.042J Mathematics for Computer Science: Graph TheoryGrounds vertices, edges, adjacency, and degree as graph vocabulary.
course-notes 2019Stanford CS224W: Spectral ClusteringSupports adjacency matrix, degree matrix, graph Laplacian, and spectral graph context.
article 2007A Tutorial on Spectral ClusteringReference tutorial for graph Laplacians, quadratic forms, and smoothness/clustering intuition.
article 2021A Gentle Introduction to Graph Neural NetworksHigh-quality visual bridge from graph structure to node features and later message passing.
Practice Loop
Try the idea before it explains itself
Adjacency, degree, and Laplacian matrices turn a graph into linear algebra: rows name neighborhoods, and x^T L x measures how sharply a signal changes across edges.
Before touching the demo, predict one visible change that should happen in Graph Basics: Adjacency, Degree, and Laplacian.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to a claim, equation, code, or demo
Pick the concept, equation, source, runnable code, claim, misconception, or demo state before asking for help. The handoff keeps that page item in context.Open the draft below to save one note and next action in this browser.
Graph Basics: Adjacency, Degree, and Laplacian
What is the smallest example that makes Graph Basics: Adjacency, Degree, and Laplacian click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays in this browser, attached to the selected learning item.
- References to inspect: attached references on this page.
- Definition, prerequisite, and contrast concept links
- The equation or runnable code that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Graph Basics: Adjacency, Degree, and Laplacian Selected item key: recorded for copy. Context: Linear Algebra Page anchor: recorded for copy. Open question: What is the smallest example that makes Graph Basics: Adjacency, Degree, and Laplacian click without losing the math? Evidence to inspect: - References to inspect: attached references on this page. - Definition, prerequisite, and contrast concept links - The equation or runnable code that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.
concept/concept-notebook/linear-algebra/graph-basics-adjacency-laplacian
concept:linear-algebra/graph-basics-adjacency-laplacian