NetworkX

Previous topic

is_directed_acyclic_graph

Next topic

Distance Measures

is_aperiodic

is_aperiodic(G)[source]

Return True if G is aperiodic.

A directed graph is aperiodic if there is no integer k > 1 that divides the length of every cycle in the graph.

Parameters :

G : NetworkX DiGraph

Graph

Returns :

aperiodic : boolean

True if the graph is aperiodic False otherwise

Raises :

NetworkXError :

If G is not directed

Notes

This uses the method outlined in [R162], which runs in O(m) time given m edges in G. Note that a graph is not aperiodic if it is acyclic as every integer trivial divides length 0 cycles.

References

[R162](1, 2) Jarvis, J. P.; Shier, D. R. (1996), Graph-theoretic analysis of finite Markov chains, in Shier, D. R.; Wallenius, K. T., Applied Mathematical Modeling: A Multidisciplinary Approach, CRC Press.