Anders and Briegel in Python
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

mix_graph_and_networkx.py 233B

8 年前
8 年前
12345678910
  1. from abp import NXGraphState
  2. from abp.util import xyz
  3. import networkx as nx
  4. n = 10
  5. g = NXGraphState(list(range(n)))
  6. nx.set_node_attributes(g, "color", "red")
  7. g.add_edges_from([i, i+1] for i in range(n-1))
  8. print(g.node[0]["color"])