path = [(2, 0), (2, 1), (1, 2), (0, 3), (0, 4), (1, 5), (2, 5), (3, 4), (3,
    3), (3, 2), (4, 1)]

def adjacent(elem, next_elem):
    return abs(elem[0] - next_elem[0]) <= 1 and abs(elem[1] - next_elem[1]
        ) <= 1
new_path = []
i = 0
while True:
    elem = path[i]
new_path.append(elem)
if i + 1 == len(path):
    break
j = len(path) - 1
while True:
    future_elem = path[j]
if adjacent(elem, future_elem):
    break
j -= 1
i = j
print(new_path)
Shorten a list of tuples by cutting out loops?