is_regular_expander#

is_regular_expander(G, *, epsilon=0)[source]#

Determines whether the graph G is a regular expander. [1]

An expander graph is a sparse graph with strong connectivity properties.

More precisely, this helper checks whether the graph is a regular (n,d,λ)-expander with λ close to the Alon-Boppana bound and given by λ=2d1+ϵ. [2]

In the case where ϵ=0 then if the graph successfully passes the test it is a Ramanujan graph. [3]

A Ramanujan graph has spectral gap almost as large as possible, which makes them excellent expanders.

Parameters:
GNetworkX graph
epsilonint, float, default=0
Returns:
bool

Whether the given graph is a regular (n,d,λ)-expander where λ=2d1+ϵ.

References

Examples

>>> G = nx.random_regular_expander_graph(20, 4)
>>> nx.is_regular_expander(G)
True