Edmond's Blossom Algorithm

Step 1 of 36 Init

Every vertex starts with the same budget: half the maximum edge weight. Internally, we double all budgets to ensure things stay integers, and that doubling is shown in the visualization as well.

An edge is "tight" when its endpoints' budgets sum to exactly 2× the edge weight. The highest-weight edges are tight from the start; lower-weight edges become tight as S-vertex budgets are spent during delta steps.

Legend

Vertices

S — active searchers, queued for scanning. Unmatched vertices start as S; matched vertices become S when their partner becomes T.
T — reached via a tight edge from an S-vertex. Never queued directly; their matched partner immediately becomes S and joins the queue.
Unlabeled — not yet reached by the search in this stage.
Active — the vertex currently being operated on this step.

Edges

Matched — in the current matching. The algorithm maximizes total weight of these edges.
Unmatched — available but not currently in the matching.
Active — involved in the current operation.

During Scan Steps

Each edge from the scanned S-vertex is classified by its slack and the neighbor's label:

Grow — tight (slack = 0) to an unlabeled vertex. Tree extends: neighbor becomes T, its matched partner becomes S.
S–S — tight to another S-vertex. Either an augmenting path (different trees) or a blossom (same tree).
Tight-T — tight to a T-vertex. Already in the tree; no action needed.
Δ₂ candidate — not tight, neighbor is unlabeled. Tracked for the next delta step.
Δ₃ candidate — not tight, neighbor is S. Tracked for the next delta step. Slack shrinks at 2× rate since both endpoints are S.

Budget (the number below each vertex name) starts at half the max edge weight, shown at 2× scale to keep values integer. S-budgets decrease during delta steps; T-budgets increase.

Slack = budget[x] + budget[y] − 2×weight. Zero means the edge is tight and the algorithm can use it. During scans, each edge is annotated with this arithmetic.

Blossom (dashed purple group) — an odd cycle contracted into a single super-vertex. This is the key trick that makes matching work on non-bipartite graphs. Blossoms have their own budget that increases (if S) or decreases (if T) during delta steps.