Graph TheoryMediumGraph Algorithms
Graph Algorithms · Medium problem
A graph has vertices and edges . Running a DFS from that visits each vertex's unvisited neighbors in alphabetical order discovers a back edge connecting and . What is the length (number of edges) of the cycle that this back edge forms with the DFS tree path between and ?