Graph
Graph
Bases: Protocol
, Generic[Node]
The graph interface.
This interface defines the methods that a graph object must implement. The graph interface is mainly for compatibility reasons so that one can use multiple graph implementations interchangeably.
get_edges
get_edges() -> Iterable[tuple[Node, Node]]
Get all the edges in the graph.
Source code in src/kirin/graph.py
26 27 28 |
|
get_neighbors
get_neighbors(node: Node) -> Iterable[Node]
Get the neighbors of a node.
Source code in src/kirin/graph.py
18 19 20 |
|
get_nodes
get_nodes() -> Iterable[Node]
Get all the nodes in the graph.
Source code in src/kirin/graph.py
22 23 24 |
|