networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef
find_induced_nodes(G, s, t, treewidth_bound=9223372036854775807)

Notes

G must be a chordal graph and (s,t) an edge that is not in G.

If a treewidth_bound is provided, the search for induced nodes will end as soon as the treewidth_bound is exceeded.

The algorithm is inspired by Algorithm 4 in . A formal definition of induced node can also be found on that reference.

Parameters

G : graph

A chordal NetworkX graph

s : node

Source node to look for induced nodes

t : node

Destination node to look for induced nodes

treewidth_bound: float :

Maximum treewidth acceptable for the graph H. The search for induced nodes will end as soon as the treewidth_bound is exceeded.

Raises

NetworkXError

The algorithm does not support DiGraph, MultiGraph and MultiDiGraph. If the input graph is an instance of one of these classes, a NetworkXError is raised. The algorithm can only be applied to chordal graphs. If the input graph is found to be non-chordal, a NetworkXError is raised.

Returns

induced_nodes : Set of nodes

The set of induced nodes in the path from s to t in G

Returns the set of induced nodes in the path from s to t.

Examples

>>> G = nx.Graph()
... G = nx.generators.classic.path_graph(10)
... induced_nodes = nx.find_induced_nodes(G, 1, 9, 2)
... sorted(induced_nodes) [1, 2, 3, 4, 5, 6, 7, 8, 9]
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.algorithms.chordal.find_induced_nodes

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/algorithms/chordal.py#88
type: <class 'function'>
Commit: