I am using Python 3.7.1 and networkx 2.2. I used networkx to generate my directed graph and I want to calculate the communities of the graph with networkx.algorithms.community.modularity_max.greedy_modularity_communities in following steps:
import networkx as nx
from networkx.algorithms.community import greedy_modularity_communities
G=nx.DiGraph()
G.add_nodes_from([1,10])
G.add_edges_from([(1,2),(3,4),(5,6),(7,1),(2,10),(3,8),(9,8)])
c = list(greedy_modularity_communities(G))
sorted(c[0])
I recive an error:
IndexError: list index out of range