start and target vertices it performs depth-first search traversal beginning at the start vertex we maintain the path of discovery edges from the start vertex to the current vertex when we encounter an unexplored vertexwe add it to the end of the pathand when we finish processing vertexwe remove it from the path the traversal is terminated when the target vertex is encounteredand the path is returned as an iterable collection of vertices and edges (both kinds of positions in graphnote that the path found by this class consists of discovery edges code fragment specialization of class dfs to find path between start and target vertices