Check all paths from the ith indexed city
if ( j == tsp [ i ] . length ) { sum += min ; min = Integer . MAX_VALUE ; visitedRouteList . add ( route [ counter ] - 1 ) ; j = 0 ; i = route [ counter ] - 1 ; counter ++ ; } }