rustworkx.node_connected_component#

node_connected_component(graph, node, /)#

Returns the set of nodes in the component of graph containing node.

Parameters:
  • graph (PyGraph) – The graph to be used.

  • node (int) – A node in the graph.

Returns:

A set of nodes in the component of graph containing node.

Return type:

set

Raises:

InvalidNode – When an invalid node index is provided.