胸外扩是什么样子| 炀是什么意思| 尿素偏高是什么意思| 面部提升紧致做什么效果最好| 女朋友生日送什么礼物好| 镜子碎了有什么征兆吗| 风凉话是什么意思| 胎动突然频繁是什么原因| 甲状腺结节挂什么科| 木辛读什么| 节节草能治什么病| VA什么意思| 杭州五行属什么| 透明人什么意思| 叶绿素是什么| 全身酸痛什么原因| 出家当尼姑需要什么条件| 什么东西补肾最好| 毛遂自荐是什么意思| 胆囊息肉是什么原因造成的| 贫血吃什么比较好| 肚子有虫吃什么药| 女生下边长痘痘是什么病| 女性腰酸是什么妇科病| 调月经吃什么药好| 约会什么意思| 2017年属什么生肖| 什么争鸣成语| 红润润的什么| 什么叫痉挛| 独在异乡为异客的异是什么意思| 喝茶对身体有什么好处| 头孢有什么用| 喝红茶有什么效果| 越位是什么意思| vc是什么| 红色玫瑰花代表什么意思| 宋江是一个什么样的人| 血脂稠是什么原因造成的| 病理报告是什么意思| castle是什么意思| 睡觉趴着睡什么原因| 外感风热是什么意思| 火同念什么| 急性青光眼是什么症状| 饵丝是什么| po是什么| 玉兰油属于什么档次| 脑梗前有什么预兆| 送什么礼物好| 实诚是什么意思| 退化是什么意思| 溃疡吃什么水果| 什么是有氧运动| 生理反应是什么意思| 消防大队长是什么级别| 跳大神是什么意思| 转氨酶高吃什么| 正畸是什么意思| 什么的跳舞| 头痛是什么病的前兆| 尖锐湿疣吃什么药| 症瘕积聚是什么意思| 细菌性感染吃什么药| 近视手术有什么后遗症| 干咳嗽无痰是什么原因| 眼睛突然红了是什么原因| 什么生肖晚上不睡觉| 梦见自己疯了什么意思| 什么时候喝牛奶最好| 狗吃什么食物| 地什么人什么| 牛油果核有什么用| 鲱鱼罐头那么臭为什么还有人吃| 发烧了吃什么食物好| 属鼠是什么命| 湿疹有什么症状和图| 尿粘液丝高是什么原因| 鹅蛋什么人不能吃| 身体乳是什么| 属鸡的跟什么属相最配| 婴儿喝什么奶粉最好| 吃什么水果对胃好| 鸡的五行属什么| 脚面疼是什么原因引起的| 教师节唱什么歌| 六味地黄丸什么牌子的好| 飞秒是什么| 经常感冒发烧是什么原因| 高血压会引起什么病症| 四月七号是什么星座| 层峦叠翠的意思是什么| 爷们儿大结局是什么| 滔滔不绝的绝是什么意思| 发情是什么意思| 牛肚是牛的什么部位| 泉中水命是什么意思| 去湿气吃什么| palladium是什么牌子| 离殇是什么意思| 随访复查什么意思| 国安局是干什么的| 医保和农村合作医疗有什么区别| 鸟加衣念什么| 女人喜欢什么姿势| 胸膜炎吃什么药| 艾滋病阳性是什么意思| 什么的挑选| 屁股一侧疼是什么原因| 水能变成什么| 马镫什么时候发明的| 自嘲是什么意思| 坐立不安是什么意思| 辣子鸡属于什么菜系| 前列腺吃什么食物调理| 三叉神经痛挂什么科就诊| 曲解什么意思| 为什么白带是黄绿色的| 脸发红是什么原因| 大包子什么馅好吃| 高回声结节是什么意思| 白羊跟什么星座最配| 天使轮是什么意思| 嘴唇薄的男人面相代表什么意味| 白羊座前面是什么星座| 年岁是什么意思| 世界上最长的蛇是什么| 吃六味地黄丸有什么好处| 不丹为什么不跟中国建交| 什么事情只能用一只手去做| 屏保什么意思| 跳梁小丑是什么生肖| bzd是什么意思| 来月经喝什么汤好| 半夜胎动频繁是什么原因| 高职本科是什么意思| 吃什么护肝| 食客是什么意思| 壑是什么字| 禁欲系是什么意思| 靥什么意思| gl值是什么意思| 血压不稳定是什么原因| 孕妇腹泻可以吃什么药| 龙和什么属相最配| 血粘稠吃什么药最好| 支教回来后有什么待遇| 颈椎病看什么科最好| 什么叫更年期| 人活一辈子到底为了什么| 劫富济贫是什么意思| cop是什么| 划船是什么意思| 破鞋是什么意思啊| 极化是什么意思| 什么花香| 非洲人吃什么主食| 大什么什么针| 汲水什么意思| 皮肤溃烂是什么病| 为什么每天晚上睡觉都做梦| 为什么会有| 阿托伐他汀钙片什么时候吃最好| 山东人为什么那么高| 宝宝拉肚子吃什么药好得快| 阴道炎应该吃什么药| 1964年属什么生肖| ryan是什么意思| 果皮属于什么垃圾| 肠胃不好吃什么菜比较好| 吃维生素b1有什么好处和副作用| 举人相当于什么官| 天顶星座是什么意思| 福建人喜欢吃什么口味| 6.16什么星座| 政治面貌填什么| 是谁在敲打我窗是什么歌| 什么时候喝咖啡能减肥| 眼睛蒙蒙的是什么原因| 甲状腺1度肿大是什么意思| 1983属什么生肖| 博字属于五行属什么| 婚姻宫是什么意思| 梦见黑蛇是什么意思| 口腔溃疡是什么原因引起的| skp什么意思| 为什么南极比北极冷| 剂量是什么意思| 小孩子包皮挂什么科| 命门是什么意思| 死灰复燃是什么意思| 耳朵痒是什么原因引起的| 能吃是福是什么意思| 近水楼台先得月是什么生肖| 穷途末路什么意思| 肠系膜淋巴结是什么病| 什么是星座| 为什么总是睡不着| 白羊座是什么星座| 为什么怀不上孩子| 四级什么时候报名| 红豆杉是什么植物| 什么水果可以解酒| 便秘吃什么最快排便| 大便出血什么原因| 地三鲜是什么| 眼前有亮光闪是什么问题| 碳酸钙俗称什么| 苏州有什么好玩的| 血肌酐高是什么原因| 处女座前面是什么星座| 唐玄宗叫什么| 气血不足吃什么食物好| 维生素b族什么时候吃效果最好| 猫癣用什么药| 天天睡不着觉什么原因| 一学年是什么意思| 金字旁加巨念什么| 破窗效应是什么意思| 花骨朵是什么意思| 肾结石都有什么症状| 无家可归是什么生肖| 不二人选是什么意思| pure什么意思| 鼻子挤出来的白色东西是什么| 鼎是干什么用的| 淋巴细胞升高说明什么| 阴囊长白毛是什么原因| hib疫苗是什么意思| 脚心发痒是什么原因| 脂肪肝吃什么中成药| 为什么来完月经下面痒| 南北杏和什么煲汤止咳化痰| 麾下是什么意思| 比目鱼是什么鱼| 什么水果是温性的| 普瑞巴林胶囊治什么病| 关东八大碗都有什么| 梦见杀人是什么预兆| 心字底的字与什么有关| 什么是三好学生| 宫颈癌前期有什么症状| 伤口不容易愈合是什么原因| 静脉曲张有什么症状| 酶是什么| 下午2点半是什么时辰| 三进宫是什么意思| 发烧后头疼是什么原因| 感染hpv有什么症状| 一什么无什么| 黑话是什么意思| 饱和什么意思| 一如既往的意思是什么| 脚心疼是什么原因| 阴道炎是什么原因引起的| 呼吸性碱中毒吃什么药| 巴基斯坦讲什么语言| 飞廉是什么意思| 爸爸生日礼物送什么| 日值四离是什么意思| 什么牌子的助听器最好| 什么不动| 什么是横纹肌溶解症| 痛经喝什么能缓解| 百度Jump to content

台湾男子返台定居:深圳物价太高 扛不住了

From Wikipedia, the free encyclopedia
Worked example of assigning tasks to an unequal number of workers using the Hungarian method
百度 春季的南京各处早已一片花海,各景区的花卉也各不相同,别有一番姿色。

The assignment problem is a fundamental combinatorial optimization problem. In its most general form, the problem is as follows:

The problem instance has a number of agents and a number of tasks. Any agent can be assigned to perform any task, incurring some cost that may vary depending on the agent-task assignment. It is required to perform as many tasks as possible by assigning at most one agent to each task and at most one task to each agent, in such a way that the total cost of the assignment is minimized.

Alternatively, describing the problem using graph theory:

The assignment problem consists of finding, in a weighted bipartite graph, a matching of maximum size, in which the sum of weights of the edges is minimum.

If the numbers of agents and tasks are equal, then the problem is called balanced assignment, and the graph-theoretic version is called minimum-cost perfect matching. Otherwise, it is called unbalanced assignment.[1]

If the total cost of the assignment for all tasks is equal to the sum of the costs for each agent (or the sum of the costs for each task, which is the same thing in this case), then the problem is called linear assignment. Commonly, when speaking of the assignment problem without any additional qualification, then the linear balanced assignment problem is meant.

Examples

[edit]

Suppose that a taxi firm has three taxis (the agents) available, and three customers (the tasks) wishing to be picked up as soon as possible. The firm prides itself on speedy pickups, so for each taxi the "cost" of picking up a particular customer will depend on the time taken for the taxi to reach the pickup point. This is a balanced assignment problem. Its solution is whichever combination of taxis and customers results in the least total cost.

Now, suppose that there are four taxis available, but still only three customers. This is an unbalanced assignment problem. One way to solve it is to invent a fourth dummy task, perhaps called "sitting still doing nothing", with a cost of 0 for the taxi assigned to it. This reduces the problem to a balanced assignment problem, which can then be solved in the usual way and still give the best solution to the problem.

Similar adjustments can be done in order to allow more tasks than agents, tasks to which multiple agents must be assigned (for instance, a group of more customers than will fit in one taxi), or maximizing profit rather than minimizing cost.

Formal definition

[edit]

The formal definition of the assignment problem (or linear assignment problem) is

Given two sets, A and T, together with a weight function C : A × TR. Find a bijection f : AT such that the cost function:
is minimized.

Usually the weight function is viewed as a square real-valued matrix C, so that the cost function is written down as:

The problem is "linear" because the cost function to be optimized as well as all the constraints contain only linear terms.

Algorithms

[edit]

A naive solution for the assignment problem is to check all the assignments and calculate the cost of each one. This may be very inefficient since, with n agents and n tasks, there are n! (factorial of n) different assignments.

Another naive solution is to greedily assign the pair with the smallest cost first, and remove the vertices; then, among the remaining vertices, assign the pair with the smallest cost; and so on. This algorithm may yield a non-optimal solution. For example, suppose there are two tasks and two agents with costs as follows:

  • Alice: Task 1 = 1, Task 2 = 2.
  • George: Task 1 = 5, Task 2 = 8.

The greedy algorithm would assign Task 1 to Alice and Task 2 to George, for a total cost of 9; but the reverse assignment has a total cost of 7.

Fortunately, there are many algorithms for finding the optimal assignment in time polynomial in n. The assignment problem is a special case of the transportation problem, which is a special case of the minimum cost flow problem, which in turn is a special case of a linear program. While it is possible to solve any of these problems using the simplex algorithm, or in worst-case polynomial time using the ellipsoid method, each specialization has a smaller solution space and thus more efficient algorithms designed to take advantage of its special structure.

Balanced assignment

[edit]

In the balanced assignment problem, both parts of the bipartite graph have the same number of vertices, denoted by n.

One of the first polynomial-time algorithms for balanced assignment was the Hungarian algorithm. It is a global algorithm – it is based on improving a matching along augmenting paths (alternating paths between unmatched vertices). Its run-time complexity, when using Fibonacci heaps, is ,[2] where m is a number of edges. This is currently the fastest run-time of a strongly polynomial algorithm for this problem. Some variants of the Hungarian algorithm also benefit from parallel computing, including GPU acceleration.[3] If all weights are integers, then the run-time can be improved to , but the resulting algorithm is only weakly-polynomial.[4] If the weights are integers, and all weights are at most C (where C>1 is some integer), then the problem can be solved in weakly-polynomial time in a method called weight scaling.[5][6][7]

In addition to the global methods, there are local methods which are based on finding local updates (rather than full augmenting paths). These methods have worse asymptotic runtime guarantees, but they often work better in practice. These algorithms are called auction algorithms, push-relabel algorithms, or preflow-push algorithms. Some of these algorithms were shown to be equivalent.[8]

Some of the local methods assume that the graph admits a perfect matching; if this is not the case, then some of these methods might run forever.[1]:?3? A simple technical way to solve this problem is to extend the input graph to a complete bipartite graph, by adding artificial edges with very large weights. These weights should exceed the weights of all existing matchings, to prevent appearance of artificial edges in the possible solution.

As shown by Mulmuley, Vazirani and Vazirani,[9] the problem of minimum weight perfect matching is converted to finding minors in the adjacency matrix of a graph. Using the isolation lemma, a minimum weight perfect matching in a graph can be found with probability at least 1?2. For a graph with n vertices, it requires time.

Unbalanced assignment

[edit]

In the unbalanced assignment problem, the larger part of the bipartite graph has n vertices and the smaller part has r<n vertices. There is also a constant s which is at most the cardinality of a maximum matching in the graph. The goal is to find a minimum-cost matching of size exactly s. The most common case is the case in which the graph admits a one-sided-perfect matching (i.e., a matching of size r), and s=r.

Unbalanced assignment can be reduced to a balanced assignment. The naive reduction is to add new vertices to the smaller part and connect them to the larger part using edges of cost 0. However, this requires new edges. A more efficient reduction is called the doubling technique. Here, a new graph G' is built from two copies of the original graph G: a forward copy Gf and a backward copy Gb. The backward copy is "flipped", so that, in each side of G', there are now n+r vertices. Between the copies, we need to add two kinds of linking edges:[1]:?4–6?

  • Large-to-large: from each vertex in the larger part of Gf, add a zero-cost edge to the corresponding vertex in Gb.
  • Small-to-small: if the original graph does not have a one-sided-perfect matching, then from each vertex in the smaller part of Gf, add a very-high-cost edge to the corresponding vertex in Gb.

All in all, at most new edges are required. The resulting graph always has a perfect matching of size . A minimum-cost perfect matching in this graph must consist of minimum-cost maximum-cardinality matchings in Gf and Gb. The main problem with this doubling technique is that there is no speed gain when .

Instead of using reduction, the unbalanced assignment problem can be solved by directly generalizing existing algorithms for balanced assignment. The Hungarian algorithm can be generalized to solve the problem in strongly-polynomial time. In particular, if s=r then the runtime is . If the weights are integers, then Thorup's method can be used to get a runtime of .[1]:?6?

Solution by linear programming

[edit]

The assignment problem can be solved by presenting it as a linear program. For convenience we will present the maximization problem. Each edge (i,j), where i is in A and j is in T, has a weight . For each edge ?? we have a variable . The variable is 1 if the edge is contained in the matching and 0 otherwise, so we set the domain constraints:

The total weight of the matching is: . The goal is to find a maximum-weight perfect matching.

To guarantee that the variables indeed represent a perfect matching, we add constraints saying that each vertex is adjacent to exactly one edge in the matching, i.e., .

All in all we have the following LP:

This is an integer linear program. However, we can solve it without the integrality constraints (i.e., drop the last constraint), using standard methods for solving continuous linear programs. While this formulation allows also fractional variable values, in this special case, the LP always has an optimal solution where the variables take integer values. This is because the constraint matrix of the fractional LP is totally unimodular – it satisfies the four conditions of Hoffman and Gale.

Other methods and approximation algorithms

[edit]

Other approaches for the assignment problem exist and are reviewed by Duan and Pettie[10] (see Table II). Their work proposes an approximation algorithm for the assignment problem (and the more general maximum weight matching problem), which runs in linear time for any fixed error bound.

Many-to-many assignment

[edit]

In the basic assignment problem, each agent is assigned to at most one task and each task is assigned to at most one agent. In the many-to-many assignment problem,[11] each agent i may take up to ci tasks (ci is called the agent's capacity), and each task j may be taken by up to dj agents simultaneously (dj is called the task's capacity). If the sums of capacities in both sides are equal (), then the problem is balanced, and the goal is to find a perfect matching (assign exactly ci tasks to each agent i and exactly dj agents to each task j) such that the total cost is as small as possible.

The problem can be solved by reduction to the minimum cost network flow problem.[12] Construct a flow network with the following layers:

  • Layer 1: One source-node s.
  • Layer 2: a node for each agent. There is an arc from s to each agent i, with cost 0 and capacity ci .
  • Level 3: a node for each task. There is an arc from each agent i to each task j, with the corresponding cost, and capacity 1.
  • Level 4: One sink-node t. There is an arc from each task to t, with cost 0 and capacity dj.

An integral maximum flow of minimum cost can be found in polynomial time; see network flow problem. Every integral maximum flow in this network corresponds to a matching in which at most ci tasks are assigned to each agent i and at most dj agents are assigned to each task j (in the balanced case, exactly ci tasks are assigned to i and exactly dj agents are assigned to j). A min-cost maximum flow corresponds to a min-cost assignment.

Generalization

[edit]

When phrased as a graph theory problem, the assignment problem can be extended from bipartite graphs to arbitrary graphs. The corresponding problem, of finding a matching in a weighted graph where the sum of weights is maximized, is called the maximum weight matching problem.

Another generalization of the assignment problem is extending the number of sets to be matched from two to many. So that rather than matching agents to tasks, the problem is extended to matching agents to tasks to time intervals to locations. This results in Multidimensional assignment problem (MAP).

See also

[edit]

References and further reading

[edit]
  1. ^ a b c d Lyle Ramshaw, Robert E. Tarjan (2012). "On minimum-cost assignments in unbalanced bipartite graphs" (PDF). HP research labs.
  2. ^ Fredman, Michael L.; Tarjan, Robert Endre (2025-08-04). "Fibonacci Heaps and Their Uses in Improved Network Optimization Algorithms". J. ACM. 34 (3): 596–615. doi:10.1145/28869.28874. ISSN 0004-5411. S2CID 7904683.
  3. ^ Kawtikwar, Samiran; Nagi, Rakesh (2025-08-04). "HyLAC: Hybrid linear assignment solver in CUDA". Journal of Parallel and Distributed Computing. 187: 104838. doi:10.1016/j.jpdc.2024.104838. ISSN 0743-7315.
  4. ^ Thorup, Mikkel (2025-08-04). "Integer priority queues with decrease key in constant time and the single source shortest paths problem". Journal of Computer and System Sciences. Special Issue on STOC 2003. 69 (3): 330–353. doi:10.1016/j.jcss.2004.04.003. ISSN 0022-0000.
  5. ^ Gabow, H.; Tarjan, R. (2025-08-04). "Faster Scaling Algorithms for Network Problems". SIAM Journal on Computing. 18 (5): 1013–1036. doi:10.1137/0218069. ISSN 0097-5397.
  6. ^ Goldberg, A.; Kennedy, R. (2025-08-04). "Global Price Updates Help". SIAM Journal on Discrete Mathematics. 10 (4): 551–572. doi:10.1137/S0895480194281185. ISSN 0895-4801.
  7. ^ Orlin, James B.; Ahuja, Ravindra K. (2025-08-04). "New scaling algorithms for the assignment and minimum mean cycle problems". Mathematical Programming. 54 (1–3): 41–56. doi:10.1007/BF01586040. ISSN 0025-5610. S2CID 18213947.
  8. ^ Alfaro, Carlos A.; Perez, Sergio L.; Valencia, Carlos E.; Vargas, Marcos C. (2025-08-04). "The assignment problem revisited". Optimization Letters. 16 (5): 1531–1548. doi:10.1007/s11590-021-01791-4. ISSN 1862-4480. S2CID 238644205.
  9. ^ Mulmuley, Ketan; Vazirani, Umesh; Vazirani, Vijay (1987). "Matching is as easy as matrix inversion". Combinatorica. 7 (1): 105–113. doi:10.1007/BF02579206. S2CID 47370049.
  10. ^ Duan, Ran; Pettie, Seth (2025-08-04). "Linear-Time Approximation for Maximum Weight Matching". Journal of the ACM. 61: 1–23. doi:10.1145/2529989. S2CID 207208641.
  11. ^ Zhu, Haibin; Liu, Dongning; Zhang, Siqin; Zhu, Yu; Teng, Luyao; Teng, Shaohua (2025-08-04). "Solving the Many to Many assignment problem by improving the Kuhn–Munkres algorithm with backtracking". Theoretical Computer Science. 618: 30–41. doi:10.1016/j.tcs.2016.01.002. ISSN 0304-3975.
  12. ^ D.W. "High-multiplicity maximum-weight matching". Computer Science Stack Exchange. Retrieved 2025-08-04.
crs是什么意思 蒲公英有什么作用 小孩反复高烧是什么原因 七月七是什么节 暗渡陈仓是什么生肖
托塔李天王的塔叫什么 babyface是什么意思 白化病是什么能活多久 利妥昔单抗是治什么病 断头婚是什么意思
周边什么意思 大自然的馈赠什么意思 2010年是什么命 甲木代表什么 夏天吹空调感冒吃什么药
浮肿是什么原因引起的 六月份什么星座 胎监是检查什么的 法身是什么意思 苯磺酸氨氯地平片什么时候吃
软骨病是什么病hcv7jop7ns1r.cn 是什么样的感觉我不懂是什么歌hcv9jop6ns5r.cn 微博是什么意思hcv8jop4ns3r.cn 正月十六是什么星座hcv8jop6ns8r.cn 梦见父亲死了是什么意思ff14chat.com
膝盖疼是什么原因hcv8jop8ns4r.cn 口杯是什么意思hcv9jop1ns9r.cn 400能上什么大学hcv8jop6ns8r.cn 吃李子不能吃什么hcv9jop2ns7r.cn 相得益彰意思是什么hcv8jop2ns2r.cn
女性分泌物带血是什么原因hcv9jop5ns5r.cn 食管反流吃什么药最好bjhyzcsm.com complex是什么意思hcv9jop4ns8r.cn 毕生是什么意思qingzhougame.com 测血糖挂什么科jinxinzhichuang.com
好高什么远wuhaiwuya.com 女生食指戴戒指什么意思hcv7jop9ns9r.cn 舌头中间疼是什么原因hcv9jop5ns9r.cn 轻度贫血有什么症状hcv7jop4ns6r.cn 云母是什么hcv9jop6ns2r.cn
百度