N-Queens results on Casio calculators
|
08-28-2024, 08:19 PM
(This post was last modified: 08-30-2024 06:00 PM by Hlib.)
Post: #21
|
|||
|
|||
RE: N-Queens results on Casio calculators
The name N-Queens of the thread hints at a more general approach to the task: 5 ... 8, 9 ... N queens on 5×5 ... 8×8, 9×9 ... N×N boards with the definition of all positions in each variant:
Code:
For N=10 (10->R), the calculator gives the result: _10-gueens _10×10 board P=724_positions S=348150_steps t=177.1_sec // Mat B=[[1,3,6,8,10,5,9,2,4,7]] is the last position 724. For other N the calculation time t(N) for GII-2 (CBASIC) can be estimated approximately: t(15)~10 +/- 1_days, t(20)~150 +/- 15_years. Just for comparison, on modern laptop PC: t(15)~10_minutes, t(20)~40_days. If we need to have a record of all the positions in each variant, then the program code should be slightly changed (after Lbl 0): Code:
Example for N=11, GII-2(CBASIC): P=2680_positions S=1806706_steps t=2741_sec Mat B is the array of all positions. This is the limit for CASIO, as the array with the results 8_rows×2680_columns=21440_cells and more dramatically reduces performance. The option without recording all positions gives t(11)=984_sec (i.e. ×2.8 times faster). In my opinion, the second version of the program (complete 10-queens benchmark) is very well suited for testing modern fast calculators. It checks not only the speed of calculations, but also manipulations with a large array of data. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)