From charlesreid1

 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Depth first search notes==
==Depth first search notes==


Depth first search:
Depth first search utilizes backtracking and recursion to explore each node of a tree, or each vertex of a graph, exactly once.


Graphs:
On a graph, depth-first search is a crucial building block of several algorithms related to connectivity, such as finding cycles, determining of two vertices are connected, and constructing spanning trees.
* see [[TSP]] (traveling salesperson problem).


Trees:
For an example of depth-first search on a graph, see [[TSP|traveling salesperson problem]] page.
* see [[Preorder]] or [[Postorder]] or [[Inorder]] for recursive depth-first algorithms for tree traversal.
 
==Related==


Recursion:
Recursion:
* see [[Recursion]] for recursion.
* See [[Recursion]]


Related pages:
{{TraversalRelated}}
* see [[:Category:DFS]] for more.


==Flags==
==Flags==


{{TreesFlag}}
{{TreesFlag}}
{{GraphsFlag}}
[[Category:Trees]]
[[Category:Binary Trees]]
[[Category:Graphs]]


[[Category:Traversal]]
[[Category:Algorithms]]
[[Category:Recursion]]
[[Category:Recursion]]
[[Category:DFS]]
[[Category:DFS]]

Latest revision as of 15:52, 7 September 2017

Depth first search notes

Depth first search utilizes backtracking and recursion to explore each node of a tree, or each vertex of a graph, exactly once.

On a graph, depth-first search is a crucial building block of several algorithms related to connectivity, such as finding cycles, determining of two vertices are connected, and constructing spanning trees.

For an example of depth-first search on a graph, see traveling salesperson problem page.

Related

Recursion:

Graphs:

Traversals on trees:

Breadth-first search and traversal on trees:

  • BFS - breadth first search
  • BFT - breadth first traversal

Depth-first search and traversal on trees:

  • DFS - depth first search
  • DFT - depth first traversal

OOP design patterns:

Category:Traversal

Flags