From d0936dc7fdbd9785fd2a999785c754eec7f06cfd Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Mon, 2 Oct 2017 12:34:58 +0200 Subject: [PATCH] Don't force loops in MLD Related commit 0972ec9115b912a76692b5c59e3d711b1f84af91 --- .../routing_algorithms/routing_base_mld.hpp | 3 ++- .../alternative_path_mld.cpp | 18 ++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/include/engine/routing_algorithms/routing_base_mld.hpp b/include/engine/routing_algorithms/routing_base_mld.hpp index e82e7e5bc..cd4f0846a 100644 --- a/include/engine/routing_algorithms/routing_base_mld.hpp +++ b/include/engine/routing_algorithms/routing_base_mld.hpp @@ -255,7 +255,8 @@ void routingStep(const DataFacade &facade, auto reverse_weight = reverse_heap.GetKey(node); auto path_weight = weight + reverse_weight; - // if loops are forced, they are so at the source + // MLD uses loops forcing only to prune single node paths in forward and/or + // backward direction (there is no need to force loops in MLD but in CH) if (!(force_loop_forward && forward_heap.GetData(node).parent == node) && !(force_loop_reverse && reverse_heap.GetData(node).parent == node) && (path_weight >= 0) && (path_weight < path_upper_bound)) diff --git a/src/engine/routing_algorithms/alternative_path_mld.cpp b/src/engine/routing_algorithms/alternative_path_mld.cpp index f9ff95bad..91845e3b6 100644 --- a/src/engine/routing_algorithms/alternative_path_mld.cpp +++ b/src/engine/routing_algorithms/alternative_path_mld.cpp @@ -456,9 +456,6 @@ void unpackPackedPaths(InputIt first, util::static_assert_iter_category(); util::static_assert_iter_value(); - const bool force_loop_forward = needsLoopForward(phantom_node_pair); - const bool force_loop_backward = needsLoopBackwards(phantom_node_pair); - const Partition &partition = facade.GetMultiLevelPartition(); Heap &forward_heap = *search_engine_data.forward_heap_1; @@ -530,8 +527,8 @@ void unpackPackedPaths(InputIt first, facade, forward_heap, reverse_heap, - force_loop_forward, - force_loop_backward, + DO_NOT_FORCE_LOOPS, + DO_NOT_FORCE_LOOPS, INVALID_EDGE_WEIGHT, sublevel, parent_cell_id); @@ -587,9 +584,6 @@ makeCandidateVias(SearchEngineData &search_engine_data, // we're over factor * weight. We have to set the weight for routingStep to INVALID_EDGE_WEIGHT // so that stepping will continue even after we reached the shortest path upper bound. - const bool force_loop_forward = needsLoopForward(phantom_node_pair); - const bool force_loop_backward = needsLoopBackwards(phantom_node_pair); - EdgeWeight forward_heap_min = forward_heap.MinKey(); EdgeWeight reverse_heap_min = reverse_heap.MinKey(); @@ -615,8 +609,8 @@ makeCandidateVias(SearchEngineData &search_engine_data, reverse_heap, overlap_via, overlap_weight, - force_loop_forward, - force_loop_backward, + DO_NOT_FORCE_LOOPS, + DO_NOT_FORCE_LOOPS, phantom_node_pair); if (!forward_heap.Empty()) @@ -641,8 +635,8 @@ makeCandidateVias(SearchEngineData &search_engine_data, forward_heap, overlap_via, overlap_weight, - force_loop_forward, - force_loop_backward, + DO_NOT_FORCE_LOOPS, + DO_NOT_FORCE_LOOPS, phantom_node_pair); if (!reverse_heap.Empty())