[Boost-bugs] [Boost C++ Libraries] #8398: dijkstra_shortest_paths implicitly requires DistanceMap and WeightMap to be the same

Subject: [Boost-bugs] [Boost C++ Libraries] #8398: dijkstra_shortest_paths implicitly requires DistanceMap and WeightMap to be the same
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-04 22:32:58


#8398: dijkstra_shortest_paths implicitly requires DistanceMap and WeightMap to be
the same
---------------------------------------------------+------------------------
 Reporter: Luis G. Torres <lgtorres42@…> | Owner: jewillco
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: graph
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: BGL, dijkstra |
---------------------------------------------------+------------------------
 The documentation for dijkstra_shortest_paths states that the given
 distance_compare functor needs to be a BinaryPredicate where both
 arguments are of the value type of DistanceMap. The distance_combine
 functor needs to be a BinaryFunction where the first argument is of the
 DistanceMap value type and the second argument is of the WeightMap value
 type.

 However, in line 162 of dijkstra_shortest_paths.hpp, a comparison is made
 between a value from WeightMap and a value from DistanceMap using the
 distance_compare functor; this violates where the documentation specifies
 that the distance_compare functor would only need to handle types from
 DistanceMap. Effectively, this requires either:

 a) the value types of WeightMap and DistanceMap are made the same
 b) the distance_compare functor overloads operator() to have two different
 types of comparison

 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).

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8398>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC