Save adjacency matrix
Closed this issue · 2 comments
timflutre commented
Hello,
thanks a lot for providing an implementation of your algorithm under the GPL! As a small enhancement, I'd suggest to add the two following lines at the end of the file "random_modular_generator_variable_modules.py":
adjacency_matrix = nx.to_numpy_matrix(G)
np.savetxt("graph.txt", adjacency_matrix, delimiter="\t")
This would allow users unfamiliar with networkx to easily use their favorite software, say R with igraph, to play with the network they simulated.
Best,
Tim
ps: you could even also add these two lines to plot the graph
nx.draw(G)
plt.savefig("graph.png")
shwetabansal commented
Dear Tim,
Many thanks for your interest in our project, and the helpful comments! We'll add them into the documentation and code.
Best,
Shweta Bansal
prathasah commented
Hello Tim,
I have updated the code and the readme file. Do let us know if you have any other comments or suggestions!
Thanks,
Pratha