L = connectedGraphComponents G
This function returns the connected components of a graph. A connected component of a graph is any maximal set of vertices which are pairwise connected by a (possibly trivial) path. Isolated vertices, which are those not appearing in any edge, form their own connected components. This is in contrast to connectedComponents in which isolated vertices do not appear in any connected components. See the Connected Components Tutorial for more information.
|
|
|
In the following example, graph G contains the isolated vertex d. Notice that d appears in its own connected component and hence G is not connected.
|
|
|
|
|
The object connectedGraphComponents is a method function.