Commit 5d160cf0 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

shortest_distance: Clip max_dist excess only when it is given

parent 7f028b5f
Pipeline #296 passed with stage
in 182 minutes and 8 seconds
......@@ -274,13 +274,16 @@ struct do_bfs_search
}
catch (stop_search&) {}
parallel_vertex_loop(g,
[&](auto v)
{
auto& d = dist_map[v];
if (d > max_dist)
d = inf;
});
if (max_dist > 0)
{
parallel_vertex_loop(g,
[&](auto v)
{
auto& d = dist_map[v];
if (d > max_dist)
d = inf;
});
}
}
};
......@@ -342,13 +345,16 @@ struct do_djk_search
}
catch (stop_search&) {}
parallel_vertex_loop(g,
[&](auto v)
{
auto& d = dist_map[v];
if (d > max_dist)
d = inf;
});
if (max_dist > 0)
{
parallel_vertex_loop(g,
[&](auto v)
{
auto& d = dist_map[v];
if (d > max_dist)
d = inf;
});
}
}
};
......
Supports Markdown
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