In [1]:
from RichCore import extract_rich_core
import networkx as nx
import matplotlib.pyplot as plt
%matplotlib inline
In [8]:
G = nx.read_weighted_edgelist('airports.txt')
G = G.to_undirected()
print G.order(), 'nodes', G.size(), 'edges'
In [11]:
sigmas, ranked_nodes, r_star = extract_rich_core(G,'weight')
In [15]:
plt.plot(sigmas)
plt.axvline(x=r_star, ymin=min(sigmas), ymax = max(sigmas), linewidth=2, color='red', linestyle='--')
plt.xlabel(ur'rank', size=13)
plt.ylabel(ur'weight to higher nodes', size=13)
plt.yscale('log')
In [ ]: