Package org.jacop.examples.fd
Class PigeonHole
java.lang.Object
org.jacop.examples.fd.ExampleFD
org.jacop.examples.fd.PigeonHole
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.10
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
It executes the program to solve PigeonHole problem in two different ways.void
model()
It specifies a standard way of modeling the problem.void
It specifies inefficient model which uses only primitive constraints.Methods inherited from class org.jacop.examples.fd.ExampleFD
creditSearch, getSearch, getSearchVariables, getStore, printMatrix, search, searchAllAtOnce, searchAllOptimal, searchLDS, searchMasterSlave, searchMaxRegretOptimal, searchMiddle, searchMostConstrainedStatic, searchOptimal, searchSmallestDomain, searchSmallestMedian, searchSmallestMiddle, searchSmallestMin, searchWeightedDegree, searchWithMaxRegret, searchWithRestarts, shavingSearch
-
Field Details
-
noPigeons
public int noPigeons
-
-
Constructor Details
-
PigeonHole
public PigeonHole()
-
-
Method Details
-
model
public void model()Description copied from class:ExampleFD
It specifies a standard way of modeling the problem. -
modelBasic
public void modelBasic()It specifies inefficient model which uses only primitive constraints. -
main
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.
-