Commit e4c3c722 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Add in/out degree centrality in stats

parent 6bb10b12
......@@ -900,7 +900,7 @@ def graph_isomorph_test(model_file_1, model_file_2, output_dir='graphs/',
# Export to json file
if make_json:
with open(output_dir + "comp_results.json", 'a') as fd:
with open(output_dir + "comp_results.json", 'w') as fd:
fd.write(json.dumps(check_state, sort_keys=True, indent=4) + '\n')
return check_state
......@@ -949,6 +949,8 @@ def graph_infos(model_file, output_dir='graphs/',
'nodes': len(G.nodes()),
'edges': len(G.edges()),
'degree': nx.degree_centrality(G),
'in_degree': nx.in_degree_centrality(G),
'out_degree': nx.out_degree_centrality(G),
'betweenness': nx.betweenness_centrality(G),
'closeness': nx.closeness_centrality(G),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment