diff --git a/routing_algorithms/direct_shortest_path.hpp b/routing_algorithms/direct_shortest_path.hpp index bfd6916e8..c64264e4a 100644 --- a/routing_algorithms/direct_shortest_path.hpp +++ b/routing_algorithms/direct_shortest_path.hpp @@ -194,12 +194,12 @@ class DirectShortestPathRouting final if (!forward_core_heap.Empty()) { super::RoutingStep(forward_core_heap, reverse_core_heap, &middle, &distance, - min_edge_offset, true); + min_edge_offset, true, false); } if (!reverse_core_heap.Empty()) { super::RoutingStep(reverse_core_heap, forward_core_heap, &middle, &distance, - min_edge_offset, false); + min_edge_offset, false, false); } } diff --git a/routing_algorithms/routing_base.hpp b/routing_algorithms/routing_base.hpp index d41250a79..658850a8b 100644 --- a/routing_algorithms/routing_base.hpp +++ b/routing_algorithms/routing_base.hpp @@ -64,7 +64,8 @@ template class BasicRoutingInterface NodeID *middle_node_id, int *upper_bound, const int min_edge_offset, - const bool forward_direction) const + const bool forward_direction, + const bool stalling=true) const { const NodeID node = forward_heap.DeleteMin(); const int distance = forward_heap.GetKey(node); @@ -99,25 +100,28 @@ template class BasicRoutingInterface } // Stalling - for (const auto edge : facade->GetAdjacentEdgeRange(node)) + if (stalling) { - const EdgeData &data = facade->GetEdgeData(edge); - const bool reverse_flag = ((!forward_direction) ? data.forward : data.backward); - if (reverse_flag) - { - const NodeID to = facade->GetTarget(edge); - const int edge_weight = data.distance; + for (const auto edge : facade->GetAdjacentEdgeRange(node)) + { + const EdgeData &data = facade->GetEdgeData(edge); + const bool reverse_flag = ((!forward_direction) ? data.forward : data.backward); + if (reverse_flag) + { + const NodeID to = facade->GetTarget(edge); + const int edge_weight = data.distance; - BOOST_ASSERT_MSG(edge_weight > 0, "edge_weight invalid"); + BOOST_ASSERT_MSG(edge_weight > 0, "edge_weight invalid"); - if (forward_heap.WasInserted(to)) - { - if (forward_heap.GetKey(to) + edge_weight < distance) - { - return; - } - } - } + if (forward_heap.WasInserted(to)) + { + if (forward_heap.GetKey(to) + edge_weight < distance) + { + return; + } + } + } + } } for (const auto edge : facade->GetAdjacentEdgeRange(node))