The document discusses depth-first search (DFS), a graph traversal algorithm that visits vertices in a graph by exploring as far as possible along each branch before backtracking. It defines key DFS concepts like discovery edges, back edges, and spanning trees. The algorithm uses recursion or a stack to visit vertices. DFS runs in O(V+E) time and can find paths or cycles in a graph. It is commonly used to solve maze traversal and other graph problems.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
202 views3 pages
DFS PDF
The document discusses depth-first search (DFS), a graph traversal algorithm that visits vertices in a graph by exploring as far as possible along each branch before backtracking. It defines key DFS concepts like discovery edges, back edges, and spanning trees. The algorithm uses recursion or a stack to visit vertices. DFS runs in O(V+E) time and can find paths or cycles in a graph. It is commonly used to solve maze traversal and other graph problems.