Write with orthonormal axes ; minimize over , then over .
The matrix to decompose is a choice, and the Laplacian and the normalized Laplacian both come from graph cuts.
| name | definition |
|---|---|
| adjacency matrix | , with if and are linked |
| degree matrix | |
| Laplacian | |
| normalized Laplacian |
A cut splits the nodes into and ; Ratio Cut divides the cut size by the group sizes.
:
= left clique and :
A cut is encoded by a vector that takes one value on and another on .
for the second cut: ,
With the indicator , the Ratio Cut is , where .
= left clique and ; the outlined cells of are the cut edge.
Letting take any real value turns the problem into one that can be solved.
The Lagrangian turns the constrained minimization into an eigenvalue problem.
On Zachary's karate club, the sign of the second eigenvector of gives the two factions.
Entries of the second eigenvector, sorted; Mr. Hi's faction and the officer's faction
Normalized Cut divides the cut size by the group volumes.
volume counts edge ends, not nodes;
for the second cut: ,
The same expansion gives .
Same cut, with and .
The relaxation is the one used for Ratio Cut, with in the constraints.
The Lagrangian gives a generalized eigenvalue problem, .
The change of variable gives an ordinary eigenvalue problem.
Derive the Ratio Cut result and the Normalized Cut counterpart on paper (10 minutes).
| question | task |
|---|---|
| Q1 | and |
| Q2 | |
| Q3 | |
| Q4 | Q1 to Q3 for Normalized Cut |
| Q5 |
Embedding
word2vec (Mikolov et al. 2013) gives every word a vector, so that words used in similar contexts get close vectors.
word2vec predicts a word from a nearby word; every word has a query vector and a key vector .
A vector of numbers is one point in a -dimensional space.
one vector, one point
all words, points in one space
A real pair (label 1) is pulled together and a random pair (label 0) is pushed apart.
| input | other | label |
|---|---|---|
| favors | prepared | 1 |
| favors | water | 0 |
| only | mind | 1 |
| only | stone | 0 |
A window slides over the text, every position gives pairs, and the pairs move the vectors.
A random walk on a network is a sequence of nodes, in the same way that a sentence is a sequence of words.
| text | network |
|---|---|
| word | node |
| sentence | random walk |
| nearby words | nodes close together in a walk |
DeepWalk trains word2vec on random walks, with nodes in place of words.
Nodes that appear together in walks get close vectors, so a different walk rule gives a different embedding.
Plain walk: move to a random neighbor
Another rule is a walk with restart (personalized PageRank): return to the start node with probability .
In the lab notebook, walkers run on the Les Misérables co-appearance network and word2vec embeds the characters.
go.skojaku.com/m08lab
Valjean (lavender) and his 10 closest characters (cyan).
The lab uses personalized PageRank: restart at the start node with probability .
def ppr_walk(G, start, length, alpha, rng):
walk = [start]
# TODO: with probability alpha, go back to `start`;
# otherwise move to a random neighbor
return walk
Embedding
Papadopoulos et al. (2012) add similarity to preferential attachment.
Node gets the radius and a random angle, and links to its closest nodes.
link to the nodes with the smallest
The observed degree mixes popularity with the size of the community.
hidden degree
community size
In the hyperbolic plane of curvature , the circumference of a circle grows exponentially with its radius.
Hyperbolic space is the continuous version of a tree.
Poincaré disk, depth at distance .
General words lie near the center and specific words near the boundary.
MOCK v2 (2026-11-03). Classroom-size type, two columns (text left, figure right). The lab QR is a placeholder; the growth slide is one frame of the planned animation. Wireframe: review/WIREFRAME.md. Build: python3 figures/make_figures.py; python3 ~/.claude/skills/slide-math/tools/check.py m08-embedding.md