graphi.types.adjacency_graph module

class graphi.types.adjacency_graph.AdjacencyGraph(*source, **kwargs)

Bases: graphi.abc.Graph

Graph 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() and values() is arbitrary. The expected complexity for searches is the worst case of O(len(nodes()) = n) and O(len(edges()) -> n2), respectively.

clear()
edges()
update(other)
values()
class graphi.types.adjacency_graph.EdgeView(graph)

Bases: graphi.abc.EdgeView

View on the edges in a graph

class graphi.types.adjacency_graph.ValueView(graph)

Bases: graphi.abc.ValueView

View on the values of edges in a graph