Boost C++ Libraries: Ticket #1072: assertion failed in dijkstra algorithm https://svn.boost.org/trac10/ticket/1072 <p> a call to dijkstra_shortest_paths fails with the following assertion: </p> <p> /usr/include/boost/pending/relaxed_heap.hpp:175: <a class="missing wiki">IndexedType</a>&amp; boost::relaxed_heap&lt;<a class="missing wiki">IndexedType</a>, Compare, ID&gt;::top() [with <a class="missing wiki">IndexedType</a> = int, Compare = boost::indirect_cmp&lt;boost::STempNodeMap&lt;double&gt;, std::less&lt;double&gt; &gt;, ID = boost::SVertexIndexMap]: Assertion `smallest_value-&gt;value != 0' failed. </p> <p> It happens if a valid vertex_descriptor in my graph is 0, which shouldn't be a problem as I define null_vertex() in my graph_traits to return -1. </p> <p> I have checked the code in relaxed_heap, and though I don't really understand how it works, I don't see any reason why this assertion shouldn't be assert(smallest_value != 0) instead. </p> <p> Everything works fine if I increase all my vertex_descriptors by 1, but I don't see why I can't have a valid vertex_descriptor which is 0. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1072 Trac 1.4.3 Eric Niebler Wed, 11 Jul 2007 01:50:49 GMT owner set https://svn.boost.org/trac10/ticket/1072#comment:1 https://svn.boost.org/trac10/ticket/1072#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">doug_gregor</span> </li> </ul> Ticket Douglas Gregor Tue, 31 Jul 2007 21:58:38 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1072#comment:2 https://svn.boost.org/trac10/ticket/1072#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/38330" title="relaxed_heap.hpp: - Use boost::none in all the right places. Fixes ...">[38330]</a>) relaxed_heap.hpp: </p> <ul><li>Use boost::none in all the right places. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1072" title="#1072: Bugs: assertion failed in dijkstra algorithm (closed: fixed)">#1072</a>. Big thanks to David Gleich! </li></ul> Ticket