Coder Social home page Coder Social logo

gadgil-devashri / n-queens-hill-climbing-variants Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 907 KB

This code was submitted as programming project two for ITCS 6150 Intelligent Systems under Dr. Dewan Ahmad at the University of North Carolina at Charlotte for the fall 2021 semester. The aim is to solve N-Queens problem using hill climbing algorithm and its variants.

Python 100.00%
nqueens-problem hill-climbing-search random-restart python heuristics

n-queens-hill-climbing-variants's Introduction

N-Queens-Hill-Climbing-Variants

Contributors

  • Varad Deshpande
  • Akshay Bheda
  • Devashri Gadgil

Problem statement

Problem Statement: The N-Queens Problem consists of placing N queens on an NxN chessboard so that no two queens can capture each other. That is, no two queens are allowed to be placed on the same row, the same column or the same diagonal. The problem of finding all solutions to the 8-queens problem can be quite computationally expensive. In this project, you will experiment with the n-queens problem by using hill-climbing search and its variants. Your program should treat the number of queens as a variable and should allow the user to input the value of queens. Using a programming language of your choice, implement the followings:

  1. Hill climbing search
  2. Hill-climbing search with sideways move
  3. Random-restart hill-climbing with and without sideways move

Instructions for code execution :

Prerequisites :

  • Make sure you have python installed.
  • Make sure you have numpy installed.
  • When you import the code in an IDE make sure there are no errors on the imports (numpy and copy).

Next Steps

  • Clone the code repository from GitHub and go to the src folder. Note: There are 4 programs:
  1. NQueen_Hill_Climb - Normal Hill Climbing program
  2. NQueen_Hill_Climb_Restart - Hill Climbing with random restarts
  3. NQueen_Hill_Climb_Sideway - Hill Climbing with Sideway moves without restarts
  4. NQueen_Hill_Climb_Sideway_Restart - Hill Climbing with Sideway moves and random restarts
  • Open the terminal in the src folder and execute command to run program of your choice : โ€˜py <program_name>โ€™. Example py NQueen_Hill_Climb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.