1
$\begingroup$

I am looking for an algorithm that can compute a maximum weight matching among all matchings with at least $k$ edges for some integer $k$. Note that this matching may have smaller weight than an unconstrained max weight matching.

As an example, consider the graph consisting of two triangles joined by a single edge (called the link). One of the edges in each triangle that is adjacent to the link has a weight of 2. The remaining edges have weight 1. The max weight matching consists of the two heavy edges and has weight 4. The max weight matching with at least 3 edges includes the link and one of the light edges in each triangle, for a weight of 3.

For bipartite graphs this problem is easy, using the well-known reduction to min cost flow (add source and sink vertices with edges from the source to the "input vertices" and edges from the "output vertices" to the sink, negate the weights to get the edge costs, all edge capacities are 1) and using a min-cost augmenting path algorithm. When finding an unconstrained max weight matching, one halts the algorithm when the augmenting paths no longer have negative weight. However, if one allows the algorithm to continue running until $k$ of the original edges have positive flow, the resulting matching is the one we want.

I have been looking for a similar way to extend Edmond's blossom-shrinking algorithm for weighted graphs. While one can continue to run the algorithm so long as there are edges with tight dual constraints that can be processed, the algorithm gets blocked if a relabeling step is required. The trouble is that once the dual variables at the unmatched vertices become zero, there is no way to continue.

I have thought about extending the LP on which Edmond's algorithm is based, by adding a constraint of the form $\sum x_e \geq k$ where the sum is over all edges $e$ and $x_e$ is the selection variable for $e$. However, it's not clear to me how to establish an initial feasible solution for both the primal and dual problems that will work with Edmond's algorithm.

$\endgroup$

1 Answer 1

1
$\begingroup$

Let $n$ be the number of nodes in the graph. Add $n-2k$ dummy nodes and connect every dummy node to every other node (original and dummy) with a dummy edge of weight 0. Then a max-weight matching of size $\geq k$ in the original graph is obtained from a max-weight perfect matching in the new graph by removing dummy edges from the matching. A max-weight/min-weight perfect matching can be found with Edmonds' blossom algorithm or its variations (e.g., see Cook & Rohe (1999) paper).

$\endgroup$
4
  • $\begingroup$ Perhaps I am missing something, but consider my double triangle example. If we let $k=3$, $n-2k=0$ so nothing gets added. Running Edmonds' algorithm yields the matching containing the 2 heavy edges (weight 4). But the max weight perfect matcing (which includes the link and one edge from each triangle) has weight 3. The standard version of Edmonds algorithm halts after the first two edges are added to the matching. How does one extend it to find the max weight perfect matching? $\endgroup$
    – Jon Turner
    Commented May 19 at 14:20
  • $\begingroup$ @user1644373: "two heavy edges" is not a perfect matching in that graph. Please see this paper about Edmonds' algorithm and its further improvements. It talks about computing min-weight perfect matchings, but for perfect matchings the min-weight and max-weight problems are equivalent under replacing each weight $w$ with $C-w$ for a big contant $C$ (e.g. the largest weight in the graph). $\endgroup$ Commented May 19 at 14:49
  • 1
    $\begingroup$ Thanks. The version of Edmond's algorithm that I am familiar with finds max weight matchings only. But I see from the paper you cited that a variant (based on a different linear program) can be used for perfect matchings. This looks like exactly what I needed. $\endgroup$
    – Jon Turner
    Commented May 19 at 15:18
  • $\begingroup$ One more question. I now understand the version of Edmond's algorithm for minimum weight perfect matching and am wondering if there might be a shortcut to my original $k$ edge matching problem. The perfect matching algorithm builds the matching incrementally and halts when it arrives at a perfect matching. I wonder if at each intermediate step, the matching at that point has minimum weight among all edges of its size. If so, the algorithm could be stopped when $k$ edges are matched, rather than continuing until a perfect matching is obtained. Do you know if this property holds or not? $\endgroup$
    – Jon Turner
    Commented May 20 at 17:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .