Oyyko / N-queens-in-C

Solving N queens problem with the C programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

N-queens-in-C

Solving N queens problem (Just find one possible solution, not all situations) with the C programming language -- with high speed

⚠️️ Warning: I use some Heuristics Algorithm in this code to get a better performance when N is very large. However these Algorithm may cause a worse performance when N is small. So DON'T try small number.

performance

(On my personal laptop Thinkpad x1 carbon with i7-10710u CPU.)

It can solve X queens in Y seconds

X Y
10000 0.005
50000 0.014
100000 0.024
200000 0.030
300000 0.065
500000 0.090
1000000 0.274
2000000 0.924

About

Solving N queens problem with the C programming language

License:MIT License


Languages

Language:C 100.0%