Category:
Software Engineering
Client:
N/A
Java Sudoku Solver
Vision
The project aimed to explore and compare multiple algorithmic strategies for solving Sudoku puzzles, blending traditional computational methods with evolutionary approaches. It serves as a hands-on study in problem-solving techniques, optimization, and algorithm efficiency within a well-defined constraint space.
Approach
Three distinct solving methods were implemented:
Inductive and Deductive Algorithms: Both relied on brute-force and backtracking techniques to explore and validate possible number placements across the Sudoku grid.
Genetic Algorithm: This approach treated each board configuration as a "genome," evaluating fitness based on the number of rule violations. Over successive generations, crossover and mutation operators were used to evolve solutions, prioritizing the most promising candidates.
Each algorithm was benchmarked using Java's built-in timing functions to evaluate performance and efficiency across varying difficulty levels.
Challenges
Designing a scoring system for the genetic algorithm that could effectively guide the evolution process without getting trapped in local optima.
Managing computational complexity and stack depth in recursive backtracking approaches.
Ensuring consistent board validation and correctness across all solving methods.
Conclusion
The project demonstrated the trade-offs between exhaustive search techniques and heuristic-based approaches like genetic algorithms. While the brute-force methods delivered fast and accurate results, the genetic algorithm showcased potential for adaptive problem-solving — albeit with less reliability. Overall, the project reinforced algorithmic thinking and highlighted the importance of balancing performance with accuracy in problem-solving scenarios.