Skip to content

YEH-YU-YANG/N-Queen-Problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N-Queen-Problem

Write programs in C++ to solve the n-queen problem.

  1. Use Iterative Deepening Search (IDS)
  2. Use Hill Climbing (HC)
  3. 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.

IDS

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

HC

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

GA

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

30times.py

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published