0
$\begingroup$

I am trying to understand the various differences between Breadth-first and Depth-first search on graphs. Two sources state that BFS is "vertex based" and DFS is "edge based" even though in implementation, we use the vertices to iterate over.

So, what exactly does "vertex based" and "edge based" mean in this context?

Sources: (1) https://www.geeksforgeeks.org/difference-between-bfs-and-dfs/ (2) https://techdifferences.com/difference-between-bfs-and-dfs.html

$\endgroup$
  • 1
    $\begingroup$ I'm not sure that these terms are really important or well defined. I've never heard of this distinction and I've been dealing with DFS and BFS for years. I guess these terms are meant to make intuitive sense in some way but I think you will be better off by toying a bit with these approaches and developing your own intuition. Try to solve problems involving either or both and you will very quickly get a solid grasp on them. $\endgroup$ – Tassle Sep 14 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.