stupidb.associative.bitgraph

Implementation of a graph whose vertices are unsigned integers.

Classes

BitGraph(nodes)

An immutable graph whose vertices are unsigned integers.

class stupidb.associative.bitgraph.BitGraph(nodes)[source]

An immutable graph whose vertices are unsigned integers.

classmethod from_vertices_and_edges(*, vertices, edges)[source]

Construct a BitGraph from vertices and edges.

property in_edges: Iterator[int]

Return the nodes with indegree zero.

Return type

Iterator[int]

property nodes: Mapping[int, AbstractSet[int]]

Return a mapping from node to connected nodes.

Return type

Mapping[int, AbstractSet[int]]

property predecessors: Mapping[int, int]

Return a mapping of predecessors.

Return type

Mapping[int, int]