3

I'm using networkx in tests, so I'd like results to be deterministic. In particular, I found that nx.articulation_points(graph) sometimes gives articulation points in topological order, and other times in reverse topological order. Are there tricks to improve determinism?

I tried doing export PYTHONHASHSEED=0 before running the script, but it made no difference for nx.articulation_points

Yaroslav Bulatov
  • 57,332
  • 22
  • 139
  • 197
  • 1
    If you run the same command on the same network do you get different results? That is, is it really stochastic? I've looked at the source code and I don't see anything that would make it give points in topological order. It simply loops through the nodes as `for node in G` (with whatever [order](http://stackoverflow.com/questions/15479928/why-is-the-order-in-dictionaries-and-sets-arbitrary) python chooses for the dict whose keys are the nodes) – Joel Feb 20 '17 at 18:27
  • 1
    The topological/reverse topological could've been a coincidence since I was looking at chain graphs. It gives different results for the same underlying graph, but I'm not sure if the underlying representation is the same (ie, the order in which node entries were added to Python dict could've been different) – Yaroslav Bulatov Feb 20 '17 at 18:58

0 Answers0