NetworkX storage of graph info

柔情痞子 提交于 2021-01-07 13:04:07

问题


I'm recently working on constructing social network graphs using networkX. I'm able to visualize and manipulate the graph at small scale. Howerver Im interested in knowing where networkX stores this graph info. This is because, I'm having a large collection of users for whom I need to construct graph and use the graph info for some suggestions. So I would like to know if I could store and access the graph.


回答1:


NetworkX stores graph data in Python objects instantiated from one of several NetworkX classes. You choose the NetworkX class to use based on the type of graph you want to create. NetworkX graph classes include Graph, DiGraph, MultiGraph, and MultiDiGraph. See the NetworkX Documentation on Graph Types for more information on these classes.

For persistent storage of NetworkX graph objects, you have many options. You could pickle the Python object, or export to and import from a number of different formats, including GML, GraphML, and JSON. For more information see the NetworkX Documentation on Reading and Writing Graphs.



来源:https://stackoverflow.com/questions/32542058/networkx-storage-of-graph-info

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!