You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jesse Bacon edited this page Mar 19, 2015
·
1 revision
#CrispyBacon
import networkx as nx
g = nx.read_edgelist(‘0.edges’)
#No longer works in networkX 1.9 worked in 1.7
#sg = nx.connected_component_subgraphs(g)[ 0 ]
sg=nx.connected_component_subgraphs(g)
b=next(sg) #works
nx.radius(b),nx.diameter(b)
center = [node for node in b.nodes() if nx.eccentricity(b, node) == nx.radius(b)]
print(center)