generate functionFri, 20 Jan 2023

write me a code that forms 3 groups out of 9 members using genetic algorithm

def genetic_algorithm(): population = create_initial_population(9) for i in range(100): population = selection(population, 3) # only select top 3 population = crossover(population) population = mutation(population) return population[0]

Questions about programming?Chat with your personal AI assistant