mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-16 11:32:44 +08:00
Documentation for 8b1eab204b
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
@@ -5,10 +6,15 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: graph/connected_components.cpp File Reference</title>
|
||||
<title>TheAlgorithms/C++: graph/connected_components.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
@@ -18,14 +24,24 @@
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<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"],
|
||||
});
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</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>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -122,7 +139,9 @@ Include dependency graph for connected_components.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d77/connected__components_8cpp__incl.svg" width="350" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
</div>
|
||||
<p><a href="../../df/ddd/connected__components_8cpp_source.html">Go to the source code of this file.</a></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:"><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>
|
||||
@@ -131,13 +150,13 @@ Namespaces</h2></td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a9125ceb66bfbec3093bba64c2c1e99e2" id="r_a9125ceb66bfbec3093bba64c2c1e99e2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< int > > *adj, int u, int v)</td></tr>
|
||||
<tr class="memitem:a9125ceb66bfbec3093bba64c2c1e99e2" id="r_a9125ceb66bfbec3093bba64c2c1e99e2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a> (std::vector< std::vector< int > > *adj, int u, int v)</td></tr>
|
||||
<tr class="memdesc:a9125ceb66bfbec3093bba64c2c1e99e2"><td class="mdescLeft"> </td><td class="mdescRight">Function that add edge between two nodes or vertices of graph. <br /></td></tr>
|
||||
<tr class="separator:a9125ceb66bfbec3093bba64c2c1e99e2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a3ae80bc4c6a79d041b4f3a6589eb7fb8" id="r_a3ae80bc4c6a79d041b4f3a6589eb7fb8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8">graph::explore</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< int > > *adj, int u, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< bool > *visited)</td></tr>
|
||||
<tr class="memitem:a3ae80bc4c6a79d041b4f3a6589eb7fb8" id="r_a3ae80bc4c6a79d041b4f3a6589eb7fb8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8">graph::explore</a> (const std::vector< std::vector< int > > *adj, int u, std::vector< bool > *visited)</td></tr>
|
||||
<tr class="memdesc:a3ae80bc4c6a79d041b4f3a6589eb7fb8"><td class="mdescLeft"> </td><td class="mdescRight">Utility function for depth first seach algorithm this function explores the vertex which is passed into. <br /></td></tr>
|
||||
<tr class="separator:a3ae80bc4c6a79d041b4f3a6589eb7fb8"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a83ab16e96cec644109a58dfc9329bc2b" id="r_a83ab16e96cec644109a58dfc9329bc2b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< int > > *adj)</td></tr>
|
||||
<tr class="memitem:a83ab16e96cec644109a58dfc9329bc2b" id="r_a83ab16e96cec644109a58dfc9329bc2b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a> (const std::vector< std::vector< int > > *adj)</td></tr>
|
||||
<tr class="memdesc:a83ab16e96cec644109a58dfc9329bc2b"><td class="mdescLeft"> </td><td class="mdescRight">Function that perfoms depth first search algorithm on graph and calculated the number of connected components. <br /></td></tr>
|
||||
<tr class="separator:a83ab16e96cec644109a58dfc9329bc2b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a88ec9ad42717780d6caaff9d3d6977f9" id="r_a88ec9ad42717780d6caaff9d3d6977f9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a> ()</td></tr>
|
||||
@@ -158,7 +177,9 @@ Example - Here is graph with 3 connected components
|
||||
|
||||
first second third
|
||||
component component component
|
||||
</pre> </div><h2 class="groupheader">Function Documentation</h2>
|
||||
</pre>
|
||||
<p class="definition">Definition in file <a class="el" href="../../df/ddd/connected__components_8cpp_source.html">connected_components.cpp</a>.</p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
|
||||
@@ -175,41 +196,33 @@ Example - Here is graph with 3 connected components
|
||||
</div><div class="memdoc">
|
||||
<p>Main function </p>
|
||||
<p>running predefined tests</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 127</span> {<span class="comment"></span></div>
|
||||
<div class="line"><span class="lineno"> 128</span><span class="comment"> /// running predefined tests</span></div>
|
||||
<div class="line"><span class="lineno"> 129</span><span class="comment"></span> <a class="code hl_function" href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../df/ddd/connected__components_8cpp_source.html#l00127">127</a> of file <a class="el" href="../../df/ddd/connected__components_8cpp_source.html">connected_components.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 127</span> {</div>
|
||||
<div class="line"><span class="lineno"> 129</span> <a class="code hl_function" href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
|
||||
<div class="line"><span class="lineno"> 130</span> </div>
|
||||
<div class="line"><span class="lineno"> 131</span> <span class="keywordtype">int</span> vertices = int(), edges = int();</div>
|
||||
<div class="line"><span class="lineno"> 132</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">"Enter the number of vertices : "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 133</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> vertices;</div>
|
||||
<div class="line"><span class="lineno"> 134</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">"Enter the number of edges : "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 135</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> edges;</div>
|
||||
<div class="line"><span class="lineno"> 132</span> std::cout << <span class="stringliteral">"Enter the number of vertices : "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 133</span> std::cin >> vertices;</div>
|
||||
<div class="line"><span class="lineno"> 134</span> std::cout << <span class="stringliteral">"Enter the number of edges : "</span>;</div>
|
||||
<div class="line"><span class="lineno"> 135</span> std::cin >> edges;</div>
|
||||
<div class="line"><span class="lineno"> 136</span> </div>
|
||||
<div class="line"><span class="lineno"> 137</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<int></a>> adj(vertices, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a>());</div>
|
||||
<div class="line"><span class="lineno"> 137</span> std::vector<std::vector<int>> adj(vertices, std::vector<int>());</div>
|
||||
<div class="line"><span class="lineno"> 138</span> </div>
|
||||
<div class="line"><span class="lineno"> 139</span> <span class="keywordtype">int</span> u = int(), v = int();</div>
|
||||
<div class="line"><span class="lineno"> 140</span> <span class="keywordflow">while</span> (edges--) {</div>
|
||||
<div class="line"><span class="lineno"> 141</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> u >> v;</div>
|
||||
<div class="line"><span class="lineno"> 141</span> std::cin >> u >> v;</div>
|
||||
<div class="line"><span class="lineno"> 142</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj, u, v);</div>
|
||||
<div class="line"><span class="lineno"> 143</span> }</div>
|
||||
<div class="line"><span class="lineno"> 144</span> </div>
|
||||
<div class="line"><span class="lineno"> 145</span> <span class="keywordtype">int</span> cc = <a class="code hl_function" href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a>(&adj);</div>
|
||||
<div class="line"><span class="lineno"> 146</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << cc << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 146</span> std::cout << cc << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 147</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 148</span>}</div>
|
||||
<div class="ttc" id="abasic_istream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a></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="aconnected__components_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition</b> connected_components.cpp:93</div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="anamespacegraph_html_a83ab16e96cec644109a58dfc9329bc2b"><div class="ttname"><a href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a></div><div class="ttdeci">int getConnectedComponents(const std::vector< std::vector< int > > *adj)</div><div class="ttdoc">Function that perfoms depth first search algorithm on graph and calculated the number of connected co...</div><div class="ttdef"><b>Definition</b> connected_components.cpp:77</div></div>
|
||||
<div class="ttc" id="anamespacegraph_html_a9125ceb66bfbec3093bba64c2c1e99e2"><div class="ttname"><a href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a></div><div class="ttdeci">void addEdge(std::vector< std::vector< int > > *adj, int u, int v)</div><div class="ttdoc">Function that add edge between two nodes or vertices of graph.</div><div class="ttdef"><b>Definition</b> connected_components.cpp:46</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></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="../../df/ddd/connected__components_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="587" height="186"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="aconnected__components_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition</b> <a href="../../df/ddd/connected__components_8cpp_source.html#l00093">connected_components.cpp:93</a></div></div>
|
||||
<div class="ttc" id="anamespacegraph_html_a83ab16e96cec644109a58dfc9329bc2b"><div class="ttname"><a href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a></div><div class="ttdeci">int getConnectedComponents(const std::vector< std::vector< int > > *adj)</div><div class="ttdoc">Function that perfoms depth first search algorithm on graph and calculated the number of connected co...</div><div class="ttdef"><b>Definition</b> <a href="../../df/ddd/connected__components_8cpp_source.html#l00077">connected_components.cpp:77</a></div></div>
|
||||
<div class="ttc" id="anamespacegraph_html_a9125ceb66bfbec3093bba64c2c1e99e2"><div class="ttname"><a href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a></div><div class="ttdeci">void addEdge(std::vector< std::vector< int > > *adj, int u, int v)</div><div class="ttdoc">Function that add edge between two nodes or vertices of graph.</div><div class="ttdef"><b>Definition</b> <a href="../../df/ddd/connected__components_8cpp_source.html#l00046">connected_components.cpp:46</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a88ec9ad42717780d6caaff9d3d6977f9" name="a88ec9ad42717780d6caaff9d3d6977f9"></a>
|
||||
@@ -227,10 +240,12 @@ Here is the call graph for this function:</div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Function to test the algorithm </p>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../df/ddd/connected__components_8cpp_source.html#l00093">93</a> of file <a class="el" href="../../df/ddd/connected__components_8cpp_source.html">connected_components.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 93</span> {</div>
|
||||
<div class="line"><span class="lineno"> 94</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">"Running predefined tests..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 95</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">"Initiating Test 1..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 96</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<int></a>> adj1(9, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a>());</div>
|
||||
<div class="line"><span class="lineno"> 94</span> std::cout << <span class="stringliteral">"Running predefined tests..."</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 95</span> std::cout << <span class="stringliteral">"Initiating Test 1..."</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 96</span> std::vector<std::vector<int>> adj1(9, std::vector<int>());</div>
|
||||
<div class="line"><span class="lineno"> 97</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj1, 1, 2);</div>
|
||||
<div class="line"><span class="lineno"> 98</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj1, 1, 3);</div>
|
||||
<div class="line"><span class="lineno"> 99</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj1, 3, 4);</div>
|
||||
@@ -239,10 +254,10 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 102</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj1, 8, 9);</div>
|
||||
<div class="line"><span class="lineno"> 103</span> </div>
|
||||
<div class="line"><span class="lineno"> 104</span> assert(<a class="code hl_function" href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a>(&adj1) == 3);</div>
|
||||
<div class="line"><span class="lineno"> 105</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">"Test 1 Passed..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 105</span> std::cout << <span class="stringliteral">"Test 1 Passed..."</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 106</span> </div>
|
||||
<div class="line"><span class="lineno"> 107</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">"Innitiating Test 2..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 108</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::vector<int></a>> adj2(10, <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int></a>());</div>
|
||||
<div class="line"><span class="lineno"> 107</span> std::cout << <span class="stringliteral">"Innitiating Test 2..."</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 108</span> std::vector<std::vector<int>> adj2(10, std::vector<int>());</div>
|
||||
<div class="line"><span class="lineno"> 109</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 1, 2);</div>
|
||||
<div class="line"><span class="lineno"> 110</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 1, 3);</div>
|
||||
<div class="line"><span class="lineno"> 111</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 1, 4);</div>
|
||||
@@ -257,14 +272,9 @@ Here is the call graph for this function:</div>
|
||||
<div class="line"><span class="lineno"> 120</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 6, 7);</div>
|
||||
<div class="line"><span class="lineno"> 121</span> </div>
|
||||
<div class="line"><span class="lineno"> 122</span> assert(<a class="code hl_function" href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a>(&adj2) == 2);</div>
|
||||
<div class="line"><span class="lineno"> 123</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">"Test 2 Passed..."</span> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 123</span> std::cout << <span class="stringliteral">"Test 2 Passed..."</span> << std::endl;</div>
|
||||
<div class="line"><span class="lineno"> 124</span>}</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="../../df/ddd/connected__components_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg" width="490" height="159"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
<map id="tests" name="tests">
|
||||
<area shape="rect" id="Node000001" title=" " alt="" coords="5,55,56,80"/>
|
||||
<area shape="rect" id="Node000002" href="$df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2" title="Function that add edge between two nodes or vertices of graph." alt="" coords="156,5,268,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="55,56,103,40,140,30,141,35,104,45,57,61"/>
|
||||
<area shape="rect" id="Node000003" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="176,55,248,80"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="56,65,161,65,161,70,56,70"/>
|
||||
<area shape="rect" id="Node000004" href="$df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b" title="Function that perfoms depth first search algorithm on graph and calculated the number of connected co..." alt="" coords="104,104,320,130"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="57,74,104,90,132,97,130,103,103,95,55,79"/>
|
||||
<area shape="rect" id="Node000005" href="$df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8" title="Utility function for depth first seach algorithm this function explores the vertex which is passed in..." alt="" coords="374,79,477,104"/>
|
||||
<area shape="poly" id="edge4_Node000004_Node000005" title=" " alt="" coords="320,101,358,97,359,102,321,107"/>
|
||||
<area shape="rect" id="Node000006" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="368,128,483,154"/>
|
||||
<area shape="poly" id="edge6_Node000004_Node000006" title=" " alt="" coords="321,126,353,130,352,135,320,132"/>
|
||||
<area shape="poly" id="edge5_Node000005_Node000005" title=" " alt="" coords="390,80,383,70,387,60,402,54,426,52,452,55,465,62,463,66,450,60,426,57,403,59,391,64,388,69,394,77"/>
|
||||
</map>
|
||||
@@ -1 +0,0 @@
|
||||
ce9123d675422e0f6d8bc9543678e05d
|
||||
@@ -1,146 +0,0 @@
|
||||
<?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 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: tests Pages: 1 -->
|
||||
<svg width="367pt" height="119pt"
|
||||
viewBox="0.00 0.00 366.50 119.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 115.25)">
|
||||
<title>tests</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title=" ">
|
||||
<polygon fill="#999999" stroke="#666666" points="37.75,-74.25 0,-74.25 0,-55 37.75,-55 37.75,-74.25"/>
|
||||
<text text-anchor="middle" x="18.88" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2" target="_top" xlink:title="Function that add edge between two nodes or vertices of graph.">
|
||||
<polygon fill="white" stroke="#666666" points="197,-111.25 112.75,-111.25 112.75,-92 197,-92 197,-111.25"/>
|
||||
<text text-anchor="middle" x="154.88" y="-97.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::addEdge</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M38.15,-71.68C48.5,-75.51 61.74,-80.17 73.75,-83.62 82.61,-86.17 92.12,-88.58 101.37,-90.76"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="100.46,-94.15 110.99,-92.96 102.02,-87.32 100.46,-94.15"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="181.62,-74.25 128.12,-74.25 128.12,-55 181.62,-55 181.62,-74.25"/>
|
||||
<text text-anchor="middle" x="154.88" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M38.23,-64.62C58.27,-64.62 90.93,-64.62 116.44,-64.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="116.43,-68.13 126.43,-64.63 116.43,-61.13 116.43,-68.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b" target="_top" xlink:title="Function that perfoms depth first search algorithm on graph and calculated the number of connected co...">
|
||||
<polygon fill="white" stroke="#666666" points="236,-37.25 73.75,-37.25 73.75,-18 236,-18 236,-37.25"/>
|
||||
<text text-anchor="middle" x="154.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::getConnectedComponents</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M38.15,-57.57C48.5,-53.74 61.74,-49.08 73.75,-45.62 80.31,-43.74 87.23,-41.93 94.13,-40.23"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="94.52,-43.73 103.44,-38.01 92.9,-36.92 94.52,-43.73"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8" target="_top" xlink:title="Utility function for depth first seach algorithm this function explores the vertex which is passed in...">
|
||||
<polygon fill="white" stroke="#666666" points="354,-56.25 276.5,-56.25 276.5,-37 354,-37 354,-56.25"/>
|
||||
<text text-anchor="middle" x="315.25" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::explore</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node5 -->
|
||||
<g id="edge4_Node000004_Node000005" class="edge">
|
||||
<title>Node4->Node5</title>
|
||||
<g id="a_edge4_Node000004_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M236.45,-37.29C246.23,-38.47 255.98,-39.63 265.11,-40.73"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="264.44,-44.17 274.79,-41.89 265.27,-37.22 264.44,-44.17"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="358.5,-19.25 272,-19.25 272,0 358.5,0 358.5,-19.25"/>
|
||||
<text text-anchor="middle" x="315.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node6 -->
|
||||
<g id="edge6_Node000004_Node000006" class="edge">
|
||||
<title>Node4->Node6</title>
|
||||
<g id="a_edge6_Node000004_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M236.45,-18.47C244.57,-17.54 252.67,-16.62 260.41,-15.74"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="260.79,-19.22 270.33,-14.62 260,-12.27 260.79,-19.22"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node5 -->
|
||||
<g id="edge5_Node000005_Node000005" class="edge">
|
||||
<title>Node5->Node5</title>
|
||||
<g id="a_edge5_Node000005_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M290.14,-56.54C278.69,-65.15 287.06,-74.25 315.25,-74.25 331.11,-74.25 340.69,-71.37 344.01,-67.32"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="347.37,-66.32 340.84,-57.97 340.73,-68.57 347.37,-66.32"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 6.4 KiB |
@@ -1,120 +0,0 @@
|
||||
<?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 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: tests Pages: 1 -->
|
||||
<svg width="367pt" height="119pt"
|
||||
viewBox="0.00 0.00 366.50 119.25" 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 115.25)">
|
||||
<title>tests</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title=" ">
|
||||
<polygon fill="#999999" stroke="#666666" points="37.75,-74.25 0,-74.25 0,-55 37.75,-55 37.75,-74.25"/>
|
||||
<text text-anchor="middle" x="18.88" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2" target="_top" xlink:title="Function that add edge between two nodes or vertices of graph.">
|
||||
<polygon fill="white" stroke="#666666" points="197,-111.25 112.75,-111.25 112.75,-92 197,-92 197,-111.25"/>
|
||||
<text text-anchor="middle" x="154.88" y="-97.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::addEdge</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M38.15,-71.68C48.5,-75.51 61.74,-80.17 73.75,-83.62 82.61,-86.17 92.12,-88.58 101.37,-90.76"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="100.46,-94.15 110.99,-92.96 102.02,-87.32 100.46,-94.15"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="181.62,-74.25 128.12,-74.25 128.12,-55 181.62,-55 181.62,-74.25"/>
|
||||
<text text-anchor="middle" x="154.88" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M38.23,-64.62C58.27,-64.62 90.93,-64.62 116.44,-64.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="116.43,-68.13 126.43,-64.63 116.43,-61.13 116.43,-68.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b" target="_top" xlink:title="Function that perfoms depth first search algorithm on graph and calculated the number of connected co...">
|
||||
<polygon fill="white" stroke="#666666" points="236,-37.25 73.75,-37.25 73.75,-18 236,-18 236,-37.25"/>
|
||||
<text text-anchor="middle" x="154.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::getConnectedComponents</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M38.15,-57.57C48.5,-53.74 61.74,-49.08 73.75,-45.62 80.31,-43.74 87.23,-41.93 94.13,-40.23"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="94.52,-43.73 103.44,-38.01 92.9,-36.92 94.52,-43.73"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8" target="_top" xlink:title="Utility function for depth first seach algorithm this function explores the vertex which is passed in...">
|
||||
<polygon fill="white" stroke="#666666" points="354,-56.25 276.5,-56.25 276.5,-37 354,-37 354,-56.25"/>
|
||||
<text text-anchor="middle" x="315.25" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::explore</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node5 -->
|
||||
<g id="edge4_Node000004_Node000005" class="edge">
|
||||
<title>Node4->Node5</title>
|
||||
<g id="a_edge4_Node000004_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M236.45,-37.29C246.23,-38.47 255.98,-39.63 265.11,-40.73"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="264.44,-44.17 274.79,-41.89 265.27,-37.22 264.44,-44.17"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="358.5,-19.25 272,-19.25 272,0 358.5,0 358.5,-19.25"/>
|
||||
<text text-anchor="middle" x="315.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node6 -->
|
||||
<g id="edge6_Node000004_Node000006" class="edge">
|
||||
<title>Node4->Node6</title>
|
||||
<g id="a_edge6_Node000004_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M236.45,-18.47C244.57,-17.54 252.67,-16.62 260.41,-15.74"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="260.79,-19.22 270.33,-14.62 260,-12.27 260.79,-19.22"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node5 -->
|
||||
<g id="edge5_Node000005_Node000005" class="edge">
|
||||
<title>Node5->Node5</title>
|
||||
<g id="a_edge5_Node000005_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M290.14,-56.54C278.69,-65.15 287.06,-74.25 315.25,-74.25 331.11,-74.25 340.69,-71.37 344.01,-67.32"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="347.37,-66.32 340.84,-57.97 340.73,-68.57 347.37,-66.32"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.7 KiB |
@@ -1,19 +0,0 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="Node000001" title=" " alt="" coords="5,56,55,82"/>
|
||||
<area shape="rect" id="Node000002" href="$df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2" title="Function that add edge between two nodes or vertices of graph." alt="" coords="253,5,365,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="43,54,69,33,102,16,136,8,171,4,238,5,237,11,171,9,137,13,104,21,72,37,46,58"/>
|
||||
<area shape="rect" id="Node000003" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="274,81,345,107"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="55,68,258,87,258,92,55,74"/>
|
||||
<area shape="rect" id="Node000004" href="$df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b" title="Function that perfoms depth first search algorithm on graph and calculated the number of connected co..." alt="" coords="201,131,417,156"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="56,74,202,117,230,124,229,129,200,122,54,79"/>
|
||||
<area shape="rect" id="Node000007" href="$df/ddd/connected__components_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9" title=" " alt="" coords="103,31,153,56"/>
|
||||
<area shape="poly" id="edge7_Node000001_Node000007" title=" " alt="" coords="54,60,87,51,89,56,56,65"/>
|
||||
<area shape="rect" id="Node000005" href="$df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8" title="Utility function for depth first seach algorithm this function explores the vertex which is passed in..." alt="" coords="471,105,575,131"/>
|
||||
<area shape="poly" id="edge4_Node000004_Node000005" title=" " alt="" coords="418,128,456,124,456,129,418,133"/>
|
||||
<area shape="rect" id="Node000006" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/size.html#" title=" " alt="" coords="465,155,581,180"/>
|
||||
<area shape="poly" id="edge6_Node000004_Node000006" title=" " alt="" coords="418,153,450,157,450,162,418,159"/>
|
||||
<area shape="poly" id="edge5_Node000005_Node000005" title=" " alt="" coords="487,107,480,97,485,87,499,81,523,79,549,82,563,88,560,93,548,87,523,84,500,86,488,91,486,96,492,103"/>
|
||||
<area shape="poly" id="edge8_Node000007_Node000002" title=" " alt="" coords="153,38,237,26,238,31,154,43"/>
|
||||
<area shape="poly" id="edge9_Node000007_Node000003" title=" " alt="" coords="154,48,260,78,258,83,153,53"/>
|
||||
<area shape="poly" id="edge10_Node000007_Node000004" title=" " alt="" coords="140,55,165,87,183,104,202,117,212,122,210,127,200,122,179,108,161,90,136,58"/>
|
||||
</map>
|
||||
@@ -1 +0,0 @@
|
||||
c0d479d766f2b8778d6accfacb3568a3
|
||||
@@ -1,191 +0,0 @@
|
||||
<?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 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="440pt" height="139pt"
|
||||
viewBox="0.00 0.00 439.50 139.37" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 135.37)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title=" ">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-93.25 0,-93.25 0,-74 37,-74 37,-93.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-79.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2" target="_top" xlink:title="Function that add edge between two nodes or vertices of graph.">
|
||||
<polygon fill="white" stroke="#666666" points="270,-131.25 185.75,-131.25 185.75,-112 270,-112 270,-131.25"/>
|
||||
<text text-anchor="middle" x="227.88" y="-117.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::addEdge</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M29.48,-93.66C39.49,-102.96 55.85,-116.15 73,-121.62 105.5,-131.99 143.86,-132.02 174.15,-129.44"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="174.22,-132.95 183.83,-128.49 173.53,-125.98 174.22,-132.95"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="254.62,-74.25 201.12,-74.25 201.12,-55 254.62,-55 254.62,-74.25"/>
|
||||
<text text-anchor="middle" x="227.88" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.18,-82.01C70.81,-78.92 144.63,-72.16 189.62,-68.04"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="189.8,-71.54 199.44,-67.14 189.16,-64.57 189.8,-71.54"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b" target="_top" xlink:title="Function that perfoms depth first search algorithm on graph and calculated the number of connected co...">
|
||||
<polygon fill="white" stroke="#666666" points="309,-37.25 146.75,-37.25 146.75,-18 309,-18 309,-37.25"/>
|
||||
<text text-anchor="middle" x="227.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::getConnectedComponents</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.09,-77.95C61.55,-70.16 107.27,-55.94 146.75,-45.62 153.71,-43.81 161.04,-42 168.33,-40.28"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="168.86,-43.75 177.82,-38.09 167.28,-36.93 168.86,-43.75"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:href="../../df/ddd/connected__components_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="110.75,-112.25 73,-112.25 73,-93 110.75,-93 110.75,-112.25"/>
|
||||
<text text-anchor="middle" x="91.88" y="-98.75" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node7 -->
|
||||
<g id="edge7_Node000001_Node000007" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<g id="a_edge7_Node000001_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.14,-88.32C44.64,-90.32 53.57,-92.69 61.98,-94.93"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="60.91,-98.27 71.48,-97.46 62.71,-91.51 60.91,-98.27"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8" target="_top" xlink:title="Utility function for depth first seach algorithm this function explores the vertex which is passed in...">
|
||||
<polygon fill="white" stroke="#666666" points="427,-56.25 349.5,-56.25 349.5,-37 427,-37 427,-56.25"/>
|
||||
<text text-anchor="middle" x="388.25" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::explore</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node5 -->
|
||||
<g id="edge4_Node000004_Node000005" class="edge">
|
||||
<title>Node4->Node5</title>
|
||||
<g id="a_edge4_Node000004_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M309.45,-37.29C319.23,-38.47 328.98,-39.63 338.11,-40.73"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="337.44,-44.17 347.79,-41.89 338.27,-37.22 337.44,-44.17"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="431.5,-19.25 345,-19.25 345,0 431.5,0 431.5,-19.25"/>
|
||||
<text text-anchor="middle" x="388.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node6 -->
|
||||
<g id="edge6_Node000004_Node000006" class="edge">
|
||||
<title>Node4->Node6</title>
|
||||
<g id="a_edge6_Node000004_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M309.45,-18.47C317.57,-17.54 325.67,-16.62 333.41,-15.74"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="333.79,-19.22 343.33,-14.62 333,-12.27 333.79,-19.22"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node5 -->
|
||||
<g id="edge5_Node000005_Node000005" class="edge">
|
||||
<title>Node5->Node5</title>
|
||||
<g id="a_edge5_Node000005_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M363.14,-56.54C351.69,-65.15 360.06,-74.25 388.25,-74.25 404.11,-74.25 413.69,-71.37 417.01,-67.32"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="420.37,-66.32 413.84,-57.97 413.73,-68.57 420.37,-66.32"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7->Node2 -->
|
||||
<g id="edge8_Node000007_Node000002" class="edge">
|
||||
<title>Node7->Node2</title>
|
||||
<g id="a_edge8_Node000007_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M111.23,-105.23C127.4,-107.52 151.78,-110.98 174,-114.13"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="173.47,-117.59 183.86,-115.53 174.45,-110.66 173.47,-117.59"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7->Node3 -->
|
||||
<g id="edge9_Node000007_Node000003" class="edge">
|
||||
<title>Node7->Node3</title>
|
||||
<g id="a_edge9_Node000007_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M111.23,-97.42C131.46,-91.68 164.52,-82.31 190.13,-75.05"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="190.82,-78.49 199.49,-72.39 188.91,-71.75 190.82,-78.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7->Node4 -->
|
||||
<g id="edge10_Node000007_Node000004" class="edge">
|
||||
<title>Node7->Node4</title>
|
||||
<g id="a_edge10_Node000007_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M99.27,-92.88C108.27,-79.97 125.92,-57.48 146.75,-45.62 149.1,-44.29 151.55,-43.05 154.06,-41.9"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="155.26,-45.19 163.26,-38.24 152.68,-38.68 155.26,-45.19"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 8.5 KiB |
@@ -1,165 +0,0 @@
|
||||
<?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 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="440pt" height="139pt"
|
||||
viewBox="0.00 0.00 439.50 139.37" 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 135.37)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title=" ">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-93.25 0,-93.25 0,-74 37,-74 37,-93.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-79.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2" target="_top" xlink:title="Function that add edge between two nodes or vertices of graph.">
|
||||
<polygon fill="white" stroke="#666666" points="270,-131.25 185.75,-131.25 185.75,-112 270,-112 270,-131.25"/>
|
||||
<text text-anchor="middle" x="227.88" y="-117.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::addEdge</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M29.48,-93.66C39.49,-102.96 55.85,-116.15 73,-121.62 105.5,-131.99 143.86,-132.02 174.15,-129.44"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="174.22,-132.95 183.83,-128.49 173.53,-125.98 174.22,-132.95"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="254.62,-74.25 201.12,-74.25 201.12,-55 254.62,-55 254.62,-74.25"/>
|
||||
<text text-anchor="middle" x="227.88" y="-60.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.18,-82.01C70.81,-78.92 144.63,-72.16 189.62,-68.04"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="189.8,-71.54 199.44,-67.14 189.16,-64.57 189.8,-71.54"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b" target="_top" xlink:title="Function that perfoms depth first search algorithm on graph and calculated the number of connected co...">
|
||||
<polygon fill="white" stroke="#666666" points="309,-37.25 146.75,-37.25 146.75,-18 309,-18 309,-37.25"/>
|
||||
<text text-anchor="middle" x="227.88" y="-23.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::getConnectedComponents</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.09,-77.95C61.55,-70.16 107.27,-55.94 146.75,-45.62 153.71,-43.81 161.04,-42 168.33,-40.28"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="168.86,-43.75 177.82,-38.09 167.28,-36.93 168.86,-43.75"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:href="../../df/ddd/connected__components_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="110.75,-112.25 73,-112.25 73,-93 110.75,-93 110.75,-112.25"/>
|
||||
<text text-anchor="middle" x="91.88" y="-98.75" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node7 -->
|
||||
<g id="edge7_Node000001_Node000007" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<g id="a_edge7_Node000001_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.14,-88.32C44.64,-90.32 53.57,-92.69 61.98,-94.93"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="60.91,-98.27 71.48,-97.46 62.71,-91.51 60.91,-98.27"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8" target="_top" xlink:title="Utility function for depth first seach algorithm this function explores the vertex which is passed in...">
|
||||
<polygon fill="white" stroke="#666666" points="427,-56.25 349.5,-56.25 349.5,-37 427,-37 427,-56.25"/>
|
||||
<text text-anchor="middle" x="388.25" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">graph::explore</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node5 -->
|
||||
<g id="edge4_Node000004_Node000005" class="edge">
|
||||
<title>Node4->Node5</title>
|
||||
<g id="a_edge4_Node000004_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M309.45,-37.29C319.23,-38.47 328.98,-39.63 338.11,-40.73"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="337.44,-44.17 347.79,-41.89 338.27,-37.22 337.44,-44.17"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/size.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="431.5,-19.25 345,-19.25 345,0 431.5,0 431.5,-19.25"/>
|
||||
<text text-anchor="middle" x="388.25" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::size</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node6 -->
|
||||
<g id="edge6_Node000004_Node000006" class="edge">
|
||||
<title>Node4->Node6</title>
|
||||
<g id="a_edge6_Node000004_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M309.45,-18.47C317.57,-17.54 325.67,-16.62 333.41,-15.74"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="333.79,-19.22 343.33,-14.62 333,-12.27 333.79,-19.22"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node5 -->
|
||||
<g id="edge5_Node000005_Node000005" class="edge">
|
||||
<title>Node5->Node5</title>
|
||||
<g id="a_edge5_Node000005_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M363.14,-56.54C351.69,-65.15 360.06,-74.25 388.25,-74.25 404.11,-74.25 413.69,-71.37 417.01,-67.32"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="420.37,-66.32 413.84,-57.97 413.73,-68.57 420.37,-66.32"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7->Node2 -->
|
||||
<g id="edge8_Node000007_Node000002" class="edge">
|
||||
<title>Node7->Node2</title>
|
||||
<g id="a_edge8_Node000007_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M111.23,-105.23C127.4,-107.52 151.78,-110.98 174,-114.13"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="173.47,-117.59 183.86,-115.53 174.45,-110.66 173.47,-117.59"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7->Node3 -->
|
||||
<g id="edge9_Node000007_Node000003" class="edge">
|
||||
<title>Node7->Node3</title>
|
||||
<g id="a_edge9_Node000007_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M111.23,-97.42C131.46,-91.68 164.52,-82.31 190.13,-75.05"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="190.82,-78.49 199.49,-72.39 188.91,-71.75 190.82,-78.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7->Node4 -->
|
||||
<g id="edge10_Node000007_Node000004" class="edge">
|
||||
<title>Node7->Node4</title>
|
||||
<g id="a_edge10_Node000007_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M99.27,-92.88C108.27,-79.97 125.92,-57.48 146.75,-45.62 149.1,-44.29 151.55,-43.05 154.06,-41.9"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="155.26,-45.19 163.26,-38.24 152.68,-38.68 155.26,-45.19"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.7 KiB |
244
df/ddd/connected__components_8cpp_source.html
Normal file
244
df/ddd/connected__components_8cpp_source.html
Normal file
@@ -0,0 +1,244 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<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.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: graph/connected_components.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.js"></script>
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('df/ddd/connected__components_8cpp_source.html','../../'); initResizable(true); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">connected_components.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../df/ddd/connected__components_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="preprocessor">#include <algorithm></span></div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#include <cassert></span></div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="preprocessor">#include <iostream></span></div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#include <vector></span></div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a> {</div>
|
||||
<div class="foldopen" id="foldopen00046" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2"> 46</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">addEdge</a>(std::vector<std::vector<int>> *adj, <span class="keywordtype">int</span> u, <span class="keywordtype">int</span> v) {</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> (*adj)[u - 1].push_back(v - 1);</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> (*adj)[v - 1].push_back(u - 1);</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||
<div class="foldopen" id="foldopen00059" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8"> 59</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8">explore</a>(<span class="keyword">const</span> std::vector<std::vector<int>> *adj, <span class="keywordtype">int</span> u,</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> std::vector<bool> *visited) {</div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> (*visited)[u] = <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> v : (*adj)[u]) {</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">if</span> (!(*visited)[v]) {</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8">explore</a>(adj, v, visited);</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> }</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
|
||||
<div class="foldopen" id="foldopen00077" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b"> 77</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">getConnectedComponents</a>(<span class="keyword">const</span> std::vector<std::vector<int>> *adj) {</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordtype">int</span> n = adj->size();</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordtype">int</span> connected_components = 0;</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> std::vector<bool> visited(n, <span class="keyword">false</span>);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < n; i++) {</div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">if</span> (!visited[i]) {</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8">explore</a>(adj, i, &visited);</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> connected_components++;</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> }</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> }</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">return</span> connected_components;</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span>} <span class="comment">// namespace graph</span></div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
|
||||
<div class="foldopen" id="foldopen00093" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="../../df/ddd/connected__components_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9"> 93</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="../../df/ddd/connected__components_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>() {</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> std::cout << <span class="stringliteral">"Running predefined tests..."</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> std::cout << <span class="stringliteral">"Initiating Test 1..."</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> std::vector<std::vector<int>> adj1(9, std::vector<int>());</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj1, 1, 2);</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj1, 1, 3);</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj1, 3, 4);</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj1, 5, 7);</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj1, 5, 6);</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj1, 8, 9);</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> assert(<a class="code hl_function" href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a>(&adj1) == 3);</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> std::cout << <span class="stringliteral">"Test 1 Passed..."</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> std::cout << <span class="stringliteral">"Innitiating Test 2..."</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::vector<std::vector<int>> adj2(10, std::vector<int>());</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 1, 2);</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 1, 3);</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 1, 4);</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 2, 3);</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 3, 4);</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 4, 8);</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 4, 10);</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 8, 10);</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 8, 9);</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 5, 7);</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 5, 6);</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj2, 6, 7);</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> </div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> assert(<a class="code hl_function" href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a>(&adj2) == 2);</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> std::cout << <span class="stringliteral">"Test 2 Passed..."</span> << std::endl;</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> </div>
|
||||
<div class="foldopen" id="foldopen00127" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"><a class="line" href="../../df/ddd/connected__components_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 127</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/ddd/connected__components_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <a class="code hl_function" href="../../df/ddd/connected__components_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>();</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordtype">int</span> vertices = int(), edges = int();</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> std::cout << <span class="stringliteral">"Enter the number of vertices : "</span>;</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> std::cin >> vertices;</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> std::cout << <span class="stringliteral">"Enter the number of edges : "</span>;</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> std::cin >> edges;</div>
|
||||
<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> std::vector<std::vector<int>> adj(vertices, std::vector<int>());</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> </div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <span class="keywordtype">int</span> u = int(), v = int();</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordflow">while</span> (edges--) {</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> std::cin >> u >> v;</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <a class="code hl_function" href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a>(&adj, u, v);</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> }</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> <span class="keywordtype">int</span> cc = <a class="code hl_function" href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a>(&adj);</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> std::cout << cc << std::endl;</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="aconnected__components_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="../../df/ddd/connected__components_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition</b> <a href="#l00093">connected_components.cpp:93</a></div></div>
|
||||
<div class="ttc" id="aconnected__components_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../df/ddd/connected__components_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdef"><b>Definition</b> <a href="#l00127">connected_components.cpp:127</a></div></div>
|
||||
<div class="ttc" id="anamespacegraph_html"><div class="ttname"><a href="../../df/dce/namespacegraph.html">graph</a></div><div class="ttdoc">Graph Algorithms.</div></div>
|
||||
<div class="ttc" id="anamespacegraph_html_a3ae80bc4c6a79d041b4f3a6589eb7fb8"><div class="ttname"><a href="../../df/dce/namespacegraph.html#a3ae80bc4c6a79d041b4f3a6589eb7fb8">graph::explore</a></div><div class="ttdeci">void explore(const std::vector< std::vector< int > > *adj, int u, std::vector< bool > *visited)</div><div class="ttdoc">Utility function for depth first seach algorithm this function explores the vertex which is passed in...</div><div class="ttdef"><b>Definition</b> <a href="#l00059">connected_components.cpp:59</a></div></div>
|
||||
<div class="ttc" id="anamespacegraph_html_a83ab16e96cec644109a58dfc9329bc2b"><div class="ttname"><a href="../../df/dce/namespacegraph.html#a83ab16e96cec644109a58dfc9329bc2b">graph::getConnectedComponents</a></div><div class="ttdeci">int getConnectedComponents(const std::vector< std::vector< int > > *adj)</div><div class="ttdoc">Function that perfoms depth first search algorithm on graph and calculated the number of connected co...</div><div class="ttdef"><b>Definition</b> <a href="#l00077">connected_components.cpp:77</a></div></div>
|
||||
<div class="ttc" id="anamespacegraph_html_a9125ceb66bfbec3093bba64c2c1e99e2"><div class="ttname"><a href="../../df/dce/namespacegraph.html#a9125ceb66bfbec3093bba64c2c1e99e2">graph::addEdge</a></div><div class="ttdeci">void addEdge(std::vector< std::vector< int > > *adj, int u, int v)</div><div class="ttdoc">Function that add edge between two nodes or vertices of graph.</div><div class="ttdef"><b>Definition</b> <a href="#l00046">connected_components.cpp:46</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<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/ddd/connected__components_8cpp.html">connected_components.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.12.0 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user