Class PigeonHole


  • public class PigeonHole
    extends ExampleFD
    It solves the PigeonHole problem.

    The problem is how to assign n pigeons into n-1 holes in such a way that each hole holds only one pigeons. Clearly this problem is not satisfiable.

    Version:
    4.7
    • Field Detail

      • noPigeons

        public int noPigeons
    • Constructor Detail

      • PigeonHole

        public PigeonHole()
    • Method Detail

      • model

        public void model()
        Description copied from class: ExampleFD
        It specifies a standard way of modeling the problem.
        Specified by:
        model in class ExampleFD
      • modelBasic

        public void modelBasic()
        It specifies inefficient model which uses only primitive constraints.
      • main

        public static void main​(java.lang.String[] args)
        It executes the program to solve PigeonHole problem in two different ways. The first approach uses global constraint, the second approach uses only primitive constraints.
        Parameters:
        args - the number of pigeons.