Comparing Two Matchings by Their Edges
Two matchings can overlap, or they can choose different edges in parts of the same graph. Comparing their sizes directly tells us which has more edges, but not where the difference comes from. The symmetric difference isolates precisely the edges that belong to one matching but not both. Its components have a simple structure, and that structure explains the difference in size.
Throughout, \(G=(V,E)\) is a finite simple graph. A matching is a set of edges no two of which share an endpoint. A vertex incident to an edge of a matching is saturated by that matching; otherwise it is unsaturated. For two sets of edges \(M\) and \(N\), their symmetric difference consists of the elements in exactly one of the sets.
View \(H=(V,M\triangle N)\) as a graph on the same vertices as \(G\), using only the edges in the symmetric difference. Some vertices of \(H\) may be isolated. When we discuss its path and cycle components, we mean its components containing at least one edge; isolated vertices contribute no edges and have no effect on matching sizes.
The Structure of the Symmetric Difference
Proof. Let \(H=(V,M\triangle N)\). At any vertex \(v\), there is at most one incident edge of \(M\), since \(M\) is a matching, and at most one incident edge of \(N\). Every edge of \(H\) belongs to exactly one of \(M\setminus N\) or \(N\setminus M\). Therefore \(\deg_H(v)\le 2\). If \(\deg_H(v)=2\), one incident edge must belong to \(M\setminus N\) and the other to \(N\setminus M\): two edges from the same one of these sets would violate the matching condition for that matching.
Now consider a connected component of \(H\) containing an edge. If it has a vertex of degree 1, start there and follow its edge. At each later vertex, there is at most one edge other than the edge just used, so continue along that edge if it exists. The walk cannot repeat a vertex: a repetition would produce a cycle, and the repeated vertex would then have two cycle edges as well as the initial route from the degree-1 vertex, contradicting the degree bound or the choice of the first repetition. Since the component is finite, the walk ends at a vertex of degree 1. No vertex of the component can be outside this path, because connectedness would require an additional edge meeting the path, which would give one of its vertices degree at least 3 or allow the traversal to continue. Thus the component is a path.
If the component has no degree-1 vertex, every vertex in it has degree 2: it is connected, contains an edge, and has no isolated vertex. Start at any vertex and follow edges, always taking the edge other than the one just used. Finiteness forces a repeated vertex; because every vertex has degree 2, the first repetition closes a cycle. Every vertex on that cycle already has its two incident edges in the cycle, so connectedness leaves no vertex of the component outside it. Thus the component is a cycle. At each degree-2 vertex the two incident edges belong to different matchings, as shown above. Consequently, edges alternate along every path or cycle obtained. On a cycle, alternating between two edge sets and returning to the starting edge type requires an even number of edges. Hence every cycle component has even length. \(\square\)
This theorem uses the matchings separately: each can contribute at most one edge at any vertex. It does not say that the union \(M\cup N\) has the same structure, since an edge common to both matchings can give a vertex more incident edges in the union.
How the Components Determine the Size Difference
Proof. Edges in \(M\cap N\) contribute one to both \(|M|\) and \(|N|\), so they cancel in \(|M|-|N|\). Edges outside \(M\triangle N\) belong to neither matching. Thus the difference is the total number of \(M\setminus N\) edges minus the total number of \(N\setminus M\) edges, counted over the edge-containing components of \(H\). In an alternating cycle, the even number of edges divides equally between the two matchings, so the contribution is zero. In an alternating path, the edge types alternate. If its length is even, the two types occur equally often and the contribution is zero. If its length is odd, one type occurs once more than the other, so the contribution is \(1\) or \(-1\). This proves the formula and the stated possibilities. \(\square\)
More specifically, an odd-length path contributes \(1\) when both end edges belong to \(M\setminus N\), and \(-1\) when both belong to \(N\setminus M\). An even-length path has different matching types at its two ends and contributes zero. These statements concern edges in the path, not whether its endpoint vertices are saturated by other edges outside the symmetric difference.
Worked Example: A Cycle and a Path
Let \(G=(V,E)\) have \(V=\{1,2,3,4,5,6,7\}\) and \(E=\{12,23,34,41,56,67\}\). Take \(M=\{12,34,56\}\) and \(N=\{23,41,67\}\). Each set is a matching: no two edges within either set share an endpoint.
There are no common edges, so \(M\triangle N=\{12,23,34,41,56,67\}\). The component on \(\{1,2,3,4\}\) is the cycle \(1,2,3,4,1\), with edge pattern \(M,N,M,N\). It contributes \(2-2=0\) to \(|M|-|N|\). The component on \(\{5,6,7\}\) is the path \(5,6,7\), with edge pattern \(M,N\); it contributes \(1-1=0\).
Therefore \(|M|-|N|=0+0=0\). Directly, \(|M|=3\) and \(|N|=3\), so the component calculation agrees with the matching sizes. The cycle has length \(4\), which is even, as the theorem requires.
Worked Example: One Matching Has One Extra Edge
Let \(G=(V,E)\) have \(V=\{1,2,3,4,5,6\}\) and \(E=\{12,23,34,45,56\}\). Let \(M=\{12,34,56\}\) and \(N=\{23,45\}\). Both are matchings: the edges of \(M\) are pairwise disjoint, and \(23\) and \(45\) have no common endpoint.
The matchings have no common edges, so the symmetric difference contains all five edges. They form the path \(1,2,3,4,5,6\), with alternating pattern \(M,N,M,N,M\). Counting along the path gives \(3\) edges from \(M\setminus N\) and \(2\) from \(N\setminus M\), so its contribution is \(3-2=1\). Hence \(|M|-|N|=1\).
Check: Directly, \(|M|=3\), \(|N|=2\), and \(3-2=1\). The path has odd length \(5\) and starts and ends with an \(M\)-edge, matching the positive contribution.
Worked Example: Shared Edges and Contributions That Cancel
Let \(G=(V,E)\), where \(V=\{a,b,c,d,e,f,g,h,i,x,y\}\) and \(E=\{ab,cd,de,fg,gh,hi,xy\}\). Define \(M=\{ab,cd,fg,hi\}\) and \(N=\{ab,de,gh,xy\}\). These are matchings: in \(M\), the four edges are disjoint; in \(N\), the four edges are also disjoint.
The edge \(ab\) belongs to both matchings, so it is omitted from \(M\triangle N\). The remaining edges are \(\{cd,de,fg,gh,hi,xy\}\). They form three edge-containing components:
- The path \(c,d,e\) has pattern \(M,N\), so its contribution is \(1-1=0\).
- The path \(f,g,h,i\) has pattern \(M,N,M\), so its contribution is \(2-1=1\).
- The single-edge path \(x,y\) has its edge in \(N\setminus M\), so its contribution is \(0-1=-1\).
The total contribution is \(0+1-1=0\). Directly, \(|M|=4\) and \(|N|=4\), so \(|M|-|N|=4-4=0\). The shared edge contributes one to each size and cancels; the two nonzero path contributions cancel each other.
A Common Mistake
Wrong calculation: In the previous example, one might use the union \(M\cup N=\{ab,cd,de,fg,gh,hi,xy\}\) and treat it as one alternating structure. That is not the symmetric difference: it includes \(ab\), which belongs to both matchings. Moreover, the union has three edges incident to \(g\) or \(h\) taken together (\(fg,gh,hi\)); the degree-two structure proved for the symmetric difference does not apply to the union in general.
Correction: First remove the common edges by forming \((M\setminus N)\cup(N\setminus M)\). Here \(ab\) is removed, leaving the three alternating components listed above. Only then count each component’s \(M\)-edges and \(N\)-edges. The component counts give \(0+1-1=0\), consistent with the direct size difference \(4-4=0\).
The component formula is useful because it localizes a comparison: cycles and even-length alternating paths cannot change the difference in size, while odd-length paths account for any imbalance. This is a structural fact about two matchings, not by itself a test that either matching is maximum. In particular, the existence of a path component with one more edge from \(M\) does not alone establish that \(M\) is maximum; it only describes the comparison between the given \(M\) and \(N\).
Check Your Understanding
For each question, distinguish the symmetric difference from the union and count edges by their matching membership.
- Why can a vertex have degree at most two in \((V,M\triangle N)\)? What must be true about its two incident edges if its degree is two?
- An alternating path has edge pattern \(N,M,N,M\). What is its contribution to \(|M|-|N|\), and why?
- Explain why an alternating cycle in the symmetric difference has even length and contributes zero to the size difference.
- Suppose the symmetric difference has two odd-length path components, one contributing \(1\) and the other contributing \(-1\), and all other components are cycles. What is \(|M|-|N|\)?
- If \(M\cap N\) contains three edges, do those edges appear in \(M\triangle N\)? Explain how they affect \(|M|-|N|\).