graphi.types.undirected module

class graphi.types.undirected.Undirected(*source, **kwargs)

Bases: graphi.abc.Graph

Wrapper to make Graph instances undirected

See also

The undirectable() decorator for Graph classes.

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:UndirectedEdgeView
undirected
update(other)

Update the graph with the nodes, edges and values from other, overwriting existing elements.

Parameters:other (Graph or ItemView) – graph or items from which to pull elements
values()

Return a new view of the values of the graph’s edges

Returns:view of the values of the graph’s edges
Return type:UndirectedValueView
class graphi.types.undirected.UndirectedEdge(start, stop, step=None)

Bases: graphi.edge.Edge

An undirected edge as a pair of nodes

For any nodes a and b, the UndirectedEdges a:b and b:a are equivalent. As a result, which of the two is start or stop is arbitrary but well-defined.

class graphi.types.undirected.UndirectedEdgeView(graph)

Bases: graphi.abc.EdgeView

View on the undirected edges in a graph

class graphi.types.undirected.UndirectedValueView(graph)

Bases: graphi.abc.ValueView

View on the values of undirected edges in a graph