From d5cb1fa15f92321b1af330961c8c2e2b29177a13 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Wed, 25 Jul 2012 19:11:58 +0200 Subject: [PATCH] Fixed a bug in the computation of routes. Fixes issue #334 and other. Thanks apmon --- RoutingAlgorithms/AlternativePathRouting.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RoutingAlgorithms/AlternativePathRouting.h b/RoutingAlgorithms/AlternativePathRouting.h index ccda0503a..8c78d1b5c 100644 --- a/RoutingAlgorithms/AlternativePathRouting.h +++ b/RoutingAlgorithms/AlternativePathRouting.h @@ -298,7 +298,8 @@ private: } } - if((distance-edgeBasedOffset)*(1+VIAPATH_EPSILON) > *_upperbound){ + int scaledDistance = (distance+edgeBasedOffset)/(1.+VIAPATH_EPSILON); + if(scaledDistance > *_upperbound){ _forwardHeap->DeleteAll(); return; }