資源簡介
Newman的文章Fast algorithm for detecting community structure in networks對應的算法,有詳細的說明,并附有例子數據。
代碼片段和文件信息
function?[Z?H]?=?FastNewman(adjacent_matrix)
%?FastNewman算法實現社團發現
%?該算法參見文獻《Fast?algorithm?for?detecting?community?structure?in?networks》(2003)
%?輸入
%?adjacent_matrix?-?鄰接矩陣
%?輸出
%?Z?-?n-1*3矩陣,第i行表示第i次合并,第1列和第2列表示合并的社團標號,第3列是合并后的模塊度
%?H?-?聚類樹圖的句柄
n?=?size(adjacent_matrix1);?%?節點數目
max_id?=?n;
Z?=?[];
clusters?=?[1:n;?zeros(1n);?1:n];?%?初始劃分,第1行是節點標號,第2行是社團標號的變換,第3行是社團標號
step?=?1;
while?numel(unique(clusters(3:)))?~=?1?
%?while?step?????[Q?e?a?clusters]?=?GetModularity(adjacent_matrix?clusters);
????k?=?size(e1);?%?社團數目
????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
?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????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
- 上一篇:社區信息化管理與服務系統
- 下一篇:數據可視化
評論
共有 條評論