Graphs and results#

The graph classes, the result maps returned by algorithms, and the exception hierarchy (aryagraph.core).

Graph classes#

Graph

Undirected simple graph (self-loops allowed, no parallel edges).

DiGraph

Directed simple graph (self-loops allowed, at most one arc per ordered pair).

DAG#

DAG

Directed acyclic graph.

Result maps#

NodeMap

dict of node → value with ranking and statistics helpers.

EdgeMap

dict of (u, v) edge → value, same helpers as NodeMap.

Exceptions#

AryaGraphError

Base class for all AryaGraph errors.

NodeNotFound

A node was requested that is not in the graph.

EdgeNotFound

An edge was requested that is not in the graph.

CycleError

An operation needs an acyclic graph but found a cycle.

NegativeCycleError

A shortest-path computation met a negative-weight cycle.

NegativeWeightError

A method that needs non-negative edge weights met a negative one.

UnboundedFlowError

A maximum flow is infinite (an all-infinite-capacity path joins source and sink).

NoPath

No path exists between the requested nodes.

NotConnected

The measure is only defined for a connected (or strongly connected) graph.

GraphTypeError

The algorithm does not support this kind of graph (e.g. needs directed).

ConvergenceError

An iterative method did not converge within its iteration budget.

DependencyError

An optional dependency needed for this feature is not installed.

Utilities#

make_rng

A numpy Generator from an int seed, an existing generator, or fresh entropy.

weight_fn

Normalise a weight argument into f(u, v, attrs) -> float.