Game Guides > Game FAQ >  

Why you use DFS and BFS in graphs

Why you use DFS and BFS in graphs
DFS and BFS are both searching algorithms.
DFS, or depth first search, is a simple to implement algorithm, especially when written recursively.
BFS, or breadth first search, is only slightly more complicated.
Both search methods can be used to obtain a spanning tree of the graph, though if I recall correctly, BFS can also be used in a weighted graph to generate a minimum cost spanning tree.