mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-16 11:32:44 +08:00
Documentation for 06b6714b0e
This commit is contained in:
291
d1/d9a/hopcroft__karp_8cpp.html
Normal file
291
d1/d9a/hopcroft__karp_8cpp.html
Normal file
@@ -0,0 +1,291 @@
|
||||
<!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">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.20"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: graph/hopcroft_karp.cpp File Reference</title>
|
||||
<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>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.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/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
<link href="../../doxygen.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 style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<div id="projectname">Algorithms_in_C++
|
||||
 <span id="projectnumber">1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.20 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search');
|
||||
$(document).ready(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:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
$(document).ready(function(){initNavTree('d1/d9a/hopcroft__karp_8cpp.html','../../'); initResizable(); });
|
||||
/* @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">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#nested-classes">Classes</a> |
|
||||
<a href="#namespaces">Namespaces</a> |
|
||||
<a href="#func-members">Functions</a> </div>
|
||||
<div class="headertitle">
|
||||
<div class="title">hopcroft_karp.cpp File Reference</div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>Implementation of <a href="https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm">Hopcroft–Karp</a> algorithm.
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <iostream></code><br />
|
||||
<code>#include <cstdlib></code><br />
|
||||
<code>#include <queue></code><br />
|
||||
<code>#include <list></code><br />
|
||||
<code>#include <climits></code><br />
|
||||
<code>#include <memory></code><br />
|
||||
<code>#include <cassert></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for hopcroft_karp.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d9/d43/hopcroft__karp_8cpp__incl.svg" width="580" height="112"><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">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
|
||||
Classes</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/d69/classgraph_1_1_h_k_graph.html">graph::HKGraph</a></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Represents Bipartite graph for Hopcroft Karp implementation. <a href="../../d8/d69/classgraph_1_1_h_k_graph.html#details">More...</a><br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:df/dce/namespacegraph"><td class="memItemLeft" align="right" valign="top">  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dce/namespacegraph.html">graph</a></td></tr>
|
||||
<tr class="memdesc:df/dce/namespacegraph"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="../../dc/d61/classgraph_1_1_graph.html">Graph</a> algorithms. <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a88ec9ad42717780d6caaff9d3d6977f9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d9a/hopcroft__karp_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a> ()</td></tr>
|
||||
<tr class="separator:a88ec9ad42717780d6caaff9d3d6977f9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/d9a/hopcroft__karp_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
|
||||
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft"> </td><td class="mdescRight">Main function. <a href="../../d1/d9a/hopcroft__karp_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br /></td></tr>
|
||||
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Implementation of <a href="https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm">Hopcroft–Karp</a> algorithm. </p>
|
||||
<p>The Hopcroft–Karp algorithm is an algorithm that takes as input a bipartite graph and produces as output a maximum cardinality matching, it runs in O(E√V) time in worst case.</p>
|
||||
<h3><a class="anchor" id="autotoc_md53"></a>
|
||||
Bipartite graph</h3>
|
||||
<p>A bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets U and V such that every edge connects a vertex in U to one in V. Vertex sets U and V are usually called the parts of the graph. Equivalently, a bipartite graph is a graph that does not contain any odd-length cycles.</p>
|
||||
<h3><a class="anchor" id="autotoc_md54"></a>
|
||||
Matching and Not-Matching edges</h3>
|
||||
<p>Given a matching M, edges that are part of matching are called Matching edges and edges that are not part of M (or connect free nodes) are called Not-Matching edges.</p>
|
||||
<h3><a class="anchor" id="autotoc_md55"></a>
|
||||
Maximum cardinality matching</h3>
|
||||
<p>Given a bipartite graphs G = ( V = ( X , Y ) , E ) whose partition has the parts X and Y, with E denoting the edges of the graph, the goal is to find a matching with as many edges as possible. Equivalently, a matching that covers as many vertices as possible.</p>
|
||||
<h3><a class="anchor" id="autotoc_md56"></a>
|
||||
Augmenting paths</h3>
|
||||
<p>Given a matching M, an augmenting path is an alternating path that starts from and ends on free vertices. All single edge paths that start and end with free vertices are augmenting paths.</p>
|
||||
<h3><a class="anchor" id="autotoc_md57"></a>
|
||||
Concept</h3>
|
||||
<p>A matching M is not maximum if there exists an augmenting path. It is also true other way, i.e, a matching is maximum if no augmenting path exists.</p>
|
||||
<h3><a class="anchor" id="autotoc_md58"></a>
|
||||
Algorithm</h3>
|
||||
<p>1) Initialize the Maximal Matching M as empty. 2) While there exists an Augmenting Path P Remove matching edges of P from M and add not-matching edges of P to M (This increases size of M by 1 as P starts and ends with a free vertex i.e. a node that is not part of matching.) 3) Return M.</p>
|
||||
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/Krishnapal4050">Krishna Pal Deora</a> </dd></dl>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">◆ </a></span>main()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int main </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">void </td>
|
||||
<td class="paramname"></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<div class="fragment"><div class="line"><a name="l00307"></a><span class="lineno"> 307</span> {</div>
|
||||
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <a class="code" href="../../d1/d9a/hopcroft__karp_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>(); <span class="comment">// perform self-tests</span></div>
|
||||
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  </div>
|
||||
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keywordtype">int</span> v1 = 0, v2 = 0, e = 0;</div>
|
||||
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> v1 >> v2 >> e; <span class="comment">// vertices of left side, right side and edges</span></div>
|
||||
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  <a class="code" href="../../d8/d69/classgraph_1_1_h_k_graph.html">HKGraph</a> g(v1, v2); </div>
|
||||
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  <span class="keywordtype">int</span> u = 0, v = 0;</div>
|
||||
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < e; ++i)</div>
|
||||
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  {</div>
|
||||
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_istream.html">std::cin</a> >> u >> v;</div>
|
||||
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  g.addEdge(u, v);</div>
|
||||
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  }</div>
|
||||
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  </div>
|
||||
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  <span class="keywordtype">int</span> res = g.hopcroftKarpAlgorithm();</div>
|
||||
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Maximum matching is "</span> << res <<<span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  </div>
|
||||
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  </div>
|
||||
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span> }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d1/d9a/hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="100%" height="407"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a88ec9ad42717780d6caaff9d3d6977f9"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a88ec9ad42717780d6caaff9d3d6977f9">◆ </a></span>tests()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void tests </td>
|
||||
<td>(</td>
|
||||
<td class="paramname"></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
<p>Self-test implementation </p><dl class="section return"><dt>Returns</dt><dd>none </dd></dl>
|
||||
<div class="fragment"><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  {</div>
|
||||
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="comment">// Sample test case 1</span></div>
|
||||
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keywordtype">int</span> v1a = 3, v1b = 5, e1 = 2; <span class="comment">// vertices of left side, right side and edges</span></div>
|
||||
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <a class="code" href="../../d8/d69/classgraph_1_1_h_k_graph.html">HKGraph</a> g1(v1a, v1b); <span class="comment">// execute the algorithm </span></div>
|
||||
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  </div>
|
||||
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  g1.addEdge(0,1);</div>
|
||||
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  g1.addEdge(1,4);</div>
|
||||
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  </div>
|
||||
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keywordtype">int</span> expected_res1 = 0; <span class="comment">// for the above sample data, this is the expected output</span></div>
|
||||
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  <span class="keywordtype">int</span> res1 = g1.hopcroftKarpAlgorithm();</div>
|
||||
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  </div>
|
||||
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  assert(res1 == expected_res1); <span class="comment">// assert check to ensure that the algorithm executed correctly for test 1</span></div>
|
||||
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  </div>
|
||||
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="comment">// Sample test case 2</span></div>
|
||||
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keywordtype">int</span> v2a = 4, v2b = 4, e2 = 6; <span class="comment">// vertices of left side, right side and edges</span></div>
|
||||
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <a class="code" href="../../d8/d69/classgraph_1_1_h_k_graph.html">HKGraph</a> g2(v2a, v2b); <span class="comment">// execute the algorithm </span></div>
|
||||
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  </div>
|
||||
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  g2.addEdge(1,1);</div>
|
||||
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  g2.addEdge(1,3);</div>
|
||||
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  g2.addEdge(2,3);</div>
|
||||
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  g2.addEdge(3,4);</div>
|
||||
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  g2.addEdge(4,3);</div>
|
||||
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  g2.addEdge(4,2);</div>
|
||||
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  </div>
|
||||
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  <span class="keywordtype">int</span> expected_res2 = 0; <span class="comment">// for the above sample data, this is the expected output</span></div>
|
||||
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="keywordtype">int</span> res2 = g2.hopcroftKarpAlgorithm();</div>
|
||||
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  </div>
|
||||
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  assert(res2 == expected_res2); <span class="comment">// assert check to ensure that the algorithm executed correctly for test 2</span></div>
|
||||
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  </div>
|
||||
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="comment">// Sample test case 3</span></div>
|
||||
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <span class="keywordtype">int</span> v3a = 6, v3b = 6, e3 = 4; <span class="comment">// vertices of left side, right side and edges</span></div>
|
||||
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <a class="code" href="../../d8/d69/classgraph_1_1_h_k_graph.html">HKGraph</a> g3(v3a, v3b); <span class="comment">// execute the algorithm </span></div>
|
||||
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  </div>
|
||||
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  g3.addEdge(0,1);</div>
|
||||
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  g3.addEdge(1,4);</div>
|
||||
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  g3.addEdge(1,5);</div>
|
||||
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  g3.addEdge(5,0);</div>
|
||||
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  </div>
|
||||
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="keywordtype">int</span> expected_res3 = 0; <span class="comment">// for the above sample data, this is the expected output</span></div>
|
||||
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <span class="keywordtype">int</span> res3 = g3.hopcroftKarpAlgorithm();</div>
|
||||
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  </div>
|
||||
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  assert(res3 == expected_res3); <span class="comment">// assert check to ensure that the algorithm executed correctly for test 3</span></div>
|
||||
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  </div>
|
||||
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  </div>
|
||||
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  </div>
|
||||
<div class="line"><a name="l00300"></a><span class="lineno"> 300</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="../../d1/d9a/hopcroft__karp_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg" width="648" height="143"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<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="ahopcroft__karp_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="../../d1/d9a/hopcroft__karp_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition:</b> hopcroft_karp.cpp:255</div></div>
|
||||
<div class="ttc" id="aclassgraph_1_1_h_k_graph_html"><div class="ttname"><a href="../../d8/d69/classgraph_1_1_h_k_graph.html">graph::HKGraph</a></div><div class="ttdoc">Represents Bipartite graph for Hopcroft Karp implementation.</div><div class="ttdef"><b>Definition:</b> hopcroft_karp.cpp:67</div></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>
|
||||
<!-- 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="../../d1/d9a/hopcroft__karp_8cpp.html">hopcroft_karp.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
6
d1/d9a/hopcroft__karp_8cpp.js
Normal file
6
d1/d9a/hopcroft__karp_8cpp.js
Normal file
@@ -0,0 +1,6 @@
|
||||
var hopcroft__karp_8cpp =
|
||||
[
|
||||
[ "HKGraph", "d8/d69/classgraph_1_1_h_k_graph.html", "d8/d69/classgraph_1_1_h_k_graph" ],
|
||||
[ "main", "d1/d9a/hopcroft__karp_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "tests", "d1/d9a/hopcroft__karp_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9", null ]
|
||||
];
|
||||
@@ -0,0 +1,9 @@
|
||||
<map id="tests" name="tests">
|
||||
<area shape="rect" id="node1" title=" " alt="" coords="5,35,56,61"/>
|
||||
<area shape="rect" id="node2" href="$d8/d69/classgraph_1_1_h_k_graph.html#a3b49011c09cf90a116ab53bef61cd95a" title="function to add edge from u to v" alt="" coords="104,5,279,32"/>
|
||||
<area shape="rect" id="node4" href="$d8/d69/classgraph_1_1_h_k_graph.html#a9dbda80d02bdc26c3e8ff7330c9be75d" title="This function counts the number of augmenting paths between left and right sides of the Bipartite gra..." alt="" coords="106,57,277,98"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back.html#" title=" " alt="" coords="327,5,481,32"/>
|
||||
<area shape="rect" id="node5" href="$d8/d69/classgraph_1_1_h_k_graph.html#a7491add14d9fc04f679114ca6d6f0f93" title="This function checks for the possibility of augmented path availability." alt="" coords="333,60,475,87"/>
|
||||
<area shape="rect" id="node7" href="$d8/d69/classgraph_1_1_h_k_graph.html#ae794950cb3407b6b47d3dc986cf714c0" title="This functions checks whether an augmenting path is available exists beginning with free vertex u." alt="" coords="333,111,475,137"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/end.html#" title=" " alt="" coords="529,85,643,112"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
419a8bf7cbe88704d5a9b06319e81efb
|
||||
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.44.1 (20200629.0846)
|
||||
-->
|
||||
<!-- Title: tests Pages: 1 -->
|
||||
<svg width="486pt" height="107pt"
|
||||
viewBox="0.00 0.00 486.00 107.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 103)">
|
||||
<title>tests</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-103 482,-103 482,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title=" ">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-57.5 0,-76.5 38,-76.5 38,-57.5 0,-57.5"/>
|
||||
<text text-anchor="middle" x="19" y="-64.5" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#a3b49011c09cf90a116ab53bef61cd95a" target="_top" xlink:title="function to add edge from u to v">
|
||||
<polygon fill="white" stroke="black" points="74,-79.5 74,-98.5 205,-98.5 205,-79.5 74,-79.5"/>
|
||||
<text text-anchor="middle" x="139.5" y="-86.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::addEdge</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.26,-70.39C48.91,-72.37 63.04,-74.99 77.31,-77.64"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="76.71,-81.09 87.18,-79.47 77.98,-74.21 76.71,-81.09"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#a9dbda80d02bdc26c3e8ff7330c9be75d" target="_top" xlink:title="This function counts the number of augmenting paths between left and right sides of the Bipartite gra...">
|
||||
<polygon fill="white" stroke="black" points="75.5,-30 75.5,-60 203.5,-60 203.5,-30 75.5,-30"/>
|
||||
<text text-anchor="start" x="83.5" y="-48" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::hopcroft</text>
|
||||
<text text-anchor="middle" x="139.5" y="-37" font-family="Helvetica,sans-Serif" font-size="10.00">KarpAlgorithm</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.26,-63.61C45.9,-62.19 55.33,-60.44 65.32,-58.59"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="66.26,-61.97 75.45,-56.7 64.98,-55.09 66.26,-61.97"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="241,-79.5 241,-98.5 357,-98.5 357,-79.5 241,-79.5"/>
|
||||
<text text-anchor="middle" x="299" y="-86.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M205.02,-89C213.47,-89 222.15,-89 230.65,-89"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="230.91,-92.5 240.91,-89 230.91,-85.5 230.91,-92.5"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#a7491add14d9fc04f679114ca6d6f0f93" target="_top" xlink:title="This function checks for the possibility of augmented path availability.">
|
||||
<polygon fill="white" stroke="black" points="245.5,-38.5 245.5,-57.5 352.5,-57.5 352.5,-38.5 245.5,-38.5"/>
|
||||
<text text-anchor="middle" x="299" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::bfs</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node4->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M203.65,-46.2C214.05,-46.4 224.83,-46.61 235.22,-46.8"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="235.38,-50.31 245.45,-47 235.52,-43.31 235.38,-50.31"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#ae794950cb3407b6b47d3dc986cf714c0" target="_top" xlink:title="This functions checks whether an augmenting path is available exists beginning with free vertex u.">
|
||||
<polygon fill="white" stroke="black" points="245.5,-0.5 245.5,-19.5 352.5,-19.5 352.5,-0.5 245.5,-0.5"/>
|
||||
<text text-anchor="middle" x="299" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::dfs</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node7 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node4->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M203.65,-30.97C217.43,-27.9 231.87,-24.7 245.19,-21.73"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="246.13,-25.11 255.13,-19.53 244.61,-18.28 246.13,-25.11"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/end.html#" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="393,-19.5 393,-38.5 478,-38.5 478,-19.5 393,-19.5"/>
|
||||
<text text-anchor="middle" x="435.5" y="-26.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::end</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node6 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node5->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M352.77,-40.55C362.6,-39.16 372.87,-37.71 382.67,-36.32"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="383.27,-39.77 392.68,-34.91 382.29,-32.84 383.27,-39.77"/>
|
||||
</g>
|
||||
<!-- Node7->Node6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node7->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M352.77,-17.45C362.6,-18.84 372.87,-20.29 382.67,-21.68"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="382.29,-25.16 392.68,-23.09 383.27,-18.23 382.29,-25.16"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.0 KiB |
@@ -0,0 +1,10 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="node1" title="Main function." alt="" coords="5,45,56,72"/>
|
||||
<area shape="rect" id="node2" href="$d8/d69/classgraph_1_1_h_k_graph.html#a3b49011c09cf90a116ab53bef61cd95a" title="function to add edge from u to v" alt="" coords="203,5,377,32"/>
|
||||
<area shape="rect" id="node4" href="$d8/d69/classgraph_1_1_h_k_graph.html#a9dbda80d02bdc26c3e8ff7330c9be75d" title="This function counts the number of augmenting paths between left and right sides of the Bipartite gra..." alt="" coords="205,67,375,109"/>
|
||||
<area shape="rect" id="node8" href="$d1/d9a/hopcroft__karp_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9" title=" " alt="" coords="104,45,155,72"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/push_back.html#" title=" " alt="" coords="425,5,580,32"/>
|
||||
<area shape="rect" id="node5" href="$d8/d69/classgraph_1_1_h_k_graph.html#a7491add14d9fc04f679114ca6d6f0f93" title="This function checks for the possibility of augmented path availability." alt="" coords="431,60,574,87"/>
|
||||
<area shape="rect" id="node7" href="$d8/d69/classgraph_1_1_h_k_graph.html#ae794950cb3407b6b47d3dc986cf714c0" title="This functions checks whether an augmenting path is available exists beginning with free vertex u." alt="" coords="431,111,574,137"/>
|
||||
<area shape="rect" id="node6" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector/end.html#" title=" " alt="" coords="628,85,741,112"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
a0d5a38cc5fee67eca81aa0294d0349d
|
||||
@@ -0,0 +1,234 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.44.1 (20200629.0846)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<!--zoomable 107 -->
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" onload="init(evt)">
|
||||
<style type="text/css"><![CDATA[
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="text/javascript"><![CDATA[
|
||||
var edges = document.getElementsByTagName('g');
|
||||
if (edges && edges.length) {
|
||||
for (var i=0;i<edges.length;i++) {
|
||||
if (edges[i].id.substr(0,4)=='edge') {
|
||||
edges[i].setAttribute('class','edge');
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></script>
|
||||
<defs>
|
||||
<circle id="rim" cx="0" cy="0" r="7"/>
|
||||
<circle id="rim2" cx="0" cy="0" r="3.5"/>
|
||||
<g id="zoomPlus">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="zoomplus.mouseover" end="zoomplus.mouseout"/>
|
||||
</use>
|
||||
<path d="M-4,0h8M0,-4v8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
|
||||
</g>
|
||||
<g id="zoomMin">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="zoomminus.mouseover" end="zoomminus.mouseout"/>
|
||||
</use>
|
||||
<path d="M-4,0h8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
|
||||
</g>
|
||||
<g id="dirArrow">
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="resetDef">
|
||||
<use xlink:href="#rim2" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="reset.mouseover" end="reset.mouseout"/>
|
||||
</use>
|
||||
</g>
|
||||
</defs>
|
||||
|
||||
<script type="text/javascript">
|
||||
var viewWidth = 560;
|
||||
var viewHeight = 107;
|
||||
var sectionId = 'dynsection-1';
|
||||
</script>
|
||||
<script xlink:href="../../svgpan.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="viewport">
|
||||
<title>main</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-103 556,-103 556,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Main function.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-49.5 0,-68.5 38,-68.5 38,-49.5 0,-49.5"/>
|
||||
<text text-anchor="middle" x="19" y="-56.5" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#a3b49011c09cf90a116ab53bef61cd95a" target="_top" xlink:title="function to add edge from u to v">
|
||||
<polygon fill="white" stroke="black" points="148,-79.5 148,-98.5 279,-98.5 279,-79.5 148,-79.5"/>
|
||||
<text text-anchor="middle" x="213.5" y="-86.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::addEdge</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.16,-66.71C48.48,-70.76 61.75,-75.4 74,-78 94.48,-82.34 117,-85 137.81,-86.62"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="137.65,-90.12 147.87,-87.34 138.15,-83.14 137.65,-90.12"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#a9dbda80d02bdc26c3e8ff7330c9be75d" target="_top" xlink:title="This function counts the number of augmenting paths between left and right sides of the Bipartite gra...">
|
||||
<polygon fill="white" stroke="black" points="149.5,-22 149.5,-52 277.5,-52 277.5,-22 149.5,-22"/>
|
||||
<text text-anchor="start" x="157.5" y="-40" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::hopcroft</text>
|
||||
<text text-anchor="middle" x="213.5" y="-29" font-family="Helvetica,sans-Serif" font-size="10.00">KarpAlgorithm</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.1,-51.01C48.41,-46.88 61.68,-42.24 74,-40 94.94,-36.19 117.96,-34.65 139.12,-34.28"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="139.37,-37.78 149.34,-34.18 139.3,-30.78 139.37,-37.78"/>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a xlink:href="../../d1/d9a/hopcroft__karp_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="74,-49.5 74,-68.5 112,-68.5 112,-49.5 74,-49.5"/>
|
||||
<text text-anchor="middle" x="93" y="-56.5" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node8 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node1->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.17,-59C45.87,-59 55.03,-59 63.58,-59"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="63.59,-62.5 73.59,-59 63.59,-55.5 63.59,-62.5"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="315,-79.5 315,-98.5 431,-98.5 431,-79.5 315,-79.5"/>
|
||||
<text text-anchor="middle" x="373" y="-86.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M279.02,-89C287.47,-89 296.15,-89 304.65,-89"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="304.91,-92.5 314.91,-89 304.91,-85.5 304.91,-92.5"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#a7491add14d9fc04f679114ca6d6f0f93" target="_top" xlink:title="This function checks for the possibility of augmented path availability.">
|
||||
<polygon fill="white" stroke="black" points="319.5,-38.5 319.5,-57.5 426.5,-57.5 426.5,-38.5 319.5,-38.5"/>
|
||||
<text text-anchor="middle" x="373" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::bfs</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node4->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M277.65,-41.41C288.05,-42.14 298.83,-42.89 309.22,-43.62"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="309.23,-47.12 319.45,-44.33 309.72,-40.14 309.23,-47.12"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#ae794950cb3407b6b47d3dc986cf714c0" target="_top" xlink:title="This functions checks whether an augmenting path is available exists beginning with free vertex u.">
|
||||
<polygon fill="white" stroke="black" points="319.5,-0.5 319.5,-19.5 426.5,-19.5 426.5,-0.5 319.5,-0.5"/>
|
||||
<text text-anchor="middle" x="373" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::dfs</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node7 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node4->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M277.65,-26.17C288.16,-24.37 299.05,-22.51 309.54,-20.71"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="310.18,-24.15 319.45,-19.01 309,-17.25 310.18,-24.15"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/end.html#" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="467,-19.5 467,-38.5 552,-38.5 552,-19.5 467,-19.5"/>
|
||||
<text text-anchor="middle" x="509.5" y="-26.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::end</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node6 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node5->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M426.77,-40.55C436.6,-39.16 446.87,-37.71 456.67,-36.32"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="457.27,-39.77 466.68,-34.91 456.29,-32.84 457.27,-39.77"/>
|
||||
</g>
|
||||
<!-- Node7->Node6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node7->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M426.77,-17.45C436.6,-18.84 446.87,-20.29 456.67,-21.68"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="456.29,-25.16 466.68,-23.09 457.27,-18.23 456.29,-25.16"/>
|
||||
</g>
|
||||
<!-- Node8->Node2 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node8->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.26,-63.62C126.34,-67.19 146.5,-72.29 165.04,-76.99"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="164.29,-80.41 174.84,-79.47 166.01,-73.62 164.29,-80.41"/>
|
||||
</g>
|
||||
<!-- Node8->Node4 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node8->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.26,-55.61C119.9,-54.19 129.33,-52.44 139.32,-50.59"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="140.26,-53.97 149.45,-48.7 138.98,-47.09 140.26,-53.97"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<g id="navigator" transform="translate(0 0)" fill="#404254">
|
||||
<rect fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width=".5" x="0" y="0" width="60" height="60"/>
|
||||
<use id="zoomplus" xlink:href="#zoomPlus" x="17" y="9" onmousedown="handleZoom(evt,'in')"/>
|
||||
<use id="zoomminus" xlink:href="#zoomMin" x="42" y="9" onmousedown="handleZoom(evt,'out')"/>
|
||||
<use id="reset" xlink:href="#resetDef" x="30" y="36" onmousedown="handleReset()"/>
|
||||
<g id="arrowUp" xlink:href="#dirArrow" transform="translate(30 24)" onmousedown="handlePan(0,-1)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowUp.mouseover" end="arrowUp.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowRight" xlink:href="#dirArrow" transform="rotate(90) translate(36 -43)" onmousedown="handlePan(1,0)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowRight.mouseover" end="arrowRight.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowDown" xlink:href="#dirArrow" transform="rotate(180) translate(-30 -48)" onmousedown="handlePan(0,1)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowDown.mouseover" end="arrowDown.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowLeft" xlink:href="#dirArrow" transform="rotate(270) translate(-36 17)" onmousedown="handlePan(-1,0)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowLeft.mouseover" end="arrowLeft.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
</g>
|
||||
<svg viewBox="0 0 15 15" width="100%" height="30px" preserveAspectRatio="xMaxYMin meet">
|
||||
<g id="arrow_out" transform="scale(0.3 0.3)">
|
||||
<a xlink:href="hopcroft__karp_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg" target="_base">
|
||||
<rect id="button" ry="5" rx="5" y="6" x="6" height="38" width="38"
|
||||
fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width="1.0"/>
|
||||
<path id="arrow"
|
||||
d="M 11.500037,31.436501 C 11.940474,20.09759 22.043105,11.32322 32.158766,21.979434 L 37.068811,17.246167 C 37.068811,17.246167 37.088388,32 37.088388,32 L 22.160133,31.978069 C 22.160133,31.978069 26.997745,27.140456 26.997745,27.140456 C 18.528582,18.264221 13.291696,25.230495 11.500037,31.436501 z"
|
||||
style="fill:#404040;"/>
|
||||
</a>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.44.1 (20200629.0846)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="560pt" height="107pt"
|
||||
viewBox="0.00 0.00 560.00 107.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 103)">
|
||||
<title>main</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-103 556,-103 556,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Main function.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-49.5 0,-68.5 38,-68.5 38,-49.5 0,-49.5"/>
|
||||
<text text-anchor="middle" x="19" y="-56.5" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#a3b49011c09cf90a116ab53bef61cd95a" target="_top" xlink:title="function to add edge from u to v">
|
||||
<polygon fill="white" stroke="black" points="148,-79.5 148,-98.5 279,-98.5 279,-79.5 148,-79.5"/>
|
||||
<text text-anchor="middle" x="213.5" y="-86.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::addEdge</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.16,-66.71C48.48,-70.76 61.75,-75.4 74,-78 94.48,-82.34 117,-85 137.81,-86.62"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="137.65,-90.12 147.87,-87.34 138.15,-83.14 137.65,-90.12"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#a9dbda80d02bdc26c3e8ff7330c9be75d" target="_top" xlink:title="This function counts the number of augmenting paths between left and right sides of the Bipartite gra...">
|
||||
<polygon fill="white" stroke="black" points="149.5,-22 149.5,-52 277.5,-52 277.5,-22 149.5,-22"/>
|
||||
<text text-anchor="start" x="157.5" y="-40" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::hopcroft</text>
|
||||
<text text-anchor="middle" x="213.5" y="-29" font-family="Helvetica,sans-Serif" font-size="10.00">KarpAlgorithm</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.1,-51.01C48.41,-46.88 61.68,-42.24 74,-40 94.94,-36.19 117.96,-34.65 139.12,-34.28"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="139.37,-37.78 149.34,-34.18 139.3,-30.78 139.37,-37.78"/>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a xlink:href="../../d1/d9a/hopcroft__karp_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="74,-49.5 74,-68.5 112,-68.5 112,-49.5 74,-49.5"/>
|
||||
<text text-anchor="middle" x="93" y="-56.5" font-family="Helvetica,sans-Serif" font-size="10.00">tests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node8 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node1->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.17,-59C45.87,-59 55.03,-59 63.58,-59"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="63.59,-62.5 73.59,-59 63.59,-55.5 63.59,-62.5"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/push_back.html#" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="315,-79.5 315,-98.5 431,-98.5 431,-79.5 315,-79.5"/>
|
||||
<text text-anchor="middle" x="373" y="-86.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::push_back</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M279.02,-89C287.47,-89 296.15,-89 304.65,-89"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="304.91,-92.5 314.91,-89 304.91,-85.5 304.91,-92.5"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#a7491add14d9fc04f679114ca6d6f0f93" target="_top" xlink:title="This function checks for the possibility of augmented path availability.">
|
||||
<polygon fill="white" stroke="black" points="319.5,-38.5 319.5,-57.5 426.5,-57.5 426.5,-38.5 319.5,-38.5"/>
|
||||
<text text-anchor="middle" x="373" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::bfs</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node4->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M277.65,-41.41C288.05,-42.14 298.83,-42.89 309.22,-43.62"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="309.23,-47.12 319.45,-44.33 309.72,-40.14 309.23,-47.12"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../d8/d69/classgraph_1_1_h_k_graph.html#ae794950cb3407b6b47d3dc986cf714c0" target="_top" xlink:title="This functions checks whether an augmenting path is available exists beginning with free vertex u.">
|
||||
<polygon fill="white" stroke="black" points="319.5,-0.5 319.5,-19.5 426.5,-19.5 426.5,-0.5 319.5,-0.5"/>
|
||||
<text text-anchor="middle" x="373" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">graph::HKGraph::dfs</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4->Node7 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node4->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M277.65,-26.17C288.16,-24.37 299.05,-22.51 309.54,-20.71"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="310.18,-24.15 319.45,-19.01 309,-17.25 310.18,-24.15"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector/end.html#" target="_top" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="467,-19.5 467,-38.5 552,-38.5 552,-19.5 467,-19.5"/>
|
||||
<text text-anchor="middle" x="509.5" y="-26.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector::end</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5->Node6 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node5->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M426.77,-40.55C436.6,-39.16 446.87,-37.71 456.67,-36.32"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="457.27,-39.77 466.68,-34.91 456.29,-32.84 457.27,-39.77"/>
|
||||
</g>
|
||||
<!-- Node7->Node6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node7->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M426.77,-17.45C436.6,-18.84 446.87,-20.29 456.67,-21.68"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="456.29,-25.16 466.68,-23.09 457.27,-18.23 456.29,-25.16"/>
|
||||
</g>
|
||||
<!-- Node8->Node2 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node8->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.26,-63.62C126.34,-67.19 146.5,-72.29 165.04,-76.99"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="164.29,-80.41 174.84,-79.47 166.01,-73.62 164.29,-80.41"/>
|
||||
</g>
|
||||
<!-- Node8->Node4 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node8->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M112.26,-55.61C119.9,-54.19 129.33,-52.44 139.32,-50.59"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="140.26,-53.97 149.45,-48.7 138.98,-47.09 140.26,-53.97"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.5 KiB |
Reference in New Issue
Block a user