iduedu.largest_component

iduedu.largest_component(graph, mode='auto')[source]

Return the largest component according to the selected connectivity mode.

Parameters:
  • graph (UrbanGraph) – Graph to inspect.

  • mode (Literal['auto', 'connected', 'weak', 'strong']) – Connectivity mode. "auto" selects "strong" for directed graphs and "connected" for undirected graphs.

Return type:

set[Any]

Returns:

Set of node ids in the largest component. Returns an empty set for an empty graph.

Raises:

ValueError – If mode is not supported.