Is the networkx.MultiDiGraph.edges method order-preserving?

后端 未结 1 2031
慢半拍i
慢半拍i 2021-01-06 04:45

MyNetwork is an instance of networkx.MultiDiGraph. I\'m wondering if multiple runs of the following code is guaranteed to result exactly the same list containing all edges (

相关标签:
1条回答
  • 2021-01-06 05:02

    The list of edges returned from the MultiDiGraph.edges() method is not guaranteed to be in any order or the same when called repeatedly. You'll have to do more processing (e.g. a sort) or maintain a separate list or symbol table of edges if you need a particular ordering.

    0 讨论(0)
提交回复
热议问题