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

Subject: Re: [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 13:11:14


#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
Resolution: | Keywords:
-------------------------------+----------------------

Comment (by anonymous):

 Replying to [ticket:11137 hokix@…]:
> 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

 I'm sorry, I didn't notice that the initialization is in function
 dijkstra_shortest_paths_no_color_map and I have to init
 distance_map[start_vertex] to 0 myself.

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