The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
|
Objectives: Constraint Programming: Constraint Propagation and Backtracking SearchRequirements and Submissions: This is a programming assignment. Submit your source code via Connect. This assignment is worth 40% of the total assignment marks. Programs due on 23:55pm, Monday, March 9th. |
| There are two tasks in this assignment. The first task is to implement two functions to support the two constraint propagation methods, forward checking and arc-consistency checking, for a CSP solver. The second task is to use your fully-implemented CSP solver to solve a variant of the eight queen problem. The source code of the partially implemented CSP solver is provided to you.
Task 1: Forward Checking and AC-3 Algorithm for Maintaining Arc Consistency Download the source code of the partially-implemented CSP solver cosc322-csp-solver-src-2017.zip. The package consists of a collection of Java classes. Note that the solver is prepared specifically for this course, and its performance is not as good as industrial-strength solvers. You are required to complete two functions in the partially-completed Java classConstraintPropagator.java:
These two functions implement respectively the forward-checking algorithm and the arc-consistency algorithm (AC-3), and are used in the CSP solver implemented in the class CSPSolver.java. Please read the detailed comments in the following source files to see how the program works and what needs to be done:
|
|
Task 2: Solving a Variant of the Eight Queen Problem Using the Implemented Solver See the testing methods in the class 322CSP.java for examples on how to set up a CSP instance for the CSP solver. Please note that the our solver can only handle binary constraints, and as a consequence, the CSP formulation discussed in lecture 6 has t be used: one variable for each column, and there is a constraint between each pair of columns, giving us a total of 28 constraints.To make the problem more interesting, let's add an additional requirement for a solution: the sum of the row numbers of the two queens in any adjacent columns must be at least 7. |