It looks like 5 is possible and 6 is not,

but to discover that with simulated annealing you may want a data structure that lets you add and remove queens and knights, with a high cost for removing them.

Solved

Posted on 2006-05-15

Hello all.

I have to provide a solution to the following problem using simulated annealing:

I must place an equal number of knights and queens on a chessboard such that no piece attacks any other piece. And I need to determine the maximum number of pieces I can place on the board + how many different ways I can do it (printing the board for each discovered solution).

My experience in this field of heuristics is relatively reduced and any help you can provide regarding the data structures required to store the solution plus a way of actually solving the problem would be very much welcome.

Many thanks.

I have to provide a solution to the following problem using simulated annealing:

I must place an equal number of knights and queens on a chessboard such that no piece attacks any other piece. And I need to determine the maximum number of pieces I can place on the board + how many different ways I can do it (printing the board for each discovered solution).

My experience in this field of heuristics is relatively reduced and any help you can provide regarding the data structures required to store the solution plus a way of actually solving the problem would be very much welcome.

Many thanks.

5 Comments

It looks like 5 is possible and 6 is not,

but to discover that with simulated annealing you may want a data structure that lets you add and remove queens and knights, with a high cost for removing them.

If I need to ask this question separately (so that you may get the points for it) please tell me. I'm new and this problem is very urgent for me.

Thank you again.

in this problem, the cost might be the number of attacks and the number of queens and knights short of the maximum.

that on a 8 x 8 board a maximum of 5 queens and 5 knights can be placed. Could you please provide some code (preferably in C/C++) so as to solve this particular problem (of Q and K placement) for this particular board size using SA?

Thank you.

By clicking you are agreeing to Experts Exchange's Terms of Use.

Title | # Comments | Views | Activity |
---|---|---|---|

either24 challenge | 19 | 73 | |

ImportError: No module named 'pypyodbc' - python 3.5.2 | 3 | 245 | |

map interface methods | 3 | 45 | |

wordsWithoutList challenge | 24 | 61 |

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

Connect with top rated Experts

**13** Experts available now in Live!