Solution (source code)

= Solution

A <connected component> of an <undirected graph> is a maximal set of <vertices> such that each pair is joined by a <path>. Equivalently, components are the <equivalence classes> of the relation “reachable by a path”. The length-zero path ensures that an isolated <vertex> is a one-vertex component.