I'm encountering a problem when trying to write an LFR benchmark graph, created in networkx, to GraphML XML format.
For example, the following works fine, when G is a simple star graph:
import networkx as nx
G=nx.star_graph(10)
nx.write_graphml(G,'graph.graphml')
However, now suppose G is an LFR benchmark graph, entered as in the example found in the networkx documentation (https://networkx.github.io/documentation/stable/reference/algorithms/generated/networkx.algorithms.community.community_generators.LFR_benchmark_graph.html)
from networkx.algorithms.community import LFR_benchmark_graph
n =250
tau1 = 3
tau2 = 1.5
mu = 0.1
G=LFR_benchmark_graph(n,tau1,tau2,mu,average_degree=5,min_community=20,seed=10)
nx.write_graphml(G,'graph.graphml')