Polynomial-Time Solvability of Bipartite Matching and NP-Completeness of Three-Dimensional Matching