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__(self, nodes=())¶
Initialize a new MultiGraph object.
- __eq__(self, g)¶
Return true if g is equal to this graph.
- __repr__(self)¶
Return a unique string representation of this graph.
- __str__(self)¶
Return a concise string description of this graph.
- add_node(self, node)¶
Add a node to this graph.
- add_edge(self, source, to, label=None)¶
Add an edge to this graph.
- child_edges(self, parent)¶
Return a list of (child, label) pairs for parent.
- children(self, parent)¶
Return a list of unique children for parent.
- edges(self, label)¶
Return a list of all the edges with this label.
- labels(self)¶
Return a list of all the edge labels in this graph.
- nodes(self)¶
Return a list of the nodes in this graph.
- parent_edges(self, child)¶
Return a list of (parent, label) pairs for child.
- parents(self, child)¶
Return a list of unique parents for child.
- remove_node(self, node)¶
Remove node and all edges connected to it.
- remove_edge(self, 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.