Skip to content

Commit

Permalink
Cleaned up visualize.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nbuhagiar committed Sep 9, 2015
1 parent 44ff12c commit 6f47880
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
nx.draw(G,pos)
plt.savefig('graph.svg')
plt.show()

print('Number of Nodes: ' + str(nx.number_of_nodes(G)))
print('Number of Edges: ' + str(nx.number_of_edges(G)))
print('Most Popular Agent ID and its Degree: ' + str(sorted(G.degree_iter(),key=itemgetter(1),reverse=True)[0:1]))
print('Most Common Degree and the Number of Agents with that Degree: ' + str(max(enumerate(nx.degree_histogram(G)), key=itemgetter(1))))
print('Most Popular Agent ID and its Cumulative-Degree: ' + str(sorted(G.degree_iter(),key=itemgetter(1),reverse=True)[0:1]))
print('Most Common Cumulative-Degree and the Number of Agents with that Cumulative-Degree: ' + str(max(enumerate(nx.degree_histogram(G)), key=itemgetter(1))))
print('Graph Density: ' + str(nx.density(G)))
print('Average Shortest Path Length: ' + str(nx.average_shortest_path_length(G)))

0 comments on commit 6f47880

Please sign in to comment.