二分图完全匹配 不完全匹配 / linear_sum_assignment 详解
2022/4/17 23:18:24
本文主要是介绍二分图完全匹配 不完全匹配 / linear_sum_assignment 详解,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
https://jack.valmadre.net/notes/2020/12/08/non-perfect-linear-assignment/
\(G = (U,V,E)\)
- \(|U| = r\)
- \(|V| = n\)
- without loss of generality, assume \(r \leq n\)
- \(E(i,j) = \infty\) means no connection
- Missing edges
- \(E(i,j) = 0\) means cost is zero.
- however, given that cost can be either positive or negative, zero can be chosen.
In a matching problem, there will be \(\nu\) chosen edges.
\[0<\nu<=r \]Balanced
Balanced
means \(r = n\)
two subsets have equal cardinality
Perfect/Complete Matching
note that the problem is not actuallysolved using a general-purpose ILP(integer linear programming) solver, it is just a convenient framework in which to express the problem
Perfect/Complete matching = every vertex has a match
The constraint that the sum of each row and column is equal to one ensures that each element has exactly one match.
Unbalanced
assume \(r < n\)
an unbalanced probem cannot have a perfect matching, since there will be at least \(n-r\) unmatched elements in the larger set.
One-sided Perfect Matching
One-sided Perfect Matching
= every vertex in the smaller set has a match.
In one-sided perfect matching, \(\nu = r < n\)
What if there is no perfect matching?
Imperfect Matching(with given edge number)
- when there does not exist a (one-sided)perfect matching.
when \(\nu < r\), i.e. one-sided perfect matching cannot be achieved due to the lack of edges, all possible matchings are imperfect/incomplete.
[Note
这篇关于二分图完全匹配 不完全匹配 / linear_sum_assignment 详解的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-23Springboot应用的多环境打包入门
- 2024-11-23Springboot应用的生产发布入门教程
- 2024-11-23Python编程入门指南
- 2024-11-23Java创业入门:从零开始的编程之旅
- 2024-11-23Java创业入门:新手必读的Java编程与创业指南
- 2024-11-23Java对接阿里云智能语音服务入门详解
- 2024-11-23Java对接阿里云智能语音服务入门教程
- 2024-11-23JAVA对接阿里云智能语音服务入门教程
- 2024-11-23Java副业入门:初学者的简单教程
- 2024-11-23JAVA副业入门:初学者的实战指南