mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-04 02:30:56 +08:00
Documentation for 341ed50da8
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.9.1"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.9.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: graph/is_graph_bipartite.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -17,9 +17,9 @@
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
@@ -32,8 +32,7 @@
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<div id="projectname">Algorithms_in_C++
|
||||
 <span id="projectnumber">1.0.0</span>
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
</td>
|
||||
@@ -42,21 +41,22 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.1 -->
|
||||
<!-- Generated by Doxygen 1.9.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",false,'Search','.html');
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",'Search','.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */</script>
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
@@ -70,7 +70,7 @@ $(function() {
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(document).ready(function(){initNavTree('d6/dd8/is__graph__bipartite_8cpp.html','../../'); initResizable(); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
@@ -94,12 +94,11 @@ $(document).ready(function(){initNavTree('d6/dd8/is__graph__bipartite_8cpp.html'
|
||||
<a href="#nested-classes">Classes</a> |
|
||||
<a href="#namespaces">Namespaces</a> |
|
||||
<a href="#func-members">Functions</a> </div>
|
||||
<div class="headertitle">
|
||||
<div class="title">is_graph_bipartite.cpp File Reference</div> </div>
|
||||
<div class="headertitle"><div class="title">is_graph_bipartite.cpp File Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>Algorithm to check whether a graph is <a href="https://en.wikipedia.org/wiki/Bipartite_graph">bipartite</a>
|
||||
<p>Algorithm to check whether a graph is <a href="https://en.wikipedia.org/wiki/Bipartite_graph" target="_blank">bipartite</a>
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <iostream></code><br />
|
||||
<code>#include <queue></code><br />
|
||||
@@ -111,22 +110,22 @@ Include dependency graph for is_graph_bipartite.cpp:</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
||||
Classes</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html">graph::is_graph_bipartite::Graph</a></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Class for representing graph as an adjacency list. <a href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html#details">More...</a><br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:df/dce/namespacegraph"><td class="memItemLeft" align="right" valign="top">  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dce/namespacegraph.html">graph</a></td></tr>
|
||||
<tr class="memitem:df/dce/namespacegraph"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dce/namespacegraph.html">graph</a></td></tr>
|
||||
<tr class="memdesc:df/dce/namespacegraph"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="../../dc/d61/classgraph_1_1_graph.html">Graph</a> Algorithms. <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:de/d83/namespaceis__graph__bipartite"><td class="memItemLeft" align="right" valign="top">  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d83/namespaceis__graph__bipartite.html">is_graph_bipartite</a></td></tr>
|
||||
<tr class="memitem:de/d83/namespaceis__graph__bipartite"><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d83/namespaceis__graph__bipartite.html">is_graph_bipartite</a></td></tr>
|
||||
<tr class="memdesc:de/d83/namespaceis__graph__bipartite"><td class="mdescLeft"> </td><td class="mdescRight">Functions for checking whether a graph is bipartite or not. <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
|
||||
<tr class="separator:aa8dca7b867074164d5f45b0f3851269d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -134,9 +133,9 @@ Functions</h2></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </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 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>
|
||||
<div class="textblock"><p >Algorithm to check whether a graph is <a href="https://en.wikipedia.org/wiki/Bipartite_graph" target="_blank">bipartite</a> </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
|
||||
|
||||
@@ -150,9 +149,9 @@ Example - Here is a graph G2 with 3 vertices and is not bipartite
|
||||
\ /
|
||||
3
|
||||
|
||||
</pre><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/AkVaya">Akshat Vaya</a> </dd></dl>
|
||||
</pre><dl class="section author"><dt>Author</dt><dd><a href="https://github.com/AkVaya" target="_blank">Akshat Vaya</a> </dd></dl>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
@@ -167,23 +166,23 @@ Example - Here is a graph G2 with 3 vertices and is not bipartite
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Main function </p>
|
||||
<p>Testing</p>
|
||||
<div class="fragment"><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  {</div>
|
||||
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <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>  <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span> }</div>
|
||||
<p >Main function </p>
|
||||
<p >Testing</p>
|
||||
<div class="fragment"><div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> {</div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <a class="code hl_function" href="../../d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">/// Testing</span></div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span>}</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><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d6/dd8/is__graph__bipartite_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="575" height="118"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d6/dd8/is__graph__bipartite_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="371" height="118"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="aa8dca7b867074164d5f45b0f3851269d"></a>
|
||||
<a id="aa8dca7b867074164d5f45b0f3851269d" name="aa8dca7b867074164d5f45b0f3851269d"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">◆ </a></span>test()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
@@ -205,46 +204,46 @@ Here is the call graph for this function:</div>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<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="l00136"></a><span class="lineno"> 136</span>  {</div>
|
||||
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <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>  5); <span class="comment">/// creating graph G1 with 5 vertices</span><span class="comment"></span></div>
|
||||
<div class="line"><a name="l00139"></a><span class="lineno"> 139</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> <span class="comment"></span> G1.addEdge(1, 2);</div>
|
||||
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  G1.addEdge(1, 3);</div>
|
||||
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  G1.addEdge(3, 4);</div>
|
||||
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  G1.addEdge(4, 5);</div>
|
||||
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  </div>
|
||||
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <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>  3); <span class="comment">/// creating graph G2 with 3 vertices</span><span class="comment"></span></div>
|
||||
<div class="line"><a name="l00147"></a><span class="lineno"> 147</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> <span class="comment"></span> G2.addEdge(1, 2);</div>
|
||||
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  G2.addEdge(1, 3);</div>
|
||||
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  G2.addEdge(2, 3);</div>
|
||||
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="comment"></span> </div>
|
||||
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> <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> <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>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The given graph G1 is a bipartite graph\n"</span>;</div>
|
||||
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The given graph G1 is not a bipartite graph\n"</span>;</div>
|
||||
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  }</div>
|
||||
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keywordflow">if</span> (G2.is_bipartite()) {</div>
|
||||
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The given graph G2 is a bipartite graph\n"</span>;</div>
|
||||
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The given graph G2 is not a bipartite graph\n"</span>;</div>
|
||||
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  }</div>
|
||||
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> }</div>
|
||||
<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 id="l00136" name="l00136"></a><span class="lineno"> 136</span> {</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <a class="code hl_class" href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html">graph::is_graph_bipartite::Graph</a> G1(</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> 5); <span class="comment">/// creating graph G1 with 5 vertices</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="comment"> /// adding edges to the graphs as per the illustrated example</span></div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="comment"></span> G1.addEdge(1, 2);</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> G1.addEdge(1, 3);</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> G1.addEdge(3, 4);</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> G1.addEdge(4, 5);</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> </div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <a class="code hl_class" href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html">graph::is_graph_bipartite::Graph</a> G2(</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> 3); <span class="comment">/// creating graph G2 with 3 vertices</span><span class="comment"></span></div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span><span class="comment"> /// adding edges to the graphs as per the illustrated example</span></div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span><span class="comment"></span> G2.addEdge(1, 2);</div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> G2.addEdge(1, 3);</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> G2.addEdge(2, 3);</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span><span class="comment"> /// checking whether the graphs are bipartite or not</span></div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span><span class="comment"></span> <span class="keywordflow">if</span> (G1.is_bipartite()) {</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The given graph G1 is a bipartite graph\n"</span>;</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The given graph G1 is not a bipartite graph\n"</span>;</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> }</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordflow">if</span> (G2.is_bipartite()) {</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The given graph G2 is a bipartite graph\n"</span>;</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"The given graph G2 is not a bipartite graph\n"</span>;</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> }</div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span>}</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:51</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d6/dd8/is__graph__bipartite_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="476" height="118"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d6/dd8/is__graph__bipartite_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="272" height="118"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -256,7 +255,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="../../d6/dd8/is__graph__bipartite_8cpp.html">is_graph_bipartite.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.1 </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.2 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var is__graph__bipartite_8cpp =
|
||||
[
|
||||
[ "Graph", "de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html", "de/d00/classgraph_1_1is__graph__bipartite_1_1_graph" ],
|
||||
[ "graph::is_graph_bipartite::Graph", "de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html", "de/d00/classgraph_1_1is__graph__bipartite_1_1_graph" ],
|
||||
[ "main", "d6/dd8/is__graph__bipartite_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "test", "d6/dd8/is__graph__bipartite_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -1,6 +1,5 @@
|
||||
<map id="test" name="test">
|
||||
<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,267,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,267,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="315,13,471,39"/>
|
||||
<area shape="rect" id="node3" 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,267,112"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
4e0be744b75f883f63641c5d23dc6807
|
||||
0ceef407870c21cf2311ef42463b3d10
|
||||
@@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.48.0 (20210717.1556)
|
||||
<!-- Generated by graphviz version 2.49.0 (20210828.1703)
|
||||
-->
|
||||
<!-- Title: test Pages: 1 -->
|
||||
<svg width="357pt" height="88pt"
|
||||
viewBox="0.00 0.00 357.00 88.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="204pt" height="88pt"
|
||||
viewBox="0.00 0.00 204.00 88.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 84)">
|
||||
<title>test</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-84 353,-84 353,4 -4,4"/>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-84 200,-84 200,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
@@ -34,36 +34,21 @@
|
||||
<path fill="none" stroke="midnightblue" d="M33.35,-42.98C40.51,-44.55 49.52,-46.52 59.17,-48.64"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="58.46,-52.07 68.98,-50.79 59.96,-45.23 58.46,-52.07"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html#a9b0c6400693a5cfff971f768dd5ca5ca" target="_top" xlink:title="function to add edges to our graph">
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html#a9b0c6400693a5cfff971f768dd5ca5ca" target="_top" xlink:title="function to add edges to our graph">
|
||||
<polygon fill="white" stroke="black" points="69,-0.5 69,-30.5 196,-30.5 196,-0.5 69,-0.5"/>
|
||||
<text text-anchor="start" x="77" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::is_graph_bipartite</text>
|
||||
<text text-anchor="middle" x="132.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Graph::is_bipartite</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M33.35,-36.16C40.51,-34.66 49.52,-32.76 59.17,-30.73"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="59.91,-34.15 68.98,-28.66 58.47,-27.3 59.91,-34.15"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="232,-55 232,-74 349,-74 349,-55 232,-55"/>
|
||||
<text text-anchor="middle" x="290.5" y="-62" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M196.05,-64.5C204.58,-64.5 213.37,-64.5 221.98,-64.5"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="221.99,-68 231.99,-64.5 221.99,-61 221.99,-68"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.7 KiB |
@@ -2,6 +2,5 @@
|
||||
<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=" " 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,365,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,365,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="413,13,569,39"/>
|
||||
<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="196,71,365,112"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
a3358a1d81e2e5c2a495fb90f5aad915
|
||||
9375e93b0aa141b70a155590b6dadc50
|
||||
@@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.48.0 (20210717.1556)
|
||||
<!-- Generated by graphviz version 2.49.0 (20210828.1703)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="431pt" height="88pt"
|
||||
viewBox="0.00 0.00 431.00 88.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="278pt" height="88pt"
|
||||
viewBox="0.00 0.00 278.00 88.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 84)">
|
||||
<title>main</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-84 427,-84 427,4 -4,4"/>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-84 274,-84 274,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
@@ -49,36 +49,21 @@
|
||||
<path fill="none" stroke="midnightblue" d="M107.35,-42.98C114.51,-44.55 123.52,-46.52 133.17,-48.64"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="132.46,-52.07 142.98,-50.79 133.96,-45.23 132.46,-52.07"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html#a9b0c6400693a5cfff971f768dd5ca5ca" target="_top" xlink:title="function to add edges to our graph">
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../de/d00/classgraph_1_1is__graph__bipartite_1_1_graph.html#a9b0c6400693a5cfff971f768dd5ca5ca" target="_top" xlink:title="function to add edges to our graph">
|
||||
<polygon fill="white" stroke="black" points="143,-0.5 143,-30.5 270,-30.5 270,-0.5 143,-0.5"/>
|
||||
<text text-anchor="start" x="151" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::is_graph_bipartite</text>
|
||||
<text text-anchor="middle" x="206.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::Graph::is_bipartite</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node2->Node5</title>
|
||||
<!-- Node2->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node2->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M107.35,-36.16C114.51,-34.66 123.52,-32.76 133.17,-30.73"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="133.91,-34.15 142.98,-28.66 132.47,-27.3 133.91,-34.15"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="306,-55 306,-74 423,-74 423,-55 306,-55"/>
|
||||
<text text-anchor="middle" x="364.5" y="-62" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node3->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M270.05,-64.5C278.58,-64.5 287.37,-64.5 295.98,-64.5"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="295.99,-68 305.99,-64.5 295.99,-61 295.99,-68"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.4 KiB |
Reference in New Issue
Block a user