#

Note

This documents the development version of NetworkX. Documentation for the current release can be found here.

#

networkx.algorithms.threshold.is_threshold_graph

is_threshold_graph(G)[source]

Returns True if G is a threshold graph.

Parameters

G (NetworkX graph instance) – An instance of Graph, DiGraph, MultiGraph or MultiDiGraph

Returns

True if G is a threshold graph, False otherwise.

Return type

bool

Examples

>>> from networkx.algorithms.threshold import is_threshold_graph
>>> G = nx.path_graph(3)
>>> is_threshold_graph(G)
True
>>> G = nx.barbell_graph(3, 3)
>>> is_threshold_graph(G)
False

References

1

Threshold graphs: https://en.wikipedia.org/wiki/Threshold_graph