Class ChessHorseAllTest
java.lang.Object
topics.backtracking.knighttour.ChessHorseAllTest
Test Suite for ChessHorseAll
Validates the exhaustive backtracking algorithm for the Knight's Tour problem. Employs assertions to verify path generation counts across different board configurations and initial states.
* @author vicegd-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidsetup()Initializes context and resources prior to executing the test suite.(package private) voidScenario: Standard 5x5 board starting at the top-left corner.(package private) voidScenario: 5x5 board starting at an edge coordinate (1,4).(package private) static voidteardown()Cleans up resources after the entire test suite has finished execution.
-
Constructor Details
-
ChessHorseAllTest
ChessHorseAllTest()
-
-
Method Details
-
setup
@BeforeAll static void setup()Initializes context and resources prior to executing the test suite. -
teardown
@AfterAll static void teardown()Cleans up resources after the entire test suite has finished execution. -
shouldFindAllSolutionsOnStandard5x5Board
@Test void shouldFindAllSolutionsOnStandard5x5Board()Scenario: Standard 5x5 board starting at the top-left corner.
Expected Outcome: The algorithm must traverse the entire state space and discover exactly 304 valid topological paths.
-
shouldFindNoSolutionsFromDeadEndStartingPosition
@Test void shouldFindNoSolutionsFromDeadEndStartingPosition()Scenario: 5x5 board starting at an edge coordinate (1,4).
Expected Outcome: Due to mathematical constraints, a knight cannot complete a full tour from this specific starting point. The algorithm must safely terminate with 0 solutions.
-