• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版0a0a791ee78b826ffa4675748e0ced1a0a88d7ea (tree)
时间2009-06-19 00:07:53
作者isella
Commiterisella

Log Message

I added the calculation of the mean betweenness and explained the relation
with the igraph calculation. Careful again: it looks like there is a factor 2

in between the (unnormalized) betweenness calculated by igraph and the one

calculated with networkx.

更改概述

差异

diff -r f47dae75cccc -r 0a0a791ee78b Python-codes/networkx-analysis.py
--- a/Python-codes/networkx-analysis.py Thu Jun 18 14:12:43 2009 +0000
+++ b/Python-codes/networkx-analysis.py Thu Jun 18 15:07:53 2009 +0000
@@ -48,10 +48,17 @@
4848
4949 print "the mean shortest path is, ", short
5050
51-betx=nx.betweenness_centrality(G)
51+bet_val=nx.betweenness_centrality(G, normalized=False)
5252
53+#NB: the betweenness is stored as a Python dictionary, now I need to use its .values() method
54+#to fetch the numerical values of the betweenness of each node
5355
56+bet_arr=s.asarray(bet_val.values()) #I changed the numerical values of the betweenness for each vertex
57+#into a numpy array
5458
59+print "the mean value of the betweenness is, ", bet_arr.mean()/2. #careful about the definitions here!!!
60+#there is a factor 2 between the (unnormalized) betweenness in networkx and in igraph
5561
62+#print "bet_arr is, ", bet_arr
5663
5764 print "So far so good"