Algorithm for Solving Easy Sudoku Puzzles: Pick an empty cell to begin. List the numbers (1 through 9) that the cell could still be, by eliminating all the numbers in this cell's 3x3 section, and all the numbers in this cell's row, and all the numbers in this column. Repeat that process for every empty cell on the board. Hint: you will need a different kind of variable (not a matrix) to store these possibilities for each location. At the end of this process, the value of a few cells will be completely known, i.e., all other eight numbers have been eliminated as possibilities. So now you can go back and re-process all the unknown cells on the board with this new information. At the end of that re-processing, if there are any cells that are now completely known, that weren't completely known before, then you can re-process again. That re-processing can continue again and again until there are no longer any new completely known values. If the all of the values on the board are completely determined, congratulations! You're solved an easy Sudoku puzzle! For more difficult Sudoko puzzles, some guessing and checking would be needed, which is beyond the scope of this lab. Your program only needs to work for easy sudoku puzzl which no guesses are needed. Housekeeping Commands:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Question

MATLAB Language

Algorithm for Solving Easy Sudoku Puzzles:
Pick an empty cell to begin.
List the numbers (1 through 9) that the cell could still be, by eliminating all the numbers in this cell's 3x3 section, and all the numbers in this cell's row, and all the numbers in this cell's
column.
Repeat that process for every empty cell on the board.
Hint: you will need a different kind of variable (not a matrix) to store these possibilities for each location.
At the end of this process, the value of a few cells will be completely known, i.e., all other eight numbers have been eliminated as possibilities.
So now yo ca
go back and re-process all the unknown cells on the board with this new information.
At the end of that re-processing, if there are any cells that are now completely known, that weren't completely known before, then you can re-process again.
That re-processing can continue again and again until there are no longer any new completely known values.
If the all of the values on the board are completely determined, congratulations! You're solved an easy Sudoku puzzle!
For more difficult Sudoko puzzles, some guessing and checking would be needed, which is beyond the scope of this lab. Your program only needs to work for easy sudoku puzzles, for
which no guesses are needed.
Housekeeping Commands:
2
clear
3
clc
Test Cases:
% Test Case 1 (where a Ø represents an unknown value)
M= [5 3 0 6 7 8 9 1 2;
0 0 2 1 9 5 3 0 8;
1 9 8 3 4 2 0 6 7;
8 0 9 7 6 1 4 2 3;
4 2 6 8 0 379 0;
0 0 3 9 2 4 8 0 6;
0 6 1 5 3 7 2 8 4;
2 8 7 4 1 9 6 0 5;
3 4 5 2 8 6 1 7 0]
% Test Case 1 solution:
% M= [534 6 7 8 9 1 2;
6 7 2 19 5 3 4 8;
1 9 8 3 4 2 5 6 7;
5
7
8
9
10
11
12
13
14
15
16
17
UTF-8
Transcribed Image Text:Algorithm for Solving Easy Sudoku Puzzles: Pick an empty cell to begin. List the numbers (1 through 9) that the cell could still be, by eliminating all the numbers in this cell's 3x3 section, and all the numbers in this cell's row, and all the numbers in this cell's column. Repeat that process for every empty cell on the board. Hint: you will need a different kind of variable (not a matrix) to store these possibilities for each location. At the end of this process, the value of a few cells will be completely known, i.e., all other eight numbers have been eliminated as possibilities. So now yo ca go back and re-process all the unknown cells on the board with this new information. At the end of that re-processing, if there are any cells that are now completely known, that weren't completely known before, then you can re-process again. That re-processing can continue again and again until there are no longer any new completely known values. If the all of the values on the board are completely determined, congratulations! You're solved an easy Sudoku puzzle! For more difficult Sudoko puzzles, some guessing and checking would be needed, which is beyond the scope of this lab. Your program only needs to work for easy sudoku puzzles, for which no guesses are needed. Housekeeping Commands: 2 clear 3 clc Test Cases: % Test Case 1 (where a Ø represents an unknown value) M= [5 3 0 6 7 8 9 1 2; 0 0 2 1 9 5 3 0 8; 1 9 8 3 4 2 0 6 7; 8 0 9 7 6 1 4 2 3; 4 2 6 8 0 379 0; 0 0 3 9 2 4 8 0 6; 0 6 1 5 3 7 2 8 4; 2 8 7 4 1 9 6 0 5; 3 4 5 2 8 6 1 7 0] % Test Case 1 solution: % M= [534 6 7 8 9 1 2; 6 7 2 19 5 3 4 8; 1 9 8 3 4 2 5 6 7; 5 7 8 9 10 11 12 13 14 15 16 17 UTF-8
% Test Case 1 (where a 0 represents an unknown value)
M= [5 3 0 6 7 8 9 1 2;
0 0 2 1 9 5 3 0 8;
19 8 3 4 2 0 6 7;
8 0 9 7 6 1 4 2 3;
4 2 6 8 0 3 7 9 0;
0 0 3 9 2 4 8 0 6;
0 6 1 5 3 7 2 8 4;
2 8 7 4 1 9 6 0 5;
4
5
7
8
10
11
12
3 4 5 2 8 6 1 7 0]
% Test Case 1 solution:
% M= [5 3 4 6 7 8 9 1 2;
6 7 2 19 5 3 4 8;
1 9 8 3 4 2 5 6 7;
8 5 9 76 1 4 2 3;
4 2 6 85 37 9 1;
7 1 3 9 2 4 8 5 6;
9 6 1 5 3 7 2 8 4;
9 6 3 5;
3 4 5 2 8 6 1 7 9]
13
14
15
16
17
19
20
21
22
2 8 7 4 1
23
24
% Test Case 2 (where a 0 represents an unknown
% M= [0 0 5 269 7 8 1;
6 8 0 0 7 1 4 9 3;
1 9 7 8 0 0 5 6 2;
25
value)
26
27
28
29
8 26 19 5 0 0 7;
3 7 4 6 8 2 9 0 0;
9 5 17 4 3 0 0 8;
5 19 3 0 0 8 7 4;
1 3 6;
0 0 3 4 1 8 2 5 9]
% Test Case 2 solution:
% M= [4 3 5 2 6 9 7 8 1;
6 8 2 5 7 1 4 9 3;
1 9 7 8 3 4 5 6 2;
8 2 6 19 5 3 4 7;
3 7 4 6 8 2 9 1 5;
9 5 1 7 4 3 6 2 8;
5 1 9 3 2 6 8 7 4;
30
31
32
33
2 4 0 0 5
34
35
36
37
38
39
40
41
42
2 4 8 9 5 7 1 3 6;
7 6 3 4 1 8 2 59]
43
44
UTF-8
O N00
Transcribed Image Text:% Test Case 1 (where a 0 represents an unknown value) M= [5 3 0 6 7 8 9 1 2; 0 0 2 1 9 5 3 0 8; 19 8 3 4 2 0 6 7; 8 0 9 7 6 1 4 2 3; 4 2 6 8 0 3 7 9 0; 0 0 3 9 2 4 8 0 6; 0 6 1 5 3 7 2 8 4; 2 8 7 4 1 9 6 0 5; 4 5 7 8 10 11 12 3 4 5 2 8 6 1 7 0] % Test Case 1 solution: % M= [5 3 4 6 7 8 9 1 2; 6 7 2 19 5 3 4 8; 1 9 8 3 4 2 5 6 7; 8 5 9 76 1 4 2 3; 4 2 6 85 37 9 1; 7 1 3 9 2 4 8 5 6; 9 6 1 5 3 7 2 8 4; 9 6 3 5; 3 4 5 2 8 6 1 7 9] 13 14 15 16 17 19 20 21 22 2 8 7 4 1 23 24 % Test Case 2 (where a 0 represents an unknown % M= [0 0 5 269 7 8 1; 6 8 0 0 7 1 4 9 3; 1 9 7 8 0 0 5 6 2; 25 value) 26 27 28 29 8 26 19 5 0 0 7; 3 7 4 6 8 2 9 0 0; 9 5 17 4 3 0 0 8; 5 19 3 0 0 8 7 4; 1 3 6; 0 0 3 4 1 8 2 5 9] % Test Case 2 solution: % M= [4 3 5 2 6 9 7 8 1; 6 8 2 5 7 1 4 9 3; 1 9 7 8 3 4 5 6 2; 8 2 6 19 5 3 4 7; 3 7 4 6 8 2 9 1 5; 9 5 1 7 4 3 6 2 8; 5 1 9 3 2 6 8 7 4; 30 31 32 33 2 4 0 0 5 34 35 36 37 38 39 40 41 42 2 4 8 9 5 7 1 3 6; 7 6 3 4 1 8 2 59] 43 44 UTF-8 O N00
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY