Questions Tagged With dfshttps://inoi15.discuss.codechef.com/tags/dfs/?type=rssquestions tagged <span class="tag">dfs</span>enWed, 21 Jan 2015 23:08:45 +0530Help me with this graph problemhttps://inoi15.discuss.codechef.com/questions/60367/help-me-with-this-graph-problem<p>Someone mentioned in an answer that the following problem can be solved using only DFS/BFS: <a href="http://www.spoj.com/problems/PRATA/">http://www.spoj.com/problems/PRATA/</a></p>
<p>I am not getting any idea on how to solve this problem without using Dijkstra's algo/ MST. Binary Search is another approach. Can anyone tell how to solve this using only BFS/DFS?</p>ketanhwrWed, 31 Dec 2014 21:54:18 +0530https://inoi15.discuss.codechef.com/questions/60367/help-me-with-this-graph-problembfsgraphdijkstramstdfsShortest path from BFS and DFShttps://inoi15.discuss.codechef.com/questions/62375/shortest-path-from-bfs-and-dfs<p>Hi all,
I recently learnt how to implement breadth-first-search (BFS) using C++ STL vector. However, though I know the algorithm of depth-first-search (DFS) but cannot understand how to implement it using C++ STL. Please provide me a code using C++ STL to implement it.
Also kindly tell me how the shortest path algorithms (such as Dijkstra's algorithm or Floyd-Warshall's algorithm) can be derived from BFS and DFS.</p>
<p>Thanks in advance!</p>anupam_dattaWed, 21 Jan 2015 23:08:45 +0530https://inoi15.discuss.codechef.com/questions/62375/shortest-path-from-bfs-and-dfsbfsdfsshortest-path