Here is Kuhn's algorithm for maximum bipartite matching:
match = array of size |R|, all -1
result = 0
function dfs(u, visited):
for v in adj[u]:
if visited[v]:
continue
visited[v] = true
if match[v] == -1 or dfs(match[v], visited):
match[v] = u
return true
return false
for u in L:
visited = array of size |R|, all false
if dfs(u, visited):
result = result + 1
return result
The match[v] array tracks which vertex in is matched to vertex in . For each , we try to find an augmenting path using DFS.