3

Given a bipartite graph G=(X,Y,E) and consider the b-matchings where each X-node is matched with at most one Y-node and each Y-node is matched with at most 2 X-nodes.

Is there a polynomial-time algorithm to find a b-matching with maximum cardinality (# of edges) and given that, the smallest number of distinct Y-nodes among these b-matchings?


In both figures below, the red edges form a valid maximum b-matching. However, the right one is the desired since it has only one Y-node ($y_2$) while the left one has two ($y_1$ and $y_2$).

enter image description here

1 Answers1

2

Let's build another graph $H$ in the following way. Each vertex $v \in X$ becomes a vertex of $H$. Each vertex $u \in Y$ turns into two vertices $u_1$ and $u_2$ of $H$. For every edge $\{\,v, u\,\} \in E(G)$ there are two edges $\{\,v, u_1\,\}$ and $\{\,v, u_2\,\}$ of $H$. It is easy to see that maximum matching in the graph $H$ has the same cardinality as maximum b-matching in the graph $G$. Let's denote it's cardinality as $c$.

To answer the second part let's build yet another graph $F_k$. Each vertex $v \in X$ becomes a vertex of $F_k$. Each vertex $u \in Y$ turns into two adjacent vertices $u_1, u_2 \in U$. For every edge $\{\,v, u\,\} \in E(G)$ there are two edges $\{\,v, u_1\,\}$ and $\{\,v, u_2\,\}$ of $F_k$. Let's add set $V$ of $|X| - c$ vertices each of which is adjacent to every vertex $v \in X$. Let's add set $W$ of $k$ vertices each of which is adjacent to every $u_1$.

Now the graph $F_k$ has perfect matching if and only if there is b-matching in the graph $G$ of cardinality $c$ with exactly $\frac{c + k}2$ vertices of $Y$ being matched. Indeed if such b-matching exists, there are $\frac{c - k}2$ vertices of $Y$ that are matched to two vertices each, and $k$ vertices of $Y$ that are matched to a single vertex. Then in the graph $F_k$ there is a perfect matching in which $\frac{c - k}2$ pairs of adjacent vertices of $U$ that are matched to vertices of $X$. There are $k$ more vertices $u_2$ from $U$ that are matched to vertices of $X$ and $k$ more vertices $u_1$ from $U$ that are matched to vertices of $W$. Remaining vertices of $U$ induce a perfect matching. Remaining $|X| - c$ vertices of $X$ are matched to vertices from $V$. And there are no more unmatched vertices.

On the other hand, if a perfect matching exists in the graph $F_k$ then all $k$ vertices of $W$ are matched to $k$ vertices of $U$. Their $k$ counterparts in $U$ are matched to $k$ vertices of $X$ and correspond to vertices of $Y$ that are matched in $G$ to a single vertex of $X$ each. All $|X| - c$ vertices of $V$ are matched to $|X| - c$ vertices of $X$. That's why remaining $c - k$ vertices of $X$ are matched to vertices of $U$ which correspond to $\frac{c - k}2$ vertices of $Y$ that are matched in $G$ to two vertices of $X$ each. Remaining vertices of $U$ are matched to each other.

So it is possible to use binary search to find minimum possible $k$. So the total time is $\mathrm{O}(M(n, m) \log n)$, where $n = |G|$, $m = |E(G)|$, and $M(n, m)$ is time required to find maximum matching. I guess it could be optimized a bit further, just to one or two maximum matchings.

Smylic
  • 1,043
  • 5
  • 15