Question

In: Computer Science

In a maze with starting and ending point. Genetic Algorithm can be used to find the...

In a maze with starting and ending point. Genetic Algorithm can be used to find the path through the maze.

1. What does each chromosome represent?

2. How to evaluate the chromosome (Fitness function)?

Solutions

Expert Solution

In a maze with starting and ending point. Genetic Algorithm can be used to find the path through the maze.

1. What does each chromosome represent?

2. How to evaluate the chromosome (Fitness function)?

ANS. Genetic Algorithms

Genetic algorithms (Holland, 1975) perform a search for the solution to a problem by generating candidate solutions from the space of all solutions and testing the performance of the candidates. The search method is based on ideas from genetics and the size of the search space is determined by the representation of the domain. An understanding of genetic algorithms will be aided by an example.

A very common problem in adaptive control is learning to balance a pole that is hinged on a cart that can move in one dimension along a track of fixed length, as show in Figure 4. The control must use `bang-bang' control, that is, a force of fixed magnitude can be applied to push the cart to the left or right.

  
Figure 4. A Pole Balancer

Before we can begin to learn how to control this system, it is necessary to represent it somehow. We will use the BOXES method that was devised by Michie and Chambers (1968). The measurements taken of the physical system are the angle of the pole, θ and its angular velocity and the position of the cart, x, and its velocity. Rather than treat the four variables as continuous values, Michie and Chambers chose to discretise each dimension of the state space. One possible discretisation is shown in Figure 5.

  
Figure 5. Discretisation of pole balancer state space.

This discretisation results in 3 x 3 x 6 x 3 = 162 `boxes' that partition the state space. Each box has associated with it an action setting which tells the controller that when the system is in that part of the state space, the controller should apply that action, which is a push to the left or a push to the right. Since there is a simple binary choice and there are 162 boxes, there are 2162 possible control strategies for the pole balancer.

The simplest kind of learning in this case, is to exhaustively search for the right combination. However, this is clearly impractical given the size of the search space. Instead, we can invoke a genetic search strategy that will reduce the amount of search considerably.

In genetic learning, we assume that there is a population of individuals, each one of which, represents a candidate problem solver for a given task. Like evolution, genetic algorithms test each individual from the population and only the fittest survive to reproduce for the next generation. The algorithm creates new generations until at least one individual is found that can solve the problem adequately.

Each problem solver is a chromosome. A position, or set of positions in a chromosome is called a gene. The possible values (from a fixed set of symbols) of a gene are known as alleles. In most genetic algorithm implementations the set of symbols is {0, 1} and chromosome lengths are fixed. Most implementations also use fixed population sizes.

The most critical problem in applying a genetic algorithm is in finding a suitable encoding of the examples in the problem domain to a chromosome. A good choice of representation will make the search easy by limiting the search space, a poor choice will result in a large search space. For our pole balancing example, we will use a very simple encoding. A chromosome is a string of 162 boxes. Each box, or gene, can take values: 0 (meaning push left) or 1 (meaning push right). Choosing the size of the population can be tricky since a small population size provides an insufficient sample size over the space of solutions for a problem and large population requires a lot of evaluation and will be slow. In this example, 50 is a suitable population size.

Each iteration in a genetic algorithm is called a generation. Each chromosome in a population is used to solve a problem. Its performance is evaluated and the chromosome is given some rating of fitness. The population is also given an overall fitness rating based on the performance of its members. The fitness value indicates how close a chromosome or population is to the required solution. For pole balancing, the fitness value of a chromosome may be the number of time steps that the chromosome is able to keep the pole balanced for.

New sets of chromosomes are produced from one generation to the next. Reproduction takes place when selected chromosomes from one generation are recombined with others to form chromosomes for the next generation. The new ones are called offspring. Selection of chromosomes for reproduction is based on their fitness values. The average fitness of population may also be calculated at end of each generation. For pole balancing, individuals whose fitness is below average are replaced by reproduction of above average chromosomes. The strategy must be modified if two few or two many chromosomes survive. For example, at least 10% and at most 60% must survive.

Operators that recombine the selected chromosomes are called genetic operators. Two common operators are crossover and mutation. Crossover exchanges portions of a pair of chromosomes at a randomly chosen point called the crossover point. Some Implementations have more than one crossover point. For example, if there are two chromosomes, X and Y:

       X = 1001 01011   Y = 1110 10010

and the crossover point is 4, the resulting offspring are:

       O1 = 100110010   O2 = 1110 01011

Offspring produced by crossover cannot contain information that is not already in the population, so an additional operator, mutation, is required. Mutation generates an offspring by randomly changing the values of genes at one or more gene positions of a selected chromosome. For example, if the following chromosome,

       Z = 100101011

is mutated at positions 2, 4 and 9, then the resulting offspring is:

       O = 110001010

The number of offspring produced for each new generation depends on how members are introduced so as to maintain a fixed population size. In a pure replacement strategy, the whole population is replaced by a new one. In an elitist strategy, a proportion of the population survives to the next generation.

In pole balancing, all offspring are created by crossover (except when more the 60% will survive for more than three generations when the rate is reduced to only 0.75 being produced by crossover). Mutation is a background operator which helps to sustain exploration. Each offspring produced by crossover has a probability of 0.01 of being mutated before it enters the population. If more then 60% will survive, the mutation rate is increased to 0.25.

The number of offspring an individual can produce by crossover is proportional to its fitness:

  
where the number of children is the total number of individuals to be replaced. Mates are chosen at random among the survivors.

The pole balancing experiments described above, were conducted by Odetayo (1988) and required an average of 8165 trials before balancing pole. Of course, this may not be the only way of encoding the problem for a genetic algorithm and so a faster solution may be possible. However, this requires effort on the part of the user to devise a clever encoding.


Related Solutions

Consider a phase maneuver starting at Earth and ending up at the L5 point, using 1...
Consider a phase maneuver starting at Earth and ending up at the L5 point, using 1 revolution.a) Describe the phasing orbit in terms of semi-major axis, period, and distance from the sun at aphelion and perihelion.b) Calculate the ∆v’s required to enter the orbit from Earth and exit the orbit at L5.c) Looking at the symmetry of the situation, you should conclude that going to L4 and back takes just as much time and fuel as going to L5 and...
how to write a genetic algorithm for a knapsack problem .
how to write a genetic algorithm for a knapsack problem .
Which type of genetic test can be used to identify genetic and chromosomal abnormalities before pregnancy...
Which type of genetic test can be used to identify genetic and chromosomal abnormalities before pregnancy starts? Amniocentesis Newborn screening Chorionic villus sampling Preimplantation genetic diagnosis In vitro fertilization Sporadic cancer: occurs during one's lifetime occurs in somatic cells affects all cells in the individual A and B only A, B and C Cancer cells are NOT contact inhibited. transplantable. invasive. de-differentiated. immortal. What is the purpose of a pharmacogenomic test? Detection of variants of genes or gene expression patterns...
Genetic genealogy Mitochondrial DNA and the Y chromosome can be used to trace certain genetic lineages....
Genetic genealogy Mitochondrial DNA and the Y chromosome can be used to trace certain genetic lineages. Choose the best term to complete each of the following statements. (Fill in the blanks) 1. Mitochondrial DNA traces------ . 2. Analysis of the Y chromosome can be used to trace---- . 3. The ancestral mitochondrial DNA sequence theoretically represents------ . 4. The mitochondrial Eve lived in------------ approximately --------years ago.
How can the concept of recombination frequency be used in genetic mapping?
How can the concept of recombination frequency be used in genetic mapping?
How can the concept of recombination frequency be used in genetic mapping?
How can the concept of recombination frequency be used in genetic mapping?
Two-Point Mapping The general strategy used to determine the genetic distance between linked genes is to:...
Two-Point Mapping The general strategy used to determine the genetic distance between linked genes is to: 1. Make all of the genes of interest heterozygous in an individual or strain 2. Examine the gametes produced in the heterozygous individual(s) Using our example above. You have two pure-breeding lines of plants, one with green seeds and short height (GG tt) the other with yellow seeds and tall height (gg TT). You cross the two strains to make the genes heterozygous. What...
a) Describe, in detail, how a genetic cross can be used to identify the number of...
a) Describe, in detail, how a genetic cross can be used to identify the number of genes involved in major changes in body form between two different organisms. b) If you found a group of similar species living on nearby islands, describe in detail a method you could use to determine their exact evolutionary relationship to each other. c) Describe, in detail, how a mutation in the intracellular domain of MC1R could change the coat color in rock pocket from...
Ackermann’s function is a recursive mathematical algorithm that can be used to test how well a...
Ackermann’s function is a recursive mathematical algorithm that can be used to test how well a computer performs recursion. Write a method ackermann(m, n), which solves Ackermann’s function. Use the following logic in your method: If m = 0, then return n + 1 If n = 0, then return ackermann(m-1, 1) Otherwise, return ackermann(m -1, ackermann(m, n - 1)) Test your method in a java program that displays the return values of the following method calls: ackermann(0, 0), ackermann(0,...
1. How can the NMR spectrum be used to show that there is no starting material...
1. How can the NMR spectrum be used to show that there is no starting material left in the products? 2. Can the NMR spectrum be used to determine the ratio of 2-hexanol to 1-hexanol? 3. What produces the peak around 3.65 ppm in the NMR?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT