A connected component is a list of vertices of a graph that are connected, in other words there exists a path of edges between any two vertices in the component.
i1 : G = graph(toList(1..8),{{1,2},{2,3},{3,4},{5,6}}); |
i2 : connectedComponents G o2 = {{1, 2, 3, 4}, {5, 6}, {7}, {8}} o2 : List |
The object connectedComponents is a method function.