![]() |
|
Navigation |
Synopsis Determine the connected components of a graph.
Function
set[set[&T]] connectedComponents(Graph[&T] G)
Usage
import analysis::graphs::Graph;
Description Returns the connected components
![]() G , as sets of nodes. All nodes within one component are all reachable from one another, there are no paths between two nodes from different components. The graph is assumed to be undirected.
Examples
rascal>import analysis::graphs::Graph; ok rascal>connectedComponents({<1,2>, <1,3>, <4,5>, <5,6>}); set[set[int]]: { {1,2,3}, {4,5,6} } ![]() |