In graph theory, the Hungarian algorithm is an algorithm which solves instances of the assignment problem in polynomial time. Its first version, known as the Hungarian method, was invented by H. Kuhn in 1955. The Hungarian method was in turn revised by James Munkres in 1957, and ever since it has been widely known as the Hungarian algorithm, or the Munkres' assignment algorithm, or even as the Kuhn-Munkres algorithm.