N Queens problem

  • Thread starter Thread starter Entrevado
  • Start date Start date
Entrevado
Messages
3
Reaction score
0
Would it be useful to have a method to generate a (just one) direct and valid solution for each value of N?
 
Physics news on Phys.org
Are you suggesting that each of the Aleph Null problems be solved one-by-one?
The wiki article for n=8 also discusses the N queens problem. There is a systematic way of finding one of the solutions for any ##N\ge4##.
 
Last edited:
I'm not familiar with any of those methods, I'm just trying to find a simple way to generate a valid and direct result , I'm currently at 70% of N values, but I don't know if completion can be helpful, that's why I'm asking.
And thanks for responding.
 
The Wikipedia article has a step-by-step instruction how to generate solutions for any n>=4.
 
Entrevado said:
Would it be useful to have a method to generate a (just one) direct and valid solution for each value of N?
can i know what kind of solution are you expecting. like the position coordinates of the n queens in the n*n chess boards
 
Thanks for your answers. Regarding the mention of the solution on Wikipedia, it's correct, but I wasn't familiar with it. I may be following the same path without realizing it.
Here's the solution for N=20:
2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 3, 1, 7, 5, 11, 9, 15, 13, 19, 17

P.S.: I also see that N=0 and N=1 are valid.


Sorry for the English ( I used the translator. )

Edition:

Now I'm trying to include odd multiples of three in the code pattern, and I don't know if the result will be the same as Wikipedia's.
N=21
3,1,7,5,11,9,15,13,19,17,20,2,4,6,8,10,12,14,16,18,21
 
Last edited:

Similar threads

Replies
2
Views
2K
Replies
23
Views
3K
Replies
20
Views
6K
Replies
6
Views
3K
Replies
1
Views
2K
2
Replies
86
Views
22K
Replies
3
Views
2K
Back
Top