fixes ticket 6. Slight speed increase for queries, escpecially long distance ones.
This commit is contained in:
parent
e32ba24b6a
commit
164c9333ef
@ -187,7 +187,7 @@ public:
|
|||||||
pathNode = _forwardHeap->GetData( pathNode ).parent;
|
pathNode = _forwardHeap->GetData( pathNode ).parent;
|
||||||
packedPath.push_front( pathNode );
|
packedPath.push_front( pathNode );
|
||||||
}
|
}
|
||||||
// NodeID realStart = pathNode;
|
// NodeID realStart = pathNode;
|
||||||
packedPath.push_back( middle );
|
packedPath.push_back( middle );
|
||||||
pathNode = middle;
|
pathNode = middle;
|
||||||
|
|
||||||
@ -275,7 +275,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void RegisterThread(const unsigned k, const unsigned v) {
|
inline void RegisterThread(const unsigned k, const unsigned v) {
|
||||||
nodeHelpDesk->RegisterThread(k,v);
|
nodeHelpDesk->RegisterThread(k,v);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -294,13 +294,24 @@ private:
|
|||||||
_forwardHeap->DeleteAll();
|
_forwardHeap->DeleteAll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//Stalling
|
||||||
|
|
||||||
for ( typename GraphT::EdgeIterator edge = _graph->BeginEdges( node ); edge < _graph->EndEdges(node); edge++ ) {
|
for ( typename GraphT::EdgeIterator edge = _graph->BeginEdges( node ); edge < _graph->EndEdges(node); edge++ ) {
|
||||||
const NodeID to = _graph->GetTarget(edge);
|
const NodeID to = _graph->GetTarget(edge);
|
||||||
const int edgeWeight = _graph->GetEdgeData(edge).distance;
|
const EdgeWeight edgeWeight = _graph->GetEdgeData(edge).distance;
|
||||||
|
|
||||||
assert( edgeWeight > 0 );
|
assert( edgeWeight > 0 );
|
||||||
const int toDistance = distance + edgeWeight;
|
const int toDistance = distance + edgeWeight;
|
||||||
|
|
||||||
|
if(_forwardHeap->WasInserted( to )) {
|
||||||
|
if(!forwardDirection ? _graph->GetEdgeData(edge).forward : _graph->GetEdgeData(edge).backward) {
|
||||||
|
if(_forwardHeap->GetKey( to ) + edgeWeight < distance) {
|
||||||
|
// std::cout << "[stalled] node " << node << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(forwardDirection ? _graph->GetEdgeData(edge).forward : _graph->GetEdgeData(edge).backward )
|
if(forwardDirection ? _graph->GetEdgeData(edge).forward : _graph->GetEdgeData(edge).backward )
|
||||||
{
|
{
|
||||||
//New Node discovered -> Add to Heap + Node Info Storage
|
//New Node discovered -> Add to Heap + Node Info Storage
|
||||||
|
Loading…
Reference in New Issue
Block a user