python中的Graph shuffling包。
shuffle-graph的Python项目详细描述
洗牌图
python中的Graph shuffling包。
安装
安装可以通过pip完成。python版本必须为3.gt
pip install shuffle-graph
使用
导入包的语句:
^{pr2}$示例:
>>> from networkx.classes.graph import Graph
>>> G = Graph({0: {1: {}}, 1: {0: {}, 2: {}}, 2: {1: {}, 3: {}}, 3: {2: {}, 4: {}}, 4: {3: {}}})
>>> seed = 170141183460469231731687303715884105727
>>> shuffle_graph(G, seed).adj #Set seed to make the results repeatable.
AdjacencyView({2: {1: {}, 3: {}}, 1: {2: {}, 0: {}}, 3: {2: {}, 4: {}}, 0: {1: {}}, 4: {3: {}}})
- 项目
标签: