find_threshold_graph#

find_threshold_graph(G, create_using=None)[source]#

Returns a threshold subgraph that is close to largest in G.

The threshold graph will contain the largest degree node in G.

Parameters:
GNetworkX graph instance

An instance of Graph, or MultiDiGraph

create_usingNetworkX graph class or None (default), optional

Type of graph to use when constructing the threshold graph. If None, infer the appropriate graph type from the input.

Returns:
graph

A graph instance representing the threshold graph

References

Examples

>>> from networkx.algorithms.threshold import find_threshold_graph
>>> G = nx.barbell_graph(3, 3)
>>> T = find_threshold_graph(G)
>>> T.nodes  # may vary
NodeView((7, 8, 5, 6))