DragonBreath
An Optimization Engine based on Constraint Programming and Local Search

[HOMEPAGE] -> [Documentation] -> [Interfaces to the Engine] -> [Java] -> [Constraints]


Constraints

(Section to be done; see Sample.java) (Shortcuts for easier creation will be added soon)

Constraints are added in two basic steps: At first, the constraint is created together with its minimal connections, and then, its connections are extended stepwise up to the preferred configuration.

Embeddings

The creation process of a constraint requires the specification of an Embedding, i.e., a definition with which graph components the constraint is to be connected.

Embedding Embedding(int connectedNodeNumber);

void extendEmbedding(Embedding embedding, Node node, int edgeID, 
  boolean direction);

Options for edgeID:

Options for direction:

Example:

Variable varA = gsc.createVariable("a");
Variable varS = gsc.createVariable("s");

Embedding e = new Embedding(2);
gsc.extendEmbedding(e, varA, Registry.ADD_EDGE, Registry.INCOMING);
gsc.extendEmbedding(e, varS, Registry.SUM_EDGE, Registry.OUTGOING);

Constraint Creation

Many different versions... using defaults or not.

ConventionalConstraint createConstraint(int constraintID, 
  Embedding embedding, int costID, Object costMappingOptions);

ConventionalConstraint createConstraint(int constraintID, 
  Embedding embedding, int costID);

ConventionalConstraint createConstraint(int constraintID, 
  Embedding embedding, Object costMappingOptions);

ConventionalConstraint createConstraint(int constraintID, 
  Embedding embedding);

ConventionalConstraint createConstraint(int constraintID, 
  Embedding embedding, int costID, Object costMappingOptions, 
  int x, int y);

ConventionalConstraint createConstraint(int constraintID, 
  Embedding embedding, int costID, int x, int y);

ConventionalConstraint createConstraint(int constraintID, 
  Embedding embedding, Object costMappingOptions, int x, int y);

ConventionalConstraint createConstraint(int constraintID, 
  Embedding embedding, int x, int y);

Options for constraintID:

By way of the costID, the user can specify a different cost type than the default one (if the constraint supports this). By way of the costMappingOptions, the user can give the current cost mapping specialized information on how to handle the constraint's costs (e.g., overriding a default factor). The x and y parameters play the same role as for variables.

Example, using the embedding created in the example above:

ConventionalConstraint cSum = gsc.createConstraint(Registry.SUM_CONSTRAINT, e);

Other cost types of a constraint can be used in addition by the following member functions of the GlobalSearchControl object:

void addCosts(ConventionalConstraint constraint, int costID,
  Object costMappingOptions);

void addCosts(ConventionalConstraint constraint, int costID);

Constraint Extension

void extendConstraint(ConventionalConstraint constraint, Embedding embedding);

Example, using the structures created in the examples above:

Variable varB = gsc.createVariable("b");

e = new Embedding(1);
gsc.extendEmbedding(e, varB, Registry.ADD_EDGE, Registry.INCOMING);

gsc.extendConstraint(cSum, e);

Constraint Reduction

void reduceConstraint(ConventionalConstraint constraint, Embedding embedding);

Example, using the structures created in the examples above:

e = new Embedding(1);
gsc.extendEmbedding(e, varA, Registry.ADD_EDGE, Registry.INCOMING);

gsc.reduceConstraint(cSum, e);

Constraint Deletion

Note that a constraint to be deleted must be reduced to its minimal base graph before. The constraint can then be deleted using the following member function of the related GlobalSearchControl object:

void deleteConstraint(ConventionalConstraint constraint);

Example, using the structures created in the examples above:

gsc.deleteConstraint(cSum);


[HOMEPAGE] -> [Documentation] -> [Interfaces to the Engine] -> [Java] -> [Constraints]


For questions, comments or suggestions, please visit our feedback forum.

Last update:
September 3, 2002 by Alexander Nareyek