0% found this document useful (0 votes)
12 views

AI Assig 1

Uploaded by

Hawi Atieno
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

AI Assig 1

Uploaded by

Hawi Atieno
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

HAWI ATIENO

21/07188
ARTIFICIAL INTELLIGENCE
ASIGNMENT 1

A computer AI system was presented with a Sudoku problem like the one presented in class.
Explain how the computer system would solve the problem correctly

To solve a Sudoku puzzle, a computer AI system typically employs algorithms based on


backtracking, constraint satisfaction, or a combination of both. Here's a general outline of how
such a system might solve the puzzle:
Representation: The Sudoku puzzle is represented as a 9x9 grid where each cell can contain
a digit from 1 to 9. Empty cells are usually represented by zeros or another placeholder.
Initial State: The AI system starts with the initial state of the puzzle, which contains some
numbers filled in and some empty cells.
Constraint Satisfaction: The system applies constraints to ensure that each row, column,
and 3x3 sub grid contains only one instance of each digit from 1 to 9. This constraint
satisfaction process helps in reducing the search space.
Backtracking Search: The AI system uses a backtracking search algorithm to explore
possible solutions. It starts by selecting an empty cell and trying out possible digit choices
for that cell, ensuring that the chosen digit does not violate any constraints. If a chosen digit
leads to a contradiction (e.g., violating the Sudoku rules), the system backtracks and tries a
different digit.

Recursion: The backtracking process is typically implemented recursively, exploring


different possible choices for each empty cell until a solution is found or all possibilities are
exhausted.
Optimizations: To improve efficiency, the AI system may incorporate various optimizations,
such as constraint propagation techniques, forward checking, or heuristic strategies for
selecting the next cell to fill.
Solution Verification: Once a candidate solution is found, the AI system verifies that it
satisfies all constraints, ensuring that each row, column, and subgrid contains all digits from
1 to 9.
Iterative Process: If the initial backtracking search does not lead to a solution, the AI system
may try different strategies or variations of the algorithms to continue searching for a valid
solution.

Completion: Once a valid solution is found, the AI system presents the completed Sudoku
grid to the user.
Overall, the computer AI system employs a combination of constraint satisfaction and
backtracking search techniques to efficiently solve Sudoku puzzles while ensuring that the
solution adheres to the rules of the game.

You might also like