A directed graph object.
|
|
|
|
|
add(self,
node,
parent,
priority=0)
Adds the specified node with the specified parent. |
source code
|
|
|
|
remove(self,
node)
Removes the specified node from the digraph, also removing and ties
to other nodes in the digraph. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
contains(self,
node)
Checks if the digraph contains mynode |
source code
|
|
|
|
|
|
|
all_nodes(self)
Return a list of all nodes in the graph |
source code
|
|
|
|
child_nodes(self,
node,
ignore_priority=None)
Return all children of the specified node |
source code
|
|
|
|
parent_nodes(self,
node,
ignore_priority=None)
Return all parents of the specified node |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
is_empty(self)
Checks if the digraph is empty |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| shortest_path(self,
start,
end,
ignore_priority=None) |
source code
|
|
|
|
get_cycles(self,
ignore_priority=None,
max_length=None)
Returns all cycles that have at most length 'max_length'. |
source code
|
|
|
|
addnode(self,
node,
parent,
priority=0)
Adds the specified node with the specified parent. |
source code
|
|
|
|
allnodes(self)
Return a list of all nodes in the graph |
source code
|
|
|
|
|
|
|
hasnode(self,
node)
Checks if the digraph contains mynode |
source code
|
|
|
|
__contains__(self,
node)
Checks if the digraph contains mynode |
source code
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__sizeof__,
__str__,
__subclasshook__
|