networkx.algorithms.node_connected_component

networkx.algorithms.node_connected_component(G, n)[source]

Return the nodes in the component of graph containing node n.

Parameters:

G : NetworkX Graph

An undirected graph.

n : node label

A node in G

Returns:

comp : set

A set of nodes in the component of G containing node n.

Raises:

NetworkXNotImplemented:

If G is undirected.

Notes

For undirected graphs only.