'How to graph from tuple
How would I graph the tuples returned by the girvan_newman function?
import networkx as nx
import matplotlib.pyplot as plt
import networkx.algorithms.community.centrality as nxb
import itertools
G = nx.read_graphml('data.graphml')
comp = nxb.girvan_newman(G)
k = 4
for communities in itertools.islice(comp, k):
print(tuple(sorted(c) for c in next(comp)))
#nx.draw(comp)
plt.show()
I am trying to to call: nx.draw(comp) to visualize the detected communities
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
