3,126 views
0 votes
0 votes

For an unweighted graph, DFS traversal of the graph produces the minimum spanning tree and all pair shortest path tree

Is the above statement is valid ?

My doubt is what will be minimum cost spanning for unweighted graph?

Every spanning tree is an MST for unweighted graphs.So i think the first part of statement is true.

However we can,t find single shortest path using DFT then how we will find all pair shortest path ?Expain pls?

Source:http://www.geeksforgeeks.org/applications-of-depth-first-search/

1 Answer

1 votes
1 votes
we use BFS to calculate the shortest path not DFS that is the advantage of BFS over DFS

Related questions

2 votes
2 votes
2 answers
1
Hcas Hgnis asked Dec 16, 2014
1,401 views
0 votes
0 votes
0 answers
4
Nefarious Monkey asked Feb 23, 2018
261 views
#DMRC application: The form for post of RE07 has Post graduation field as mandatory. But their advertisement says something else. Anybody else having this problem?