import networkx as nx nx.read cd fbdata g = nx.read_edgelist('0.edges') len(g.nodes()), len(g.edges()) nx.radius(g) nx.connected sg = nx.connected_component_subgraphs(g) [len(s) for s in sg] sg = sg[0] nx.radius(sg), nx.diameter(sg) nx.eccentricity? %pdef nx.eccentricity %pdoc nx.eccentricity %psource nx.eccentricity %timeit nx.center(sg) nx.center(sg) cd ../.. run -t center.py run -p center.py run -t center2.py nx.draw_networkx(sg, node_size=15, edge_color='y', with_labels=False, alpha=.4, linewidths=0)