vaultah / sa-queens

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SA-Queens

Python implementation of the Simulated Annealing algorithm for solving the N queens problem.

Example output for the eight queens puzzle:

Initial arrangement:

QueenBoard(8x8, 8 queens,
- - - - - - - -
- - - - - - - -
- - - - - - - -
- - - Q - - Q -
- - - - Q - - -
Q - - - - Q - -
- - - - - - - Q
- Q Q - - - - -
)

Energy (initial): 9

Optimal arrangement:

QueenBoard(8x8, 8 queens,
- - - - - - - Q
- Q - - - - - -
- - - - Q - - -
- - Q - - - - -
Q - - - - - - -
- - - - - - Q -
- - - Q - - - -
- - - - - Q - -
)

Energy (optimal): 0
Elapsed time: 0.2252 seconds

About

License:MIT License


Languages

Language:Python 100.0%