(related to Algorithm: Get All Components of a Graph)
The correctness of the algorithm follows immediately from the definition of components as equivalence classes of vertices connected to a given vertex \(v\).
Thank you to the contributors under CC BY-SA 4.0!