-
大小: 145KB文件類型: .rar金幣: 1下載: 0 次發(fā)布日期: 2021-01-03
- 語言: 其他
- 標(biāo)簽: 社區(qū)發(fā)現(xiàn)??FN??matlab??
資源簡介
Newman的文章Fast algorithm for detecting community structure in networks對應(yīng)的算法,有詳細(xì)的說明,并附有例子數(shù)據(jù)。
代碼片段和文件信息
function?[Z?H]?=?FastNewman(adjacent_matrix)
%?FastNewman算法實(shí)現(xiàn)社團(tuán)發(fā)現(xiàn)
%?該算法參見文獻(xiàn)《Fast?algorithm?for?detecting?community?structure?in?networks》(2003)
%?輸入
%?adjacent_matrix?-?鄰接矩陣
%?輸出
%?Z?-?n-1*3矩陣,第i行表示第i次合并,第1列和第2列表示合并的社團(tuán)標(biāo)號(hào),第3列是合并后的模塊度
%?H?-?聚類樹圖的句柄
n?=?size(adjacent_matrix1);?%?節(jié)點(diǎn)數(shù)目
max_id?=?n;
Z?=?[];
clusters?=?[1:n;?zeros(1n);?1:n];?%?初始劃分,第1行是節(jié)點(diǎn)標(biāo)號(hào),第2行是社團(tuán)標(biāo)號(hào)的變換,第3行是社團(tuán)標(biāo)號(hào)
step?=?1;
while?numel(unique(clusters(3:)))?~=?1?
%?while?step?????[Q?e?a?clusters]?=?GetModularity(adjacent_matrix?clusters);
????k?=?size(e1);?%?社團(tuán)數(shù)目
????DeltaQs?=?[];
????for?i?=?1:size(e1)
????????for?j?=?1:size(e1)
????????????if?i?~=?j
????????????????DeltaQ?=?2*(e(ij)-a(i)*a(j));
????????????????DeltaQs?=?[DeltaQs?[i;j;DeltaQ]];
????????????end????????????
????????end
????end
?
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????181339??2012-05-14?21:44??Fast?Newman算法\(2003)Fast_algorithm_for_detecting_community_structure_in_networks(FN算法).pdf
?????文件???????2380??2012-05-14?21:39??Fast?Newman算法\dataset\karate.dat
?????文件???????1422??2012-05-15?09:55??Fast?Newman算法\FastNewman.m
?????文件???????1352??2012-05-14?21:39??Fast?Newman算法\GetModularity.m
?????文件????????126??2012-05-15?09:56??Fast?Newman算法\main.m
?????目錄??????????0??2012-05-15?09:57??Fast?Newman算法\dataset
?????目錄??????????0??2012-05-15?09:58??Fast?Newman算法
-----------?---------??----------?-----??----
???????????????186619????????????????????7
評(píng)論
共有 條評(píng)論