Boost C++ Libraries: Ticket #8398: dijkstra_shortest_paths implicitly requires DistanceMap and WeightMap to be the same https://svn.boost.org/trac10/ticket/8398 <p> The documentation for dijkstra_shortest_paths states that the given distance_compare functor needs to be a <a class="missing wiki">BinaryPredicate</a> where both arguments are of the value type of <a class="missing wiki">DistanceMap</a>. The distance_combine functor needs to be a <a class="missing wiki">BinaryFunction</a> where the first argument is of the <a class="missing wiki">DistanceMap</a> value type and the second argument is of the <a class="missing wiki">WeightMap</a> value type. </p> <p> However, in line 162 of dijkstra_shortest_paths.hpp, a comparison is made between a value from <a class="missing wiki">WeightMap</a> and a value from <a class="missing wiki">DistanceMap</a> using the distance_compare functor; this violates where the documentation specifies that the distance_compare functor would only need to handle types from <a class="missing wiki">DistanceMap</a>. Effectively, this requires either: </p> <p> a) the value types of <a class="missing wiki">WeightMap</a> and <a class="missing wiki">DistanceMap</a> are made the same b) the distance_compare functor overloads operator() to have two different types of comparison </p> <p> I imagine that fixing this issue would require either changing the documentation or changing line 162 to not require this comparison to be made (it seems to only be a way of verifying that there are no negative edges in the graph). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8398 Trac 1.4.3 Jeremiah Willcock Fri, 05 Apr 2013 18:25:36 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8398#comment:1 https://svn.boost.org/trac10/ticket/8398#comment:1 <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/83772" title="Changed test for negative edges per #8398; fixes #8398">[83772]</a>) Changed test for negative edges per <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8398" title="#8398: Bugs: dijkstra_shortest_paths implicitly requires DistanceMap and WeightMap ... (closed: fixed)">#8398</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8398" title="#8398: Bugs: dijkstra_shortest_paths implicitly requires DistanceMap and WeightMap ... (closed: fixed)">#8398</a> </p> Ticket Jeremiah Willcock Sat, 17 Aug 2013 22:12:21 GMT <link>https://svn.boost.org/trac10/ticket/8398#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8398#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85386" title="Fixed test for negative-weight edges when combine operator is ...">[85386]</a>) Fixed test for negative-weight edges when combine operator is project2nd (as in prim_minimum_spanning_tree); fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9012" title="#9012: Bugs: Unexpected negative edge weight error in boost::prim_minimum_spanning_tree (closed: fixed)">#9012</a>; refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8398" title="#8398: Bugs: dijkstra_shortest_paths implicitly requires DistanceMap and WeightMap ... (closed: fixed)">#8398</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>