Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maximum bipartite matching (ford-fulkerson)

I was reading http://www.geeksforgeeks.org/maximum-bipartite-matching/ and http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm and am having trouble understanding. It seems the example is under the assumptions that each job can only accept 1 person and each person wants 1 job. I was wondering how the algorithm/code would change if for example, the v set had capacity > 1 (can hire multiple people for that job) and the u set > 1 (each person wants more than 1 job)?

like image 342
senjougahara Avatar asked Mar 30 '14 17:03

senjougahara


People also ask

Can we use Ford Fulkerson method to solve maximum bipartite matching?

Maximum bipartite matching solutionSuch a problem can be solved very effectively by the Ford Fulkerson algorithm, which connects and disconnects all possible edges in the graph till the maximum match number is found, such as the highest edge count.

What is maximum bipartite matching problem?

A matching in a Bipartite Graph is a set of the edges chosen in such a way that no two edges share an endpoint. A maximum matching is a matching of maximum size (maximum number of edges). In a maximum matching, if any edge is added to it, it is no longer a matching.

What is the time complexity of maximum bipartite matching problem with Ford Fulkerson algorithm?

For a bipartite graph G = (V, E) maximum matching are matching whose cardinalities are maximum among all matchings. Existing enumerating algorithm of maximum matching has time complexity is O(|V |) per matching. Ford- Fulkerson method finds the maximum matching on a bipartite graph with O(VE) time.


1 Answers

To allow jobs to have more than one person assigned to them, you'd only modify edge capacities from Jobs to Terminal (Similar to how Niklas B. described in his comment, but not exactly.)

Like this:

Flow network

The capacities of 1 from the Source to the People, and 1 from People to Jobs guarantees that a person will only ever be selected for one job (because the maximum flow that they can contribute overall is 1). However, the capacities > 1 from Jobs to Terminal allows that more than one person can be assigned to that job.

If a person can perform also more than 1 job, then the max flow from Source to Person increases by that amount:

Another flow network

Where i, j, k, and x are stand-ins for integers with values >= 1

The key thing to remember here is that flow capacities to the left of People dictate how many jobs they may take, and the flow capacities to the right of Jobs dictate how many people may be assigned that job. The capacities in the middle should not change.

like image 84
AndyG Avatar answered Sep 20 '22 21:09

AndyG