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.

mix_graph_and_networkx.py 340B

5 anni fa
5 anni fa
8 anni fa
8 anni fa
5 anni fa
12345678910111213
  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"]))