BFS & amp; DFS - What summit to start?
source link: https://www.codesd.com/item/bfs-dfs-what-summit-to-start.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
BFS & amp; DFS - What summit to start?
I've read pages and pages of information on BFS and DFS algorithms. What none of them say, is which vertex to choose first?
For instance, in this image, do the arrows mean you cannot traverse from c to b, but can traverse from b to c?
Your help is much appreciated, friends.
If it's not a directed graph, it doesn't matter. The graph you posted is a directed graph which means exactly what you've stated. You can go from a to b but not from b to a.
Regarding which node to choose in a directed graph, every node you'll choose can produce different result. Usually under these circumstances it's best to start from the root node if it's given.
Related Articles
Using BFS or DFS to determine connectivity in an unconnected graph?
Printing permutation using bfs or dfs
How to build a tree with its BFS and DFS traversal
Application of BFS or DFS
Find a cycle in a directed graph using BFS or DFS
Difference between BFS and DFS
I can not understand how Prolog knows what is the start state in a DFA acceptance rule
What does Java start the heap if I do not specify an -Xms?
What is ApnsService.start used for in notnoop javapns? I can press msg with the push method without starting ()
At what age will you start teaching your child programming? What language to start?
What is & ldquo; Started with a change SCM & rdquo; in Hudson?
What do the 'start' and 'length' attributes mean in LocalVariableTable?
What is the starting angle and end angle of the bow in the html5 fabric?
What should I start developing for iPhones?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK