2-opt algorithm for tsp in python