(matrix, tour)
return total
Returns the total length of the tour
Returns the total length of the tour
Returns the total length of the tour
def tour_length(matrix, tour):
    """ Returns the total length of the tour """
    total = 0
    t = tour.getInternalList()
    for i in range(CITIES):
        j      = (i+1)%CITIES
        total += matrix[t[i], t[j]]
    return total
def tour_length ( matrix , tour ) : total = 0 t = tour . getInternalList ( ) for i in range ( CITIES ) : j = ( i + 1 ) % CITIES total += matrix [ t [ i ] , t [ j ] ] return total