Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sudoku Hands-on Training Masters Project Presentation Yiqi Gao March 19, 2014.

Similar presentations


Presentation on theme: "Sudoku Hands-on Training Masters Project Presentation Yiqi Gao March 19, 2014."— Presentation transcript:

1

2 Sudoku Hands-on Training Masters Project Presentation Yiqi Gao March 19, 2014

3 PROJECT MOTIVATION Passion for Sudoku Missing pages found on the flight to Mexico Thrill of building an expert system with user interface by integrating Clips with Java

4 BACKGROUND Sudoku – 数独 sūdoku, Digit-single –Originally called Number Place, is a logic-based, combinatorial number- placement puzzle

5 BACKGROUND Sudoku –The objective is to fill the playing board with digits so that each row, column and box contains all of the digits from 1 to 9. –The same single integer can only appear once in each row, column or box

6 INTRODUCTION Objective –Part I: Show solution to a given Sudoku puzzle step by step with detailed illustration –Part II: Introduce user interaction that could tell whether user gives the answer by guessing or reasoning and only accept answers got by reasoning

7 INTRODUCTION Design Choice –Clips (Inference Engine): a public domain software tool for building expert systems –Swing (User Interface): Java GUI widget toolkit –Jess (IE & UI Interaction): a rule engine for the Java platform, which is a superset of the CLIPS programming language

8 INTRODUCTION User Interface Checkerboard Buttons InfoBar

9 INTRODUCTION Functions –Quick Start with a built-in Sudoku puzzle

10 INTRODUCTION Functions –Initialize your own Sudoku puzzle

11 INTRODUCTION Functions –Try a number to check the correctness

12 INTRODUCTION Functions –Step to get a currently possible answer

13 INTRODUCTION Functions –Solve the puzzle immediately

14 INTRODUCTION Functions –Clear the playing board

15 INTRODUCTION Difficulties & Solutions (Part I) –How to make the sequence of outcomes more natural (close to the sequence when done by human) ? –Declare different salience for rules

16 INTRODUCTION Difficulties & Solutions (Part I) –How to illustrate the reasoning for each step on the playing board? –Trace the rules that make a cell have only one possibility, color the related cells and give the reasoning

17 INTRODUCTION Difficulties & Solutions (Part II) –How to interact with user? –Take user input as an assertion of fact, modify the rules to make the inference engine run again with the new fact and after checking the correctness, retract the fact

18 INTRODUCTION Difficulties & Solutions (Part II) –Sudoku is a constraint satisfaction problem, and usually more than one cell is available at a point, thus choosing different cells makes different paths. –However, inference engine could only get one path at a point

19 INTRODUCTION Difficulties & Solutions (Part II) –How to check the correctness if the cell is not the first on the path? –Instead of a depth-first way of thinking, keep the possibilities of the cells before they get to one, put them in a list, thus all the currently available cells are in the list until the inference engine has no rule to trigger, then compare the cell with the list

20 PROJECT STRUCTURE

21 Captured from lecture notes of CAP 5635 Artificial Intelligence System Architecture: Sudoku Rules & Patterns Sudoku Problem Sudoku Board

22 EXPERT KNOWLEDGE Sudoku Rules –Each row, column and box contains all of the digits from 1 to 9 –The same single integer can only appear once in each row, column and box

23 EXPERT KNOWLEDGE Solving Patterns –Sole Candidate –Unique Candidate –Box and column / Row Interaction –Box / Box Interaction http://www.kristanix.com/sudokuepic/sudoku-solving-techniques.php

24 EXPERT KNOWLEDGE Solving Patterns –Naked Subset –Hidden subset http://www.kristanix.com/sudokuepic/sudoku-solving-techniques.php

25 INFERENCE ENGINE Facts –Cell: 9×9 facts recording the information of each cell and 20+ facts for the puzzle (box 0)

26 INFERENCE ENGINE Facts –Current: 1 fact recording current status and currently available results

27 INFERENCE ENGINE Rules –Initialize puzzle: extract the (possibilities ?) value from puzzle(20+ Cell facts) to board(9×9 Cell facts) and retract these facts after initialization so that there are always 9×9 Cell facts afterwards

28 INFERENCE ENGINE Rules –All elimination rules: each time eliminate only one number from a cell; if after elimination the cell has only one possibility, then keep that number so that the cell has two possibilities and put this cell and its value in the current results list, meanwhile trace the rules and related cells

29 USER INTERFACE Sudoku Board –Board/Box/Cell –CardLayout (JLabel/InputBox) for Cell

30 USER INTERFACE Buttons & InfoBar –JButton –JLabel

31 IE & UI INTERACTION Assert new facts for user input with Jess Get slot values from facts and show the information on User Interface after reorganization

32 EXPECTED RESULTS Two Parts (Both Finished) –Part I: Show solution to a given Sudoku puzzle step by step with detailed illustration –Part II: Introduce user interaction that could tell whether the user gives the answer by guessing or reasoning and only accept answers got by reasoning

33 RESULTS

34

35

36

37

38

39

40

41 MAIN INNOVATIONS Teaching with detailed illustrations –Part I : Colored cells with reasoning Training rather than just teaching –Part II : Be able to tell whether the user gets the answer by guessing or reasoning and only accept answers got by reasoning

42 PROJECT SUMMARY Sudoku teaching and training tool Clips and Java integration Expert system with GUI User interaction

43


Download ppt "Sudoku Hands-on Training Masters Project Presentation Yiqi Gao March 19, 2014."

Similar presentations


Ads by Google