Sudoku.

Slides:



Advertisements
Similar presentations
Local Search Algorithms Chapter 4. Outline Hill-climbing search Simulated annealing search Local beam search Genetic algorithms Ant Colony Optimization.
Advertisements

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?
Announcements Assignment #4 is due tonight. Last lab program is going to be assigned this Wednesday. ◦ A backtracking problem.
Backtracking COP Backtracking  Backtracking is a technique used to solve problems with a large search space, by systematically trying and eliminating.
1 Chapter 5 Advanced Search. 2 Chapter 5 Contents l Constraint satisfaction problems l Heuristic repair l The eight queens problem l Combinatorial optimization.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 8 Multidimensional.
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.
SOLVING SUDOKU Graham Hutton University of Nottingham (with thanks to Richard Bird)
The Mathematics of Sudoku Helmer Aslaksen Department of Mathematics National University of Singapore
SOLVING THE KAKURO PUZZLE Andreea Erciulescu Department of Mathematics, Colorado State University, Fort Collins (Mentor: A. Hulpke)
Patrick March, Lori Burns. History Islamic thinks and the discovery of the latin square. Leonhard Euler, a Swiss mathematician from the 18 th century,
SOLVING SUDOKU WITH MATLAB VERIFICATION FUNCTION correctness verification of the puzzle: checks if the current element appears twice in the same line,
SUDOKU Via Relaxation Labeling
1 CSC 427: Data Structures and Algorithm Analysis Fall 2011 See online syllabus (also available through BlueLine): Course goals:
SOLVING SUDOKU WITH MATLAB Raluca Marinescu, Andrea Garcia, Ivan Castro, Eduard Enoiu Mälardalen University, Västerås,
1 Chapter 5 Advanced Search. 2 Chapter 5 Contents l Constraint satisfaction problems l Heuristic repair l The eight queens problem l Combinatorial optimization.
2009/11/14GPW20091 Analysis of the Behavior of People Solving Sudoku Puzzles Reijer Grimbergen School of Computer Science, Tokyo University of Technology.
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.
HKOI2006 Analysis and Solution Junior Q3 – Sudoku HKOI Training Team
Sudoku Jordi Cortadella Department of Computer Science.
Propositional Satisfiability A compound proposition is satisfiable if there is an assignment of truth values to its variables that make it true. When no.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
SOLVING SUDOKU WITH MATLAB Raluca Marinescu, Andrea Garcia, Ivan Castro, Eduard Enoiu Mälardalen University, Västerås,
Monster (“Mega”) Sudoku
Backtracking & Brute Force Optimization Intro2CS – weeks
Local Search. Systematic versus local search u Systematic search  Breadth-first, depth-first, IDDFS, A*, IDA*, etc  Keep one or more paths in memory.
SUDOKU SOLVER Will Bazil, Ryan Covert, Ricky Parker.
INTELLIGENT TEST SCHEDULING TE-MPE Technical Meeting Michael Galetzka.
Constraints Satisfaction Edmondo Trentin, DIISM. Constraint Satisfaction Problems: Local Search In many optimization problems, the path to the goal is.
CS 561, Session 8 1 This time: constraint satisfaction - Constraint Satisfaction Problems (CSP) - Backtracking search for CSPs - Local search for CSPs.
Games: Expectimax MAX MIN MAX Prune if α ≥ β. Games: Expectimax MAX MIN MAX
Various Problem Solving Approaches. Problem solving by analogy Very often problems can be solved by looking at similar problems. For example, consider.
CSG3F3/ Desain dan Analisis Algoritma
CSC 421: Algorithm Design & Analysis
Name: Aimee McLaughlin
CSC 321: Data Structures Fall 2017
CSSE 230 Day 25 Skip Lists.
Monster (“Mega”) Sudoku
Event “zero-time” determination with TOF detector
MA/CSSE 473 Day 13 Finish Topological Sort Permutation Generation
A CIS 5603 Course Project By: Qizhong Mao, Baiyi Tao, Arif Aziz
Chapter 3 Probability.
EGR 115 Introduction to Computing for Engineers
Constraint Satisfaction Problems vs. Finite State Problems
David Kauchak CS30 – Spring 2016
Local Search Algorithms
Constraint Satisfaction Problem
Chapter 3 Probability.
CSC 421: Algorithm Design & Analysis
Computer Science cpsc322, Lecture 14
Problem Solving: Brute Force Approaches
Finding Heuristics Using Abstraction
Example Fill in the grid so that every row, column and box contains each of the numbers 1 to 9:
Jordi Cortadella Department of Computer Science
Modeling Sudoku as a CNF Formula
Multi-Objective Optimization
Modeling Sudoku as a CNF Formula
adapted from Recursive Backtracking by Mike Scott, UT Austin
Permutations and Combinations
Heuristics Local Search
Chapter 3 Probability.
Local Search Algorithms
Constraint Satisfaction Problems
Announcements Assignment #4 is due tonight. Last lab program is going to be assigned this Wednesday. ◦ A backtracking problem.
David Kauchak CS51A – Spring 2019
Local Search Algorithms
Presentation transcript:

Sudoku

What is Sudoku? A number based combinatorial puzzle The objective is to fill a 9x9 grid The allowed values are [1,9] Different digits in each column Different digits in each row Every 3x3 subgrid contains all of the digits A few cells are filled to start https://en.wikipedia.org/wiki/Sudoku

Minimal Sudoku No starting value can be removed without violating the unambiguousness. Around 3.1 × 10 37 minimal table exist. 2.55× 10 25 are different. Lots of minimal table collected at http://staffhome.ecm.uwa.edu.au/~00013890/sudokumin.php

Solving strategies Backtracking: This is implemented in the example code. Find an empty cell. Find a value which is allowed in the cell. Try to solve the new table. If the new table cannot be solved then back track to a previous state.

Solving strategies Stochastic search Random based search Fill the table randomly Search for violations in the filled table Permute the violating numbers If the number of violations is zero then we found a real solution Simulated annealing, genetic algorithms, etc.

Solving strategies Other strategies Constraint based algorithms Humanistic strategy Combination of simpler methods

Assignment Implement an efficient Sudoku solver! Minimum: able to solve a 9x9 table stop if the given table cannot be solved if multiple solutions are available gather all of them Be able to solve larger tables! Be able to generate valid sudokus!