The document outlines a genetic algorithm for optimizing mathematical functions, specifically the Rosenbrock function. It includes functions for initializing a population, selecting parents, performing crossover, and applying mutation. The algorithm iteratively evolves the population over a specified number of generations to find the best solution and its corresponding fitness value.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
13 views2 pages
Genetic Algorithm
The document outlines a genetic algorithm for optimizing mathematical functions, specifically the Rosenbrock function. It includes functions for initializing a population, selecting parents, performing crossover, and applying mutation. The algorithm iteratively evolves the population over a specified number of generations to find the best solution and its corresponding fitness value.
for i in range(offspring.shape[0]): if np.random.rand() < mutation_rate: mutation_point = np.random.randint(offspring.shape[1]) offspring[i, mutation_point] = np.random.uniform(-5, 5) return offspring
Soumen Paul Department of Computer Science and Informatics Haldia Institute of Technology ICARE Complex, HIT Campus, P.O - HIT, PIN 721657 Haldia, West Bengal