MathCastle
Graph TheoryEasyGraph Algorithms

Graph Algorithms · Easy problem

A graph has vertices a,b,c,d,ea, b, c, d, e and edges ab,bc,cd,de,ea,bdab, bc, cd, de, ea, bd. Running a DFS from aa that visits each vertex's unvisited neighbors in alphabetical order reaches dd for a second time through the edge bdbd, which turns out to be a back edge. What is the length (number of edges) of the cycle that this back edge forms together with the DFS tree path between bb and dd?