I am solving the traveling salesman problem using 2-opt algorithm. I have my 2opt switch working correctly in this for loop:
for(i = 1; i < N - 1; i++){