graphi.types.adjacency_graph module¶
-
class
graphi.types.adjacency_graph.AdjacencyGraph(*args, **kwargs)¶ Bases:
graphi.abc.GraphGraph storing edge distances via adjacency lists
Parameters: - source – adjacency information
- undirected – whether the graph enforces symmetry
This graph provides optimal performance for random, direct access to nodes and edges. As it stores individual nodes and edges, it is optimal in both space and time for sparse graphs.
However, ordering of
nodes(),edges()andvalues()is arbitrary. The expected complexity for searches is the worst case of O(len(nodes()) = n) and O(len(edges()) -> n2), respectively.-
clear()¶ Remove all elements from this graph
-
edges()¶ Return a new view of the graph’s edges
Returns: view of the graph’s edges Return type: EdgeView
-
class
graphi.types.adjacency_graph.EdgeView(graph)¶ Bases:
graphi.abc.EdgeViewView on the edges in a graph
-
class
graphi.types.adjacency_graph.ValueView(graph)¶ Bases:
graphi.abc.ValueViewView on the values of edges in a graph