Matching in a graph is a  set of edges which share no common edges. The code finds the maximum matching in a graph, A matching M  is called perfect if each vertex in graph is incident on exactly one vertex of the matching M.