diff --git a/include/engine/routing_algorithms/routing_base_mld.hpp b/include/engine/routing_algorithms/routing_base_mld.hpp index 7a51120af..ed8237d89 100644 --- a/include/engine/routing_algorithms/routing_base_mld.hpp +++ b/include/engine/routing_algorithms/routing_base_mld.hpp @@ -255,16 +255,16 @@ void relaxOutgoingEdges(const DataFacade &facade, { const EdgeWeight to_weight = weight + shortcut_weight; BOOST_ASSERT(to_weight >= weight); - auto toNodeData= forward_heap.GetHeapNodeIfWasInserted(to); - if (!toNodeData) + auto toHeapNode = forward_heap.GetHeapNodeIfWasInserted(to); + if (!toHeapNode) { forward_heap.Insert(to, to_weight, {heapNode.node, true}); } - else if (to_weight < forward_heap.GetKey(to)) + else if (to_weight < toHeapNode->weight) { - toNodeData->data = {heapNode.node, true}; - toNodeData->weight=to_weight; - forward_heap.DecreaseKey(*toNodeData); + toHeapNode->data = {heapNode.node, true}; + toHeapNode->weight=to_weight; + forward_heap.DecreaseKey(*toHeapNode); } } ++destination; @@ -284,16 +284,16 @@ void relaxOutgoingEdges(const DataFacade &facade, { const EdgeWeight to_weight = weight + shortcut_weight; BOOST_ASSERT(to_weight >= weight); - auto toNodeData= forward_heap.GetHeapNodeIfWasInserted(to); - if (!toNodeData) + auto toHeapNode = forward_heap.GetHeapNodeIfWasInserted(to); + if (!toHeapNode) { forward_heap.Insert(to, to_weight, {heapNode.node, true}); } - else if (to_weight < forward_heap.GetKey(to)) + else if (to_weight < toHeapNode->weight) { - toNodeData->data = {heapNode.node, true}; - toNodeData->weight=to_weight; - forward_heap.DecreaseKey(*toNodeData); + toHeapNode->data = {heapNode.node, true}; + toHeapNode->weight=to_weight; + forward_heap.DecreaseKey(*toHeapNode); } } ++source; @@ -322,16 +322,16 @@ void relaxOutgoingEdges(const DataFacade &facade, const EdgeWeight to_weight = weight + node_weight + turn_penalty; - auto toNodeData= forward_heap.GetHeapNodeIfWasInserted(to); - if (!toNodeData) + auto toHeapNode = forward_heap.GetHeapNodeIfWasInserted(to); + if (!toHeapNode) { forward_heap.Insert(to, to_weight, {heapNode.node, false}); } - else if (to_weight < forward_heap.GetKey(to)) + else if (to_weight < toHeapNode->weight) { - toNodeData->data = {heapNode.node, false}; - toNodeData->weight=to_weight; - forward_heap.DecreaseKey(*toNodeData); + toHeapNode->data = {heapNode.node, false}; + toHeapNode->weight=to_weight; + forward_heap.DecreaseKey(*toHeapNode); } } } @@ -358,16 +358,16 @@ void routingStep(const DataFacade &facade, // is weight + reverse_weight // More tighter upper bound requires additional condition reverse_heap.WasRemoved(to) // with weight(to -> target) = reverse_weight and all weights ≥ 0 - auto reverveNodeData= reverse_heap.GetHeapNodeIfWasInserted(heapNode.node); - if (reverveNodeData) + auto reverseNodeData = reverse_heap.GetHeapNodeIfWasInserted(heapNode.node); + if (reverseNodeData) { - auto reverse_weight = reverveNodeData->weight; + auto reverse_weight = reverseNodeData->weight; auto path_weight = weight + reverse_weight; // 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 && heapNode.data.parent == heapNode.node) && - !(force_loop_reverse && reverveNodeData->data.parent == heapNode.node) && + !(force_loop_reverse && reverseNodeData->data.parent == heapNode.node) && (path_weight >= 0) && (path_weight < path_upper_bound)) { middle_node = heapNode.node; diff --git a/src/engine/routing_algorithms/alternative_path_ch.cpp b/src/engine/routing_algorithms/alternative_path_ch.cpp index 78b160ad6..2f7d8b99c 100644 --- a/src/engine/routing_algorithms/alternative_path_ch.cpp +++ b/src/engine/routing_algorithms/alternative_path_ch.cpp @@ -121,7 +121,7 @@ void alternativeRoutingStep(const DataFacade &facade, forward_heap.Insert(to, to_weight, heapNode.node); } // Found a shorter Path -> Update weight - else if (to_weight < forward_heap.GetKey(to)) + else if (to_weight < toHeapNode->weight) { // new parent toHeapNode->data.parent = heapNode.node; diff --git a/src/engine/routing_algorithms/many_to_many_ch.cpp b/src/engine/routing_algorithms/many_to_many_ch.cpp index 6ccf6e95d..9c3d5bbb2 100644 --- a/src/engine/routing_algorithms/many_to_many_ch.cpp +++ b/src/engine/routing_algorithms/many_to_many_ch.cpp @@ -79,7 +79,7 @@ void relaxOutgoingEdges(const DataFacade &facade, } // Found a shorter Path -> Update weight and set new parent else if (std::tie(to_weight, to_duration) < - std::tie(query_heap.GetKey(to), query_heap.GetData(to).duration)) + std::tie(toHeapNode->weight, toHeapNode->data.duration)) { toHeapNode->data = {heapNode.node, to_duration, to_distance}; toHeapNode->weight=to_weight; diff --git a/src/engine/routing_algorithms/many_to_many_mld.cpp b/src/engine/routing_algorithms/many_to_many_mld.cpp index 796d8eb8a..b6f8aaa5b 100644 --- a/src/engine/routing_algorithms/many_to_many_mld.cpp +++ b/src/engine/routing_algorithms/many_to_many_mld.cpp @@ -78,7 +78,7 @@ void relaxBorderEdges(const DataFacade &facade, } // Found a shorter Path -> Update weight and set new parent else if (std::tie(to_weight, to_duration, to_distance, node) < - std::tie(query_heap.GetKey(to), + std::tie(toHeapNode->weight, toHeapNode->data.duration, toHeapNode->data.distance, toHeapNode->data.parent)) @@ -140,7 +140,7 @@ void relaxOutgoingEdges(const DataFacade &facade, query_heap.Insert(to, to_weight, {node, true, to_duration, to_distance}); } else if (std::tie(to_weight, to_duration, to_distance, node) < - std::tie(query_heap.GetKey(to), + std::tie(toHeapNode->weight, toHeapNode->data.duration, toHeapNode->data.distance, toHeapNode->data.parent)) @@ -180,7 +180,7 @@ void relaxOutgoingEdges(const DataFacade &facade, query_heap.Insert(to, to_weight, {node, true, to_duration, to_distance}); } else if (std::tie(to_weight, to_duration, to_distance, node) < - std::tie(query_heap.GetKey(to), + std::tie(toHeapNode->weight, toHeapNode->data.duration, toHeapNode->data.distance, toHeapNode->data.parent))