From 23132e5292f19bfbe3d61fa4cef9e4f2a5fa4ef2 Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Wed, 31 Dec 2014 15:59:42 +0100 Subject: [PATCH] Use >= 0 to include routes where start/end is the same --- routing_algorithms/many_to_many.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing_algorithms/many_to_many.hpp b/routing_algorithms/many_to_many.hpp index 112971c7a..636510f69 100644 --- a/routing_algorithms/many_to_many.hpp +++ b/routing_algorithms/many_to_many.hpp @@ -171,7 +171,7 @@ template class ManyToManyRouting final : public BasicRouting (*result_table)[source_id * number_of_locations + target_id]; // check if new distance is better const EdgeWeight new_distance = source_distance + target_distance; - if (new_distance > 0 && new_distance < current_distance) + if (new_distance >= 0 && new_distance < current_distance) { (*result_table)[source_id * number_of_locations + target_id] = (source_distance + target_distance);