MCPcopy
hub / github.com/networkx/networkx / find_threshold_graph

Function find_threshold_graph

networkx/algorithms/threshold.py:373–404  ·  view source on GitHub ↗

Returns a threshold subgraph that is close to largest in `G`. The threshold graph will contain the largest degree node in G. Parameters ---------- G : NetworkX graph instance An instance of `Graph`, or `MultiDiGraph` create_using : NetworkX graph class or `None` (d

(G, create_using=None)

Source from the content-addressed store, hash-verified

371
372@nx._dispatchable(returns_graph=True)
373def find_threshold_graph(G, create_using=None):
374 """
375 Returns a threshold subgraph that is close to largest in `G`.
376
377 The threshold graph will contain the largest degree node in G.
378
379 Parameters
380 ----------
381 G : NetworkX graph instance
382 An instance of `Graph`, or `MultiDiGraph`
383 create_using : NetworkX graph class or `None` (default), optional
384 Type of graph to use when constructing the threshold graph.
385 If `None`, infer the appropriate graph type from the input.
386
387 Returns
388 -------
389 graph :
390 A graph instance representing the threshold graph
391
392 Examples
393 --------
394 >>> from networkx.algorithms.threshold import find_threshold_graph
395 >>> G = nx.barbell_graph(3, 3)
396 >>> T = find_threshold_graph(G)
397 >>> T.nodes # may vary
398 NodeView((7, 8, 5, 6))
399
400 References
401 ----------
402 .. [1] Threshold graphs: https://en.wikipedia.org/wiki/Threshold_graph
403 """
404 return threshold_graph(find_creation_sequence(G), create_using)
405
406
407@nx._dispatchable

Callers

nothing calls this directly

Calls 2

threshold_graphFunction · 0.85
find_creation_sequenceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…