Skip to content

alecfreud/8queens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

8queens

8 Queens Problem with Random Restart Hill Climbing

simple c# implementation:

  • generates random starting state of 1 queen per column

  • checks number of queen interactions based on chess rules (horiz + diagonal) + assigns to H value

  • moves each queen through her column and checks for a lower H. Each queen reset to starting position before moving to next column

  • starting state updates to current state if H value is lower. number of lower states is counted

  • if no lower state is found during all neighbor checks, current state is randomly restarted

  • each state and associated H value is printed out (simple graphical conversion from int array to 8x8 1s & 0s), along with the number of neighbor states with lower H.

  • solution state is printed along with the total state changes & number of restarts

About

8 Queens Problem with Random Restart Hill Climbing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages