Simple python NetworkX centrality- graph calculations

Closed - This job posting has been filled.

Job Description

Take the NetworkX python modules readily available on the web:

http://networkx.github.io/download.html

Take as input pairs of nodes in format [node, node]

return results in .txt file
The output should look like a sorted list of highest to lowest ASes for betwenness centrality.

betweenness_centrality
http://networkx.lanl.gov/reference/generated/networkx.algorithms.centrality.betweenness_centrality.html#networkx.algorithms.centrality.betweenness_centrality

using

http://networkx.github.io/documentation/latest/examples/algorithms/krackhardt_centrality.html

#!/usr/bin/env python
"""
Centrality measures

from networkx import *

G=krackhardt_kite_graph()

print("Betweenness")
b=betweenness_centrality(G)
for v in G.nodes():
print("%0.2d %5.3f"%(v,b[v]))

print("Degree centrality")
d=degree_centrality(G)
for v in G.nodes():
print("%0.2d %5.3f"%(v,d[v]))

print("Closeness centrality")
c=closeness_centrality(G)
for v in G.nodes():
print("%0.2d %5.3f"%(v,c[v]))

That is the first job, just betweenness_centrality

Then if successful also:

1) Total nodes and links
2) Average degree
3) Clustering coefficient
4) Assortativity
5) Radius and diameter
6) Average path length
7) Connected components
8) Modularity

Open Attachment