[SOLVED] CSCI5260 Lab 5-Constraint Satisfaction with Eight Queens

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab-5-prcy00.zip (159.6 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product

 

Lab 5 – Constraint Satisfaction with Eight Queens

Overview

The eight queens problem is a classic illustration of constraint satisfaction. The problem says that you should place eight queens on an 8×8 chessboard such that no queen can capture another. When placed row-by-row, the possible placements in the next rows are constrained by each placement. If you have a position to place a queen in each row, you’ve found a solution. This problem is generalized as the n-queens problem.

Backtracking Code Exploration

Download the lab5.py file from the D2L dropbox. The code requires the following libraries:

  1. os
  2. random
  3. sys
  4. time

Backtracking Algorithm Understanding

  1. Examine the code. Explain how the code is behaving within the context of this particular problem.

 

  1. Now that you have investigated the code, specify the problem in terms of the following:

 

  1. Variables
  2. Domains
  3. Constraints

 

  1. Explain the idea of propagating constraints and unpropagating constraints in the n-Queens problem provided. Why is unpropagating constraints necessary?

 

Consistency

  1. Explain the following terms.

 

Node Consistency

Arc Consistency

Path Consistency

 

  1. Does the provided code maintain arc consistency? If not, explain how you could maintain arc consistency in the n-Queens problem.

 

 

  • Lab-5-prcy00.zip