Class ChessHorse

java.lang.Object
topics.greedy.ChessHorse

public class ChessHorse extends Object
GREEDY ALGORITHM PROBLEM: THE HORSE JUMPING PROBLEM (Knight's tour) It has not an optimal solution in some cases
Author:
vicegd
  • Constructor Details

    • ChessHorse

      public ChessHorse(int n)
      Constructor for ChessHorse objects
      Parameters:
      n - Size of the board
  • Method Details

    • horse

      public boolean horse(int[] pos)
      Checks whether the horse can complete the board
      Parameters:
      pos - Initial position of the horse
      Returns:
      Whether the horse complete the board
    • writeSolution

      public void writeSolution()