Hungarian algorithm

The Hungarian method is a combinatorial optimization algorithm that solves the assignment problem in polynomial time and which anticipated later primal–dual methods. It was developed and published in 1955 by Harold Kuhn, who gave the name “Hungarian method” because the algorithm was largely based on the earlier works of two Hungarian mathematicians: Dénes Kőnig and Jenő Egerváry.[1][2]

James Munkres reviewed the algorithm in 1957 and observed that it is (strongly) polynomial.[3] Since then the algorithm has been known also as the Kuhn–Munkres algorithm or Munkres assignment algorithm. The time complexity of the original algorithm was {\displaystyle O(n{4})}O(n{4}), however Edmonds and Karp, and independently Tomizawa noticed that it can be modified to achieve an {\displaystyle O(n{3})}O(n{3}) running time.[4][5][how?] One of the most popular[citation needed] {\displaystyle O(n{3})}O(n{3}) variants is the Jonker–Volgenant algorithm.[6] Ford and Fulkerson extended the method to general maximum flow problems in form of the Ford–Fulkerson algorithm. In 2006, it was discovered that Carl Gustav Jacobi had solved the assignment problem in the 19th century, and the solution had been published posthumously in 1890 in Latin.[7]

Contents

  • 1 The problem
    • 1.1 Example
    • 1.2 Matrix formulation
    • 1.3 Bipartite graph formulation
  • 2 The algorithm in terms of bipartite graphs
    • 2.1 Proof that the algorithm makes progress
    • 2.2 Proof that adjusting the potential y leaves M unchanged
    • 2.3 Proof that y remains a potential
  • 3 Matrix interpretation
    • 3.1 Step 1
    • 3.2 Step 2
    • 3.3 Step 3
    • 3.4 Step 4

1 The problem

1.1 Example

In this simple example there are three workers: Paul, Dave, and Chris. One of them has to clean the bathroom, another sweep the floors and the third washes the windows, but they each demand different pay for the various tasks. The problem is to find the lowest-cost way to assign the jobs. The problem can be represented in a matrix of the costs of the workers doing the jobs. For example:

Clean bathroom Sweep floors Wash windows
Paul $2 $3 $3
Dave $3 $2 $3
Chris $3 $3 $2
The Hungarian method, when applied to the above table, would give the minimum cost: this is $6, achieved by having Paul clean the bathroom, Dave sweep the floors, and Chris wash the windows.

1.2 Matrix formulation

In the matrix formulation, we are given a nonnegative n×n matrix, where the element in the i-th row and j-th column represents the cost of assigning the j-th job to the i-th worker. We have to find an assignment of the jobs to the workers, such that each job is assigned to one worker and each worker is assigned one job, such that the total cost of assignment is minimum.

This can be expressed as permuting the rows and columns of a cost matrix C to minimize the trace of a matrix:

{\displaystyle \min _{L,R}{\rm {Tr}}(LCR)}{\displaystyle \min _{L,R}{\rm {Tr}}(LCR)}
where L and R are permutation matrices.

If the goal is to find the assignment that yields the maximum cost, the problem can be solved by negating the cost matrix C.

1.3 Bipartite graph formulation

The algorithm can equivalently be described by formulating the problem using a bipartite graph. We have a complete bipartite graph {\displaystyle G=(S,T;E)}G=(S, T; E) with n worker vertices (S) and n job vertices (T), and each edge has a nonnegative cost {\displaystyle c(i,j)}c(i,j). We want to find a perfect matching with a minimum total cost.

2 The algorithm in terms of bipartite graphs

2.1 Proof that the algorithm makes progress

2.2 Proof that adjusting the potential y leaves M unchanged

2.3 Proof that y remains a potential

3 Matrix interpretation

3.1 Step 1

3.2 Step 2

3.3 Step 3

3.4 Step 4

你可能感兴趣的:(Supimo,算法)