Anders and Briegel in Python
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines

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