N queens problem with simulated annealing algorithm solution

Posted on 2006-04-14
Last Modified: 2013-12-26
I have asked in the previous question the data structure I will follow for solving the N Queens problem.
Here is my previous question about N -queens  algorithm.

It is better to read it first to understand this question.

I want to ask how can i now move the queens randomly according to the number of conflicts they have?
The bigger the number of conflicts the bigger probability to move further. The queens are also restricted in the N x N space.
I don't want to follow a hill climbing approach but a simulated annealing algorithm where in the beginning i will have big probability to accept bad soution .
Question by:xenoula
    LVL 84

    Accepted Solution

    A typical simulated annealing algorithm would try a move to a random neighbouring state,
    (you might consider neighbouring state to be a move of one queen by one space, or moving one queen to any other space, or moving one queen horizonally, or moving any number of queens by one space.  It could help if you can define your neighborhood such that good solutions tend to be close to other good solutions)
    and reject that move if e^-D/T > (random number between 0 and 1) where D is the change in energy and T is the temperature.

    Author Comment

    I have as valid positions the queens to move in the same column so i eliminate big proportion of the state space .

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
    Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now