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
- Returns
- graph
A graph instance representing the threshold graph
References
- 1
Threshold graphs: https://en.wikipedia.org/wiki/Threshold_graph
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))