Package sudoku.lab
Class FewestOptionsFirstSearchOrder
java.lang.Object
sudoku.lab.FewestOptionsFirstSearchOrder
- All Implemented Interfaces:
SquareSearchOrder
- Author:
- __STUDENT_NAME__, Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionselectNextUnfilledSquare(SudokuPuzzle puzzle)A square search algorithm that prefers squares with fewer options.
-
Constructor Details
-
FewestOptionsFirstSearchOrder
public FewestOptionsFirstSearchOrder()
-
-
Method Details
-
selectNextUnfilledSquare
A square search algorithm that prefers squares with fewer options. In other words, this algorithm should always pick the empty square that is the most constrained by its peers. This algorithm should return a square with no options if it exists (meaning that the puzzle is impossible to solve), or it should return empty, if the puzzle is already completely solved.- Specified by:
selectNextUnfilledSquarein interfaceSquareSearchOrder- Parameters:
puzzle- The sudoku puzzle to examine- Returns:
- the next unfilled square to examine in the puzzle
-