Git Product home page Git Product logo

kakuro-ai-project-'s Introduction

Kakuro

Kakuro is a logic puzzle that is often referred to as a mathematical transliteration of the crossword. The puzzle is played in a grid of filled and barred cells, "black" and "white" respectively. The black cells contain a diagonal slash from upper-left to lower-right and a number in one or both halves, such that each horizontal entry has a number in the black half-cell to its immediate left and each vertical entry has a number in the black half-cell immediately above it. The objective of the puzzle is to insert a digit from 1 to 9 inclusive into each white cell such that the sum of the numbers in each entry matches the clue associated with it and that no digit is duplicated in any entry.

Algorithms

There are four different puzzles to be solved and there have been 3 different algorithms to achieve that. The algorithms are:

  • BackTracking (BT)
  • Forward Checking (FC)
  • Maintaining Arc Consistency (MAC)

Those algorithms were forked by AIMA (https://github.com/aimacode/aima-python).

Files

The file of my code is kakuro.py and all the rest are also from AIMA.

Results

The time-table:

                 SIMPLE BACKTRACKING - BT   | FORWARD CHECKING - FC   |  MAINTAINING ARC CONSISTENCY - MAC 
      KAKURO1           25 microsec              0,... microsec                     1 microsec

      KAKURO2           2 microsec               0,... microsec                     1 microsec

      KAKURO3          44431 microsec              4 microsec                       7 microsec

      KAKURO4         1097825 microsec            21 microsec                       35 microsec

So, we notice that simple backtracking is by far the slowest algorithm, while FC and MAC have close times but obviously faster is FC. This result was expected because the FC and MAC are improvements BT.

Run

In order to run the program you need at least python 3.3

kakuro-ai-project-'s People

Contributors

myrto-iglezou avatar

Watchers

 avatar

Forkers

hashem-sanaei

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.