简体   繁体   English

给定最大匹配,找到二部图的最小顶点覆盖

[英]Find minimum vertex Cover for bipartite graph given the maximum matching

I seem to have found an algorithm but am having trouble understanding it, I was wondering if any of you knew the generic outline of the algorithm. 我似乎找到了一种算法,但是在理解它时遇到了麻烦,我想知道你们中的任何人是否知道该算法的一般概述。

Here is the link to the algorithm I found on page 2 这是我在第2页上找到的算法的链接

http://www.cse.iitb.ac.in/~sundar/cs435/lecture23.pdf http://www.cse.iitb.ac.in/~sundar/cs435/lecture23.pdf

Algorithm is simple as that: 算法很简单,因为:

  1. Find unmatched vertex, mark it as not included in minimum vertex cover. 查找不匹配的顶点,将其标记为不包含在最小顶点覆盖范围内。
  2. Mark all matched neighbours of this vertex as included in minimum vertex cover. 标记此顶点的所有匹配邻居为最小顶点覆盖范围内的标记。
  3. Treat all mates of vertexes from previous step as unmatched vertexes and repeat step 1. 将上一步的所有顶点配对视为不匹配的顶点,然后重复步骤1。
  4. If recursion ended, repeat from step 1 (that is case of several connected components of graph). 如果递归结束,请从第1步开始重复(这是图形的多个连接组件的情况)。
  5. If there is no unmatched vertexes, take all remaining pairs and mark them any way you like (remember that one vertex in pair has to be included in minimum vertex cover, and other one has to be not included). 如果没有不匹配的顶点,则取所有剩余的对并以您喜欢的方式标记它们(请记住,成对的一个顶点必须包含在最小顶点覆盖范围内,而另一个则不包括在内)。

PS I know this is necroposting. 附言:我知道这是坏事。

first you should know bipartite graph, two sets of vertexes, and edges, ok, you know that now. 首先,您应该知道二部图,两组顶点和边,好吧,现在您知道了。

then you need to choose some vertexes from the two sets, to cover all the edges. 那么您需要从两组中选择一些顶点,以覆盖所有边缘。 As long as one vertex is chosen, all the edges link to it is covered. 只要选择一个顶点,所有链接到它的边都将被覆盖。 Now your task is to choose the minimum number of vertexes, to cover all the edges. 现在您的任务是选择最少数量的顶点,以覆盖所有边缘。

the principle means, the minimum number you need equals to the number of max matching pairs. 原理是,您需要的最小数量等于最大匹配对的数量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM