• 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]

    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

  • 相关阅读:
    “并发、并行、异步、同步”的区别
    C++程序设计-第六/七/八章 运算符重载/包含与继承/虚函数和多态性【期末复习|考研复习】
    gitlab安装在虚拟机下,使用gitlabrunner通过宿主机网络访问
    MySQL2
    Docker学习-目录
    六、表空间管理
    【Proteus仿真】【Arduino单片机】数码管显示
    win10 系统安装 doker 入门详细教程
    影响WebPack部署的常见因素及解决办法
    笔记(五)-传统图机器学习的特征工程-全图
  • 原文地址:https://blog.csdn.net/qq_66485519/article/details/128096558