3

How do you find the maximum bipartite matching when your graph has several components ? Each component can be colored in two ways. How do you decide the two sets X and Y in order to run the maximum matching routine ?

rohit89
  • 5,745
  • 2
  • 25
  • 42
  • maximum matching or maximum **bipartite** matching? (the former is intractable) – abeln Apr 19 '11 at 16:37
  • Run the routine on each component separately, combine your answers? – btilly Apr 19 '11 at 17:29
  • @abeln Its maximum bipartite matching. – rohit89 Apr 19 '11 at 19:40
  • @btilly The problem is that depending on the way you color (for graphs with odd vertices especially), you can combine in different ways. – rohit89 Apr 19 '11 at 19:43
  • @abeln- Maximum matching in a general graph can be solved in polynomial time with a variety of algorithms, the best of which is asymptotically quite good (O(m sqrt n), I believe). It's definitely tractable, though the algorithms have high constant factors. – templatetypedef Apr 19 '11 at 21:41
  • What maximum matching routine are you talking about? What are *X* and *Y*? The partitions of the graph? – fuglede Oct 08 '19 at 14:01

3 Answers3

1

If your graph has several different connected components, you can find the maximum matching in the graph by just finding the maximum matching in each of those components and returning their union.

As for how to decide the sets X and Y, many algorithms exist for detecting whether a particular graph is bipartite and, if so, assigning labels to the nodes to recover those two groups. You can do this with a modified DFS or BFS fairly easily. Consequently, an algorithm for your problem might be

  1. Run a DFS over the entire graph to break it into connected components.
  2. For each of those components:
    1. Run a DFS on those components to recover which nodes are in the groups X and Y.
    2. Use a maximum bipartite matching algorithm to find a maximum matching in that component.
  3. Combine all the results together to get the overall answer.

Hope this helps!

templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
1

Don't look at a matching from the point of view of the edges, look at is as a set of edges. This point of view makes it clearer that no matter how you join the subresults it will still be OK latter on.

  1. Separate your graph into connected components

  2. Find a maximum matching for each graph component, using your algorithm of choice.

  3. The union of the matchings found is a maximum matching of the whole graph.

hugomg
  • 68,213
  • 24
  • 160
  • 246
0

I don't know about disconnected graph but if you have a complete graph like I have this might be interesting for you: http://wilanw.blogspot.com/2009/09/maximumminimum-weighted-bipartite.html. It's using a modified Floyd-Warshall algorithm to find the maximum matching. I don't know about the difference between this and the Hungarian algorithm.

Micromega
  • 12,486
  • 7
  • 35
  • 72