Bio.Pathway.Rep.MultiGraph module
get/set abstraction for multi-graph representation.
- class Bio.Pathway.Rep.MultiGraph.MultiGraph(nodes=())
Bases:
object
A directed multigraph abstraction with labeled edges.
- __init__(nodes=())
Initialize a new MultiGraph object.
- __eq__(g)
Return true if g is equal to this graph.
- __repr__()
Return a unique string representation of this graph.
- __str__()
Return a concise string description of this graph.
- add_node(node)
Add a node to this graph.
- add_edge(source, to, label=None)
Add an edge to this graph.
- child_edges(parent)
Return a list of (child, label) pairs for parent.
- children(parent)
Return a list of unique children for parent.
- edges(label)
Return a list of all the edges with this label.
- labels()
Return a list of all the edge labels in this graph.
- nodes()
Return a list of the nodes in this graph.
- parent_edges(child)
Return a list of (parent, label) pairs for child.
- parents(child)
Return a list of unique parents for child.
- remove_node(node)
Remove node and all edges connected to it.
- remove_edge(parent, child, label)
Remove edge (NOT IMPLEMENTED).
- __hash__ = None
- Bio.Pathway.Rep.MultiGraph.df_search(graph, root=None)
Depth first search of g.
Returns a list of all nodes that can be reached from the root node in depth-first order.
If root is not given, the search will be rooted at an arbitrary node.
- Bio.Pathway.Rep.MultiGraph.bf_search(graph, root=None)
Breadth first search of g.
Returns a list of all nodes that can be reached from the root node in breadth-first order.
If root is not given, the search will be rooted at an arbitrary node.