Git Product home page Git Product logo

solving-16-queen-problem-using-genetic-algorithm's Introduction

Breif

The 16 Queen is the problem of placing 16 chess queens on an 16×16 chessboard so that no two queens attack each other.

Naive Algorithm: Generates all possible configurations of queens on board and print a configuration that satisfies the given constraints.

Genetic Algorithm: Generates different configurations of queens on board based on cross-over and mutation rate and print a configuration that statisfies the given constraints.

Naive Algorithm vs Genetic Algorithm - Naive algorithm searches through the entire search space whereas Genetic algorithm effectively searches through the search space based on the fitness of the solutions.

Test Environment

  • Compiler - onlinegdb.com (online C++ compiler)
  • Text Editor - Notepad++

Repository Contents

  • 16-Queen Problem.pptx - A Powerpoint presentation about the code and its theory

  • main.c - Source code

Genetic Algorithm

A genetic algorithm is a search heuristic that is inspired by Charles Darwin’s theory of natural evolution. This algorithm reflects the process of natural selection where the fitest solutions are selected for cross-over in order to produce new solutions of the next generation.

Code Sequence

  1. Parent generation
  2. Fitness calculation
  3. Tournament selection is used to select the best parent for cross-over process
  4. Cross-over operation (PMX)
  5. Mutation operation (Activation of this operation depends on the mutation rate)
  6. Cross-over and mutation operation together generates the next generation solutions
  7. Check if any solution has fitness value 0 (max fitness), if false repeat from step 2
  8. Prints the optimal solution

solving-16-queen-problem-using-genetic-algorithm's People

Contributors

sayeed97 avatar

Watchers

 avatar

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.