Documentation for 0931d530ae

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

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: graph/connected_components_with_dsu.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -129,22 +129,22 @@ Namespaces</h2></td></tr>
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae91ed94113c56191b75fe45f688d6e62"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d99/connected__components__with__dsu_8cpp.html#ae91ed94113c56191b75fe45f688d6e62">graph::disjoint_union::make_set</a> ()</td></tr>
<tr class="memdesc:ae91ed94113c56191b75fe45f688d6e62"><td class="mdescLeft">&#160;</td><td class="mdescRight">function the initialize every node as it's own parent <a href="../../d8/d99/connected__components__with__dsu_8cpp.html#ae91ed94113c56191b75fe45f688d6e62">More...</a><br /></td></tr>
<tr class="memdesc:ae91ed94113c56191b75fe45f688d6e62"><td class="mdescLeft">&#160;</td><td class="mdescRight">function the initialize every node as it's own parent <br /></td></tr>
<tr class="separator:ae91ed94113c56191b75fe45f688d6e62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a469384d8a4197a9b24482ce7c321a85e"><td class="memItemLeft" align="right" valign="top">int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d99/connected__components__with__dsu_8cpp.html#a469384d8a4197a9b24482ce7c321a85e">graph::disjoint_union::find_set</a> (int64_t val)</td></tr>
<tr class="memdesc:a469384d8a4197a9b24482ce7c321a85e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find the component where following node belongs to. <a href="../../d8/d99/connected__components__with__dsu_8cpp.html#a469384d8a4197a9b24482ce7c321a85e">More...</a><br /></td></tr>
<tr class="memdesc:a469384d8a4197a9b24482ce7c321a85e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find the component where following node belongs to. <br /></td></tr>
<tr class="separator:a469384d8a4197a9b24482ce7c321a85e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67cb7472f310a798f555fe45cdf50145"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d99/connected__components__with__dsu_8cpp.html#a67cb7472f310a798f555fe45cdf50145">graph::disjoint_union::union_sets</a> (int64_t node1, int64_t node2)</td></tr>
<tr class="memdesc:a67cb7472f310a798f555fe45cdf50145"><td class="mdescLeft">&#160;</td><td class="mdescRight">Merge 2 components to become one. <a href="../../d8/d99/connected__components__with__dsu_8cpp.html#a67cb7472f310a798f555fe45cdf50145">More...</a><br /></td></tr>
<tr class="memdesc:a67cb7472f310a798f555fe45cdf50145"><td class="mdescLeft">&#160;</td><td class="mdescRight">Merge 2 components to become one. <br /></td></tr>
<tr class="separator:a67cb7472f310a798f555fe45cdf50145"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2d6698b71384a352ec4b81b31b13141"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d99/connected__components__with__dsu_8cpp.html#ac2d6698b71384a352ec4b81b31b13141">graph::disjoint_union::no_of_connected_components</a> ()</td></tr>
<tr class="memdesc:ac2d6698b71384a352ec4b81b31b13141"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find total no. of connected components. <a href="../../d8/d99/connected__components__with__dsu_8cpp.html#ac2d6698b71384a352ec4b81b31b13141">More...</a><br /></td></tr>
<tr class="memdesc:ac2d6698b71384a352ec4b81b31b13141"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find total no. of connected components. <br /></td></tr>
<tr class="separator:ac2d6698b71384a352ec4b81b31b13141"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d99/connected__components__with__dsu_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test Implementations. <a href="../../d8/d99/connected__components__with__dsu_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">More...</a><br /></td></tr>
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test Implementations. <br /></td></tr>
<tr class="separator:aa8dca7b867074164d5f45b0f3851269d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d99/connected__components__with__dsu_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <a href="../../d8/d99/connected__components__with__dsu_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br /></td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function. <br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
@@ -160,11 +160,11 @@ uint32_t&#160;</td><td class="memItemRight" valign="bottom"><b>graph::disjoint_u
<tr class="separator:af675d8149b6a82cb7fa07f39210b8a2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p ><a href="https://en.wikipedia.org/wiki/Disjoint_union" target="_blank">Disjoint union</a> </p>
<p >The Disjoint union is the technique to find connected component in graph efficiently.</p>
<div class="textblock"><p><a href="https://en.wikipedia.org/wiki/Disjoint_union" target="_blank">Disjoint union</a> </p>
<p>The Disjoint union is the technique to find connected component in graph efficiently.</p>
<h3><a class="anchor" id="autotoc_md75"></a>
Algorithm</h3>
<p >In <a class="el" href="../../da/d9a/class_graph.html">Graph</a>, if you have to find out the number of connected components, there are 2 options</p><ol type="1">
<p>In <a class="el" href="../../da/d9a/class_graph.html">Graph</a>, if you have to find out the number of connected components, there are 2 options</p><ol type="1">
<li>Depth first search</li>
<li>Disjoint union 1st option is inefficient, Disjoint union is the most optimal way to find this.</li>
</ol>
@@ -429,7 +429,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="../../d8/d99/connected__components__with__dsu_8cpp.html">connected_components_with_dsu.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5 </li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
</ul>
</div>
</body>

View File

@@ -1,7 +1,7 @@
<?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 7.0.4 (20221203.1631)
<!-- Generated by graphviz version 7.0.6 (20230106.0513)
-->
<!-- Title: graph::disjoint_union::find_set Pages: 1 -->
<svg width="114pt" height="56pt"

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -1,7 +1,7 @@
<?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 7.0.4 (20221203.1631)
<!-- Generated by graphviz version 7.0.6 (20230106.0513)
-->
<!-- Title: graph::disjoint_union::union_sets Pages: 1 -->
<svg width="256pt" height="94pt"

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -1,7 +1,7 @@
<?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 7.0.4 (20221203.1631)
<!-- Generated by graphviz version 7.0.6 (20230106.0513)
-->
<!-- Title: test Pages: 1 -->
<svg width="131pt" height="27pt"

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,7 +1,7 @@
<?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 7.0.4 (20221203.1631)
<!-- Generated by graphviz version 7.0.6 (20230106.0513)
-->
<!-- Title: graph::disjoint_union::no_of_connected_components Pages: 1 -->
<svg width="305pt" height="131pt"

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -1,7 +1,7 @@
<?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 7.0.4 (20221203.1631)
<!-- Generated by graphviz version 7.0.6 (20230106.0513)
-->
<!-- Title: main Pages: 1 -->
<svg width="205pt" height="27pt"

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -1,7 +1,7 @@
<?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 7.0.4 (20221203.1631)
<!-- Generated by graphviz version 7.0.6 (20230106.0513)
-->
<!-- Title: graph::disjoint_union::make_set Pages: 1 -->
<svg width="114pt" height="56pt"

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB