Code Monkey home page Code Monkey logo

geneticalgorithm's Introduction

Genetic Algorithms

This is a simple MATLAB implementation of genetic algorithms (GA). Two demos are shown here: First one finds the maximum point of a single-input function. It will show the evolution of the populations and the maximum point. The second one solves the Tower of Hanoi using GA. To run the Tower of Hanoi, follow the instructions inside its folder.

Getting Started

Maximization

Download the repo to your MATLAB workspace. To try the maximization problem, open genetic_algorithm.m with MATLAB. Then Simply press 'Run' or hit F5 to see the demo, or type genetic_algorithm() in the command window and hit Enter.

Tower of Hanoi

The Tower of Hanoi puzzle consists of three poles and a number of rings of different sizes which can move onto any pole. The puzzle starts with the rings neatly stacked in order of the size on one pole, the smallest at the top, making a conical shape. The objective of the puzzle is to move the entire rings to another pole, obeying the following rules:

  • Only one ring may be moved at a time.
  • Each move consists of taking the upper ring from one of the poles and moving it onto another pole, on top of the other rings that may already be present on that pole.
  • No ring may be placed on top of a smaller ring.

The classical recursive solution tells that within 2^n - 1 moves, where n is the number of rings, puzzle can be solved. In fact this is the optimal answer to the puzzle.

Prerequisites

MATLAB R2016b

Authors

  • Sajad Saeedi

License

This project is licensed under the MIT License - see the LICENSE.md file for details

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.