Direct bipartite matching. Weโve seen how to find a maximum matching in a bipartite graph via reduction to the maximum flow problem. We now develop a direct algorithm.
Let be a bipartite graph (so each edge has one endpoint in and one endpoint in ), and letbe a matching in the graph (that is, a set of edges that donโt touch). A vertex is said to be covered byif it is the endpoint of one of the edges in . An alternating path is a path of odd length that starts and ends with a non-covered vertex, and whose edges alternate between and .
(a) In the bipartite graph below, a matching is shown in bold. Find an alternating path.

(b) Prove that a matchingis maximal if and only if there does not exist an alternating path with respect to it.
(c) Design an algorithm that finds an alternating path intime using a variant of breadth-first search.
(d) Give a directalgorithm for finding a maximal matching in a bipartite graph.