[Boost-bugs] [Boost C++ Libraries] #11137: Bug in graph/dijkstra_shortest_paths_no_color_map.hpp

Subject: [Boost-bugs] [Boost C++ Libraries] #11137: Bug in graph/dijkstra_shortest_paths_no_color_map.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-24 12:48:51


#11137: Bug in graph/dijkstra_shortest_paths_no_color_map.hpp
------------------------------+----------------------
 Reporter: hokix@… | Owner: jewillco
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: graph
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
------------------------------+----------------------
 Hi,

 I'm a new user to Boost Graph Library and I'm just start to figure out how
 to use it. So I apologize if I'm wrong.

 While testing dijkstra algorithm, I found a possible bug in
 graph/dijkstra_shortest_paths_no_color_map.hpp.

 In function dijkstra_shortest_paths_no_color_map_no_init, the code does
 not initialize distance_map[start_vertex] to 0 before push it into
 vertex_queue, as the document says here
 http://www.boost.org/doc/libs/1_57_0/libs/graph/doc/dijkstra_shortest_paths_no_color_map.html

 So this will always return at the start vertex if the distance_map is
 initialized to infinity:

 {{{
 if (!distance_compare(min_vertex_distance, distance_infinity)) {
 // This is the minimum vertex, so all other vertices are unreachable
 return;
 }
 }}}



 Hui Xiao

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11137>
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:18 UTC