Package CSPGen

This package is a generator of Random CSPs.

See:
          Description

Class Summary
BinaryConstraint This class is used to store the data structure of a single binary constraint.
Problem Problem class is the generator of flawless Random CSPs.
Variable An instance of this class represents one variable in a CSP.
 

Package CSPGen Description

This package is a generator of Random CSPs. This generator is based on the paper "Random constraint satisfaction: Flaws and structure" by Gent et al.,1998. This program has been placed in its own package so that is is easy to keep it seperate from your own code. Feel free to place this package inside whatever package you wish, but I recommend that it remain in a seperate package.

To construct a random CSP you must know 5 parameters:

  1. a long value for the seed of the random number generator
  2. the number of variables
  3. the size of the domain (all variables will have the same domain)
  4. the chance that there is a constraint between a pair of variables (between 0 and 1)
  5. the chance that a pair of values is consistant under a specific constraint (between 0 and 1)
Togeather the above 5 parameter's uniquely identify a specific CSP.

To create a problem, call the constructor of the Problem class with the 5 parameters. It will then construct the required instances of the Variable class (one instance per variable) and the BinaryConstraint class. The returned problem object can then be used to refer to the problem as a whole and can be passed to an algorithm for solving.

See the API of each class for further details on accessing the specifics of the generated CSP.