From 8a47c87a8a7dac5af61a0ed06a402ab1efb03a20 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Fri, 3 Feb 2012 16:39:18 +0100 Subject: [PATCH] Fixing issues #81 and #82 --- DataStructures/SearchEngine.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/DataStructures/SearchEngine.h b/DataStructures/SearchEngine.h index 38c2267fd..214ab236a 100644 --- a/DataStructures/SearchEngine.h +++ b/DataStructures/SearchEngine.h @@ -122,15 +122,15 @@ public: _forwardHeap2->Clear(); //insert new starting nodes into forward heap, adjusted by previous distances. if(searchFrom1stStartNode) { - _forwardHeap->Insert(phantomNodePair.startPhantom.edgeBasedNode, distance1-phantomNodePair.startPhantom.weight1, phantomNodePair.startPhantom.edgeBasedNode); - _forwardHeap2->Insert(phantomNodePair.startPhantom.edgeBasedNode, distance2-phantomNodePair.startPhantom.weight1, phantomNodePair.startPhantom.edgeBasedNode); + _forwardHeap->Insert(phantomNodePair.startPhantom.edgeBasedNode, -phantomNodePair.startPhantom.weight1, phantomNodePair.startPhantom.edgeBasedNode); + _forwardHeap2->Insert(phantomNodePair.startPhantom.edgeBasedNode, -phantomNodePair.startPhantom.weight1, phantomNodePair.startPhantom.edgeBasedNode); // INFO("1,2)forw insert " << phantomNodePair.startPhantom.edgeBasedNode << " with weight " << phantomNodePair.startPhantom.weight1); // } else { // INFO("Skipping first start node"); } if(phantomNodePair.startPhantom.isBidirected() && searchFrom2ndStartNode) { - _forwardHeap->Insert(phantomNodePair.startPhantom.edgeBasedNode+1, distance1-phantomNodePair.startPhantom.weight2, phantomNodePair.startPhantom.edgeBasedNode+1); - _forwardHeap2->Insert(phantomNodePair.startPhantom.edgeBasedNode+1, distance2-phantomNodePair.startPhantom.weight2, phantomNodePair.startPhantom.edgeBasedNode+1); + _forwardHeap->Insert(phantomNodePair.startPhantom.edgeBasedNode+1, -phantomNodePair.startPhantom.weight2, phantomNodePair.startPhantom.edgeBasedNode+1); + _forwardHeap2->Insert(phantomNodePair.startPhantom.edgeBasedNode+1, -phantomNodePair.startPhantom.weight2, phantomNodePair.startPhantom.edgeBasedNode+1); // INFO("1)forw insert " << phantomNodePair.startPhantom.edgeBasedNode+1 << " with weight " << distance1-phantomNodePair.startPhantom.weight1); // INFO("2)forw insert " << phantomNodePair.startPhantom.edgeBasedNode+1 << " with weight " << distance2-phantomNodePair.startPhantom.weight1); // } else if(!searchFrom2ndStartNode) { @@ -324,7 +324,6 @@ public: } } - // INFO("-> dist " << _upperbound); if ( _upperbound == INT_MAX ) { return _upperbound; }