first 2opt algorithm implementation