import random


def mutation(tour):
    """
    Simple mutation operator: switch two cities in given tour for a 60% chance   
    
    Parameters:

        tour(numpy.ndarray): Array of indices (of cities according to csv file) representing the tour order
    Returns:
        tour(numpy.ndarray): The mutated tour 
    """
    if(random.random() <= 0.6):
        switchIndices = random.sample(range(0, len(tour)), 2)
        t1 = tour[switchIndices[0]]
        t2 = tour[switchIndices[1]]
        tour[switchIndices[1]] = t1
        tour[switchIndices[0]] = t2
    return tour