Make sure to terminate when the core heaps are empty

This commit is contained in:
Patrick Niklaus 2015-08-10 00:51:05 +02:00
parent 2ff2ce460c
commit 48d1a5ec5d

View File

@ -186,7 +186,8 @@ class DirectShortestPathRouting final
}
// run two-target Dijkstra routing step on core with termination criterion
while (distance > (forward_core_heap.MinKey() + reverse_core_heap.MinKey()) )
while (0 < (forward_core_heap.Size() + reverse_core_heap.Size()) &&
distance > (forward_core_heap.MinKey() + reverse_core_heap.MinKey()))
{
if (!forward_core_heap.Empty())
{