Abstract
Matchings and perfect matchings have received considerable attention in graph theory as well as in other related domains (such as, but not limited to, algorithms and optimization). There still remain many open problems — such as Barnette’s conjecture, Berge-Fulkerson conjecture, and so on — due to which it continues to remain an active area of research. At the heart of all this research lies the bottleneck of finding a maximum cardinality matching in undirected graphs. Edmonds’ Blossom algorithm [1], introduced in 1965, was groundbreaking in providing the first polynomial-time solution by effectively handling odd-length cycles (blossoms) in \(\mathcal{O}(|E|\cdot|V|^2)\) time. There are algorithms, with the Linear Programming backbone, that exploit the properties of the matching polytope for computing a maximum cardinality matching. For nonbipartite graphs, it either suffers from nontight Linear Programming relaxation, leading to fractional solutions or otherwise the inclusion of exponential numbers of the odd-set constraint.
Overtime, there have been several attempts in order to effectively compute the maximum cardinality matching in general undirected graphs. In 1980, Silvio Micali and Vijay V. Vazirani presented an algorithm [3] that calculates a maximum cardinality matching in \(\mathcal{O}(|E| \cdot \sqrt{V})\) time. It is worth noting that the Micali-Vazirani algorithm, by far, offers the best theoretical runtime known for the concerned problem. Despite this, there are no publicly available sagemath implementations. It is for this reason that researchers in this area are at a loss, and are required to implement this by themselves. Currently, in SageMath, for general undirected graphs, the method matching(), computes a maximum cardinality matching in \(\mathcal{O}(|E|\cdot|V|^2)\) either through Edmonds’ algorithm or by using Linear Programming formulation. Ergo, we propose to implement the \(mathcal{O}(|E| \cdot \sqrt{|V|})\) Micali-Vazirani algorithm for maximum cardinality matching in undirected graphs in SageMath, and to make all of that available freely to students, educators as well as researchers all across the world.
This implementation draws upon the work of Prof. Vazirani [4] and the study by Michael Huang and Clifford Stein [2]. In addition, a presentation [5] delivered by Prof. Vazirani at the Simons Institute — A Theory of Alternating Paths and Blossoms, from the Perspective of Minimum Length — was consulted to obtain a more comprehensive understanding of the algorithm.
References