You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
A solution to the NQueens problem using the min-conflicts iterative repair method. Additionally, an implementation of the AlphaBeta pruning algorithm is included.
CISC 352: Artificial Intelligence Sean Nesdoly & Mary Hoekstra March 19th, 2017
This repository implements the algorithms required for solving the following two problems that are outlined in the assignment 3 documentation for CISC352:
TheN-Queens puzzle is the problem of placingn chess queens on ann-by-n chessboard so that no two queens threaten each other. This problem is solved using aniterative repair algorithm where conflicts are resolved using theminimum conflicts heuristic.
TheAlpha-Beta Pruning algorithm is a search algorithm that seeks to decrease the number of nodes that are evaluated by theminimax algorithm in its search tree. This is used in the context of a machine playing implementation ofzero-sum games; the "minimax" refers to each playerminimizing themaximum payoff possible for the other.
Build Process
CompiledJAR files have been included under the root project directory for each problem. Note that Java version 1.8 was used.
If required to build a project, there are two methods that may be used:
gradle build toolnot installed: run thegradlew executable or thegraddlew.bat batch file (for Windows)
gradle build toolis installed: from the project root directory, run thegradle build command
Running the N-Queens Problem
Using the compiledJAR file:
cd path-to-CISC352-Assignment3/nqueensjava -Xmx6g -jar nqueens.jar
Using thegradle executable:
cd path-to-CISC352-Assignment3/nqueens./gradlew -q# if gradle is NOT installedgradle -q# if gradle is installed
Running Alpha-Beta Pruning
Using the compiledJAR file:
cd path-to-CISC352-Assignment3/alphabetajava -jar alphabeta.jar
Using thegradle executable:
cd path-to-CISC352-Assignment3/alphabeta./gradlew -q# if gradle is NOT installedgradle -q# if gradle is installed
Program Input/Output
In each projects root directory there is a folder namedsrc/. The specified input & output files are contained within this folder. Edit the files as desired, but do not move them to another directory. Both programs are coded to read from & write to the directorysrc/.
Here are the important components of the project structure for reference:
A solution to the NQueens problem using the min-conflicts iterative repair method. Additionally, an implementation of the AlphaBeta pruning algorithm is included.