Matching in graphs involves selecting edges without common vertices, crucial for optimization and pairing problems.
A matching in a graph is a set of edges pairwise without common vertices. It is used to solve assignment problems: matching workers and tasks, students and seats, donors and recipients [1].
A matching is maximal if no edge can be added, maximum if it has the greatest possible number of edges, perfect if it covers all vertices. A perfect matching requires an even number of vertices. In bipartite graphs, the vertices are divided into two groups and edges go only between the groups [1][2].
Three workers $L_1, L_2, L_3$ and three tasks $C_1, C_2, C_3$ (assumed values). $L_1$ can do $C_1$ or $C_2$; $L_2$ can do $C_1$; $L_3$ can do $C_2$ or $C_3$. A perfect matching is $L_1 C_2$, $L_2 C_1$, $L_3 C_3$: each worker has a different task. In total the possible perfect matchings are $1$ (calculation).
A bipartite graph with groups $X$ and $Y$ has a matching covering $X$ if and only if for every subset $S \subseteq X$ the neighborhood set $N(S)$ has at least $|S|$ elements. In the example, $\{L_1, L_2\}$ has neighbors $\{C_1, C_2\}$, numbering $2 \ge 2$, and the condition holds for every subset (calculation).
In bipartite graphs, optimization with augmenting paths is used, for example the Hopcroft-Karp algorithm. In general graphs Edmonds gave a polynomial algorithm based on "blossoms". With weights on edges, one looks for the minimum or maximum weight matching, for example with the Hungarian method [1].
Assignment of personnel, shifts and schedules, matching in transplants, networks and chemistry (the Kekulé structures of aromatic hydrocarbons correspond to perfect matchings) (general observation).
A perfect matching does not always exist: a graph with an odd number of vertices cannot have one. For graphs with additional constraints, such as preferences, the problem becomes more complex, for example in stable matchings. See the graph theory entry for basic definitions.
[1] Wikipedia (it): Grafo
[2] Wikipedia (en): Matching (graph theory)
Generating summary…