SUDOKU Via Relaxation Labeling

Slides:



Advertisements
Similar presentations
Can you master it?. Sudoku Hype Sudoku is a logic-based number placement puzzle. The objective is to fill a 9×9 grid so that each column, each row, and.
Advertisements

Message-Passing and Sudoku Scott Kirkpatrick, HUJI Danny Bickson, HUJI TAU, June 18, 2006.
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
Playing Fair at Sudoku Joshua Cooper USC Department of Mathematics.
CPSC 322, Lecture 11Slide 1 Constraint Satisfaction Problems (CSPs) Introduction Computer Science cpsc322, Lecture 11 (Textbook Chpt 4.0 – 4.2) January,
The value of kernel function represents the inner product of two training points in feature space Kernel functions merge two steps 1. map input data from.
How to Choose a Random Sudoku Board Joshua Cooper USC Department of Mathematics.
Game Gallery Project (1) Supervised By: Professor Mona Mursi 2007.
A game of logic where the player must assign the numbers 1..9 to cells on a 9x9 grid. The placement of the numbers must be such that every number must.
The Mathematics of Sudoku Helmer Aslaksen Department of Mathematics National University of Singapore
Algorithm design techniques
Solving Sudoku Mark PTTLS Micro teach. Solving Sudoku What is a Sudoku? A Sudoku is a number puzzle based on a 9x9 grid made up from smaller 3x3 blocks.
CS194 Project: Sudoku Difficulty Kha Chu Advisor: Professor Sahai.
SOLVING SUDOKU WITH MATLAB
SOLVING SUDOKU WITH MATLAB VERIFICATION FUNCTION correctness verification of the puzzle: checks if the current element appears twice in the same line,
Sudoku Puzzles Frank Hilvers Taylor O’Brien. The History of Sudoku The history of Sudoku puzzles dates back to the 18th century.  Swiss mathematician.
Tractable Symmetry Breaking Using Restricted Search Trees Colva M. Roney-Dougal, Ian P. Gent, Tom Kelsey, Steve Linton Presented by: Shant Karakashian.
Scott Perryman Jordan Williams.  NP-completeness is a class of unsolved decision problems in Computer Science.  A decision problem is a YES or NO answer.
Brute Force Average of 88 checks Worst possible algorithm if there is a ship in the bottom right cell Best search: 25.
Sudoku Taryn, Jin, Jehsang, Phil, and Matt. Outline What is Sudoku? –The game of Sudoku –The website Sudoku UI Prototype How to use the site (use cases)
An advanced greedy square jigsaw puzzle solver
SOLVING SUDOKU WITH MATLAB Raluca Marinescu, Andrea Garcia, Ivan Castro, Eduard Enoiu Mälardalen University, Västerås,
8. Linear Programming (Simplex Method) Objectives: 1.Simplex Method- Standard Maximum problem 2. (i) Greedy Rule (ii) Ratio Test (iii) Pivot Operation.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Reinforcement Learning for the game of Tetris using Cross Entropy
2009/11/14GPW20091 Analysis of the Behavior of People Solving Sudoku Puzzles Reijer Grimbergen School of Computer Science, Tokyo University of Technology.
Monte Carlo Methods1 T Special Course In Information Science II Tomas Ukkonen
A Power Grid Analysis and Verification Tool Based on a Statistical Prediction Engine M.K. Tsiampas, D. Bountas, P. Merakos, N.E. Evmorfopoulos, S. Bantas.
1 N -Queens via Relaxation Labeling Ilana Koreh ( ) Luba Rashkovsky ( )
Research Into the Time Reversal of Cellular Automata Team rm -rf / Daniel Kaplun, Dominic Labanowski, Alex Lesman.
Applying Genetic Algorithm to the Knapsack Problem Qi Su ECE 539 Spring 2001 Course Project.
Computing Science 1P Large Group Tutorial 20 Simon Gay Department of Computing Science University of Glasgow 2006/07.
Whiteboardmaths.com © 2008 All rights reserved
Data Structures Using C++ 2E1 Recursion and Backtracking: DFS Depth first search (a way to traverse a tree or graph) Backtracking can be regarded as a.
Sudoku Solver Comparison A comparative analysis of algorithms for solving Sudoku.
1 On Completing Latin Squares Iman Hajirasouliha Joint work with Hossein Jowhari, Ravi Kumar, and Ravi Sundaram.
Sudoku Jordi Cortadella Department of Computer Science.
Honors Track: Competitive Programming & Problem Solving Optimization Problems Kevin Verbeek.
SOLVING SUDOKU WITH MATLAB Raluca Marinescu, Andrea Garcia, Ivan Castro, Eduard Enoiu Mälardalen University, Västerås,
Edge and Boundary interpretation Consistent line drawing labeling via backtracking Presented by Guy Shtub.
1 Project Management Example Solving Sudoku 2 What is Sudoku?  Sudoku is a game with 9 columns and 9 rows and 9 “boxes” composed of a 3 x 3 Grid  Numbers.
To create a program, written in C++, that could generate a Sudoku. Elements to take into consideration: The Sudoku created must have one unique solution.
Rook Polynomial Relaxation Labeling Ofir Cohen Shay Horonchik.
Quality of LP-based Approximations for Highly Combinatorial Problems Lucian Leahu and Carla Gomes Computer Science Department Cornell University.
A Critique and Improvement of an Evaluation Metric for Text Segmentation A Paper by Lev Pevzner (Harvard University) Marti A. Hearst (UC, Berkeley) Presented.
Minesweeper Solver Marina Maznikova Artificial Intelligence II Fall 2011.
MOCK TEST 11 ( ) Detailed Analysis.  Mock Test 11 follows the CLAT pattern wherein the students are subjected to the same level of difficulty both.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
Deterministic Algorithms for Submodular Maximization Problems Moran Feldman The Open University of Israel Joint work with Niv Buchbinder.
Sudoku is a logic-based, combinatorial number-placement puzzle. The objective is to fill a 9x9 grid with digits so that each column, each row, and each.
Monster (“Mega”) Sudoku
Backtracking & Brute Force Optimization Intro2CS – weeks
CompSci Problem Solving: Sudoku  Rules of the Game Sudoku is played with a 9 by 9 "board" consisting of nine 3 by 3 sub-boards. The symbols 1 -
By Luke. What is Sudoku? Sudoku is a number game it has 81 squares. The only numbers you can use are 1,2,3,4,5,6,7,8 and 9.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 23: Intractable Problems (Smiley Puzzles.
SUDOKU SOLVER Will Bazil, Ryan Covert, Ricky Parker.
Unconstrained Submodular Maximization Moran Feldman The Open University of Israel Based On Maximizing Non-monotone Submodular Functions. Uriel Feige, Vahab.
Various Problem Solving Approaches. Problem solving by analogy Very often problems can be solved by looking at similar problems. For example, consider.
Constraint Satisfaction Problems (CSPs) Introduction
BnB vs Label Relaxation.
Reinforcement Learning (1)
Constraint Satisfaction Problems (CSPs) Introduction
Recursive Thinking Chapter 9 introduces the technique of recursive programming. As you have seen, recursive programming involves spotting smaller occurrences.
Recursive Thinking Chapter 9 introduces the technique of recursive programming. As you have seen, recursive programming involves spotting smaller occurrences.
Analysis and design of algorithm
Jordi Cortadella Department of Computer Science
CS202 - Fundamental Structures of Computer Science II
Sudoku (数独 sūdoku?), also known as Number Place or Nanpure, is a logic-based placement puzzle. The objective is to fill the grid so that every column,
Sudoku.
Presentation transcript:

SUDOKU Via Relaxation Labeling Vova Goldman 321465031

SuDoku Puzzle What is SuDoku? The Sudoku grid consists of eighty-one squares in a nine by nine grid. There is just one simple rule controlling where you can place numbers in the grid: Fill in the grid so that every row,          every column, and          every 3 x 3 box (region) contains the digits 1 through 9.

SuDoku Puzzle Some History of the SuDoku The name Sudoku comes from Japan: Su - 'number' ,Doku - 'single'. puzzle itself originates from Switzerland and then travels to Japan by way of America Leonhard Euler

SuDoku Puzzle Puzzle Theory Sudoku is all about permutations, but permutations with an extra twist of logic. Finding patterns within these permutation subsets is definitely a 'hard' problem. (The NP complete class ) The time taken to solve does not grow linearly with problem size it grows exponentially. There exist many solution strategies and techniques for solving sudoku: Gödel numbers; Two out of three rule; Sub-group exclusion rule; Hidden Twin exclusion rule; General permutation rule; X-Wing and Swordfish; Backtracking and the Labyrinth and other…

Relaxation Labeling Algorithm Relaxation labeling is a general name for group of methods for assigning labels to set of objects using contextual constraints. It was originally developed for use in the field of computer vision. Set of objects: Set of labels: In the beginning algorithm sets initial probability value for each object labeled by each label. This value is the measured confidence that object bi should be labeled by label .

Relaxation Labeling Algorithm The strength of compatibility between the hypotheses " bi has label - " and " bj has label - “ For each iteration the algorithm calculates the support function for label for object bi (according to the compatibility of this label with the surrounding): The original "ad-hoc" update rule [Rosenfild et. al. 1976] : Fundamental result for RL theory: Under certain conditions on the relaxation labeling process will converge to a consistent labeling while maximizing the average local consistency. The Average Local Consistency (ALC) of the assignment

SuDoku via Relaxation Labeling Algorithm (I) The first attempt - brute force - SuDoku grid cells - numbers from 1 to 9 - 1/9 except for first row/column/region - returns 0 or 1 in following conditions: 1 – if objects j and i are NOT in one row/column/region, OR if i , j are both in the same row/column/region and ; 0 – otherwise. The stopping condition of algorithm is that changes in Average Local Consistency are low than 0.001 Results: Very long running time; it doesn’t converge to the correct solution; a few successful runs.

SuDoku via Relaxation Labeling Algorithm The second (successful) attempt n iterations of RL Algorithm runs first region – random permutation of (1…9). So in each iteration k (1 <= k <= 9): : numbers (All 1-s or 2-s,…,9-s). :all “possible” places in region that we can set number :1/(number of labels), all objects except for the first region. : returns 1 – if labels are NOT in one row/column; 0 – otherwise. The stopping condition of algorithm is that changes in Average Local Consistency are low than 0.01 Thus, in each of n iteration, position of “some” (1…9) number in every region is defined.

SuDoku via Relaxation Labeling Algorithm Results: For 4x4 sudoku grid, game simulator generates SuDoku very fast and correct For 9x9 sudoku grid, game simulator generates correct SuDoku in 55 second (average time) Good percent of correct solutions

Problems Different purposes of two algorithms Running time The purpose of RL algorithm is to find some assignments of labels to objects. The purpose of SuDoku problem is to find consistent arrangement of numbers (objects) in the grid. This difference causes the relaxation labeling algorithm to stop (when it converges) even if current assignment of numbers to cells doesn't make correct SuDoku solution Running time very large to big size SuDoku reasons of impossibility to check “deadlocks” in big size SuDoku “Deadlock” - incorrect (inconsistent) solution/generation It occurs partially because of the first problem (different purpose) because of running 9 iterations of RL algorithm separately but in “normal” SuDoku size it works comprehensively well. Randomization First step in all “iterations” is randomly generated region.

Conclusion: This interpretation (variation) of Relaxation Labeling algorithm is good for generating/solving SuDoku puzzle problem. For small SuDoku puzzle 4x4 it works perfectly! For normal Sudoku puzzle 9x9 it also works good. But running time is not the best. Adding some backtracking mechanism may improve results of this algorithm. There exist many other better and faster techniques for generation/solving SuDoku problem that can solve even bigger and different kinds of SuDoku.

SuDoku Game Simulator: 4x4 and 9x9 SuDoku puzzle grid size 3 difficulty levels: easy, normal, hard Generate SuDoku button – generate sudoku with defined size PLAY button – start SuDoku game Show Solution button – solve SuDoku and display solution

Reference On the Foundations of Relaxation Labeling Processes, by Hummel and Zucker 1983 Relaxation Labeling Algorithms – A Review, by Kittler and Illingworth, 1985 Perceptual Organization (III), CS 202-1-5251, BGU, Ohad Ben-Shahar Relaxation Labeling techniques - Computer Science, Cardiff University SuDoku Puzzle Theory. SuDoku Puzzle site. Sudoku Science.

Questions ??? Thanks!