Revision 27b1b922 simulator.py

View differences:

simulator.py
63 63
                '''bw_centrality = nx.betweenness_centrality(G, normalized=False,  weight='weight', endpoints=True)'''
64 64
                #code.interact(local=dict(globals(), **locals()))
65 65
                import graph_tool.centrality as gtc
66
                gtG = nx2gt.nx2gt(G)
67
                ws=gtG.edge_properties["weight"]
68
                vp, ep = gtc.betweenness(gtG, norm=False, weight=ws)
66
                #print "Convertig nxG to graph_tool Graph..."
67
                #gtG = nx2gt.nx2gt(G)
68
                ws=G.edge_properties["weight"]
69
                #print "Computing BC with graph_tool..."
70
                vp, ep = gtc.betweenness(G, norm=False, weight=ws)
71
                #print "Writing BC to disk..."
69 72
                btw = {i: vp.a[i] for i in range(len(vp.a))}
70 73
                df = pd.DataFrame(btw.items(), columns=['Node', 'BC'])
71 74
                df.to_csv(self.OP+"/BC"+tag+".csv", sep=',',

Also available in: Unified diff