Class CheatingNQueensPhaseCommand

java.lang.Object
org.optaplanner.examples.nqueens.optional.solver.solution.CheatingNQueensPhaseCommand
All Implemented Interfaces:
org.optaplanner.core.impl.phase.custom.CustomPhaseCommand<NQueens>

public class CheatingNQueensPhaseCommand extends Object implements org.optaplanner.core.impl.phase.custom.CustomPhaseCommand<NQueens>
Because N Queens is not NP-complete or NP-hard, it can be cheated. For this reason, N queens should not be used for benchmarking purposes.

This class solves any N Queens instance using a polynomial time algorithm (explicit solutions algorithm).

  • Constructor Details

    • CheatingNQueensPhaseCommand

      public CheatingNQueensPhaseCommand()
  • Method Details

    • changeWorkingSolution

      public void changeWorkingSolution(org.optaplanner.core.api.score.director.ScoreDirector<NQueens> scoreDirector)
      Specified by:
      changeWorkingSolution in interface org.optaplanner.core.impl.phase.custom.CustomPhaseCommand<NQueens>