Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Finding the matching number of a graph
A matching in a graph is a set of edges where no two edges share a common vertex. The matching number of a graph is the maximum number of edges in any matching − in other words, the largest set of edges you can select such that no vertex appears more than once.
The matching number is denoted by β1.
Upper Bound
For a graph with n vertices, the matching number has the following upper bound −
β1 ≤ ⌊n / 2⌋
This is because each edge in a matching uses exactly 2 vertices, and no vertex can be reused. So the maximum possible matching size is ⌊n / 2⌋.
Problem Statement
What is the matching number for the following graph ?
Solution
The graph has 9 vertices. The theoretical upper bound is −
β? ≤ ⌊n / 2⌋ β? ≤ ⌊9 / 2⌋ β? ≤ 4
Since 9 is an odd number, at most 8 vertices can be matched (one vertex must remain unmatched). We can find a matching that uses 4 edges covering 8 of the 9 vertices, as shown below −
The highlighted edges form a maximum matching − each selected edge connects two vertices, no vertex is used more than once, and no larger matching is possible. Vertex 'e' remains unmatched.
The four matched edges are −
| Matched Edge | Vertices Covered |
|---|---|
| M1: (a, b) | a, b |
| M2: (c, f) | c, f |
| M3: (d, g) | d, g |
| M4: (h, i) | h, i |
Therefore, the matching number is −
β1 = 4
Conclusion
The matching number of a graph is the maximum number of edges that can be selected without any two edges sharing a vertex. For a graph with n vertices, it is always at most ⌊n / 2⌋. When n is odd, at least one vertex will remain unmatched in any maximum matching.
