component of given vertex vby performing depth-first search traversal from that terminates when back edge is found it returns (possibly emptyiterable collection of the vertices and edges in the cycle formed by the found back edge code fragment specialization of class dfs to find cycle in the connected component of the start vertex