Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 743 Bytes

graph_traversals.md

File metadata and controls

20 lines (13 loc) · 743 Bytes

Graph traversals

Here we will study different ways of visiting the vertices of a graph following their relations. This will be useful when we are designing algorithms that work with the data in the graph and require following a strict pattern when visiting the vertices.

Breadth-First Search

BFS is a graph traversal algorithm that explores the neighbor vertices first, before moving to the next level neighbors.

Depth-First Search

DFS is a graph traversal algorithm that visits all vertices down a branch and then backtracks to neighbors.