maximal non branching paths

struggling with DFS walking. shall be dependent ?....