Write programs in C++
to solve the n-queen problem.
- Use
Iterative Deepening Search (IDS)
- Use
Hill Climbing (HC)
- Use
Genetic Algorithm (GA)
report.pdf
is my research report. Write in Mandarin.
N-Queen Problem Record.xlsx
is research recording of 8-Queens、50 Queens solved with IDS、HC、GA algorithm.
compile .cpp
g++ IDS.cpp -o IDS.exe
Solve 8-Queens problem with IDS algorithm
Outputfile: IDS_8_Queens.txt
.\IDS.exe 8
Solve 50-Queens problem with IDS algorithm
Outputfile: IDS_50_Queens.txt
.\IDS.exe 50
compile .cpp
g++ HC.cpp -o HC.exe
Solve 8-Queens problem with HC algorithm
Outputfile: HC_8_Queens.txt
.\HC.exe 8
Solve 50-Queens problem with HC algorithm
Outputfile: HC_50_Queens.txt
.\HC.exe 50
compile .cpp
g++ GA.cpp -o GA.exe
Solve 8-Queens problem with GA algorithm
Outputfile: GA_8_Queens.txt
.\GA.exe 8
Solve 50-Queens problem with GA algorithm
Outputfile: GA_50_Queens.txt
.\GA.exe 50
Execution
.\30times.py N -> N Queen
This aims to generate output automatically.
It will solve N-Queens problem with HC or GA algorithm and generate output 30 times.
( Or you can modify parameter of output times in 30times.py )
Outputs will be generate in Result.xlsx
automatically.