Computes the maximum matching for unweighted graph and maximum matching for (un)weighted bipartite graph efficiently.