0

I am trying to generate the Waxman random graph using the built-in function which works fine and generates the Waxman graph.

Later in my code, I am writing the above-generated graph using graphml as: nx.write_graphml(my_graph_waxman, "waxman_Iteration.graphml")

This writing function gives the error:

  1. networkx.exception.NetworkXError: GraphML writer does not support <class 'tuple'> as data values.

My complete code is here:

import networkx as nx
import matplotlib.pyplot as plt
import numpy as np

my_graph_waxman=nx.waxman_graph(6, beta=0.8, alpha=0.6, L=None, domain=(0, 0, 1, 1), metric=None, seed=None)
nx.draw(my_graph_waxman, with_labels=True, font_weight='normal')

plt.axis('on')
plt.show()
nx.write_graphml(my_graph_waxman, "waxman_Iteration.graphml")

0 Answers0