Anders and Briegel in Python
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
340B

  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"]))