Class ChessHorseAllTest

java.lang.Object
topics.backtracking.knighttour.ChessHorseAllTest

class ChessHorseAllTest extends Object

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 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.