https://github.com/dev-michael-schmidt/n-queens
Solve the classic N-Queens problem using a variety of techniques including Greedy Local Search, genetic algorithm, and DFS/Backtracking
https://github.com/dev-michael-schmidt/n-queens
Last synced: 27 days ago
JSON representation
Solve the classic N-Queens problem using a variety of techniques including Greedy Local Search, genetic algorithm, and DFS/Backtracking
- Host: GitHub
- URL: https://github.com/dev-michael-schmidt/n-queens
- Owner: dev-michael-schmidt
- Created: 2018-09-09T00:59:05.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-10T14:43:56.000Z (over 7 years ago)
- Last Synced: 2025-12-07T15:05:52.427Z (7 months ago)
- Language: C++
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# n-queens
The classic problem of placing "queen" chess pieces on an N×N board such that no queen attacks any other queen. Queen pieces move vertically, horizontally, and both diagonals. This repo implements search algorithms to solve this problem in both C++ and Python programming languages.
- C++
- Depth First Search
- Greedy Local Search
- Genetic Search
- Simulated Annealing (under RESEARCH)
- Python
- Depth First Search
- Greedy Local Search
- Genetic Search (under development)
## C++
Currently, genetic search performs slower than both depth first and greedy local search algorithms.
#### Building:
the usual: `make`
#### Usage:
`./n-queens `, where seed is used to seed the random generator, and N is used to specify the board size.
## Python:
Currently, no main driver exists for Python classes. A module will be created in the future with a driver script.
#### Usage:
`python3 depth_first.py`
`python3 greedy_local.py`