GithubHelp home page GithubHelp logo

vugarmammadli / csc384-kenken-csp Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 143 KB

The encoding of a CSP model to solve the logic puzzle, "Kenken", and the implementation of two constraint propagators – a Forward Checking constraint propagator, and a Generalized Arc Consistence (GAC) constraint propagator, along with the variable ordering heuristic of Minimum Remaining Values (MRV).

Python 100.00%
python csp kenken ai

csc384-kenken-csp's Introduction

CSC384 - Introduction to AI, Summer 2017

Homework Assignment 2: Constraint Satisfaction

Kenken puzzle has the following formal description:

  • Kenken consists of an nxn grid where each cell can be assigned a number 1 to n, so that no digit appears more than once in any row or column. Grids range in size from 3x3 to 9x9. Additionally, Kenken grids are divided into heavily outlined groups of cells - or 'cage'. The numbers in the cells of each 'cage' must produce a certain 'target' value when combined using a specified mathematical operation. These operations may be either addition, subtraction, multiplication or division. Note that values in a 'cage' can be combined in any order; the first number in a 'cage' may be used to divide the second, for example, or vice versa.

Introduction

There are two parts to this assignment:

  • the implementation of two constraint propagators – a Forward Checking constraint propagator, and a Generalized Arc Consistence (GAC) constraint propagator, along with the variable ordering heuristic of Minimum Remaining Values (MRV),
  • the encoding of a CSP model to solve the logic puzzle, “Kenken”, as described above.

Propagators and Variable ordering

Implemented python functions to realize two constraint propagators – a Forward Checking constraint propagator and a Generalized Arc Consistence (GAC) constraint propagator, and the variable ordering heuristic Minimum Remaining Values (MRV). The files cspbase.py, propagators.py and orderings.py provide the complete input/output specification of the three functions you are to implement.

Kenken model

Implemented a CSP encoding to solve the logic puzzle, Kenken. The file kenken_csp.py provides the complete input/output specification of the CSP encoding you are to implement.

Extra details

To get extra details about the specifications of the assignment, please read Assignment Handout.

csc384-kenken-csp's People

Contributors

vugarmammadli avatar

Stargazers

 avatar

Watchers

 avatar

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.