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.

11 line
226B

  1. from abp import NXGraphState
  2. from abp.util import xyz
  3. import networkx as nx
  4. n = 10
  5. g = NXGraphState(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"]