ExamplesJaCoP
Class PigeonHole

java.lang.Object
  extended by ExamplesJaCoP.Example
      extended by ExamplesJaCoP.PigeonHole

public class PigeonHole
extends Example

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.

Author:
Radoslaw Szymanek

Field Summary
 int noPigeons
           
 
Fields inherited from class ExamplesJaCoP.Example
cost, search, store, vars
 
Constructor Summary
PigeonHole()
           
 
Method Summary
static void main(java.lang.String[] args)
          It executes the program to solve PigeonHole problem in two different ways.
 void model()
          It specifies a standard way of modeling the problem.
 void modelBasic()
          It specifies inefficient model which uses only primitive constraints.
 
Methods inherited from class ExamplesJaCoP.Example
creditSearch, getSearch, getSearchVariables, getStore, printMatrix, search, searchAllAtOnce, searchAllOptimal, searchLDS, searchMasterSlave, searchMaxRegretOptimal, searchMiddle, searchMostConstrainedStatic, searchOptimal, searchSmallestDomain, searchSmallestMedian, searchSmallestMiddle, searchSmallestMin, searchWeightedDegree, searchWithMaxRegret, searchWithRestarts, shavingSearch
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noPigeons

public int noPigeons
Constructor Detail

PigeonHole

public PigeonHole()
Method Detail

model

public void model()
Description copied from class: Example
It specifies a standard way of modeling the problem.

Specified by:
model in class Example

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.