Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A solution to the NQueens problem using the min-conflicts iterative repair method. Additionally, an implementation of the AlphaBeta pruning algorithm is included.

NotificationsYou must be signed in to change notification settings

SeanNesdoly/CISC352-A3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  1. 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.
  2. 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:

├── README├── TechnicalDocument.pdf├── alphabeta│   ├── alphabeta.jar# JAR file│   ├── gradlew# Unix executable│   ├── gradlew.bat# Windows executable│   └── src│       ├── alphabeta│       │   ├── AlphaBeta.java│       │   ├── Main.java│       │   └── TextFile.java│       ├── alphabeta.txt# input file│       └── alphabeta_out.txt# output file└── nqueens    ├── nqueens.jar# JAR file    ├── gradlew# Unix executable    ├── gradlew.bat# Windows executable    └── src        ├── java        │   ├── Main.java        │   ├── NQueens.java        │   └── TextFile.java        ├── nqueens.txt# input file        └── nqueens_out.txt# output file

About

A solution to the NQueens problem using the min-conflicts iterative repair method. Additionally, an implementation of the AlphaBeta pruning algorithm is included.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp