1

To find the maximum matching on a bipartite graph, I propose the following greedy algorithm: At each iteration, pick an unmatched vertex with the smallest degree and match it to one of it's neighbours if possible. Remove the 2 matched vertices and all of it's edges from the graph and repeat till the graph is empty.

I've tried finding a counter example for this greedy algorithm, but am not able to come up with one.

Could someone provide me with a counter example? Thanks!

Pål GD
  • 16,115
  • 2
  • 41
  • 65
  • Have you tried implementing it and using random testing? See https://cs.stackexchange.com/q/59964/755. – D.W. Nov 29 '23 at 02:48

1 Answers1

1

Here's a counter example on codeforces. However if it's complete bipartite matching, we can use the greedy Nobel winning algorithm in Economics.

Kenneth Kho
  • 654
  • 2
  • 17