Uploaded by Han Luu Bang

ga-problems-srerkhmkl

advertisement
lOMoARcPSD|34675539
GA Problems - SRERKHMKL
Genetic Algorithm And Machine Learning (SRM Institute of Science and Technology)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
GENETIC
ALGORTIHMS AND
ITS APPLICATIONS
PROBLEMS
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
TSP using GA
Solving the Traveling Salesman Problem (TSP) using
Genetic Algorithms (GAs) involves representing
cities as individuals in a population, evolving
generations of solutions, and gradually improving
the tours to minimize the total distance traveled.
Here's a step-by-step guide on how to apply GAs to
solve the TSP:
1. Define the Problem:
Cities: Identify the cities you want to visit
and their coordinates.
Objective Function: Define the fitness function
to be minimized (e.g., total distance traveled).
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
TSP using GA
2. Encoding:
Encode a potential solution (a tour) as a
permutation
of
city
indices.
Each
chromosome
represents a different tour.
3. Initialization:
Generate an initial population of tours randomly
or using heuristics like nearest neighbor or
insertion.
4. Fitness Evaluation:
Calculate the fitness of each tour in the
population based on the objective function (e.g.,
total distance).
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
TSP using GA
5. Selection:
Use a selection mechanism (e.g., roulette wheel,
tournament selection) to choose parents for the next
generation with higher fitness being more likely to
be selected.
6. Crossover:
Apply
crossover
(e.g.,
order
crossover,
partially mapped crossover) to create offspring from
selected parents. Crossover generates new tours by
recombining the order of cities.
Downloaded by Han Luu Bang (hanluubang@gmail.com)
lOMoARcPSD|34675539
TSP using GA
7. Mutation:
Apply mutation (e.g., swap mutation, inversion
mutation) to introduce small changes in the
offspring tours.
8. Offspring Generation:
Create a new population of tours by combining
the parents and offspring.
9. Termination Criteria:
Define stopping criteria, such as reaching a
maximum number of generations, a fitness threshold,
or no improvement over several generations.
Downloaded by Han Luu Bang (hanluubang@gmail.com)
Download