Coder Social home page Coder Social logo

n-queens's Introduction

n-queens

本程序使用C++编写,分别运用随机重启爬山法、CSP最小冲突法和遗传算法对n - queens问题进行求解

10 50 100 1000 10000
随机重启爬山法 0ms 0ms 1ms 15ms 5181ms
最小冲突法 0ms 0ms 0ms 12ms 6128ms
遗传算法 41ms 7601ms 17001ms \ \

该结果表明,在问题规模逐渐增大时,随机重启爬山法和最小冲突法表现良好,而遗传算法在规模大于100时会因非常容易陷入局部最优解。

随机重启爬山法和最小冲突法虽然也会陷入局部最优解,但是由于其算法的完备性,导致其可以在$n^2$时间内找到最优解,随机重启爬山法由于在达到迭代次数后随机重启,在时间上,似乎要优于最小冲突法。

n-queens's People

Contributors

zly201 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.