Documentation for 0931d530ae

This commit is contained in:
github-actions
2023-01-22 19:44:10 +00:00
parent a448f64699
commit b48f6e8671
2457 changed files with 9513 additions and 8691 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: graph/breadth_first_search.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -141,21 +141,21 @@ Functions</h2></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p ><a href="https://en.wikipedia.org/wiki/Breadth-first_search" target="_blank">Breadth First Search Algorithm (Breadth First Search)</a> </p>
<div class="textblock"><p><a href="https://en.wikipedia.org/wiki/Breadth-first_search" target="_blank">Breadth First Search Algorithm (Breadth First Search)</a> </p>
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/ayaankhan98" target="_blank">Ayaan Khan</a> </dd>
<dd>
<a href="https://github.com/gpamangkp" target="_blank">Aman Kumar Pandey</a></dd></dl>
<p>Breadth First Search also quoted as BFS is a <a class="el" href="../../da/d9a/class_graph.html">Graph</a> Traversal Algorithm. Time Complexity O(|V| + |E|) where V are the number of vertices and E are the number of edges in the graph.</p>
<p >Applications of Breadth First Search are</p>
<p>Applications of Breadth First Search are</p>
<ol type="1">
<li>Finding shortest path between two vertices say u and v, with path length measured by number of edges (an advantage over depth first search algorithm)</li>
<li>Ford-Fulkerson Method for computing the maximum flow in a flow network.</li>
<li>Testing bipartiteness of a graph.</li>
<li>Cheney's Algorithm, Copying garbage collection.</li>
</ol>
<p >And there are many more...</p>
<p>And there are many more...</p>
<h4>working</h4>
<p >In the implementation below we first created a graph using the adjacency list representation of graph. Breadth First Search Works as follows it requires a vertex as a start vertex, Start vertex is that vertex from where you want to start traversing the graph. We maintain a bool array or a vector to keep track of the vertices which we have visited so that we do not traverse the visited vertices again and again and eventually fall into an infinite loop. Along with this boolen array we use a <a class="el" href="../../dc/db5/struct_queue.html">Queue</a>.</p>
<p>In the implementation below we first created a graph using the adjacency list representation of graph. Breadth First Search Works as follows it requires a vertex as a start vertex, Start vertex is that vertex from where you want to start traversing the graph. We maintain a bool array or a vector to keep track of the vertices which we have visited so that we do not traverse the visited vertices again and again and eventually fall into an infinite loop. Along with this boolen array we use a <a class="el" href="../../dc/db5/struct_queue.html">Queue</a>.</p>
<ol type="1">
<li>First we mark the start vertex as visited.</li>
<li>Push this visited vertex in the <a class="el" href="../../dc/db5/struct_queue.html">Queue</a>.</li>
@@ -181,7 +181,7 @@ Functions</h2></td></tr>
</tr>
</table>
</div><div class="memdoc">
<p >Main function </p>
<p>Main function </p>
<div class="fragment"><div class="line"><span class="lineno"> 186</span> {</div>
<div class="line"><span class="lineno"> 187</span> <a class="code hl_function" href="../../df/d82/breadth__first__search_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a>();</div>
<div class="line"><span class="lineno"> 188</span> <span class="keywordtype">size_t</span> edges = 0;</div>
@@ -238,10 +238,10 @@ Here is the call graph for this function:</div>
</tr>
</table>
</div><div class="memdoc">
<p >Test function </p>
<p >Test 1 Begin</p>
<p >Test 2 Begin</p>
<p >Test 3 Begins</p>
<p>Test function </p>
<p>Test 1 Begin</p>
<p>Test 2 Begin</p>
<p>Test 3 Begins</p>
<div class="fragment"><div class="line"><span class="lineno"> 139</span> {<span class="comment"></span></div>
<div class="line"><span class="lineno"> 140</span><span class="comment"> /// Test 1 Begin</span></div>
<div class="line"><span class="lineno"> 141</span><span class="comment"></span> <a class="code hl_class" href="../../dc/d61/classgraph_1_1_graph.html">graph::Graph&lt;int&gt;</a> <a class="code hl_function" href="../../d4/d18/composite__simpson__rule_8cpp.html#a2f67508d5f392b0321772169342c98ad">g</a>;</div>
@@ -305,7 +305,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_12552d7fa429bf94a2e32e5cf39f7e69.html">graph</a></li><li class="navelem"><a class="el" href="../../df/d82/breadth__first__search_8cpp.html">breadth_first_search.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
</ul>
</div>
</body>