Fix off-by-one in avoid search
This commit is contained in:
parent
c6be2e768a
commit
45140ca9f7
@ -184,11 +184,6 @@ void routingStep(const DataFacade<Algorithm> &facade,
|
|||||||
BOOST_ASSERT(destination != cell.GetDestinationNodes().end());
|
BOOST_ASSERT(destination != cell.GetDestinationNodes().end());
|
||||||
const NodeID to = *destination;
|
const NodeID to = *destination;
|
||||||
|
|
||||||
if (facade.AvoidNode(to))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shortcut_weight != INVALID_EDGE_WEIGHT && node != to)
|
if (shortcut_weight != INVALID_EDGE_WEIGHT && node != to)
|
||||||
{
|
{
|
||||||
const EdgeWeight to_weight = weight + shortcut_weight;
|
const EdgeWeight to_weight = weight + shortcut_weight;
|
||||||
@ -216,11 +211,6 @@ void routingStep(const DataFacade<Algorithm> &facade,
|
|||||||
BOOST_ASSERT(source != cell.GetSourceNodes().end());
|
BOOST_ASSERT(source != cell.GetSourceNodes().end());
|
||||||
const NodeID to = *source;
|
const NodeID to = *source;
|
||||||
|
|
||||||
if (facade.AvoidNode(to))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shortcut_weight != INVALID_EDGE_WEIGHT && node != to)
|
if (shortcut_weight != INVALID_EDGE_WEIGHT && node != to)
|
||||||
{
|
{
|
||||||
const EdgeWeight to_weight = weight + shortcut_weight;
|
const EdgeWeight to_weight = weight + shortcut_weight;
|
||||||
@ -247,12 +237,9 @@ void routingStep(const DataFacade<Algorithm> &facade,
|
|||||||
if (DIRECTION == FORWARD_DIRECTION ? edge_data.forward : edge_data.backward)
|
if (DIRECTION == FORWARD_DIRECTION ? edge_data.forward : edge_data.backward)
|
||||||
{
|
{
|
||||||
const NodeID to = facade.GetTarget(edge);
|
const NodeID to = facade.GetTarget(edge);
|
||||||
if (facade.AvoidNode(to))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (checkParentCellRestriction(partition.GetCell(level + 1, to), args...))
|
if (!facade.AvoidNode(to) &&
|
||||||
|
checkParentCellRestriction(partition.GetCell(level + 1, to), args...))
|
||||||
{
|
{
|
||||||
BOOST_ASSERT_MSG(edge_data.weight > 0, "edge_weight invalid");
|
BOOST_ASSERT_MSG(edge_data.weight > 0, "edge_weight invalid");
|
||||||
const EdgeWeight to_weight = weight + edge_data.weight;
|
const EdgeWeight to_weight = weight + edge_data.weight;
|
||||||
|
@ -518,6 +518,9 @@ void unpackPackedPaths(InputIt first,
|
|||||||
forward_heap.Insert(source, 0, {source});
|
forward_heap.Insert(source, 0, {source});
|
||||||
reverse_heap.Insert(target, 0, {target});
|
reverse_heap.Insert(target, 0, {target});
|
||||||
|
|
||||||
|
BOOST_ASSERT(!facade.AvoidNode(source));
|
||||||
|
BOOST_ASSERT(!facade.AvoidNode(target));
|
||||||
|
|
||||||
// TODO: when structured bindings will be allowed change to
|
// TODO: when structured bindings will be allowed change to
|
||||||
// auto [subpath_weight, subpath_source, subpath_target, subpath] = ...
|
// auto [subpath_weight, subpath_source, subpath_target, subpath] = ...
|
||||||
EdgeWeight subpath_weight;
|
EdgeWeight subpath_weight;
|
||||||
|
Loading…
Reference in New Issue
Block a user