a00009.html 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
  5. <title>GTL - Graph Template Library: dijkstra Class Reference</title>
  6. <link href="doxygen.css" rel="stylesheet" type="text/css">
  7. </head>
  8. <body>
  9. <p class="links">
  10. <a href="../index.html">Home</a> |
  11. Documentation |
  12. <a href="../register.html">Download</a> |
  13. <a href="../platforms.html">Platforms</a> |
  14. <a href="../refer.html">Projects</a> |
  15. <a href="../lists.html">Mailing Lists</a> |
  16. <a href="../history.html">Version History</a>
  17. </p>
  18. <!-- Generated by Doxygen 1.5.3 -->
  19. <div class="tabs">
  20. <ul>
  21. <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
  22. <li class="current"><a href="classes.html"><span>Classes</span></a></li>
  23. <li><a href="files.html"><span>Files</span></a></li>
  24. <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  25. </ul>
  26. </div>
  27. <div class="tabs">
  28. <ul>
  29. <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
  30. <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
  31. <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
  32. <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  33. </ul>
  34. </div>
  35. <h1>dijkstra Class Reference</h1><!-- doxytag: class="dijkstra" --><!-- doxytag: inherits="algorithm" -->Dijkstra's Algorithm for computing single source shortest path.
  36. <a href="#_details">More...</a>
  37. <p>
  38. <div class="dynheader">
  39. Inheritance diagram for dijkstra:</div>
  40. <div class="dynsection">
  41. <p><center><img src="a00136.gif" border="0" usemap="#a00137" alt="Inheritance graph"></center>
  42. <map name="a00137">
  43. <area shape="rect" href="a00001.html" title="Abstract baseclass for all algoritm&#45;classes." alt="" coords="5,7,83,31"></map>
  44. <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
  45. <div class="dynheader">
  46. Collaboration diagram for dijkstra:</div>
  47. <div class="dynsection">
  48. <p><center><img src="a00138.gif" border="0" usemap="#a00139" alt="Collaboration graph"></center>
  49. <map name="a00139">
  50. <area shape="rect" href="a00001.html" title="Abstract baseclass for all algoritm&#45;classes." alt="" coords="501,5,579,29"><area shape="rect" href="a00020.html" title="A node in a graph." alt="" coords="515,92,565,116"><area shape="rect" title="s\nt" alt="" coords="563,97,571,105"><area shape="rect" title="s\nt" alt="" coords="844,209,852,217"><area shape="rect" title="int_node" alt="" coords="511,92,519,100"><area shape="rect" title="int_node" alt="" coords="563,92,571,100"><area shape="rect" href="a00021.html" title="node_map\&lt; int \&gt;" alt="" coords="479,140,601,164"><area shape="rect" title="mark" alt="" coords="597,151,605,159"><area shape="rect" title="mark" alt="" coords="831,209,839,217"><area shape="rect" href="a00019.html" title="ne_map\&lt; node, int, graph, allocator\&lt; int \&gt; \&gt;" alt="" coords="61,140,344,164"><area shape="rect" href="a00021.html" title="node_map\&lt; edge \&gt;" alt="" coords="471,188,609,212"><area shape="rect" title="pred" alt="" coords="605,201,613,209"><area shape="rect" title="pred" alt="" coords="816,219,824,227"><area shape="rect" href="a00019.html" title="ne_map\&lt; node, edge, graph, allocator\&lt; edge \&gt; \&gt;" alt="" coords="45,188,360,212"><area shape="rect" href="a00021.html" title="node_map\&lt; list\&lt; node \&gt; \&gt;" alt="" coords="451,236,629,260"><area shape="rect" title="shortest_path_node_list" alt="" coords="625,251,633,259"><area shape="rect" title="shortest_path_node_list" alt="" coords="816,235,824,243"><area shape="rect" href="a00019.html" title="ne_map\&lt; node, list\&lt; node \&gt;, graph, allocator\&lt; list\&lt; node \&gt; \&gt; \&gt;" alt="" coords="5,236,400,260"><area shape="rect" href="a00011.html" title="edge_map\&lt; double \&gt;" alt="" coords="465,284,615,308"><area shape="rect" title="weight" alt="" coords="611,299,619,307"><area shape="rect" title="weight" alt="" coords="837,235,845,243"><area shape="rect" href="a00019.html" title="ne_map\&lt; edge, double, graph, allocator\&lt; double \&gt; \&gt;" alt="" coords="36,284,369,308"><area shape="rect" href="a00021.html" title="node_map\&lt; list\&lt; edge \&gt; \&gt;" alt="" coords="451,332,629,356"><area shape="rect" title="shortest_path_edge_list" alt="" coords="623,353,631,361"><area shape="rect" title="shortest_path_edge_list" alt="" coords="845,235,853,243"><area shape="rect" href="a00019.html" title="ne_map\&lt; node, list\&lt; edge \&gt;, graph, allocator\&lt; list\&lt; edge \&gt; \&gt; \&gt;" alt="" coords="5,332,400,356"><area shape="rect" href="a00021.html" title="node_map\&lt; double \&gt;" alt="" coords="465,380,615,404"><area shape="rect" title="dist" alt="" coords="591,401,599,409"><area shape="rect" title="dist" alt="" coords="845,235,853,243"><area shape="rect" href="a00019.html" title="ne_map\&lt; node, double, graph, allocator\&lt; double \&gt; \&gt;" alt="" coords="36,380,369,404"></map>
  51. <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
  52. <p>
  53. <a href="a00140.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
  54. <tr><td></td></tr>
  55. <tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
  56. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5062e9a8339848666efcf2143c4c1881"></a><!-- doxytag: member="dijkstra::shortest_path_node_iterator" ref="5062e9a8339848666efcf2143c4c1881" args="" -->
  57. typedef list&lt; <a class="el" href="a00020.html">node</a> &gt;<br>
  58. ::const_iterator&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#5062e9a8339848666efcf2143c4c1881">shortest_path_node_iterator</a></td></tr>
  59. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Iterator type for traversing nodes on one shortest path. <br></td></tr>
  60. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d35d95d4ed7a4202a5d048a63aa115b9"></a><!-- doxytag: member="dijkstra::shortest_path_edge_iterator" ref="d35d95d4ed7a4202a5d048a63aa115b9" args="" -->
  61. typedef list&lt; <a class="el" href="a00010.html">edge</a> &gt;<br>
  62. ::const_iterator&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#d35d95d4ed7a4202a5d048a63aa115b9">shortest_path_edge_iterator</a></td></tr>
  63. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Iterator type for traversing edges on one shortest path. <br></td></tr>
  64. <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
  65. <tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#64a1fcb9cca32ff932b9b98a08cff106">dijkstra</a> ()</td></tr>
  66. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor. <a href="#64a1fcb9cca32ff932b9b98a08cff106"></a><br></td></tr>
  67. <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#3840ee3f3f49662f31e9bfab46fd0d12">~dijkstra</a> ()</td></tr>
  68. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. <a href="#3840ee3f3f49662f31e9bfab46fd0d12"></a><br></td></tr>
  69. <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#9689f2628f76ddb3747ea18c91bd7041">source</a> (const <a class="el" href="a00020.html">node</a> &amp;n)</td></tr>
  70. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets source node. <a href="#9689f2628f76ddb3747ea18c91bd7041"></a><br></td></tr>
  71. <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#1e9971d767046306574551a461aa2238">target</a> (const <a class="el" href="a00020.html">node</a> &amp;n)</td></tr>
  72. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets target node. <a href="#1e9971d767046306574551a461aa2238"></a><br></td></tr>
  73. <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#92f4394b757f6ffcb372535114a6cbf6">weights</a> (const <a class="el" href="a00011.html">edge_map</a>&lt; double &gt; &amp;weight)</td></tr>
  74. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets weights of the edges. <a href="#92f4394b757f6ffcb372535114a6cbf6"></a><br></td></tr>
  75. <tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#f79383dbbb6b737afcefd8e32350192d">store_preds</a> (bool set)</td></tr>
  76. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enables or disables the storing of predecessors. <a href="#f79383dbbb6b737afcefd8e32350192d"></a><br></td></tr>
  77. <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#fb4aff7134caa15dcce88668c54899aa">check</a> (<a class="el" href="a00014.html">graph</a> &amp;G)</td></tr>
  78. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Checks whether the preconditions for Dijkstra are satisfied. <a href="#fb4aff7134caa15dcce88668c54899aa"></a><br></td></tr>
  79. <tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#7b30f3d8ad42baae27989bc14befe0d0">run</a> (<a class="el" href="a00014.html">graph</a> &amp;G)</td></tr>
  80. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Runs shortest path algorithm on <code>G</code>. <a href="#7b30f3d8ad42baae27989bc14befe0d0"></a><br></td></tr>
  81. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00020.html">node</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#a91b7c49f9ca6b40a4b95747238fabdc">source</a> () const </td></tr>
  82. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns source node. <a href="#a91b7c49f9ca6b40a4b95747238fabdc"></a><br></td></tr>
  83. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00020.html">node</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#65fe009e1b882ccebfd62b876d76223d">target</a> () const </td></tr>
  84. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns target node if set, <code><a class="el" href="a00020.html#82669b7358b50bd8d7888d7df4ff8dfa">node::node()</a></code> else. <a href="#65fe009e1b882ccebfd62b876d76223d"></a><br></td></tr>
  85. <tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#a099fc1273e1a7f5902cfe02d5ddabdf">store_preds</a> () const </td></tr>
  86. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns whether the storing of predecessors is enabled. <a href="#a099fc1273e1a7f5902cfe02d5ddabdf"></a><br></td></tr>
  87. <tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#eda156a71bc3eacfb9192e79e5581fef">reached</a> (const <a class="el" href="a00020.html">node</a> &amp;n) const </td></tr>
  88. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns whether <code>n</code> is reachable from source node. <a href="#eda156a71bc3eacfb9192e79e5581fef"></a><br></td></tr>
  89. <tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#d2195288151f7b95bad96f186faef815">distance</a> (const <a class="el" href="a00020.html">node</a> &amp;n) const </td></tr>
  90. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the distance from source node to node <code>n</code>. <a href="#d2195288151f7b95bad96f186faef815"></a><br></td></tr>
  91. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00020.html">node</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#4885d97269ef954ea17047ebf8a697ab">predecessor_node</a> (const <a class="el" href="a00020.html">node</a> &amp;n) const </td></tr>
  92. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Predecessor node of node <code>n</code> on the shortest path from the source node. <a href="#4885d97269ef954ea17047ebf8a697ab"></a><br></td></tr>
  93. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00010.html">edge</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#f33f8c44fbe24f40e79c725b782b97dc">predecessor_edge</a> (const <a class="el" href="a00020.html">node</a> &amp;n) const </td></tr>
  94. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Predecessor edge of node <code>n</code> on the shortest path from the source node. <a href="#f33f8c44fbe24f40e79c725b782b97dc"></a><br></td></tr>
  95. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00009.html#5062e9a8339848666efcf2143c4c1881">shortest_path_node_iterator</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#fb6b11117d954b6f83ef03735f47a7e3">shortest_path_nodes_begin</a> (const <a class="el" href="a00020.html">node</a> &amp;dest)</td></tr>
  96. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns an iterator to the beginning (to the source node) of a shortest node path to node <code>dest</code>. <a href="#fb6b11117d954b6f83ef03735f47a7e3"></a><br></td></tr>
  97. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00009.html#5062e9a8339848666efcf2143c4c1881">shortest_path_node_iterator</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#5e7c8dd055ab5e397b3ba22292d07024">shortest_path_nodes_end</a> (const <a class="el" href="a00020.html">node</a> &amp;dest)</td></tr>
  98. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns an iterator one after the end (one after node <code>dest</code>) of a shortest node path to node <code>dest</code>. <a href="#5e7c8dd055ab5e397b3ba22292d07024"></a><br></td></tr>
  99. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00009.html#d35d95d4ed7a4202a5d048a63aa115b9">shortest_path_edge_iterator</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#c2bc10ad8c2df1a1db40dc6ee8af1089">shortest_path_edges_begin</a> (const <a class="el" href="a00020.html">node</a> &amp;dest)</td></tr>
  100. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns an iterator to the beginning edge of a shortest edge path to node <code>dest</code>. <a href="#c2bc10ad8c2df1a1db40dc6ee8af1089"></a><br></td></tr>
  101. <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00009.html#d35d95d4ed7a4202a5d048a63aa115b9">shortest_path_edge_iterator</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#df4b143b1c583871819028a734a1ab01">shortest_path_edges_end</a> (const <a class="el" href="a00020.html">node</a> &amp;dest)</td></tr>
  102. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns an iterator one after the end of a shortest edge path to node <code>dest</code>. <a href="#df4b143b1c583871819028a734a1ab01"></a><br></td></tr>
  103. <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00009.html#16f9249e8cce25cbd0a3297fc8fa9a44">reset</a> ()</td></tr>
  104. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Resets Dijkstra's <a class="el" href="a00001.html" title="Abstract baseclass for all algoritm-classes.">algorithm</a>. <a href="#16f9249e8cce25cbd0a3297fc8fa9a44"></a><br></td></tr>
  105. </table>
  106. <hr><a name="_details"></a><h2>Detailed Description</h2>
  107. Dijkstra's Algorithm for computing single source shortest path.
  108. <p>
  109. This class implements Dijkstra's <a class="el" href="a00001.html" title="Abstract baseclass for all algoritm-classes.">algorithm</a> for computing single source shortest path in <img class="formulaInl" alt="$\mathcal{O}((|V| + |E|) log |V|)$" src="form_0.png"> worst case.<p>
  110. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="a00002.html" title="Bellman Ford algorithm.">bellman_ford</a></dd></dl>
  111. <dl class="author" compact><dt><b>Author:</b></dt><dd>Christian Bachmaier <a href="mailto:chris@infosun.fmi.uni-passau.de">chris@infosun.fmi.uni-passau.de</a> </dd></dl>
  112. <hr><h2>Constructor &amp; Destructor Documentation</h2>
  113. <a class="anchor" name="64a1fcb9cca32ff932b9b98a08cff106"></a><!-- doxytag: member="dijkstra::dijkstra" ref="64a1fcb9cca32ff932b9b98a08cff106" args="()" -->
  114. <div class="memitem">
  115. <div class="memproto">
  116. <table class="memname">
  117. <tr>
  118. <td class="memname">dijkstra::dijkstra </td>
  119. <td>(</td>
  120. <td class="paramname"> </td>
  121. <td>&nbsp;)&nbsp;</td>
  122. <td width="100%"></td>
  123. </tr>
  124. </table>
  125. </div>
  126. <div class="memdoc">
  127. <p>
  128. Default constructor.
  129. <p>
  130. Enables only the calculation of shortest paths.<p>
  131. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="a00001.html#b79e1ddec2f2afdf4b36b10724db8b15" title="Creates an algorithm object.">algorithm::algorithm</a> </dd></dl>
  132. </div>
  133. </div><p>
  134. <a class="anchor" name="3840ee3f3f49662f31e9bfab46fd0d12"></a><!-- doxytag: member="dijkstra::~dijkstra" ref="3840ee3f3f49662f31e9bfab46fd0d12" args="()" -->
  135. <div class="memitem">
  136. <div class="memproto">
  137. <table class="memname">
  138. <tr>
  139. <td class="memname">virtual dijkstra::~dijkstra </td>
  140. <td>(</td>
  141. <td class="paramname"> </td>
  142. <td>&nbsp;)&nbsp;</td>
  143. <td width="100%"><code> [virtual]</code></td>
  144. </tr>
  145. </table>
  146. </div>
  147. <div class="memdoc">
  148. <p>
  149. Destructor.
  150. <p>
  151. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="a00001.html#dca9b1e7fa3afd914519a9dbb44e9fd5" title="Destroys the algorithm object.">algorithm::~algorithm</a> </dd></dl>
  152. </div>
  153. </div><p>
  154. <hr><h2>Member Function Documentation</h2>
  155. <a class="anchor" name="9689f2628f76ddb3747ea18c91bd7041"></a><!-- doxytag: member="dijkstra::source" ref="9689f2628f76ddb3747ea18c91bd7041" args="(const node &amp;n)" -->
  156. <div class="memitem">
  157. <div class="memproto">
  158. <table class="memname">
  159. <tr>
  160. <td class="memname">void dijkstra::source </td>
  161. <td>(</td>
  162. <td class="paramtype">const <a class="el" href="a00020.html">node</a> &amp;&nbsp;</td>
  163. <td class="paramname"> <em>n</em> </td>
  164. <td>&nbsp;)&nbsp;</td>
  165. <td width="100%"></td>
  166. </tr>
  167. </table>
  168. </div>
  169. <div class="memdoc">
  170. <p>
  171. Sets source node.
  172. <p>
  173. The default source is the invalid node (<a class="el" href="a00020.html#82669b7358b50bd8d7888d7df4ff8dfa">node::node()</a>), in this case an arbitrary node is chosen and stored when this <a class="el" href="a00001.html" title="Abstract baseclass for all algoritm-classes.">algorithm</a> is run.<p>
  174. <dl compact><dt><b>Parameters:</b></dt><dd>
  175. <table border="0" cellspacing="2" cellpadding="0">
  176. <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>source <a class="el" href="a00020.html" title="A node in a graph.">node</a> </td></tr>
  177. </table>
  178. </dl>
  179. </div>
  180. </div><p>
  181. <a class="anchor" name="1e9971d767046306574551a461aa2238"></a><!-- doxytag: member="dijkstra::target" ref="1e9971d767046306574551a461aa2238" args="(const node &amp;n)" -->
  182. <div class="memitem">
  183. <div class="memproto">
  184. <table class="memname">
  185. <tr>
  186. <td class="memname">void dijkstra::target </td>
  187. <td>(</td>
  188. <td class="paramtype">const <a class="el" href="a00020.html">node</a> &amp;&nbsp;</td>
  189. <td class="paramname"> <em>n</em> </td>
  190. <td>&nbsp;)&nbsp;</td>
  191. <td width="100%"></td>
  192. </tr>
  193. </table>
  194. </div>
  195. <div class="memdoc">
  196. <p>
  197. Sets target node.
  198. <p>
  199. If a target is set with this method the algorithm stops if a shortest distance to <code>n</code> is found. Ohterwise shortest paths are computed from source to any node in the graph.<p>
  200. <dl compact><dt><b>Parameters:</b></dt><dd>
  201. <table border="0" cellspacing="2" cellpadding="0">
  202. <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>target <a class="el" href="a00020.html" title="A node in a graph.">node</a> </td></tr>
  203. </table>
  204. </dl>
  205. </div>
  206. </div><p>
  207. <a class="anchor" name="92f4394b757f6ffcb372535114a6cbf6"></a><!-- doxytag: member="dijkstra::weights" ref="92f4394b757f6ffcb372535114a6cbf6" args="(const edge_map&lt; double &gt; &amp;weight)" -->
  208. <div class="memitem">
  209. <div class="memproto">
  210. <table class="memname">
  211. <tr>
  212. <td class="memname">void dijkstra::weights </td>
  213. <td>(</td>
  214. <td class="paramtype">const <a class="el" href="a00011.html">edge_map</a>&lt; double &gt; &amp;&nbsp;</td>
  215. <td class="paramname"> <em>weight</em> </td>
  216. <td>&nbsp;)&nbsp;</td>
  217. <td width="100%"></td>
  218. </tr>
  219. </table>
  220. </div>
  221. <div class="memdoc">
  222. <p>
  223. Sets weights of the edges.
  224. <p>
  225. This method <b>must</b> be called before check run.<p>
  226. <dl compact><dt><b>Parameters:</b></dt><dd>
  227. <table border="0" cellspacing="2" cellpadding="0">
  228. <tr><td valign="top"></td><td valign="top"><em>weight</em>&nbsp;</td><td>weights of the edges </td></tr>
  229. </table>
  230. </dl>
  231. </div>
  232. </div><p>
  233. <a class="anchor" name="f79383dbbb6b737afcefd8e32350192d"></a><!-- doxytag: member="dijkstra::store_preds" ref="f79383dbbb6b737afcefd8e32350192d" args="(bool set)" -->
  234. <div class="memitem">
  235. <div class="memproto">
  236. <table class="memname">
  237. <tr>
  238. <td class="memname">void dijkstra::store_preds </td>
  239. <td>(</td>
  240. <td class="paramtype">bool&nbsp;</td>
  241. <td class="paramname"> <em>set</em> </td>
  242. <td>&nbsp;)&nbsp;</td>
  243. <td width="100%"></td>
  244. </tr>
  245. </table>
  246. </div>
  247. <div class="memdoc">
  248. <p>
  249. Enables or disables the storing of predecessors.
  250. <p>
  251. If enabled for every node the predecessor on the shortest path from will be stored.<p>
  252. <dl compact><dt><b>Parameters:</b></dt><dd>
  253. <table border="0" cellspacing="2" cellpadding="0">
  254. <tr><td valign="top"></td><td valign="top"><em>set</em>&nbsp;</td><td><code>true</code> if predecessors should be stored</td></tr>
  255. </table>
  256. </dl>
  257. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="a00009.html#4885d97269ef954ea17047ebf8a697ab" title="Predecessor node of node n on the shortest path from the source node.">dijkstra::predecessor_node</a> <p>
  258. <a class="el" href="a00009.html#f33f8c44fbe24f40e79c725b782b97dc" title="Predecessor edge of node n on the shortest path from the source node.">dijkstra::predecessor_edge</a> </dd></dl>
  259. </div>
  260. </div><p>
  261. <a class="anchor" name="fb4aff7134caa15dcce88668c54899aa"></a><!-- doxytag: member="dijkstra::check" ref="fb4aff7134caa15dcce88668c54899aa" args="(graph &amp;G)" -->
  262. <div class="memitem">
  263. <div class="memproto">
  264. <table class="memname">
  265. <tr>
  266. <td class="memname">virtual int dijkstra::check </td>
  267. <td>(</td>
  268. <td class="paramtype"><a class="el" href="a00014.html">graph</a> &amp;&nbsp;</td>
  269. <td class="paramname"> <em>G</em> </td>
  270. <td>&nbsp;)&nbsp;</td>
  271. <td width="100%"><code> [virtual]</code></td>
  272. </tr>
  273. </table>
  274. </div>
  275. <div class="memdoc">
  276. <p>
  277. Checks whether the preconditions for Dijkstra are satisfied.
  278. <p>
  279. Necessary preconditions are:<ul>
  280. <li>the weights of the edges are set</li><li>the graph <code>G</code> has at least one node</li><li>all edge weights must be <img class="formulaInl" alt="$\ge 0$" src="form_1.png"></li><li>the source node and (if set) target node must be found in <code>G</code> </li></ul>
  281. <p>
  282. <dl compact><dt><b>Parameters:</b></dt><dd>
  283. <table border="0" cellspacing="2" cellpadding="0">
  284. <tr><td valign="top"></td><td valign="top"><em>G</em>&nbsp;</td><td><a class="el" href="a00014.html" title="A directed or undirected graph.">graph</a></td></tr>
  285. </table>
  286. </dl>
  287. <dl compact><dt><b>Return values:</b></dt><dd>
  288. <table border="0" cellspacing="2" cellpadding="0">
  289. <tr><td valign="top"></td><td valign="top"><em><a class="el" href="a00001.html#f1a0078e153aa99c24f9bdf0d97f67105114c20e4a96a76b5de9f28bf15e282b">algorithm::GTL_OK</a></em>&nbsp;</td><td>if algorithm can be applied </td></tr>
  290. <tr><td valign="top"></td><td valign="top"><em><a class="el" href="a00001.html#f1a0078e153aa99c24f9bdf0d97f67106fcf574690bbd6cf710837a169510dd7">algorithm::GTL_ERROR</a></em>&nbsp;</td><td>otherwise</td></tr>
  291. </table>
  292. </dl>
  293. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="a00009.html#9689f2628f76ddb3747ea18c91bd7041" title="Sets source node.">dijkstra::source</a> <p>
  294. <a class="el" href="a00009.html#92f4394b757f6ffcb372535114a6cbf6" title="Sets weights of the edges.">dijkstra::weights</a> <p>
  295. <a class="el" href="a00001.html#76361fb03ad1cf643affc51821e43bed" title="Checks whether all preconditions are satisfied.">algorithm::check</a> </dd></dl>
  296. <p>Implements <a class="el" href="a00001.html#76361fb03ad1cf643affc51821e43bed">algorithm</a>.</p>
  297. </div>
  298. </div><p>
  299. <a class="anchor" name="7b30f3d8ad42baae27989bc14befe0d0"></a><!-- doxytag: member="dijkstra::run" ref="7b30f3d8ad42baae27989bc14befe0d0" args="(graph &amp;G)" -->
  300. <div class="memitem">
  301. <div class="memproto">
  302. <table class="memname">
  303. <tr>
  304. <td class="memname">int dijkstra::run </td>
  305. <td>(</td>
  306. <td class="paramtype"><a class="el" href="a00014.html">graph</a> &amp;&nbsp;</td>
  307. <td class="paramname"> <em>G</em> </td>
  308. <td>&nbsp;)&nbsp;</td>
  309. <td width="100%"><code> [virtual]</code></td>
  310. </tr>
  311. </table>
  312. </div>
  313. <div class="memdoc">
  314. <p>
  315. Runs shortest path algorithm on <code>G</code>.
  316. <p>
  317. This should return always <a class="el" href="a00001.html#f1a0078e153aa99c24f9bdf0d97f67105114c20e4a96a76b5de9f28bf15e282b">algorithm::GTL_OK</a>. The return value only tracks errors that might occur. Afterwards the result of the test can be accessed via access methods.<p>
  318. <dl compact><dt><b>Parameters:</b></dt><dd>
  319. <table border="0" cellspacing="2" cellpadding="0">
  320. <tr><td valign="top"></td><td valign="top"><em>G</em>&nbsp;</td><td><a class="el" href="a00014.html" title="A directed or undirected graph.">graph</a></td></tr>
  321. </table>
  322. </dl>
  323. <dl compact><dt><b>Return values:</b></dt><dd>
  324. <table border="0" cellspacing="2" cellpadding="0">
  325. <tr><td valign="top"></td><td valign="top"><em><a class="el" href="a00001.html#f1a0078e153aa99c24f9bdf0d97f67105114c20e4a96a76b5de9f28bf15e282b">algorithm::GTL_OK</a></em>&nbsp;</td><td>on success </td></tr>
  326. <tr><td valign="top"></td><td valign="top"><em><a class="el" href="a00001.html#f1a0078e153aa99c24f9bdf0d97f67106fcf574690bbd6cf710837a169510dd7">algorithm::GTL_ERROR</a></em>&nbsp;</td><td>otherwise</td></tr>
  327. </table>
  328. </dl>
  329. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="a00001.html#734b189509a8d6b56b65f8ff772d43ca" title="Applies algorithm to graph g.">algorithm::run</a> </dd></dl>
  330. <p>Implements <a class="el" href="a00001.html#734b189509a8d6b56b65f8ff772d43ca">algorithm</a>.</p>
  331. </div>
  332. </div><p>
  333. <a class="anchor" name="a91b7c49f9ca6b40a4b95747238fabdc"></a><!-- doxytag: member="dijkstra::source" ref="a91b7c49f9ca6b40a4b95747238fabdc" args="() const " -->
  334. <div class="memitem">
  335. <div class="memproto">
  336. <table class="memname">
  337. <tr>
  338. <td class="memname"><a class="el" href="a00020.html">node</a> dijkstra::source </td>
  339. <td>(</td>
  340. <td class="paramname"> </td>
  341. <td>&nbsp;)&nbsp;</td>
  342. <td width="100%"> const</td>
  343. </tr>
  344. </table>
  345. </div>
  346. <div class="memdoc">
  347. <p>
  348. Returns source node.
  349. <p>
  350. <dl class="return" compact><dt><b>Returns:</b></dt><dd>source node </dd></dl>
  351. </div>
  352. </div><p>
  353. <a class="anchor" name="65fe009e1b882ccebfd62b876d76223d"></a><!-- doxytag: member="dijkstra::target" ref="65fe009e1b882ccebfd62b876d76223d" args="() const " -->
  354. <div class="memitem">
  355. <div class="memproto">
  356. <table class="memname">
  357. <tr>
  358. <td class="memname"><a class="el" href="a00020.html">node</a> dijkstra::target </td>
  359. <td>(</td>
  360. <td class="paramname"> </td>
  361. <td>&nbsp;)&nbsp;</td>
  362. <td width="100%"> const</td>
  363. </tr>
  364. </table>
  365. </div>
  366. <div class="memdoc">
  367. <p>
  368. Returns target node if set, <code><a class="el" href="a00020.html#82669b7358b50bd8d7888d7df4ff8dfa">node::node()</a></code> else.
  369. <p>
  370. <dl class="return" compact><dt><b>Returns:</b></dt><dd>target node </dd></dl>
  371. </div>
  372. </div><p>
  373. <a class="anchor" name="a099fc1273e1a7f5902cfe02d5ddabdf"></a><!-- doxytag: member="dijkstra::store_preds" ref="a099fc1273e1a7f5902cfe02d5ddabdf" args="() const " -->
  374. <div class="memitem">
  375. <div class="memproto">
  376. <table class="memname">
  377. <tr>
  378. <td class="memname">bool dijkstra::store_preds </td>
  379. <td>(</td>
  380. <td class="paramname"> </td>
  381. <td>&nbsp;)&nbsp;</td>
  382. <td width="100%"> const</td>
  383. </tr>
  384. </table>
  385. </div>
  386. <div class="memdoc">
  387. <p>
  388. Returns whether the storing of predecessors is enabled.
  389. <p>
  390. <dl class="return" compact><dt><b>Returns:</b></dt><dd><code>true</code> iff the storing of predecessors is enabled</dd></dl>
  391. <dl class="see" compact><dt><b>See also:</b></dt><dd>dijkstra::predecessor </dd></dl>
  392. </div>
  393. </div><p>
  394. <a class="anchor" name="eda156a71bc3eacfb9192e79e5581fef"></a><!-- doxytag: member="dijkstra::reached" ref="eda156a71bc3eacfb9192e79e5581fef" args="(const node &amp;n) const " -->
  395. <div class="memitem">
  396. <div class="memproto">
  397. <table class="memname">
  398. <tr>
  399. <td class="memname">bool dijkstra::reached </td>
  400. <td>(</td>
  401. <td class="paramtype">const <a class="el" href="a00020.html">node</a> &amp;&nbsp;</td>
  402. <td class="paramname"> <em>n</em> </td>
  403. <td>&nbsp;)&nbsp;</td>
  404. <td width="100%"> const</td>
  405. </tr>
  406. </table>
  407. </div>
  408. <div class="memdoc">
  409. <p>
  410. Returns whether <code>n</code> is reachable from source node.
  411. <p>
  412. <dl compact><dt><b>Parameters:</b></dt><dd>
  413. <table border="0" cellspacing="2" cellpadding="0">
  414. <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td><a class="el" href="a00020.html" title="A node in a graph.">node</a></td></tr>
  415. </table>
  416. </dl>
  417. <dl class="return" compact><dt><b>Returns:</b></dt><dd><code>true</code> iff <code>n</code> was reached from source </dd></dl>
  418. </div>
  419. </div><p>
  420. <a class="anchor" name="d2195288151f7b95bad96f186faef815"></a><!-- doxytag: member="dijkstra::distance" ref="d2195288151f7b95bad96f186faef815" args="(const node &amp;n) const " -->
  421. <div class="memitem">
  422. <div class="memproto">
  423. <table class="memname">
  424. <tr>
  425. <td class="memname">double dijkstra::distance </td>
  426. <td>(</td>
  427. <td class="paramtype">const <a class="el" href="a00020.html">node</a> &amp;&nbsp;</td>
  428. <td class="paramname"> <em>n</em> </td>
  429. <td>&nbsp;)&nbsp;</td>
  430. <td width="100%"> const</td>
  431. </tr>
  432. </table>
  433. </div>
  434. <div class="memdoc">
  435. <p>
  436. Returns the distance from source node to node <code>n</code>.
  437. <p>
  438. <dl compact><dt><b>Parameters:</b></dt><dd>
  439. <table border="0" cellspacing="2" cellpadding="0">
  440. <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td><a class="el" href="a00020.html" title="A node in a graph.">node</a></td></tr>
  441. </table>
  442. </dl>
  443. <dl class="return" compact><dt><b>Returns:</b></dt><dd>distance if <code>n</code> is <a class="el" href="a00009.html#eda156a71bc3eacfb9192e79e5581fef" title="Returns whether n is reachable from source node.">dijkstra::reached</a>, <code>-1.0</code> else </dd></dl>
  444. </div>
  445. </div><p>
  446. <a class="anchor" name="4885d97269ef954ea17047ebf8a697ab"></a><!-- doxytag: member="dijkstra::predecessor_node" ref="4885d97269ef954ea17047ebf8a697ab" args="(const node &amp;n) const " -->
  447. <div class="memitem">
  448. <div class="memproto">
  449. <table class="memname">
  450. <tr>
  451. <td class="memname"><a class="el" href="a00020.html">node</a> dijkstra::predecessor_node </td>
  452. <td>(</td>
  453. <td class="paramtype">const <a class="el" href="a00020.html">node</a> &amp;&nbsp;</td>
  454. <td class="paramname"> <em>n</em> </td>
  455. <td>&nbsp;)&nbsp;</td>
  456. <td width="100%"> const</td>
  457. </tr>
  458. </table>
  459. </div>
  460. <div class="memdoc">
  461. <p>
  462. Predecessor node of node <code>n</code> on the shortest path from the source node.
  463. <p>
  464. If <code>n</code> is a root or wasn't reached the return value is the invalid node <a class="el" href="a00020.html#82669b7358b50bd8d7888d7df4ff8dfa">node::node()</a>.<p>
  465. <dl compact><dt><b>Parameters:</b></dt><dd>
  466. <table border="0" cellspacing="2" cellpadding="0">
  467. <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td><a class="el" href="a00020.html" title="A node in a graph.">node</a></td></tr>
  468. </table>
  469. </dl>
  470. <dl class="return" compact><dt><b>Returns:</b></dt><dd>predecessor node of <code>n</code> </dd></dl>
  471. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="a00009.html#f79383dbbb6b737afcefd8e32350192d" title="Enables or disables the storing of predecessors.">dijkstra::store_preds</a> <p>
  472. <a class="el" href="a00009.html#f33f8c44fbe24f40e79c725b782b97dc" title="Predecessor edge of node n on the shortest path from the source node.">dijkstra::predecessor_edge</a></dd></dl>
  473. <dl class="note" compact><dt><b>Note:</b></dt><dd>The method requires that predecessor calculation option was enabled during last run. </dd></dl>
  474. </div>
  475. </div><p>
  476. <a class="anchor" name="f33f8c44fbe24f40e79c725b782b97dc"></a><!-- doxytag: member="dijkstra::predecessor_edge" ref="f33f8c44fbe24f40e79c725b782b97dc" args="(const node &amp;n) const " -->
  477. <div class="memitem">
  478. <div class="memproto">
  479. <table class="memname">
  480. <tr>
  481. <td class="memname"><a class="el" href="a00010.html">edge</a> dijkstra::predecessor_edge </td>
  482. <td>(</td>
  483. <td class="paramtype">const <a class="el" href="a00020.html">node</a> &amp;&nbsp;</td>
  484. <td class="paramname"> <em>n</em> </td>
  485. <td>&nbsp;)&nbsp;</td>
  486. <td width="100%"> const</td>
  487. </tr>
  488. </table>
  489. </div>
  490. <div class="memdoc">
  491. <p>
  492. Predecessor edge of node <code>n</code> on the shortest path from the source node.
  493. <p>
  494. If <code>n</code> is a root or wasn't reached the return value is the invalid edge <a class="el" href="a00010.html#c8047a0d7c1e08a4063be409c6fd0a88">edge::edge()</a>.<p>
  495. <dl compact><dt><b>Parameters:</b></dt><dd>
  496. <table border="0" cellspacing="2" cellpadding="0">
  497. <tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td><a class="el" href="a00020.html" title="A node in a graph.">node</a></td></tr>
  498. </table>
  499. </dl>
  500. <dl class="return" compact><dt><b>Returns:</b></dt><dd>predecessor edge of <code>n</code> </dd></dl>
  501. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="a00009.html#f79383dbbb6b737afcefd8e32350192d" title="Enables or disables the storing of predecessors.">dijkstra::store_preds</a> <p>
  502. <a class="el" href="a00009.html#4885d97269ef954ea17047ebf8a697ab" title="Predecessor node of node n on the shortest path from the source node.">dijkstra::predecessor_node</a></dd></dl>
  503. <dl class="note" compact><dt><b>Note:</b></dt><dd>The method requires that predecessor calculation option was enabled during last run. </dd></dl>
  504. </div>
  505. </div><p>
  506. <a class="anchor" name="fb6b11117d954b6f83ef03735f47a7e3"></a><!-- doxytag: member="dijkstra::shortest_path_nodes_begin" ref="fb6b11117d954b6f83ef03735f47a7e3" args="(const node &amp;dest)" -->
  507. <div class="memitem">
  508. <div class="memproto">
  509. <table class="memname">
  510. <tr>
  511. <td class="memname"><a class="el" href="a00009.html#5062e9a8339848666efcf2143c4c1881">shortest_path_node_iterator</a> dijkstra::shortest_path_nodes_begin </td>
  512. <td>(</td>
  513. <td class="paramtype">const <a class="el" href="a00020.html">node</a> &amp;&nbsp;</td>
  514. <td class="paramname"> <em>dest</em> </td>
  515. <td>&nbsp;)&nbsp;</td>
  516. <td width="100%"></td>
  517. </tr>
  518. </table>
  519. </div>
  520. <div class="memdoc">
  521. <p>
  522. Returns an iterator to the beginning (to the source node) of a shortest node path to node <code>dest</code>.
  523. <p>
  524. <dl compact><dt><b>Parameters:</b></dt><dd>
  525. <table border="0" cellspacing="2" cellpadding="0">
  526. <tr><td valign="top"></td><td valign="top"><em>dest</em>&nbsp;</td><td>target node</td></tr>
  527. </table>
  528. </dl>
  529. <dl class="return" compact><dt><b>Returns:</b></dt><dd>beginning node iterator of a shortest path</dd></dl>
  530. <dl class="note" compact><dt><b>Note:</b></dt><dd>The method requires that predecessor calculation option was enabled during last run. If this method is called on the shortest path to <code>dest</code> for the first time (before <a class="el" href="a00009.html#5e7c8dd055ab5e397b3ba22292d07024" title="Returns an iterator one after the end (one after node dest) of a shortest node path...">dijkstra::shortest_path_nodes_end</a>) it needs <img class="formulaInl" alt="$\mathcal{O}(\mbox{length of this path})$" src="form_2.png"> time. </dd></dl>
  531. </div>
  532. </div><p>
  533. <a class="anchor" name="5e7c8dd055ab5e397b3ba22292d07024"></a><!-- doxytag: member="dijkstra::shortest_path_nodes_end" ref="5e7c8dd055ab5e397b3ba22292d07024" args="(const node &amp;dest)" -->
  534. <div class="memitem">
  535. <div class="memproto">
  536. <table class="memname">
  537. <tr>
  538. <td class="memname"><a class="el" href="a00009.html#5062e9a8339848666efcf2143c4c1881">shortest_path_node_iterator</a> dijkstra::shortest_path_nodes_end </td>
  539. <td>(</td>
  540. <td class="paramtype">const <a class="el" href="a00020.html">node</a> &amp;&nbsp;</td>
  541. <td class="paramname"> <em>dest</em> </td>
  542. <td>&nbsp;)&nbsp;</td>
  543. <td width="100%"></td>
  544. </tr>
  545. </table>
  546. </div>
  547. <div class="memdoc">
  548. <p>
  549. Returns an iterator one after the end (one after node <code>dest</code>) of a shortest node path to node <code>dest</code>.
  550. <p>
  551. <dl compact><dt><b>Parameters:</b></dt><dd>
  552. <table border="0" cellspacing="2" cellpadding="0">
  553. <tr><td valign="top"></td><td valign="top"><em>dest</em>&nbsp;</td><td>target node</td></tr>
  554. </table>
  555. </dl>
  556. <dl class="return" compact><dt><b>Returns:</b></dt><dd>shortest path end node iterator</dd></dl>
  557. <dl class="note" compact><dt><b>Note:</b></dt><dd>The method requires that predecessor calculation option was enabled during last run. If this method is called on the shortest path to <code>dest</code> for the first time (before <a class="el" href="a00009.html#fb6b11117d954b6f83ef03735f47a7e3" title="Returns an iterator to the beginning (to the source node) of a shortest node path...">dijkstra::shortest_path_nodes_begin</a>) it needs <img class="formulaInl" alt="$\mathcal{O}(\mbox{length of this path})$" src="form_2.png"> time. </dd></dl>
  558. </div>
  559. </div><p>
  560. <a class="anchor" name="c2bc10ad8c2df1a1db40dc6ee8af1089"></a><!-- doxytag: member="dijkstra::shortest_path_edges_begin" ref="c2bc10ad8c2df1a1db40dc6ee8af1089" args="(const node &amp;dest)" -->
  561. <div class="memitem">
  562. <div class="memproto">
  563. <table class="memname">
  564. <tr>
  565. <td class="memname"><a class="el" href="a00009.html#d35d95d4ed7a4202a5d048a63aa115b9">shortest_path_edge_iterator</a> dijkstra::shortest_path_edges_begin </td>
  566. <td>(</td>
  567. <td class="paramtype">const <a class="el" href="a00020.html">node</a> &amp;&nbsp;</td>
  568. <td class="paramname"> <em>dest</em> </td>
  569. <td>&nbsp;)&nbsp;</td>
  570. <td width="100%"></td>
  571. </tr>
  572. </table>
  573. </div>
  574. <div class="memdoc">
  575. <p>
  576. Returns an iterator to the beginning edge of a shortest edge path to node <code>dest</code>.
  577. <p>
  578. <dl compact><dt><b>Parameters:</b></dt><dd>
  579. <table border="0" cellspacing="2" cellpadding="0">
  580. <tr><td valign="top"></td><td valign="top"><em>dest</em>&nbsp;</td><td>target node</td></tr>
  581. </table>
  582. </dl>
  583. <dl class="return" compact><dt><b>Returns:</b></dt><dd>beginning edge iterator of a shortest path</dd></dl>
  584. <dl class="note" compact><dt><b>Note:</b></dt><dd>The method requires that predecessor calculation option was enabled during last run. If this method is called on the shortest path to <code>dest</code> for the first time (before <a class="el" href="a00009.html#df4b143b1c583871819028a734a1ab01" title="Returns an iterator one after the end of a shortest edge path to node dest.">dijkstra::shortest_path_edges_end</a>) it needs <img class="formulaInl" alt="$\mathcal{O}(\mbox{length of this path})$" src="form_2.png"> time. </dd></dl>
  585. </div>
  586. </div><p>
  587. <a class="anchor" name="df4b143b1c583871819028a734a1ab01"></a><!-- doxytag: member="dijkstra::shortest_path_edges_end" ref="df4b143b1c583871819028a734a1ab01" args="(const node &amp;dest)" -->
  588. <div class="memitem">
  589. <div class="memproto">
  590. <table class="memname">
  591. <tr>
  592. <td class="memname"><a class="el" href="a00009.html#d35d95d4ed7a4202a5d048a63aa115b9">shortest_path_edge_iterator</a> dijkstra::shortest_path_edges_end </td>
  593. <td>(</td>
  594. <td class="paramtype">const <a class="el" href="a00020.html">node</a> &amp;&nbsp;</td>
  595. <td class="paramname"> <em>dest</em> </td>
  596. <td>&nbsp;)&nbsp;</td>
  597. <td width="100%"></td>
  598. </tr>
  599. </table>
  600. </div>
  601. <div class="memdoc">
  602. <p>
  603. Returns an iterator one after the end of a shortest edge path to node <code>dest</code>.
  604. <p>
  605. <dl compact><dt><b>Parameters:</b></dt><dd>
  606. <table border="0" cellspacing="2" cellpadding="0">
  607. <tr><td valign="top"></td><td valign="top"><em>dest</em>&nbsp;</td><td>target node</td></tr>
  608. </table>
  609. </dl>
  610. <dl class="return" compact><dt><b>Returns:</b></dt><dd>shortest path end edge iterator</dd></dl>
  611. <dl class="note" compact><dt><b>Note:</b></dt><dd>The method requires that predecessor calculation option was enabled during last run. If this method is called on the shortest path to <code>dest</code> for the first time (before <a class="el" href="a00009.html#c2bc10ad8c2df1a1db40dc6ee8af1089" title="Returns an iterator to the beginning edge of a shortest edge path to node dest.">dijkstra::shortest_path_edges_begin</a>) it needs <img class="formulaInl" alt="$\mathcal{O}(\mbox{length of this path})$" src="form_2.png"> time. </dd></dl>
  612. </div>
  613. </div><p>
  614. <a class="anchor" name="16f9249e8cce25cbd0a3297fc8fa9a44"></a><!-- doxytag: member="dijkstra::reset" ref="16f9249e8cce25cbd0a3297fc8fa9a44" args="()" -->
  615. <div class="memitem">
  616. <div class="memproto">
  617. <table class="memname">
  618. <tr>
  619. <td class="memname">virtual void dijkstra::reset </td>
  620. <td>(</td>
  621. <td class="paramname"> </td>
  622. <td>&nbsp;)&nbsp;</td>
  623. <td width="100%"><code> [virtual]</code></td>
  624. </tr>
  625. </table>
  626. </div>
  627. <div class="memdoc">
  628. <p>
  629. Resets Dijkstra's <a class="el" href="a00001.html" title="Abstract baseclass for all algoritm-classes.">algorithm</a>.
  630. <p>
  631. It prepares the <a class="el" href="a00001.html" title="Abstract baseclass for all algoritm-classes.">algorithm</a> to be applied again, possibly to another <a class="el" href="a00014.html" title="A directed or undirected graph.">graph</a>.<p>
  632. <dl class="note" compact><dt><b>Note:</b></dt><dd>The weights are not reset. You can apply this algorithms</dd></dl>
  633. <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="a00001.html#21aba63d066ae7897de6ca7d8425c408" title="Resets algorithm.">algorithm::reset</a> </dd></dl>
  634. <p>Implements <a class="el" href="a00001.html#21aba63d066ae7897de6ca7d8425c408">algorithm</a>.</p>
  635. </div>
  636. </div><p>
  637. <p class="links">
  638. <a href="http://www.uni-passau.de/">University of Passau</a>
  639. &nbsp;-&nbsp;
  640. <a href="http://www.fmi.uni-passau.de/">FMI</a>
  641. &nbsp;-&nbsp;
  642. <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
  643. Computer Science</a>
  644. </p>
  645. <div class="copyright">
  646. Design &copy; 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>, University of Passau
  647. </div>
  648. </body>
  649. </html>