我不相信存在于比寻找所有可能的独立集合中最大的蛮力方法以外的二分图中发现的最大独立顶点集的算法。最大独立集算法
我想知道关于伪代码来找到所有可能的顶点集。
说给出4个蓝色顶点和4红色二分图。目前,我会
Start with an arbitrary blue,
find all red that don't match this blue
put all these red in Independent Set
find all blue that dont match these red
put these blue in Independent Set
Repeat for next vertex in blue
Repeat all over again for all blue then all vertices in red.
据我所知,这种方式并没有给我的所有可能的独立设置的组合可言,因为第一步后,我选择所有的不匹配,而不是通过每步进的下一个颜色顶点方法可行。
例如,给定的图形与匹配
B R
1 1
1 3
2 1
2 3
3 1
3 3
4 2
4 4
Start with blue 1
Choose red 2 and 4 since they dont match
Add 2, 4 to independent Set
Choose 2 and 3 from blue since they dont with 2 or 4 from red
Add 2 and 3 from blue to independent set as well.
Independent Set = 1,2,3 from blue 2,4 from red
Repeat for blue 2, blue 3, ... red n (storing the cardinality for each set)
有没有一种方法,我可以改善这种算法为所有可能更好的搜索。我知道|双极图|最大集| = | Red | + |蓝色| - |最大匹配|。
问题出现与通过选择在第一次去的所有可能的红色为一个给定的蓝色,如果这些红色连接到所有其他可能的蓝色,然后我一套永远只拥有全部为1米的蓝色和红色休息的可能性。
图表有多大?节点数和边数?用标准的最大集团算法提供图形的补充可能是可能的。 – 2011-12-21 17:23:16