Graph

class graf.Graph[source]

Class of Graph.

__init__()[source]

Constructor for Graph.

create_edge(from_node, to_node, id=None)[source]

Create graf.Edge from id, from_node, to_node and add it to this graf.Graph.

from_node : graf.Node
The start node for the edge.
to_node: graf.Node
The end node for the edge.
id : str, optional
An ID for the edge. We will create one if none is given.
res : graf.Edge
The Edge object that was created.
find_edge(from_node, to_node)[source]

Search for C{Edge} with its from_node, to_node, either nodes or ids.

Parameters:
  • from_node – C{Node} or C{str}
  • to_node – C{Node} or C{str}
Returns:

C{Edge} or None