From 5af05631c2e2e5ecff0b42a3fca251cf6ed6e10d Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Fri, 29 Sep 2017 12:38:24 +0200 Subject: [PATCH] Suppress relaxation of edges on the top level during backward steps --- src/engine/routing_algorithms/many_to_many_mld.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/engine/routing_algorithms/many_to_many_mld.cpp b/src/engine/routing_algorithms/many_to_many_mld.cpp index 417ec21da..3ff8583a5 100644 --- a/src/engine/routing_algorithms/many_to_many_mld.cpp +++ b/src/engine/routing_algorithms/many_to_many_mld.cpp @@ -33,6 +33,9 @@ inline LevelID getNodeQueryLevel(const MultiLevelPartition &partition, const auto node_level = std::min(highest_diffrent_level(phantom_node.forward_segment_id), highest_diffrent_level(phantom_node.reverse_segment_id)); + if (DIRECTION == REVERSE_DIRECTION && node_level >= partition.GetNumberOfLevels() - 1) + return INVALID_LEVEL_ID; + return node_level; } @@ -79,12 +82,17 @@ void relaxOutgoingEdges(const DataFacade &facade, BOOST_ASSERT(!facade.ExcludeNode(node)); const auto &partition = facade.GetMultiLevelPartition(); + + const auto level = getNodeQueryLevel(partition, node, args...); + + // Break outgoing edges relaxation if node at the restricted level + if (level == INVALID_LEVEL_ID) + return; + const auto &cells = facade.GetCellStorage(); const auto &metric = facade.GetCellMetric(); const auto &node_data = query_heap.GetData(node); - const auto level = getNodeQueryLevel(partition, node, args...); - if (level >= 1 && !node_data.from_clique_arc) { const auto &cell = cells.GetCell(metric, level, partition.GetCell(level, node));