Ordered Graphs—Consistently ordered graphs¶
Consistently ordered variants of the default base classes.
The Ordered (Di/Multi/MultiDi) Graphs give a consistent order for reporting of nodes and edges. The order of node reporting agrees with node adding, but for edges, the order is not necessarily the order that the edges were added.
In general, you should use the default (i.e., unordered) graph classes. However, there are times (e.g., when testing) when you may need the order preserved.
-
class
OrderedMultiGraph
(data=None, **attr)[source]¶ Consistently ordered variant of
MultiGraph
.
-
class
OrderedMultiDiGraph
(data=None, **attr)[source]¶ Consistently ordered variant of
MultiDiGraph
.