remove CH-related part of loops forcing

This commit is contained in:
Michael Krasnyk 2017-04-05 17:46:25 +02:00
parent f660ae30dc
commit 0972ec9115

View File

@ -83,35 +83,10 @@ void routingStep(const datafacade::ContiguousInternalMemoryDataFacade<Algorithm>
auto path_weight = weight + reverse_weight; auto path_weight = weight + reverse_weight;
// if loops are forced, they are so at the source // if loops are forced, they are so at the source
if ((force_loop_forward && forward_heap.GetData(node).parent == node) || if (!(force_loop_forward && forward_heap.GetData(node).parent == node) &&
(force_loop_reverse && reverse_heap.GetData(node).parent == node) || !(force_loop_reverse && reverse_heap.GetData(node).parent == node) &&
// in this case we are looking at a bi-directional way where the source (path_weight >= 0) && (path_weight < path_upper_bound))
// and target phantom are on the same edge based node
path_weight < 0)
{ {
// check whether there is a loop present at the node
for (const auto edge : facade.GetAdjacentEdgeRange(node))
{
const auto &data = facade.GetEdgeData(edge);
if (DIRECTION == FORWARD_DIRECTION ? data.forward : data.backward)
{
const NodeID to = facade.GetTarget(edge);
if (to == node)
{
const EdgeWeight edge_weight = data.weight;
const EdgeWeight loop_weight = path_weight + edge_weight;
if (loop_weight >= 0 && loop_weight < path_upper_bound)
{
middle_node = node;
path_upper_bound = loop_weight;
}
}
}
}
}
else if (path_weight >= 0 && path_weight < path_upper_bound)
{
middle_node = node; middle_node = node;
path_upper_bound = path_weight; path_upper_bound = path_weight;
} }