Graph
A module representing an abstract Graph base class.
Graph
An abstract graph data structure.
Source code in maestrowf/abstracts/graph.py
add_edge(src, dest)
abstractmethod
Add the edge (src, dest) to the graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src |
Source vertex name. |
required | |
dest |
Destination vertex name. |
required |
add_node(name, obj)
abstractmethod
Method to add a node to the graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
String identifier of the node. |
required | |
obj |
An object representing the value of the node. |
required |
remove_edge(src, dest)
abstractmethod
Remove edge (src, dest) from the graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src |
Source vertex name. |
required | |
dest |
Destination vertex name. |
required |