Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

原来你是中国人,直接打汉字了,为啥我执行你的GN算法 再求club俱乐部的时候 发现你的算法结果不是很好呢? #2

Open
sdd1991 opened this issue Jul 9, 2017 · 3 comments

Comments

@sdd1991
Copy link

sdd1991 commented Jul 9, 2017

这个俱乐部真实划分结果为:
社团1:0 1 2 3 4 5 6 7 10 11 12 13 16 17 19 21
社团2:8 9 14 15 18 20 22 23 24 25 26 27 28 29 30 31 32 33

使用GN算法划分的结果为:
社团1: 0 1 3 4 5 6 7 10 11 12 13 16 17 19 21
社团2: 2 8 9 14 15 18 20 22 23 24 25 26 27 28 29 30 31 32 33

也就是说 真正的GN算法仅仅分错一个节点
但是你的算法:
社团1:0, 1, 3, 7, 11, 12, 13, 17, 19, 21
社团2:2, 24, 25, 27, 28, 31
社团3:16, 10, 4, 5, 6
社团4: 32, 33, 8, 14, 15, 18, 20, 22, 23, 26, 29, 30
社团5: 9
请问这是怎么回事?

@zzz24512653
Copy link
Owner

zzz24512653 commented Jul 11, 2017

是这样:我提供的代码里面的输出是打印的modularity最大的社区分割,而作者所说的最好的划分是第一次分开两个社区的那个划分。加上打印输出你就能看到完整的分割过程了,第一次分割开的结果和作者所说的是一致的。
while len(self._G.edges()) != 0:
edge = max(nx.edge_betweenness(self._G).items(),key=lambda item:item[1])[0]
self._G.remove_edge(edge[0], edge[1])
components = [list(c) for c in list(nx.connected_components(self._G))]
**print '------------'
for c in components:
print c
print '------------'

part result:

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33]


[0, 1, 3, 4, 5, 6, 7, 10, 11, 12, 13, 16, 17, 19, 21]
[32, 33, 2, 8, 9, 14, 15, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]

@wjy3326
Copy link

wjy3326 commented Jul 23, 2020

问下很多数据集都没有真实划分结果,请问怎么评价算法的好坏呢?

@zzz24512653
Copy link
Owner

zzz24512653 commented Aug 3, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants