Opened 15 years ago

Closed 15 years ago

#1072 closed Bugs (fixed)

assertion failed in dijkstra algorithm

Reported by: buola69@… Owned by: doug_gregor
Milestone: To Be Determined Component: graph
Version: Boost 1.34.0 Severity: Showstopper
Keywords: Cc:

Description

a call to dijkstra_shortest_paths fails with the following assertion:

/usr/include/boost/pending/relaxed_heap.hpp:175: IndexedType& boost::relaxed_heap<IndexedType, Compare, ID>::top() [with IndexedType = int, Compare = boost::indirect_cmp<boost::STempNodeMap<double>, std::less<double> >, ID = boost::SVertexIndexMap]: Assertion `smallest_value->value != 0' failed.

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.

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.

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.

Change History (2)

comment:1 by Eric Niebler, 15 years ago

Owner: set to doug_gregor

comment:2 by Douglas Gregor, 15 years ago

Resolution: fixed
Status: newclosed

(In [38330]) relaxed_heap.hpp:

  • Use boost::none in all the right places. Fixes #1072. Big thanks to David Gleich!
Note: See TracTickets for help on using tickets.