Hubbry Logo
Blossom algorithmBlossom algorithmMain
Open search
Blossom algorithm
Community hub
Blossom algorithm
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Contribute something
Blossom algorithm
Blossom algorithm
from Wikipedia

In graph theory, the blossom algorithm is an algorithm for constructing maximum matchings on graphs. The algorithm was developed by Jack Edmonds in 1961,[1] and published in 1965.[2] Given a general graph G = (V, E), the algorithm finds a matching M such that each vertex in V is incident with at most one edge in M and |M| is maximized. The matching is constructed by iteratively improving an initial empty matching along augmenting paths in the graph. Unlike bipartite matching, the key new idea is that an odd-length cycle in the graph (blossom) is contracted to a single vertex, with the search continuing iteratively in the contracted graph.

The algorithm runs in time O(|E||V|2), where |E| is the number of edges of the graph and |V| is its number of vertices. A better running time of for the same task can be achieved with the much more complex algorithm of Micali and Vazirani.[3]

A major reason that the blossom algorithm is important is that it gave the first proof that a maximum-size matching could be found using a polynomial amount of computation time. Another reason is that it led to a linear programming polyhedral description of the matching polytope, yielding an algorithm for min-weight matching.[4] As elaborated by Alexander Schrijver, further significance of the result comes from the fact that this was the first polytope whose proof of integrality "does not simply follow just from total unimodularity, and its description was a breakthrough in polyhedral combinatorics."[5]

Augmenting paths

[edit]

Given G = (V, E) and a matching M of G, a vertex v is exposed if no edge of M is incident with v. A path in G is an alternating path, if its edges are alternately not in M and in M (or in M and not in M). An augmenting path P is an alternating path that starts and ends at two distinct exposed vertices. Note that the number of unmatched edges in an augmenting path is greater by one than the number of matched edges, and hence the total number of edges in an augmenting path is odd. A matching augmentation along an augmenting path P is the operation of replacing M with a new matching

.

Augmentation along a path

By Berge's lemma, matching M is maximum if and only if there is no M-augmenting path in G.[6][7] Hence, either a matching is maximum, or it can be augmented. Thus, starting from an initial matching, we can compute a maximum matching by augmenting the current matching with augmenting paths as long as we can find them, and return whenever no augmenting paths are left. We can formalize the algorithm as follows:

   INPUT:  Graph G, initial matching M on G
   OUTPUT: maximum matching M* on G
A1 function find_maximum_matching(G, M) : M*
A2     Pfind_augmenting_path(G, M)
A3     if P is non-empty then
A4         return find_maximum_matching(G, augment M along P)
A5     else
A6         return M
A7     end if
A8 end function

We still have to describe how augmenting paths can be found efficiently. The subroutine to find them uses blossoms and contractions.

Blossoms and contractions

[edit]

Given G = (V, E) and a matching M of G, a blossom B is a cycle in G consisting of 2k + 1 edges of which exactly k belong to M, and where one of the vertices v of the cycle (the base) is such that there exists an alternating path of even length (the stem) from v to an exposed vertex w.

Finding Blossoms:

  • Traverse the graph starting from an exposed vertex.
  • Starting from that vertex, label it as an outer vertex o.
  • Alternate the labeling between vertices being inner i and outer o such that no two adjacent vertices have the same label.
  • If we end up with two adjacent vertices labeled as outer o then we have an odd-length cycle and hence a blossom.

Define the contracted graph G' as the graph obtained from G by contracting every edge of B, and define the contracted matching M' as the matching of G' corresponding to M.

Example of a blossom

G' has an M'-augmenting path if and only if G has an M-augmenting path, and that any M'-augmenting path P' in G' can be lifted to an M-augmenting path in G by undoing the contraction by B so that the segment of P' (if any) traversing through vB is replaced by an appropriate segment traversing through B.[8] In more detail:

  • if P' traverses through a segment uvBw in G', then this segment is replaced with the segment u → ( u' → … → w' ) → w in G, where blossom vertices u' and w' and the side of B, ( u' → … → w' ), going from u' to w' are chosen to ensure that the new path is still alternating (u' is exposed with respect to , ).

Path lifting when P' traverses through vB, two cases depending on the direction we need to choose to reach vB

  • if P' has an endpoint vB, then the path segment uvB in G' is replaced with the segment u → ( u' → … → v' ) in G, where blossom vertices u' and v' and the side of B, ( u' → … → v' ), going from u' to v' are chosen to ensure that the path is alternating (v' is exposed, ).

Path lifting when P' ends at vB, two cases depending on the direction we need to choose to reach vB

Thus blossoms can be contracted and search performed in the contracted graphs. This reduction is at the heart of Edmonds' algorithm.

Finding an augmenting path

[edit]

The search for an augmenting path uses an auxiliary data structure consisting of a forest F whose individual trees correspond to specific portions of the graph G. In fact, the forest F is the same that would be used to find maximum matchings in bipartite graphs (without need for shrinking blossoms). In each iteration the algorithm either (1) finds an augmenting path, (2) finds a blossom and recurses onto the corresponding contracted graph, or (3) concludes there are no augmenting paths. The auxiliary structure is built by an incremental procedure discussed next.[8]

The construction procedure considers vertices v and edges e in G and incrementally updates F as appropriate. If v is in a tree T of the forest, we let root(v) denote the root of T. If both u and v are in the same tree T in F, we let distance(u,v) denote the length of the unique path from u to v in T.

    INPUT:  Graph G, matching M on G
    OUTPUT: augmenting path P in G or empty path if none found
B01 function find_augmenting_path(G, M) : P
B02    F ← empty forest
B03    unmark all vertices and edges in G, mark all edges of M
B05    for each exposed vertex v do
B06        create a singleton tree { v } and add the tree to F
B07    end for
B08    while there is an unmarked vertex v in F with distance(v, root(v)) even do
B09        while there exists an unmarked edge e = { v, w } do
B10            if w is not in F then
                   // w is matched, so add e and w's matched edge to F
B11                x ← vertex matched to w in M
B12                add edges { v, w } and { w, x } to the tree of v
B13            else
B14                if distance(w, root(w)) is odd then
                       // Do nothing.
B15                else
B16                    if root(v)root(w) then
                           // Report an augmenting path in F  { e }.
B17                        P ← path (root(v) → ... → v) → (w → ... → root(w))
B18                        return P
B19                    else
                           // Contract a blossom in G and look for the path in the contracted graph.
B20                        B ← blossom formed by e and edges on the path vw in T
B21                        G’, M’ ← contract G and M by B
B22                        P’find_augmenting_path(G’, M’)
B23                        P ← lift P’ to G
B24                        return P
B25                    end if
B26                end if
B27            end if
B28            mark edge e
B29        end while
B30        mark vertex v
B31    end while
B32    return empty path
B33 end function

Examples

[edit]

The following four figures illustrate the execution of the algorithm. Dashed lines indicate edges that are currently not present in the forest. First, the algorithm processes an out-of-forest edge that causes the expansion of the current forest (lines B10 – B12).

Forest expansion on line B10

Next, it detects a blossom and contracts the graph (lines B20 – B21).

Blossom contraction on line B21

Finally, it locates an augmenting path P′ in the contracted graph (line B22) and lifts it to the original graph (line B23). Note that the ability of the algorithm to contract blossoms is crucial here; the algorithm cannot find P in the original graph directly because only out-of-forest edges between vertices at even distances from the roots are considered on line B17 of the algorithm.

Detection of augmenting path P′ in G′ on line B17

Lifting of P′ to corresponding augmenting path in G on line B25

Analysis

[edit]

The forest F constructed by the find_augmenting_path() function is an alternating forest.[9]

  • a tree T in G is an alternating tree with respect to M, if
    • T contains exactly one exposed vertex r called the tree root
    • every vertex at an odd distance from the root has exactly two incident edges in T, and
    • all paths from r to leaves in T have even lengths, their odd edges are not in M and their even edges are in M.
  • a forest F in G is an alternating forest with respect to M, if
    • its connected components are alternating trees, and
    • every exposed vertex in G is a root of an alternating tree in F.

Each iteration of the loop starting at line B09 either adds to a tree T in F (line B10) or finds an augmenting path (line B17) or finds a blossom (line B20). It is easy to see that the running time is .

Bipartite matching

[edit]

When G is bipartite, there are no odd cycles in G. In that case, blossoms will never be found and one can simply remove lines B20 – B24 of the algorithm. The algorithm thus reduces to the standard algorithm to construct maximum cardinality matchings in bipartite graphs[7] where we repeatedly search for an augmenting path by a simple graph traversal: this is for instance the case of the Ford–Fulkerson algorithm.

Weighted matching

[edit]

The matching problem can be generalized by assigning weights to edges in G and asking for a set M that produces a matching of maximum (minimum) total weight: this is the maximum weight matching problem. This problem can be solved by a combinatorial algorithm that uses the unweighted Edmonds's algorithm as a subroutine.[6] Vladimir Kolmogorov provides an efficient C++ implementation of this.[10]

References

[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
The Blossom algorithm, also known as Edmonds' matching algorithm, is a foundational polynomial-time method in for computing a in an undirected general graph, where a matching is a set of edges without common vertices, and the goal is to maximize the number of such edges. Unlike algorithms restricted to bipartite graphs, it handles non-bipartite structures by identifying and contracting odd-length cycles called blossoms, allowing the discovery of augmenting paths that increase the matching size. The algorithm proceeds iteratively: starting from an initial matching, it builds alternating trees rooted at free vertices to search for augmenting paths, shrinking blossoms as needed to simplify the graph until no further augmentation is possible, at which point the matching is maximum. Developed by and published in his 1965 paper "Paths, Trees, and Flowers," the algorithm builds on Claude Berge's 1957 work characterizing maximum matchings via the absence of augmenting paths, providing the first efficient solution for general graphs and proving the problem's solvability in polynomial time. Edmonds' approach not only solves the unweighted case but also laid groundwork for weighted variants, such as minimum-cost perfect matchings in complete graphs, which have applications in assignment problems and . In terms of , the original formulation has a time bound of O(V²E), where V is the number of vertices and E the number of edges, but subsequent implementations, including those by Lawler (1976) and Gabow (1976), reduced it to O(V³), making it practical for moderate-sized graphs. Modern software like Blossom V, an efficient C++ implementation by Vladimir Kolmogorov (2009), further optimizes for weighted minimum-cost perfect matchings while maintaining the core shrinking mechanism and achieving comparable performance to earlier versions. The algorithm's significance endures in , influencing research in polyhedral and network flows, as Edmonds connected maximum matchings to the vertices of a associated .

Background

Graph matching basics

In graph theory, an undirected graph G=(V,E)G = (V, E) consists of a vertex set VV and an edge set EE, where edges connect pairs of vertices. A matching MEM \subseteq E in GG is a subset of edges such that no two edges in MM share a common vertex. A maximum matching in a graph is a matching that contains the largest possible number of edges among all matchings in that graph. A perfect matching is a special case of a maximum matching where every vertex in VV is incident to exactly one edge in the matching, which requires V|V| to be even. The maximum matching problem seeks to find a maximum matching in an undirected graph GG, a fundamental task with applications in and network design. Early foundational work on this problem for bipartite graphs was established by Dénes Kőnig in , who proved that the size of a maximum matching equals the minimum in such graphs.

Bipartite versus general matching

A is an undirected graph whose vertices can be divided into two such that no two graph vertices in the same set are adjacent. In such graphs, the size of a maximum matching equals the size of a minimum , as established by König's . This duality enables efficient algorithms for computing maximum matchings in s, including the Hungarian algorithm, which runs in O(n^3) time for n vertices, and the Hopcroft-Karp algorithm, which achieves O(\sqrt{n} m) time for m edges. In general graphs, however, König's theorem does not hold, and the size of a maximum matching can be strictly smaller than the size of a minimum —for instance, in a triangle graph, the maximum matching has size 1 while the minimum has size 2. Moreover, the presence of odd cycles in general graphs complicates the search for augmenting paths, as these structures can trap the search process without revealing all possible improvements to the matching. Berge's lemma provides a foundational characterization for general graphs: a matching is maximum if and only if no augmenting path exists with respect to that matching. This result underscores the need for algorithms that systematically handle cyclic structures in non-bipartite graphs to ensure completeness in finding augmenting paths.

Core Concepts

Augmenting paths

In , a matching MM is a set of edges without common vertices. An augmenting path relative to a matching MM in an undirected graph is a simple path that starts and ends at unmatched vertices (also called free or exposed vertices) and whose edges alternate between those not in MM and those in MM; specifically, it begins and ends with an edge not in MM. The presence of an augmenting path PP allows the matching to be extended by taking the MΔPM \Delta P, which consists of all edges in MM or PP but not both. This operation flips the status of edges along PP: unmatched edges become matched, and matched edges become unmatched, resulting in a new matching M=MΔPM' = M \Delta P whose size is exactly one greater than M|M|, since PP contributes one more unmatched edge than matched edges. Formally, MΔP=M+1|M \Delta P| = |M| + 1 for any augmenting path PP relative to MM. To illustrate, consider a path uvwxu - v - w - x where uu and xx are unmatched, vwv-w is matched in MM, and uvu-v, wxw-x are unmatched; flipping yields a matching with edges uvu-v and wxw-x, augmenting the size by one. In bipartite graphs, augmenting paths can be efficiently located using breadth-first search (BFS) or depth-first search (DFS) from free vertices in one part, following alternating edges without complications from cycles. This process repeatedly augments the matching until no such paths remain, yielding a maximum matching. The Tutte–Berge formula provides a global characterization of the maximum matching size in general graphs: for a graph G=(V,E)G = (V, E) with n=Vn = |V|, the size of a maximum matching is 12minSV(n+So(GS))\frac{1}{2} \min_{S \subseteq V} (n + |S| - o(G - S)), where o(GS)o(G - S) denotes the number of odd-sized connected components in the subgraph induced by VSV \setminus S. This formula, established in 1958, equates the maximum matching size to half the minimum deficiency over all vertex subsets SS.

Blossoms and odd cycles

In the context of maximum matching in general graphs, a is defined as an odd-length alternating cycle with respect to a given matching MM, consisting of 2k+12k+1 vertices for some k1k \geq 1, where exactly kk edges belong to MM, leaving one vertex unmatched within the cycle, known as the base or stem vertex. This structure arises specifically in non-bipartite graphs, where the presence of odd cycles distinguishes the problem from bipartite matching. Odd cycles pose a significant challenge to the standard augmenting path method because they permit multiple alternating paths from a free vertex to converge on the same vertex, thereby violating the assumption of simple paths and potentially leading to incorrect or incomplete searches for augmentations. In particular, traversing an odd cycle in either direction can create the illusion of an augmenting path that does not truly increase the matching size, as the cycle's odd length ensures an imbalance in matched and unmatched edges incident to the base vertex. A key property of blossoms is their amenability to contraction, wherein the entire odd cycle is collapsed into a single supernode, preserving the equivalence of maximum matchings between the original graph and the contracted one. This contraction simplifies the graph structure without losing information about potential augmenting paths external to the blossom. In his seminal 1965 work, observed that to correctly identify true augmenting paths in general graphs, such blossoms must be systematically detected and shrunk, enabling the algorithm to proceed as if in a bipartite setting after handling these obstacles. For illustration, consider a 5-cycle (a with k=2k=2) where vertices are labeled v1,v2,v3,v4,v5v_1, v_2, v_3, v_4, v_5 in sequence, with matched edges {v1,v2}\{v_1, v_2\} and {v3,v4}\{v_3, v_4\} in MM, leaving v5v_5 as the free stem vertex connected by unmatched edges to v1v_1 and v4v_4. This configuration blocks straightforward path extension until contraction occurs. The concept of also connects to broader matching theory, as W. T. Tutte's 1947 characterizes the existence of perfect matchings in general graphs via a condition on odd components in barrier sets, with blossoms representing local manifestations of such structural barriers that Edmonds' approach resolves algorithmically.

Algorithm Mechanics

Overview of the procedure

The Blossom algorithm, developed by , aims to compute a in non-bipartite undirected graphs, where a matching is a set of edges without common vertices, and maximum means the largest possible number of such edges. The input is an undirected graph G=(V,E)G = (V, E), with VV as the vertex set and EE as the edge set, and the output is a maximum matching MEM \subseteq E. Published in , this algorithm marked the first polynomial-time solution for the general matching problem, extending beyond bipartite cases that were solvable earlier via simpler methods. At a high level, the procedure operates iteratively: starting from an initial (possibly empty) matching MM, it repeatedly searches for an augmenting path relative to MM—a path that alternates between edges not in MM and edges in MM, connecting two unmatched vertices. If such a path is found, the matching is augmented by flipping the edges along it (adding the non-matching edges and removing the matching ones), increasing the matching size by one. In non-bipartite graphs, searches may be blocked by odd cycles known as blossoms; the algorithm addresses this by contracting these blossoms into single vertices, effectively recursing on a modified graph to continue the search. This process repeats until no augmenting path exists, at which point MM is maximum. A skeletal pseudocode for the algorithm captures this iterative structure:

function BlossomAlgorithm(G = (V, E)): M ← ∅ // Initial empty matching while there exists an augmenting path P relative to M: augment M along P // Flip edges in P to update M if blossom encountered during search: contract blossom and recurse on reduced graph return M

function BlossomAlgorithm(G = (V, E)): M ← ∅ // Initial empty matching while there exists an augmenting path P relative to M: augment M along P // Flip edges in P to update M if blossom encountered during search: contract blossom and recurse on reduced graph return M

The key innovation lies in the blossom contraction mechanism, which enables efficient handling of odd cycles in general graphs, achieving an original time complexity of O(V4)O(|V|^4).

Blossom detection and contraction

In the Blossom algorithm, blossoms are detected during the search for augmenting paths, which proceeds from free (unmatched) vertices using a to build alternating paths in the graph relative to the current matching. Specifically, a blossom—an odd-length alternating cycle—is identified when a back edge connects two vertices at even distances from the in the search tree, indicating the presence of an odd cycle that obstructs the bipartite assumption. To manage the search structure, vertices are labeled as outer or inner based on their role in the alternating paths and contractions. Outer vertices include those that are unmatched or reached through previously identified augmenting paths, forming the "exposed" layer for continued search; inner vertices, conversely, lie within contracted blossoms and are treated as part of the supervertex to avoid revisiting the cycle's internal structure. This labeling ensures that the search alternates between matched and unmatched edges while respecting the contracted components. Upon detection, the blossom is contracted by shrinking the entire odd cycle into a single supervertex in a new auxiliary graph GG', where the vertices of the cycle are merged while preserving the internal matching edges within the supervertex. Edges incident to the cycle are adjusted to connect to this supervertex: an edge between two cycle vertices becomes internal (and thus ignored for external search), while edges from outside the cycle attach to the supervertex. The contracted graph GG' has a reduced matching MM' that excludes the blossom's internal edges but maintains the overall matching size. This contraction preserves equivalence for augmenting path searches because any augmenting path in the original graph GG corresponds to one in GG', and vice versa; upon finding a path in GG', it can be "lifted" or expanded back into GG by traversing the blossom's alternating cycle appropriately, ensuring the path remains augmenting. The process terminates when no further augmenting paths exist, with each contraction reducing the graph size by at least two vertices. Multiple blossoms are handled through nested and layered contractions, where newly detected blossoms may form within or around previously contracted ones, treated as a of supervertices during recursive searches. Each augmentation phase may involve up to O(n)O(n) contractions, but the overall bounds the total by polynomial time through careful expansion during path lifting.

Searching for augmenting paths

The search for augmenting paths in the Blossom algorithm begins with an exposed (unmatched) vertex, which serves as the of an alternating . A (DFS) is employed to explore alternating paths, where vertices are labeled with even or odd parity based on their distance from the , ensuring the path alternates between matched and unmatched edges. This labeling adapts the bipartite case by building a forest rather than a single tree, allowing multiple exposed vertices to be roots and preventing cycles within individual trees. During the DFS traversal, unmarked edges incident to labeled vertices are examined. If an edge connects to an unlabeled exposed vertex, an augmenting path is immediately found. Similarly, connecting to a vertex labeled even with a different yields an augmenting path by combining the two even-length alternating paths from their roots. However, if the edge connects two vertices with the same and even labels, it indicates an odd-length alternating cycle, known as a , which must be handled to continue the search. The search integrates blossom detection by identifying the cycle formed by the path from the to the two even-labeled vertices and the connecting edge. Upon detecting a blossom, the algorithm contracts it into a single supernode, typically the base vertex (the odd-labeled vertex closest to the in the cycle), reducing the graph while preserving the existence of augmenting paths. The search then recurses on this contracted graph, continuing the DFS from the appropriate point. This contraction temporarily simplifies the structure, allowing the exploration of alternating paths in the reduced graph without losing potential augmentations. Key data structures support this , including adjacency lists for efficient edge traversal, a matching array to track paired vertices, and blossom representatives to record contractions and maintain the of supernodes. If an augmenting path is found in the contracted graph, an expansion phase lifts it back to the original graph. This involves traversing the contraction history in reverse order, selecting the appropriate base for each —specifically, the one that connects to the path via an unmatched edge—and inserting the even-length alternating path within the to preserve the augmenting property. The resulting path in the original graph is then used to augment the matching by flipping matched and unmatched edges along it, increasing the matching size by one. The search procedure repeats from newly exposed vertices until no further augmenting path can be found, at which point the current matching is maximum, as per Berge's lemma generalized to non-bipartite graphs. Termination occurs when all exposed vertices have been processed without discovering a path or when the forest covers all possible alternating structures without blossoms yielding augmentations.

Examples and Illustrations

Bipartite matching walkthrough

Consider a simple with partite sets L={L1,L2,L3}L = \{L_1, L_2, L_3\} and R={R1,R2,R3,R4}R = \{R_1, R_2, R_3, R_4\}, connected by the edges L1L_1-R1R_1, L1L_1-R2R_2, L2L_2-R2R_2, L2L_2-R3R_3, L3L_3-R3R_3, and L3L_3-R4R_4. The Blossom algorithm starts with an empty matching of size 0. In the first iteration, perform a BFS from the free vertices in LL to find an augmenting path. An augmenting path is L1L_1-R1R_1, which alternates between unmatched and (trivially) matched edges. Augment the matching by including this edge, resulting in a matching of size 1: {L1\{L_1-R1}R_1\}. In the second iteration, BFS from the remaining free vertices in LL identifies the path L2L_2-R2R_2. Augment by adding this edge, yielding a matching of size 2: {L1\{L_1-R1),L2R_1), L_2-R2)}R_2)\}. The current matching size has increased, and the previously free L2L_2 is now matched. In the third iteration, BFS uncovers the path L3L_3-R3R_3. Augmenting along this path produces a matching of size 3: {L1\{L_1-R1),L2R_1), L_2-R2),L3R_2), L_3-R3)}R_3)\}. No further augmenting paths exist, as subsequent BFS searches from any remaining free vertices (none in LL) terminate without reaching a free vertex in RR. This example demonstrates the before-and-after progression: the initial empty matching grows incrementally via each augmenting path, with the final matching covering all vertices in LL but leaving R4R_4 unmatched. In bipartite graphs, the Blossom algorithm encounters no blossoms, as the absence of odd cycles eliminates the need for detection and contraction; it reduces to standard augmenting path searches. This aligns with simpler bipartite methods like the . The result is a maximum matching of size 3 without any contractions. In the bipartite case, the algorithm achieves this in O(VE)O(|V| \cdot |E|) time, with at most V/2|V|/2 augmentations and each BFS taking O(E)O(|E|) time.

Non-bipartite example with blossom

Consider a representative non-bipartite graph with vertices s,a,b,c,ts, a, b, c, t and edges sas-a, aba-b, bcb-c, cac-a, ctc-t. The initial matching is M={ab}M = \{a-b\}, leaving ss, cc, and tt exposed. This setup features an odd cycle aa-bb-cc-a)a) that forms a blossom during the search for an augmenting path. The algorithm begins the search for an augmenting path from the exposed vertex ss using a layered alternating tree. Place ss at layer 0 (even). From layer 0, traverse the unmatched edge ss-aa to reach aa at layer 1 (odd). From layer 1, traverse the matched edge aa-bb to reach bb at layer 2 (even). From layer 2, traverse the unmatched edge bb-cc to reach cc at layer 3 (odd). At this point, from cc (layer 3, odd), there is an unmatched edge cc-aa, where aa is already in the tree at layer 1 (odd). Since both endpoints have odd parity, this detects a blossom: the odd cycle aa-bb-cc-a)a) with base vertex aa (the lowest-layer vertex in the cycle). To resolve the blossom, contract the cycle aa-bb-cc into a single supervertex SS. The contracted graph now has vertices ss, SS, tt and edges ss-SS (from original ss-aa), SS-tt (from original cc-tt). The internal matching edge aa-bb is preserved within SS, leaving SS exposed in the contracted graph (as no external matched edges incident to the blossom vertices). Continue the search in this reduced graph from ss at layer 0. Traverse the unmatched edge ss-SS to reach SS at layer 1 (odd). Since SS is exposed and reached at an odd layer, an augmenting path ss-SS is found. The original graph before contraction is shown below in simple ASCII representation:

s --- a --- b | / c / | t Edges: s-a, a-b, b-c, c-a, c-t Matched: a-b (solid), others unmatched (dashed implied).

s --- a --- b | / c / | t Edges: s-a, a-b, b-c, c-a, c-t Matched: a-b (solid), others unmatched (dashed implied).

The contracted graph:

s --- S --- t Supervertex S = {a,b,c}

s --- S --- t Supervertex S = {a,b,c}

Augment along ss-SS, increasing the matching size by 1 in the contracted graph. To expand back to the original graph, lift the supervertex SS by replacing the path segment involving SS with an alternating path in the blossom from the entry point (base aa) to a free vertex within the blossom, ensuring overall alternation. The entry is at aa via ss-aa (unmatched). Within the blossom, the alternating path from aa (odd layer) to the free vertex cc (odd layer) is aa-bb-cc: matched aa-bb, unmatched bb-cc. Thus, the full augmenting path is ss-aa-bb-cc, with edges unmatched (ss-aa), matched (aa-bb), unmatched (bb-cc). Augment by flipping: add ss-aa and bb-cc, remove aa-bb. The new matching is M={sM' = \{s-a),ba), b-c}c\}, increasing the size from 1 to 2 despite the initial odd-cycle blockage. This process demonstrates the Blossom algorithm's success where simpler methods fail: the contraction allows discovering the path around the odd cycle, and expansion correctly adjusts the internal matching. Continuing iterations (e.g., from exposed tt) would yield no further augmentation, confirming MM' as maximum (size 2 for 5 vertices). The final augmented matching graph:

s - a \ b - c - t Matched edges: s-a, b-c (solid).

s - a \ b - c - t Matched edges: s-a, b-c (solid).

Analysis and Properties

Time complexity

The original Blossom algorithm, as proposed by Edmonds, exhibits a of O(V4)O(|V|^4), stemming from up to O(V)O(|V|) augmenting path searches, each taking O(V3)O(|V|^3) time due to the naive handling of blossom contractions and path explorations in dense graphs. Subsequent implementations refined this to O(V3)O(|V|^3) or O(V2E)O(|V|^2 |E|) by optimizing data structures for labeling and searching, but the fundamental bound remains quartic in the worst case for the basic procedure. Significant asymptotic improvements came with the Micali-Vazirani algorithm in 1980, achieving O(VE)O(\sqrt{|V|} |E|)
Add your contribution
Related Hubs
Contribute something
User Avatar
No comments yet.