# Number of vertices present in all maximum matchings

Given a graph $G$, we need to find the cardinality of the largest set of vertices so that each of them are present in every maximum matching possible.

Is there a solution beside the obvious remove each vertex and find the maximum matching to see it reduces?

• I don't see how what you suggested is even a solution. $\:$ (Consider a triangle.) $\hspace{1.4 in}$ – user6973 Jul 5 '15 at 17:00
• @RickyDemer first we find maximum matching in whole graph. Then, we remove a vertex and find maximum matching again. If the difference is 1 then we can say that this vertex is present in all maximum matchings. – evil999man Jul 5 '15 at 17:03
• Should "find maximum matching" be replaced with "find a maximum matching" or "find all maximum matchings"? $\;$ – user6973 Jul 5 '15 at 17:05
• I think it should be replaced with size of maximum matching. – evil999man Jul 5 '15 at 17:06
• @Awesome is right. I will edit my question. – Hououin Kyouma Jul 5 '15 at 17:08

I think you want the Edmonds-Gallai decomposition of your graph which can be computed in time $O(n^3)$ (see these notes).

• I need only size, not the vertices themselves. Can this be done in O(n^2) ? And thanks for the paper – Hououin Kyouma Jul 7 '15 at 9:14

Is your graph bipartite? Because, if it is: suppose that one side of the bipartition is left and the other is right. Find a maximum matching, and orient all matched edges left-to-right and all unmatched edges right-to-left. Then a vertex $v$ can be omitted from a maximum matching if and only if one of the three following (mutually exclusive) conditions holds:

• $v$ is already unmatched
• $v$ can be reached from an unmatched vertex on its side of the bipartition in the resulting digraph
• $v$ can reach an unmatched vertex on its side of the bipartition in the resulting digraph.

By doing two breadth-first or depth-first searches, one to find the parts of the graph that can be reached from unmatched vertices and one to find the parts that can reach unmatched vertices, you can find the essential vertices in linear time once you already have the matching.

Probably something like this will also work for the non-bipartite case, using a blossom-contracting alternating path search, but the details will be more complicated.

• I am curious how would you do it in a general graph. Could you explain it? – evil999man Jul 5 '15 at 21:15
• If I had worked it out in detail already, I would have included it in my answer. But basically you just want to find the vertices that can be reached by alternating paths from unreached vertices, as those are the ones that could possibly be left unmatched. The alternating path search should be pretty much the same as the one you use to find the matching in the first place. – David Eppstein Jul 6 '15 at 0:52
• Sorry for late comment. My graph is general. I will try to think through the method – Hououin Kyouma Jul 7 '15 at 9:09