Documentation for 2c68b68ca6

This commit is contained in:
github-actions
2023-07-25 01:00:26 +00:00
parent e9138e9e94
commit dc4d3f2965
66 changed files with 736 additions and 646 deletions

View File

@@ -119,8 +119,8 @@ Include dependency graph for dijkstra.cpp:</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d64/classgreedy__algorithms_1_1_graph.html">greedy_algorithms::Graph</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrapper class for storing a graph. <a href="../../d3/d64/classgreedy__algorithms_1_1_graph.html#details">More...</a><br /></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html">greedy_algorithms::dijkstra::Graph</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wrapper class for storing a graph. <a href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
@@ -131,15 +131,15 @@ 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:ac6731ab96fb83453aff4682d16fe2ea7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d90/namespacegreedy__algorithms.html#ac6731ab96fb83453aff4682d16fe2ea7">greedy_algorithms::minimum_distance</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt; mdist, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; bool &gt; vset, int V)</td></tr>
<tr class="memdesc:ac6731ab96fb83453aff4682d16fe2ea7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function that finds the vertex with the minimum distance in <code>mdist</code>. <br /></td></tr>
<tr class="separator:ac6731ab96fb83453aff4682d16fe2ea7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58aba3d694f77ce934f4e94042321649"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d90/namespacegreedy__algorithms.html#a58aba3d694f77ce934f4e94042321649">greedy_algorithms::print</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt; dist, int V)</td></tr>
<tr class="memdesc:a58aba3d694f77ce934f4e94042321649"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to print the distances to vertices. <br /></td></tr>
<tr class="separator:a58aba3d694f77ce934f4e94042321649"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04a39ac70bceeab6bcd3073da760e88a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/d90/namespacegreedy__algorithms.html#a04a39ac70bceeab6bcd3073da760e88a">greedy_algorithms::dijkstra</a> (<a class="el" href="../../d3/d64/classgreedy__algorithms_1_1_graph.html">Graph</a> graph, int src)</td></tr>
<tr class="memdesc:a04a39ac70bceeab6bcd3073da760e88a"><td class="mdescLeft">&#160;</td><td class="mdescRight">The main function that finds the shortest path from given source to all other vertices using Dijkstra's Algorithm. <br /></td></tr>
<tr class="separator:a04a39ac70bceeab6bcd3073da760e88a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af6cb29ca6dc5771439f6ea7262058a71"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dcb/greedy__algorithms_2dijkstra_8cpp.html#af6cb29ca6dc5771439f6ea7262058a71">greedy_algorithms::dijkstra::minimum_distance</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt; mdist, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; bool &gt; vset, int V)</td></tr>
<tr class="memdesc:af6cb29ca6dc5771439f6ea7262058a71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function that finds the vertex with the minimum distance in <code>mdist</code>. <br /></td></tr>
<tr class="separator:af6cb29ca6dc5771439f6ea7262058a71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7341d7c76a6145e991cdd231f689fca8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dcb/greedy__algorithms_2dijkstra_8cpp.html#a7341d7c76a6145e991cdd231f689fca8">greedy_algorithms::dijkstra::print</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt; dist, int V)</td></tr>
<tr class="memdesc:a7341d7c76a6145e991cdd231f689fca8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility function to print the distances to vertices. <br /></td></tr>
<tr class="separator:a7341d7c76a6145e991cdd231f689fca8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af915876d0ca33cc71a6a6191a8cd3ccd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dcb/greedy__algorithms_2dijkstra_8cpp.html#af915876d0ca33cc71a6a6191a8cd3ccd">greedy_algorithms::dijkstra::dijkstra</a> (<a class="el" href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html">Graph</a> graph, int src)</td></tr>
<tr class="memdesc:af915876d0ca33cc71a6a6191a8cd3ccd"><td class="mdescLeft">&#160;</td><td class="mdescRight">The main function that finds the shortest path from a given source to all other vertices using Dijkstra's Algorithm. <br /></td></tr>
<tr class="separator:af915876d0ca33cc71a6a6191a8cd3ccd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a483bb8ccf42aaf7375a83e91490eda1e"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/dcb/greedy__algorithms_2dijkstra_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e">tests</a> ()</td></tr>
<tr class="memdesc:a483bb8ccf42aaf7375a83e91490eda1e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Self-test implementations. <br /></td></tr>
<tr class="separator:a483bb8ccf42aaf7375a83e91490eda1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -155,6 +155,82 @@ Functions</h2></td></tr>
<dd>
<a href="https://github.com/arpanjain97" target="_blank">Arpan Jain</a> </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="af915876d0ca33cc71a6a6191a8cd3ccd" name="af915876d0ca33cc71a6a6191a8cd3ccd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af915876d0ca33cc71a6a6191a8cd3ccd">&#9670;&#160;</a></span>dijkstra()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void greedy_algorithms::dijkstra::dijkstra </td>
<td>(</td>
<td class="paramtype"><a class="el" href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html">Graph</a>&#160;</td>
<td class="paramname"><em>graph</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>src</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>The main function that finds the shortest path from a given source to all other vertices using Dijkstra's Algorithm. </p>
<dl class="section note"><dt>Note</dt><dd>This doesn't work on negative weights. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">graph</td><td>the graph to be processed </td></tr>
<tr><td class="paramname">src</td><td>the source of the given vertex </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 124</span> {</div>
<div class="line"><span class="lineno"> 125</span> <span class="keywordtype">int</span> V = <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.vertexNum;</div>
<div class="line"><span class="lineno"> 126</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;int&gt;</a> mdist{}; <span class="comment">// Stores updated distances to the vertex</span></div>
<div class="line"><span class="lineno"> 127</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;bool&gt;</a> vset{}; <span class="comment">// `vset[i]` is true if the vertex `i` is included in the shortest path tree</span></div>
<div class="line"><span class="lineno"> 128</span> </div>
<div class="line"><span class="lineno"> 129</span> <span class="comment">// Initialize `mdist and `vset`. Set the distance of the source as zero</span></div>
<div class="line"><span class="lineno"> 130</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; V; i++) {</div>
<div class="line"><span class="lineno"> 131</span> mdist[i] = INT_MAX;</div>
<div class="line"><span class="lineno"> 132</span> vset[i] = <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 133</span> }</div>
<div class="line"><span class="lineno"> 134</span> </div>
<div class="line"><span class="lineno"> 135</span> mdist[src] = 0;</div>
<div class="line"><span class="lineno"> 136</span> </div>
<div class="line"><span class="lineno"> 137</span> <span class="comment">// iterate to find the shortest path</span></div>
<div class="line"><span class="lineno"> 138</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> count = 0; count &lt; V - 1; count++) {</div>
<div class="line"><span class="lineno"> 139</span> <span class="keywordtype">int</span> u = <a class="code hl_function" href="../../df/dcb/greedy__algorithms_2dijkstra_8cpp.html#af6cb29ca6dc5771439f6ea7262058a71">minimum_distance</a>(mdist, vset, V);</div>
<div class="line"><span class="lineno"> 140</span> </div>
<div class="line"><span class="lineno"> 141</span> vset[u] = <span class="keyword">true</span>;</div>
<div class="line"><span class="lineno"> 142</span> </div>
<div class="line"><span class="lineno"> 143</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> v = 0; v &lt; V; v++) {</div>
<div class="line"><span class="lineno"> 144</span> <span class="keywordflow">if</span> (!vset[v] &amp;&amp; <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[u][v] &amp;&amp;</div>
<div class="line"><span class="lineno"> 145</span> mdist[u] + <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[u][v] &lt; mdist[v]) {</div>
<div class="line"><span class="lineno"> 146</span> mdist[v] = mdist[u] + <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[u][v];</div>
<div class="line"><span class="lineno"> 147</span> }</div>
<div class="line"><span class="lineno"> 148</span> }</div>
<div class="line"><span class="lineno"> 149</span> }</div>
<div class="line"><span class="lineno"> 150</span> </div>
<div class="line"><span class="lineno"> 151</span> print(mdist, V);</div>
<div class="line"><span class="lineno"> 152</span>}</div>
<div class="ttc" id="agreedy__algorithms_2dijkstra_8cpp_html_af6cb29ca6dc5771439f6ea7262058a71"><div class="ttname"><a href="../../df/dcb/greedy__algorithms_2dijkstra_8cpp.html#af6cb29ca6dc5771439f6ea7262058a71">greedy_algorithms::dijkstra::minimum_distance</a></div><div class="ttdeci">int minimum_distance(std::vector&lt; int &gt; mdist, std::vector&lt; bool &gt; vset, int V)</div><div class="ttdoc">Utility function that finds the vertex with the minimum distance in mdist.</div><div class="ttdef"><b>Definition</b> dijkstra.cpp:82</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="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/dcb/greedy__algorithms_2dijkstra_8cpp_af915876d0ca33cc71a6a6191a8cd3ccd_cgraph.svg" width="375" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">&#9670;&#160;</a></span>main()</h2>
@@ -173,10 +249,10 @@ Functions</h2></td></tr>
<p>Main function. </p>
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 196</span> {</div>
<div class="line"><span class="lineno"> 197</span> <a class="code hl_function" href="../../d7/d1e/graph_2dijkstra_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><span class="lineno"> 198</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 199</span>}</div>
<div class="fragment"><div class="line"><span class="lineno"> 199</span> {</div>
<div class="line"><span class="lineno"> 200</span> <a class="code hl_function" href="../../d7/d1e/graph_2dijkstra_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a>(); <span class="comment">// run self-test implementations</span></div>
<div class="line"><span class="lineno"> 201</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 202</span>}</div>
<div class="ttc" id="agraph_2dijkstra_8cpp_html_a88ec9ad42717780d6caaff9d3d6977f9"><div class="ttname"><a href="../../d7/d1e/graph_2dijkstra_8cpp.html#a88ec9ad42717780d6caaff9d3d6977f9">tests</a></div><div class="ttdeci">void tests()</div><div class="ttdef"><b>Definition</b> dijkstra.cpp:113</div></div>
</div><!-- fragment --><div class="dynheader">
Here is the call graph for this function:</div>
@@ -184,6 +260,118 @@ Here is the call graph for this function:</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/dcb/greedy__algorithms_2dijkstra_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="524" height="315"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
<a id="af6cb29ca6dc5771439f6ea7262058a71" name="af6cb29ca6dc5771439f6ea7262058a71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af6cb29ca6dc5771439f6ea7262058a71">&#9670;&#160;</a></span>minimum_distance()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int greedy_algorithms::dijkstra::minimum_distance </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt;&#160;</td>
<td class="paramname"><em>mdist</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; bool &gt;&#160;</td>
<td class="paramname"><em>vset</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>V</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Utility function that finds the vertex with the minimum distance in <code>mdist</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">mdist</td><td>array of distances to each vertex </td></tr>
<tr><td class="paramname">vset</td><td>array indicating inclusion in the shortest path tree </td></tr>
<tr><td class="paramname">V</td><td>the number of vertices in the graph </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>index of the vertex with the minimum distance </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 82</span> {</div>
<div class="line"><span class="lineno"> 83</span> <span class="keywordtype">int</span> minVal = INT_MAX, minInd = 0;</div>
<div class="line"><span class="lineno"> 84</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; V; i++) {</div>
<div class="line"><span class="lineno"> 85</span> <span class="keywordflow">if</span> (!vset[i] &amp;&amp; (mdist[i] &lt; minVal)) {</div>
<div class="line"><span class="lineno"> 86</span> minVal = mdist[i];</div>
<div class="line"><span class="lineno"> 87</span> minInd = i;</div>
<div class="line"><span class="lineno"> 88</span> }</div>
<div class="line"><span class="lineno"> 89</span> }</div>
<div class="line"><span class="lineno"> 90</span> </div>
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">return</span> minInd;</div>
<div class="line"><span class="lineno"> 92</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/dcb/greedy__algorithms_2dijkstra_8cpp_af6cb29ca6dc5771439f6ea7262058a71_cgraph.svg" width="191" height="76"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
</div>
<a id="a7341d7c76a6145e991cdd231f689fca8" name="a7341d7c76a6145e991cdd231f689fca8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7341d7c76a6145e991cdd231f689fca8">&#9670;&#160;</a></span>print()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void greedy_algorithms::dijkstra::print </td>
<td>(</td>
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>&lt; int &gt;&#160;</td>
<td class="paramname"><em>dist</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>V</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Utility function to print the distances to vertices. </p>
<p>This function prints the distances to each vertex in a tabular format. If the distance is equal to INT_MAX, it is displayed as "INF".</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dist</td><td>An array representing the distances to each vertex. </td></tr>
<tr><td class="paramname">V</td><td>The number of vertices in the graph. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 104</span> {</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> &lt;&lt; <span class="stringliteral">&quot;\nVertex Distance\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 106</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; V; i++) {</div>
<div class="line"><span class="lineno"> 107</span> <span class="keywordflow">if</span> (dist[i] &lt; INT_MAX) {</div>
<div class="line"><span class="lineno"> 108</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; i &lt;&lt; <span class="stringliteral">&quot;\t&quot;</span> &lt;&lt; dist[i] &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 109</span> }</div>
<div class="line"><span class="lineno"> 110</span> <span class="keywordflow">else</span> {</div>
<div class="line"><span class="lineno"> 111</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; i &lt;&lt; <span class="stringliteral">&quot;\tINF&quot;</span> &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 112</span> }</div>
<div class="line"><span class="lineno"> 113</span> }</div>
<div class="line"><span class="lineno"> 114</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a483bb8ccf42aaf7375a83e91490eda1e" name="a483bb8ccf42aaf7375a83e91490eda1e"></a>
@@ -211,43 +399,41 @@ Here is the call graph for this function:</div>
<p>Self-test implementations. </p>
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
<div class="fragment"><div class="line"><span class="lineno"> 157</span> {</div>
<div class="line"><span class="lineno"> 158</span> <a class="code hl_class" href="../../d3/d64/classgreedy__algorithms_1_1_graph.html">greedy_algorithms::Graph</a> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>(8);</div>
<div class="line"><span class="lineno"> 159</span> </div>
<div class="line"><span class="lineno"> 160</span> <span class="comment">// 1st test.</span></div>
<div class="line"><span class="lineno"> 161</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(6, 2, 4);</div>
<div class="line"><span class="lineno"> 162</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 6, 4);</div>
<div class="line"><span class="lineno"> 163</span> </div>
<div class="line"><span class="lineno"> 164</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[6][2] == 4);</div>
<div class="line"><span class="lineno"> 165</span> </div>
<div class="line"><span class="lineno"> 166</span> <span class="comment">// 2nd test.</span></div>
<div class="line"><span class="lineno"> 167</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(0, 1, 1);</div>
<div class="line"><span class="lineno"> 168</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 0, 1);</div>
<div class="line"><span class="lineno"> 169</span> </div>
<div class="line"><span class="lineno"> 170</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[0][1] == 1);</div>
<div class="line"><span class="lineno"> 171</span> </div>
<div class="line"><span class="lineno"> 172</span> <span class="comment">// 3rd test.</span></div>
<div class="line"><span class="lineno"> 173</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(0, 2, 7);</div>
<div class="line"><span class="lineno"> 174</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 0, 7);</div>
<div class="line"><span class="lineno"> 175</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 2, 1);</div>
<div class="line"><span class="lineno"> 176</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 1, 1);</div>
<div class="line"><span class="lineno"> 177</span> </div>
<div class="line"><span class="lineno"> 178</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[0][2] == 7);</div>
<div class="line"><span class="lineno"> 179</span> </div>
<div class="line"><span class="lineno"> 180</span> <span class="comment">// 4th test.</span></div>
<div class="line"><span class="lineno"> 181</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 3, 3);</div>
<div class="line"><span class="lineno"> 182</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(3, 1, 3);</div>
<div class="line"><span class="lineno"> 183</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 4, 2);</div>
<div class="line"><span class="lineno"> 184</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(4, 1, 2);</div>
<div class="line"><span class="lineno"> 185</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 3, 2);</div>
<div class="line"><span class="lineno"> 186</span> </div>
<div class="line"><span class="lineno"> 187</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[1][3] == 3);</div>
<div class="line"><span class="lineno"> 188</span> </div>
<div class="line"><span class="lineno"> 189</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;All tests have successfully passed!\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 190</span>}</div>
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
<div class="ttc" id="aclassgreedy__algorithms_1_1_graph_html"><div class="ttname"><a href="../../d3/d64/classgreedy__algorithms_1_1_graph.html">greedy_algorithms::Graph</a></div><div class="ttdoc">Wrapper class for storing a graph.</div><div class="ttdef"><b>Definition</b> dijkstra.cpp:33</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="fragment"><div class="line"><span class="lineno"> 160</span> {</div>
<div class="line"><span class="lineno"> 161</span> <a class="code hl_class" href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html">greedy_algorithms::dijkstra::Graph</a> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>(8);</div>
<div class="line"><span class="lineno"> 162</span> </div>
<div class="line"><span class="lineno"> 163</span> <span class="comment">// 1st test.</span></div>
<div class="line"><span class="lineno"> 164</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(6, 2, 4);</div>
<div class="line"><span class="lineno"> 165</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 6, 4);</div>
<div class="line"><span class="lineno"> 166</span> </div>
<div class="line"><span class="lineno"> 167</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[6][2] == 4);</div>
<div class="line"><span class="lineno"> 168</span> </div>
<div class="line"><span class="lineno"> 169</span> <span class="comment">// 2nd test.</span></div>
<div class="line"><span class="lineno"> 170</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(0, 1, 1);</div>
<div class="line"><span class="lineno"> 171</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 0, 1);</div>
<div class="line"><span class="lineno"> 172</span> </div>
<div class="line"><span class="lineno"> 173</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[0][1] == 1);</div>
<div class="line"><span class="lineno"> 174</span> </div>
<div class="line"><span class="lineno"> 175</span> <span class="comment">// 3rd test.</span></div>
<div class="line"><span class="lineno"> 176</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(0, 2, 7);</div>
<div class="line"><span class="lineno"> 177</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 0, 7);</div>
<div class="line"><span class="lineno"> 178</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 2, 1);</div>
<div class="line"><span class="lineno"> 179</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 1, 1);</div>
<div class="line"><span class="lineno"> 180</span> </div>
<div class="line"><span class="lineno"> 181</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[0][2] == 7);</div>
<div class="line"><span class="lineno"> 182</span> </div>
<div class="line"><span class="lineno"> 183</span> <span class="comment">// 4th test.</span></div>
<div class="line"><span class="lineno"> 184</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 3, 3);</div>
<div class="line"><span class="lineno"> 185</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(3, 1, 3);</div>
<div class="line"><span class="lineno"> 186</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(1, 4, 2);</div>
<div class="line"><span class="lineno"> 187</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(4, 1, 2);</div>
<div class="line"><span class="lineno"> 188</span> <a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.add_edge(2, 3, 2);</div>
<div class="line"><span class="lineno"> 189</span> </div>
<div class="line"><span class="lineno"> 190</span> assert(<a class="code hl_namespace" href="../../df/dce/namespacegraph.html">graph</a>.edges[1][3] == 3);</div>
<div class="line"><span class="lineno"> 191</span> </div>
<div class="line"><span class="lineno"> 192</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> &lt;&lt; <span class="stringliteral">&quot;All tests have successfully passed!\n&quot;</span>;</div>
<div class="line"><span class="lineno"> 193</span>}</div>
<div class="ttc" id="aclassgreedy__algorithms_1_1dijkstra_1_1_graph_html"><div class="ttname"><a href="../../d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html">greedy_algorithms::dijkstra::Graph</a></div><div class="ttdoc">Wrapper class for storing a graph.</div><div class="ttdef"><b>Definition</b> dijkstra.cpp:35</div></div>
</div><!-- fragment -->
</div>
</div>

View File

@@ -1,9 +1,9 @@
var greedy__algorithms_2dijkstra_8cpp =
[
[ "greedy_algorithms::Graph", "d3/d64/classgreedy__algorithms_1_1_graph.html", "d3/d64/classgreedy__algorithms_1_1_graph" ],
[ "dijkstra", "df/dcb/greedy__algorithms_2dijkstra_8cpp.html#a04a39ac70bceeab6bcd3073da760e88a", null ],
[ "greedy_algorithms::dijkstra::Graph", "d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph.html", "d2/daa/classgreedy__algorithms_1_1dijkstra_1_1_graph" ],
[ "dijkstra", "df/dcb/greedy__algorithms_2dijkstra_8cpp.html#af915876d0ca33cc71a6a6191a8cd3ccd", null ],
[ "main", "df/dcb/greedy__algorithms_2dijkstra_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
[ "minimum_distance", "df/dcb/greedy__algorithms_2dijkstra_8cpp.html#ac6731ab96fb83453aff4682d16fe2ea7", null ],
[ "print", "df/dcb/greedy__algorithms_2dijkstra_8cpp.html#a58aba3d694f77ce934f4e94042321649", null ],
[ "minimum_distance", "df/dcb/greedy__algorithms_2dijkstra_8cpp.html#af6cb29ca6dc5771439f6ea7262058a71", null ],
[ "print", "df/dcb/greedy__algorithms_2dijkstra_8cpp.html#a7341d7c76a6145e991cdd231f689fca8", null ],
[ "tests", "df/dcb/greedy__algorithms_2dijkstra_8cpp.html#a483bb8ccf42aaf7375a83e91490eda1e", null ]
];

View File

@@ -0,0 +1,4 @@
<map id="greedy_algorithms::dijkstra::minimum_distance" name="greedy_algorithms::dijkstra::minimum_distance">
<area shape="rect" id="Node000001" title="Utility function that finds the vertex with the minimum distance in mdist." alt="" coords="5,29,186,70"/>
<area shape="poly" id="edge1_Node000001_Node000001" title=" " alt="" coords="61,29,59,19,65,10,77,5,96,3,116,5,127,12,125,16,114,10,95,8,79,10,68,14,64,20,66,28"/>
</map>

View File

@@ -0,0 +1 @@
8b0cadfc1f880efbf729f96d06db14a3

View File

@@ -0,0 +1,56 @@
<?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 8.1.0 (20230707.0739)
-->
<!-- Title: greedy_algorithms::dijkstra::minimum_distance Pages: 1 -->
<svg width="143pt" height="57pt"
viewBox="0.00 0.00 143.25 56.50" 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" onload="init(evt)">
<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 52.5)">
<title>greedy_algorithms::dijkstra::minimum_distance</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Utility function that finds the vertex with the minimum distance in mdist.">
<polygon fill="#999999" stroke="#666666" points="135.25,-30.5 0,-30.5 0,0 135.25,0 135.25,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms::</text>
<text text-anchor="middle" x="67.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">dijkstra::minimum_distance</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M43.66,-30.99C38.77,-40.06 46.76,-48.5 67.62,-48.5 79.36,-48.5 87.03,-45.83 90.62,-41.88"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="94.18,-42.26 91.59,-31.99 87.21,-41.63 94.18,-42.26"/>
</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>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1,31 @@
<?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 8.1.0 (20230707.0739)
-->
<!-- Title: greedy_algorithms::dijkstra::minimum_distance Pages: 1 -->
<svg width="143pt" height="57pt"
viewBox="0.00 0.00 143.25 56.50" 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 52.5)">
<title>greedy_algorithms::dijkstra::minimum_distance</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Utility function that finds the vertex with the minimum distance in mdist.">
<polygon fill="#999999" stroke="#666666" points="135.25,-30.5 0,-30.5 0,0 135.25,0 135.25,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms::</text>
<text text-anchor="middle" x="67.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">dijkstra::minimum_distance</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000001" class="edge">
<title>Node1&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000001"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M43.66,-30.99C38.77,-40.06 46.76,-48.5 67.62,-48.5 79.36,-48.5 87.03,-45.83 90.62,-41.88"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="94.18,-42.26 91.59,-31.99 87.21,-41.63 94.18,-42.26"/>
</a>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,6 @@
<map id="greedy_algorithms::dijkstra::dijkstra" name="greedy_algorithms::dijkstra::dijkstra">
<area shape="rect" id="Node000001" title="The main function that finds the shortest path from a given source to all other vertices using Dijkst..." alt="" coords="5,29,141,70"/>
<area shape="rect" id="Node000002" href="$df/dcb/greedy__algorithms_2dijkstra_8cpp.html#af6cb29ca6dc5771439f6ea7262058a71" title="Utility function that finds the vertex with the minimum distance in mdist." alt="" coords="189,29,369,70"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="141,47,174,47,174,52,141,52"/>
<area shape="poly" id="edge2_Node000002_Node000002" title=" " alt="" coords="240,29,238,19,244,10,258,5,279,3,302,5,315,12,313,17,300,10,279,8,259,10,248,15,243,20,245,28"/>
</map>

View File

@@ -0,0 +1 @@
493345e972ec158313c96f0090a8b93c

View File

@@ -0,0 +1,75 @@
<?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 8.1.0 (20230707.0739)
-->
<!-- Title: greedy_algorithms::dijkstra::dijkstra Pages: 1 -->
<svg width="281pt" height="57pt"
viewBox="0.00 0.00 280.75 56.50" 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" onload="init(evt)">
<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 52.5)">
<title>greedy_algorithms::dijkstra::dijkstra</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="The main function that finds the shortest path from a given source to all other vertices using Dijkst...">
<polygon fill="#999999" stroke="#666666" points="101.5,-30.5 0,-30.5 0,0 101.5,0 101.5,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms::</text>
<text text-anchor="middle" x="50.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">dijkstra::dijkstra</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../df/dcb/greedy__algorithms_2dijkstra_8cpp.html#af6cb29ca6dc5771439f6ea7262058a71" target="_top" xlink:title="Utility function that finds the vertex with the minimum distance in mdist.">
<polygon fill="white" stroke="#666666" points="272.75,-30.5 137.5,-30.5 137.5,0 272.75,0 272.75,-30.5"/>
<text text-anchor="start" x="145.5" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms::</text>
<text text-anchor="middle" x="205.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">dijkstra::minimum_distance</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M101.64,-15.25C109.55,-15.25 117.89,-15.25 126.25,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="126.23,-18.75 136.23,-15.25 126.23,-11.75 126.23,-18.75"/>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2_Node000002_Node000002" class="edge">
<title>Node2&#45;&gt;Node2</title>
<g id="a_edge2_Node000002_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M177.77,-30.99C172.19,-40.06 181.31,-48.5 205.12,-48.5 218.52,-48.5 227.27,-45.83 231.37,-41.88"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="234.94,-42.29 232.48,-31.99 227.98,-41.58 234.94,-42.29"/>
</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>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -0,0 +1,50 @@
<?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 8.1.0 (20230707.0739)
-->
<!-- Title: greedy_algorithms::dijkstra::dijkstra Pages: 1 -->
<svg width="281pt" height="57pt"
viewBox="0.00 0.00 280.75 56.50" 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 52.5)">
<title>greedy_algorithms::dijkstra::dijkstra</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="The main function that finds the shortest path from a given source to all other vertices using Dijkst...">
<polygon fill="#999999" stroke="#666666" points="101.5,-30.5 0,-30.5 0,0 101.5,0 101.5,-30.5"/>
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms::</text>
<text text-anchor="middle" x="50.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">dijkstra::dijkstra</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a xlink:href="../../df/dcb/greedy__algorithms_2dijkstra_8cpp.html#af6cb29ca6dc5771439f6ea7262058a71" target="_top" xlink:title="Utility function that finds the vertex with the minimum distance in mdist.">
<polygon fill="white" stroke="#666666" points="272.75,-30.5 137.5,-30.5 137.5,0 272.75,0 272.75,-30.5"/>
<text text-anchor="start" x="145.5" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms::</text>
<text text-anchor="middle" x="205.12" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">dijkstra::minimum_distance</text>
</a>
</g>
</g>
<!-- Node1&#45;&gt;Node2 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node1&#45;&gt;Node2</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M101.64,-15.25C109.55,-15.25 117.89,-15.25 126.25,-15.25"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="126.23,-18.75 136.23,-15.25 126.23,-11.75 126.23,-18.75"/>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node2 -->
<g id="edge2_Node000002_Node000002" class="edge">
<title>Node2&#45;&gt;Node2</title>
<g id="a_edge2_Node000002_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#63b8ff" d="M177.77,-30.99C172.19,-40.06 181.31,-48.5 205.12,-48.5 218.52,-48.5 227.27,-45.83 231.37,-41.88"/>
<polygon fill="#63b8ff" stroke="#63b8ff" points="234.94,-42.29 232.48,-31.99 227.98,-41.58 234.94,-42.29"/>
</a>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,5 @@
<map id="greedy_algorithms::dijkstra::Graph" name="greedy_algorithms::dijkstra::Graph">
<area shape="rect" id="Node000001" title="Wrapper class for storing a graph." alt="" coords="16,109,152,150"/>
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/vector.html" title=" " alt="" coords="5,5,163,46"/>
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="87,61,87,109,81,109,81,61"/>
</map>

View File

@@ -0,0 +1 @@
24db918ea4b864252d7d1e4eb4c36930

View File

@@ -0,0 +1,67 @@
<?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 8.1.0 (20230707.0739)
-->
<!-- Title: greedy_algorithms::dijkstra::Graph Pages: 1 -->
<svg width="126pt" height="116pt"
viewBox="0.00 0.00 126.00 116.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" onload="init(evt)">
<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 112.25)">
<title>greedy_algorithms::dijkstra::Graph</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Wrapper class for storing a graph.">
<polygon fill="#999999" stroke="#666666" points="109.75,-30.5 8.25,-30.5 8.25,0 109.75,0 109.75,-30.5"/>
<text text-anchor="start" x="16.25" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms::</text>
<text text-anchor="middle" x="59" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">dijkstra::Graph</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector.html" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="118,-108.25 0,-108.25 0,-77.75 118,-77.75 118,-108.25"/>
<text text-anchor="start" x="8" y="-94.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector&lt; std::vector</text>
<text text-anchor="middle" x="59" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">&lt; int &gt; &gt;</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node2&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M59,-66.71C59,-54.78 59,-40.96 59,-30.81"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="55.5,-66.39 59,-76.39 62.5,-66.39 55.5,-66.39"/>
</a>
</g>
<text text-anchor="middle" x="73.62" y="-50.25" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> edges</text>
</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>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,42 @@
<?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 8.1.0 (20230707.0739)
-->
<!-- Title: greedy_algorithms::dijkstra::Graph Pages: 1 -->
<svg width="126pt" height="116pt"
viewBox="0.00 0.00 126.00 116.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 112.25)">
<title>greedy_algorithms::dijkstra::Graph</title>
<!-- Node1 -->
<g id="Node000001" class="node">
<title>Node1</title>
<g id="a_Node000001"><a xlink:title="Wrapper class for storing a graph.">
<polygon fill="#999999" stroke="#666666" points="109.75,-30.5 8.25,-30.5 8.25,0 109.75,0 109.75,-30.5"/>
<text text-anchor="start" x="16.25" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms::</text>
<text text-anchor="middle" x="59" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">dijkstra::Graph</text>
</a>
</g>
</g>
<!-- Node2 -->
<g id="Node000002" class="node">
<title>Node2</title>
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/vector.html" xlink:title=" ">
<polygon fill="white" stroke="#666666" points="118,-108.25 0,-108.25 0,-77.75 118,-77.75 118,-108.25"/>
<text text-anchor="start" x="8" y="-94.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::vector&lt; std::vector</text>
<text text-anchor="middle" x="59" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">&lt; int &gt; &gt;</text>
</a>
</g>
</g>
<!-- Node2&#45;&gt;Node1 -->
<g id="edge1_Node000001_Node000002" class="edge">
<title>Node2&#45;&gt;Node1</title>
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
<path fill="none" stroke="#9a32cd" stroke-dasharray="5,2" d="M59,-66.71C59,-54.78 59,-40.96 59,-30.81"/>
<polygon fill="#9a32cd" stroke="#9a32cd" points="55.5,-66.39 59,-76.39 62.5,-66.39 55.5,-66.39"/>
</a>
</g>
<text text-anchor="middle" x="73.62" y="-50.25" font-family="Helvetica,sans-Serif" font-size="10.00" fill="grey"> edges</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB