我不相信存在於比尋找所有可能的獨立集合中最大的蠻力方法以外的二分圖中發現的最大獨立頂點集的算法。最大獨立集算法
我想知道關於僞代碼來找到所有可能的頂點集。
說給出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