Coder Social home page Coder Social logo

gams's Introduction

GAMS

Genetic Algorithm Magicsquare Search

About

This is my experiment to test how Genetic Algorithms can be used to speed up search. This repo uses a very simplistic approach to solve a simple problem, to search for magic squares.

Why Magic Squares?

Magic squares make the perfect candidate for testing the efficacy of genetic algorithms. The state space grows very huge by the relation (s * s)!, where s is side of the square, and the number of solutions gets more and more sparse

Results

The search was relatively fast for small boards, but on larger boards the chance of getting stuck on a local minima was greater, upon hitting a minima for the larger boards you would have to increase the mutation rate to essentially start again.

The crossover function, even though it is not very domain specific, helped a lot is speeding up search, its addition was very noticable as it quickly converged to any minimas.

I usually like to crossover about 70% to 80% of the population, and the rest generated by mutation, this is because sometimes we are extremely close to solving the problem and crossover may yield outlandish answers. Further lengthening the search

I am not sure if k way selection actually has any significant benefits, a more detailed statistical study will be needed to conclude anything regarding k-way selection.

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.