for d1, t1s in pairs(tour_distances) do
for d2, t2s in pairs(tour_distances) do
if d1 ~= 0 and d2 ~= 0 and math.abs(d1 - d2) <= 1 then
for d1, t1s in pairs(tour_distances) do
for d2, t2s in pairs(tour_distances) do
if d1 ~= 0 and d2 ~= 0 and math.abs(d1 - d2) <= 1 then