Class 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 Detail

      • CheatingNQueensPhaseCommand

        public CheatingNQueensPhaseCommand()
    • Method Detail

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