| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
IndexedGraph
is a graph that is indexed by both incoming and outgoing edges.
The constructor argument edges is an iterable of (from, to)-tuples, where both from and to must be hashable.
The class keeps a set rootNodes of "root nodes" (i.e. those with no incoming edges).
To find leaf nodes, you'd have to compute allNodes-set(outgoingIndex).
You may access allNodes, rootNodes, incomingIndex, and outgoingIndex reading, but any external change to them will wreak havoc.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
| Properties | |
|
Inherited from |
| Method Details |
x.__init__(...) initializes x; see help(type(x)) for signature
|
returns a random edge. It raises an IndexError if the graph is empty. |
returns an arbitrary element of rootNodes. This will raise a KeyError if no root nodes are left. |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu May 2 07:29:09 2019 | http://epydoc.sourceforge.net |