Code Monkey home page Code Monkey logo

genetic-algorithm-simulation's Introduction

Genetic Algorithm

Genetic Algorithms (GAs) are adaptive heuristic search algorithm based on the evolutionary ideas of natural selection and genetics. As such they represent an intelligent exploitation of a random search used to solve optimization problems. Although randomised, GAs are by no means random, instead they exploit historical information to direct the search into the region of better performance within the search space.

GAs are based on an analogy with the genetic structure and behaviour of chromosomes within a population of individuals using the following foundations:

•	Individuals in a population compete for resources and mates.
•	Those Individuals most successful in each 'competition' will produce more offspring than those Individuals that perform poorly.
•	Genes from 'good' Individuals propagate throughout the population so that two good parents will sometimes produce offspring that are better than either parent.
•	Thus, each successive Generation will become more suited to their environment.

In this particular program, each Organism is randomly generated with a gene sequence. A Generation of the above-mentioned Organisms is created and compared with an Organism considered to be ideal for the specific runtime.

New Generations are generated by selecting Organisms from previous Generation which have a higher fitness number and crossing them to make a child Organism which is part of the generated Generation.

Random mutations are added to the program. With some low probability, a portion of the new Organisms will have random genes input in their sequence. Its purposes to maintain diversity within the population and inhibit premature convergence.

The Algorithm:

1.Randomly generate a population(x)
2.Determine fitness of the population(x)
3.Repeat until organism with highest fitness number is achieved
    a.	Select parents from the population(x)
    b.	Perform crossover and mutation on parents and create population(x+1)
    c.	Determine fitness of population(x+1)

The ability of the algorithm to explore and exploit simultaneously, a growing amount of theoretical justification, and successful application to real-world problems strengthens the conclusion that GAs are a powerful, robust optimisation technique.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.