Documentation for 3239fcc19e

This commit is contained in:
github-actions
2020-08-27 14:31:36 +00:00
parent 85feb58970
commit a7071744aa
201 changed files with 5182 additions and 4547 deletions

View File

@@ -102,8 +102,8 @@ $(document).ready(function(){initNavTree('d6/dd8/is__graph__bipartite_8cpp.html'
<p>Algorithm to check whether a graph is <a href="https://en.wikipedia.org/wiki/Bipartite_graph">bipartite</a>
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;iostream&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
<code>#include &lt;queue&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for is_graph_bipartite.cpp:</div>
<div class="dyncontent">
@@ -129,22 +129,20 @@ Namespaces</h2></td></tr>
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft">&#160;</td><td class="mdescRight">namespace graph <a href="../../d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">More...</a><br /></td></tr>
<tr class="separator:aa8dca7b867074164d5f45b0f3851269d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dd8/is__graph__bipartite_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</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>Algorithm to check whether a graph is <a href="https://en.wikipedia.org/wiki/Bipartite_graph">bipartite</a> </p>
<p>A graph is a collection of nodes also called vertices and these vertices are connected by edges.A bipartite graph is a graph whose vertices can be divided into two disjoint and independent sets U and V such that every edge connects a vertex in U to one in V. <br />
</p>
<p>The given Algorithm will determine whether the given graph is bipartite or not</p>
<p>A graph is a collection of nodes also called vertices and these vertices are connected by edges. A graph is bipartite if its vertices can be divided into two disjoint and independent sets U and V such that every edge connects a vertex in U to one in V.</p>
<p>The algorithm implemented in this file determines whether the given graph is bipartite or not.</p>
<pre>
Example - Here is a graph g1 with 5 vertices and is bipartite</pre><pre> 1 4
Example - Here is a graph g1 with 5 vertices and is bipartite</pre><pre> 1 4
/ \ / \
2 3 5</pre><pre>Example - Here is a graph G2 with 3 vertices and is not bipartite</pre><pre> 1 --- 2
\ /
3</pre><pre></pre><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/AkVaya">Akshat Vaya</a> </dd></dl>
2 3 5</pre><pre>Example - Here is a graph G2 with 3 vertices and is not bipartite</pre><pre> 1 --- 2
\ /
3</pre><pre></pre><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/AkVaya">Akshat Vaya</a> </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">&#9670;&nbsp;</a></span>main()</h2>
@@ -163,10 +161,10 @@ Example - Here is a graph g1 with 5 vertices and is bipartite</pre><pre> 1
</div><div class="memdoc">
<p>Main function </p>
<p>Testing</p>
<div class="fragment"><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; {</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <a class="code" href="../../d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">///Testing</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;<span class="comment"></span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;}</div>
<div class="fragment"><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; {</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <a class="code" href="../../d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">/// Testing</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;<span class="comment"></span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -198,42 +196,40 @@ Here is the call graph for this function:</div>
</tr>
</table>
</div><div class="memdoc">
<p>namespace graph </p>
<p>Function to test the above algorithm </p><dl class="section return"><dt>Returns</dt><dd>none </dd></dl>
<p>creating graph G1 with 5 vertices</p>
<p>adding edges to the graphs as per the illustrated example</p>
<p>creating graph G2 with 3 vertices</p>
<p>adding edges to the graphs as per the illustrated example</p>
<p>checking whether the graphs are bipartite or not</p>
<div class="fragment"><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; {</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <a class="code" href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html">graph::is_graph_bipartite::Graph</a> G1(5); <span class="comment">/// creating graph G1 with 5 vertices</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="comment"></span><span class="comment"> /// adding edges to the graphs as per the illustrated example</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="comment"></span> G1.addEdge(1,2);</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; G1.addEdge(1,3);</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; G1.addEdge(3,4);</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; G1.addEdge(4,5);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <a class="code" href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html">graph::is_graph_bipartite::Graph</a> G2(3); <span class="comment">/// creating graph G2 with 3 vertices</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;<span class="comment"></span><span class="comment"> /// adding edges to the graphs as per the illustrated example</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="comment"></span> G2.addEdge(1,2);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; G2.addEdge(1,3);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; G2.addEdge(2,3);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;<span class="comment"> /// checking whether the graphs are bipartite or not</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;<span class="comment"></span> <span class="keywordflow">if</span>(G1.is_bipartite()){</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a>&lt;&lt;<span class="stringliteral">&quot;The given graph G1 is a bipartite graph\n&quot;</span>;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; } </div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keywordflow">else</span>{</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a>&lt;&lt;<span class="stringliteral">&quot;The given graph G1 is not a bipartite graph\n&quot;</span>;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; }</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="keywordflow">if</span>(G2.is_bipartite()){</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a>&lt;&lt;<span class="stringliteral">&quot;The given graph G2 is a bipartite graph\n&quot;</span>;</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; } </div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">else</span>{</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a>&lt;&lt;<span class="stringliteral">&quot;The given graph G2 is not a bipartite graph\n&quot;</span>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; }</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;}</div>
<div class="fragment"><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; {</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <a class="code" href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html">graph::is_graph_bipartite::Graph</a> G1(</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; 5); <span class="comment">/// creating graph G1 with 5 vertices</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="comment"></span><span class="comment"> /// adding edges to the graphs as per the illustrated example</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="comment"></span> G1.addEdge(1, 2);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; G1.addEdge(1, 3);</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; G1.addEdge(3, 4);</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; G1.addEdge(4, 5);</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; <a class="code" href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html">graph::is_graph_bipartite::Graph</a> G2(</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; 3); <span class="comment">/// creating graph G2 with 3 vertices</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="comment"></span><span class="comment"> /// adding edges to the graphs as per the illustrated example</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="comment"></span> G2.addEdge(1, 2);</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; G2.addEdge(1, 3);</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; G2.addEdge(2, 3);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;<span class="comment"> /// checking whether the graphs are bipartite or not</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;<span class="comment"></span> <span class="keywordflow">if</span> (G1.is_bipartite()) {</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;The given graph G1 is a bipartite graph\n&quot;</span>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;The given graph G1 is not a bipartite graph\n&quot;</span>;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; }</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; <span class="keywordflow">if</span> (G2.is_bipartite()) {</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;The given graph G2 is a bipartite graph\n&quot;</span>;</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;The given graph G2 is not a bipartite graph\n&quot;</span>;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; }</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;}</div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
@@ -245,9 +241,9 @@ Here is the call graph for this function:</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="ais__graph__bipartite_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">namespace graph</div><div class="ttdef"><b>Definition:</b> is_graph_bipartite.cpp:129</div></div>
<div class="ttc" id="ais__graph__bipartite_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdef"><b>Definition:</b> is_graph_bipartite.cpp:136</div></div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="aclassgraph_1_1is__graph__bipartite_1_1_graph_html"><div class="ttname"><a href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html">graph::is_graph_bipartite::Graph</a></div><div class="ttdoc">Class for representing graph as an adjacency list.</div><div class="ttdef"><b>Definition:</b> is_graph_bipartite.cpp:49</div></div>
<div class="ttc" id="aclassgraph_1_1is__graph__bipartite_1_1_graph_html"><div class="ttname"><a href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html">graph::is_graph_bipartite::Graph</a></div><div class="ttdoc">Class for representing graph as an adjacency list.</div><div class="ttdef"><b>Definition:</b> is_graph_bipartite.cpp:51</div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>

View File

@@ -1,5 +1,5 @@
<map id="test" name="test">
<area shape="rect" id="node1" title="namespace graph" alt="" coords="5,46,49,73"/>
<area shape="rect" id="node1" title=" " alt="" coords="5,46,49,73"/>
<area shape="rect" id="node2" href="$de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html#ad8c10df34357b2cd865c81e0c4f0bd8c" title="Function that add an edge between two nodes or vertices of graph." alt="" coords="97,5,261,47"/>
<area shape="rect" id="node4" href="$de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html#a9b0c6400693a5cfff971f768dd5ca5ca" title="function to add edges to our graph" alt="" coords="97,71,261,112"/>
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back.html#" title=" " alt="" coords="309,13,464,39"/>

View File

@@ -1 +1 @@
a6549d119662d6201a83efd94768f2b3
4e0be744b75f883f63641c5d23dc6807

View File

@@ -12,7 +12,7 @@
<!-- Node1 -->
<g id="node1" class="node">
<title>Node1</title>
<g id="a_node1"><a xlink:title="namespace graph">
<g id="a_node1"><a xlink:title=" ">
<polygon fill="#bfbfbf" stroke="black" points="0,-30 0,-49 33,-49 33,-30 0,-30"/>
<text text-anchor="middle" x="16.5" y="-37" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
</a>

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,6 +1,6 @@
<map id="main" name="main">
<area shape="rect" id="node1" title=" " alt="" coords="5,46,56,73"/>
<area shape="rect" id="node2" href="$d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="namespace graph" alt="" coords="104,46,148,73"/>
<area shape="rect" id="node2" href="$d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title=" " alt="" coords="104,46,148,73"/>
<area shape="rect" id="node3" href="$de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html#ad8c10df34357b2cd865c81e0c4f0bd8c" title="Function that add an edge between two nodes or vertices of graph." alt="" coords="196,5,360,47"/>
<area shape="rect" id="node5" href="$de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html#a9b0c6400693a5cfff971f768dd5ca5ca" title="function to add edges to our graph" alt="" coords="196,71,360,112"/>
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back.html#" title=" " alt="" coords="408,13,563,39"/>

View File

@@ -1 +1 @@
4304c99872312673eb221911fd941f45
a3358a1d81e2e5c2a495fb90f5aad915

View File

@@ -21,7 +21,7 @@
<!-- Node2 -->
<g id="node2" class="node">
<title>Node2</title>
<g id="a_node2"><a xlink:href="../../d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="namespace graph">
<g id="a_node2"><a xlink:href="../../d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title=" ">
<polygon fill="white" stroke="black" points="74,-30 74,-49 107,-49 107,-30 74,-30"/>
<text text-anchor="middle" x="90.5" y="-37" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
</a>

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB