import random def d( cities,a, b ) : ''' Returns the length of the edge between city a and city b ''' pass def swap( tour, i1, i2 ) : ''' Swaps the values of i1 and i2 tour elements ''' pass def random_location( w, h ) : ''' Returns a random (x, y) coordinate where is from the range(0, w) and y is from the range(0, h ) ''' pass def initialize_city_locations( n, w, h ) : ''' Returns a new list of n (x, y) pairs, where each pair is generated using an invocation of random_location( w, h ) ''' pass def cost( cities, tour ) : ''' Returns the length traveled visiting all cities in the order indicated by tour. That length includes the length of the connection from the last city back to the first city. ''' pass def consider( cities, tour, i1, i2 ) : ''' Determines whether swapping tour elements i1 and i2 produce a better tour. If so, True is returned; otherwise, False is returned and tour is left unchanged. ''' pass if ( __name__ == "__main__" ) : import test_tsp test_tsp.test_d() test_tsp.test_swap() test_tsp.test_random_location() test_tsp.test_initialize_city_locations() test_tsp.test_cost() test_tsp.test_consider()