#14: Bron Kerbosch最大Clique解


algasami (Kyuushin Kushinada)

School : 花蓮高中
ID : 210
IP address : [101.12.89.218]
Last Login :
2023-09-27 11:52:39
c017. 經典最大群問題來了 | From: [192.168.34.131] | Post Date : 2022-09-08 15:34

Bron Kerbosch

使用修改過的Bron Kerbosch演算法求出最大Clique

思維如下

declare and define biggest as an integer with the value of 0

algorithm modifiedBronKerbosch( Pivot is int, PotentialExpansion is {x|x is int} ) is

    Clique = {Pivot}

    for each int I in PotentialExpansion do

        if Clique ⊆ expand(I) then

            Clique = Clique ⋃ {I}

    biggest = max(biggest, n(Clique))

雖然效率沒有很好,但是還是個堪用的解喔!

有任何需要補充的可以留言喔:D

 
ZeroJudge Forum