Commit 67eff378 authored by Tiago Peixoto's avatar Tiago Peixoto

Fix initialization of distance values in shortest_distance()

parent f90c6c2b
......@@ -109,6 +109,12 @@ struct do_bfs_search
dist_t max_d = (max_dist > 0) ?
max_dist : numeric_limits<dist_t>::max();
int i, N = num_vertices(g);
#pragma omp parallel for default(shared) private(i)
for (i = 0; i < N; ++i)
dist_map[i] = numeric_limits<dist_t>::max();
dist_map[source] = 0;
pred_map[vertex(source, g)] = vertex(source, g);
unchecked_vector_property_map<boost::default_color_type, VertexIndexMap>
color_map(vertex_index, num_vertices(g));
......@@ -136,6 +142,12 @@ struct do_djk_search
dist_t max_d = (max_dist > 0) ?
max_dist : numeric_limits<dist_t>::max();
int i, N = num_vertices(g);
#pragma omp parallel for default(shared) private(i)
for (i = 0; i < N; ++i)
dist_map[i] = numeric_limits<dist_t>::max();
dist_map[source] = 0;
try
{
dijkstra_shortest_paths(g, vertex(source, g),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment