Title: Genetic Algorithms and Applications of Genetic Algorithms in Compilers
1Genetic Algorithms and Applications of Genetic
Algorithms in Compilers
2Search Strategies in AI
- Searching is a very important application area of
artificial intelligence. - Common search strategies
- depth first search
- breadth first search
- best first search
- hill climbing
- simulated annealing
- genetic algorithms
3Outline
- Introduction and historical background
- Biological background
- Stages in a genetic algorithm
- Phase ordering problem in compilers
- Applying GA to address phase ordering
- Other GA applications
- Conclusions
4Introduction and Historical Background
- GAs are part of evolutionary computing introduced
by I. Rechenberg in the 1960s. - GAs were invented by John Holland in 1975.
- GAs are based on Darwins principle of evolution
and survival of the fittest. - GA is a biased sampling search technique.
5Outline
- Introduction and historical background
- Biological background
- Stages in a genetic algorithm
- Phase ordering problem in compilers
- Applying GA to address phase ordering
- Other GA applications
- Conclusions
6Biological Background
7Biological Background (cont...)
8Outline
- Introduction and historical background
- Biological background
- Stages in a genetic algorithm
- Phase ordering problem in compilers
- Applying GA to address phase ordering
- Other GA applications
- Conclusions
9GA Stage 1 Initialization
- Randomly initialize some number of individual
solutions to form an initial population
Output the best solution found
Create initial population of chromosomes
Evaluate fitness of each chromosome in the
population
Y
Terminate cond. ?
N
Perform crossover/ mutation to create new
generation
10GA Stage 2 Evaluation and Selection
- Evaluate the fitness value of each chromosome.
Create initial population of chromosomes
Output the best solution found
Evaluate fitness of each chromosome in the
population
Y
Terminate cond. ?
N
Perform crossover/ mutation to create new
generation
11GA Stage 3 Check Termination
- The algorithm terminates when some pre-determined
termination condition is reached.
Create initial population of chromosomes
Output the best solution found
Evaluate fitness of each chromosome in the
population
Y
Terminate cond. ?
N
Perform crossover/ mutation to create new
generation
12GA Stage 4 Reproduction
- Perform crossover and mutation to generate a new
population from the current chromosomes.
Create initial population of chromosomes
Output the best solution found
Evaluate fitness of each chromosome in the
population
Y
Terminate cond. ?
N
Perform crossover/ mutation to create new
generation
13GA Stage 5 Output Solution
- Output the best solution found during the
algorithm.
Create initial population of chromosomes
Output the best solution found
Evaluate fitness of each chromosome in the
population
Y
Terminate cond. ?
N
Perform crossover/ mutation to create new
generation
14Outline
- Introduction and historical background
- Biological background
- Stages in a genetic algorithm
- Phase ordering problem in compilers
- Applying GA to address phase ordering
- Other GA applications
- Conclusions
15Phase Ordering Problem
- Optimizing compilers apply several optimization
phases to improve the performance of
applications. - Optimization phases interact with each other.
- Determining the best order of applying
optimization phases has been a long standing
problem in compilers.
16Addressing the Phase Ordering Problem
- Most researchers consider exhaustive enumeration
infeasible - largest optimization sequence length in our
experiments was 32 - 15 phases for an optimization sequence length of
32 would result in 1532 evaluations! - Heuristics are used to search only a small
portion of the optimization phase order space - random search, genetic algorithms etc.
17Outline
- Introduction and historical background
- Biological background
- Stages in a genetic algorithm
- Phase ordering problem in compilers
- Applying GA to address phase ordering
- Other GA applications
- Conclusions
18GA Stage 1 Initialization
a
e
a
b
c
d
c
f
e
d
a
c
e
a
f
f
c
e
population1
19GA Stage 2 Evaluation and Selection
88
20
95
a
e
a
b
c
d
c
f
e
d
a
c
e
a
f
f
c
e
population1
20GA Stage 3 Check Termination
- Terminating conditions
- the desired performance is reached
- specified number of generations have elapsed
- time constraint for genetic algorithm exceeded
21GA Stage 4 Reproduction
- Crossover - 20 sequences in each generation
replaced
- Mutation - phases in each sequence replaced with
a low probability
22Outline
- Introduction and historical background
- Biological background
- Stages in a genetic algorithm
- Phase ordering problem in compilers
- Applying GA to address phase ordering
- Other GA applications
- Conclusions
23Other GA Applications
- Designing electronic circuits
- Designing of aircrafts
- Routing in circuit switched telecommunication
networks - Genetic algorithm applied to robot trajectory
design - and many more....
24Conclusion
- Genetic algorithm are a class of heuristic biased
sampling approach to searching large spaces. - Described steps during a genetic algorithm
- Presented detailed application of genetic
algorithm to phase ordering problem in compilers.