Reputation: 39
I looking for a simple algorithm getting the minimum weighted edge among the edges for a bipartite graph. I searched and I all could know it means the cover edge of a bipartite in other words if we have bipartite graph and each edge has a number weight how to get the smallest number among them
Upvotes: 3
Views: 3731
Reputation: 3203
Even better than the Hungarian Algorithm as suggested in the other answers, is the Jonker-Volgenant (LAPJV) algorithm.
Take a look at this GitHub repository aptly named Bipartite Solver, which is basically a tutorial on how to implement LAPJV in code, complete with a runnable graphical sample.
It's crazy fast, able to do 1000 to 1000 in under a second.
Also included in the library is greedy search, which is even faster, but does not guarantee optimality.
The library also has some executables if you wish to try out the algorithms without having to build it from source.
Upvotes: 0
Reputation: 194
You need the Hungarian algorithm. Click here to get lecture notes.
Before processing, you should have a cost matrix, where each entry is the edge cost from node A to node B. The matching steps as follows:
The algorithm above is based on a mathematic therorem that
Upvotes: 0
Reputation: 19241
The way this question is posed makes it very unclear. One of the interpretations I got from it was: "Given a weighted bipartite graph G, how do I obtain the minimum edge cover of G ?". If that is the case, then the Hungarian algorithm (see http://reference.wolfram.com/mathematica/ref/FindEdgeCover.html also) solves your problem.
Upvotes: 0