A Mathematical Framework for a General

Purp ose Constraint Management System

by

Steven James Carden

Submitted in accordance with the requirements

for the degree of Do ctor of Philosophy

The University of Leeds

Scho ol of Computer Studies

June

The candidate conrms that the work submitted is his own and that

appropriate credit has b een given where reference has b een made to the

work of others

Abstract

The use of constraints in for designing complex mo dels is very p op

ular Current constraint solvers are divided into two broad classes general and

domain specic Those that are general can handle very general constraint prob

lems but are typically slow while those that are domain sp ecic can handle only a

sp ecic typ e of problem but are typically fast For example numerical algorithms

are slow but general whilst lo cal propagation techniques are fast but limited to

simple problems

It is generally acknowledged that there is a close coupling b etween engineering

constraints and geometric constraints in the pro cess and so the solution of

constraint problems consisting of engineering and geometric constraints is an imp or

tant research issue Some authors attempt to overcome the expressive limitations of

domain sp ecic solvers by using hybrid systems which try to nd a balance b etween

the sp eed of domain sp ecic solvers and the generality of general solvers

Previous research at the University of Leeds has led to the development of a num

b er of domain sp ecic solvers that are capable of solving geometric and engineering

constraint problems separately In particular the Leeds solvers are incremental and

can nd solutions when a new constraint is added very quickly This thesis investi

gates the use of a hybrid of the various Leeds solvers with an aim to interactively

solving constraint problems in engineering design This hybrid would have the sp eed

advantages of the domain sp ecic solvers and the expressiveness of a more general

solver In order for the hybrid to b e constructed commonalities of existing engineer

ing constraint solvers must b e identied A characterisation of existing constraint

solvers leads to the identication of a numb er of issues that need to b e addressed

b efore the hybrid can b e built

In order to examine these issues a framework for the constraint satisfaction

process is presented that allows abstractions of constraint denition constraint rep

resentation and constraint satisfaction Using the constraint satisfaction framework

it is p ossible to study the quality of solution of constraint solvers This leads to the

identication of imp ortant problems in current constraint solvers

The constraint pro cess framework leads to a study of the use of various paradigms

of col laboration within the hybrid such as sequential parallel and concurrent The

study of the quality of solution allows concrete statements to b e made ab out the

hybrid collab orations A new incremental constraint solver is presented that uses

the hybrid collab oration paradigms and provides a rst step towards a p owerful

engineering constraint solver i

Acknowledgments

First of all I would like to thank Pete Dew my sup ervisor Although I was

jealous of more ordered pro jects I enjoyed the relatively free hand with just enough

rop e to hang myself Pete was usually there with an encouraging word and just

enough guidance to keep me on the right track Either that or I nally convinced

him that I was right

Terrence Fernando my second sup ervisor was also a great supp ort to me as

was the whole Virtual Working Environment group esp ecially Martin Thompson

Mingxian Fa YungTeng Tsai and Edgard Lamounier

The p eople in BGT and the AI lab also kept me comparatively sane and cheerful

esp ecially on trips to the Pennines

Russ Bubley was a huge help throughout the three years I have known him and

shared an oce with him We continually b ounced ideas o each other and whilst

I tried not to b e to o ignorant of what he was talking ab out he usually managed

to put me straight on my pro ject His capitulation at squash was also particularly

gratifying

My housemates Mark Fred and Stuart were great fun to b e with and weve

had some great parties

My parents and siblings Jim Carol Neil and Claire put up with many a demon

stration at the dinner table ab out what constraints actually were I think theyre

still none the wiser

And nally I would like to thank Alice who b esides b eing wonderful and sym

pathetic all the way through also pro ofread my thesis even though it must have

sounded like gobbledigo ok to her ii

Contents

Intro duction

Ob jectives of this thesis

Incremental constraint solvers

Thesis organisation

Related Work

The

Decomp osition of constraint problems

Hybrid constraint solvers

Solution spaces

Constraints in engineering design

Constraint solvers

General constraint solvers

Numerical solvers

Symb olic solvers

Finite domain constraint solvers

Backtracking

Forwardchecking

Other nite domain research

Geometric constraint solvers

Underconstrained geometric constraint solvers

Wellconstrained geometric constraint solvers

Overconstrained geometric constraint solvers

Functional constraint solvers

Overconstrained functional constraint solvers

Maintenance and physical constraint solvers

Conclusions iii

Solving Problems by Decomp osition

Examples of current constraint solvers

DCM

INCES

IGCS

Connectivity Analysis

Decomp osition strategies

Examples of decomp osition strategies

Decomp osition to domain sp ecic subproblems

Advantages of decomp osition strategies

Limitations of decomp osition strategies

Incremental issues in decomp osition strategies

Conclusions

Ordering strategies

Examples of ordering strategies

Ordering strategies for a constraint solver

Incremental issues in ordering strategies

Conclusions

Solution of subproblems

Examples of solution of subproblems

Solving using domain sp ecic knowledge

Incremental issues in solving subproblems

Conclusions

Conclusions

Constraint Denition

Entities

Constraints

Constraint problems

Constraint solvers

Dimensions

Denition of dimensions

Constrainedness

Conclusions iv

Constraint Representation

Representing entities and constraints

Finitedomain entities and constraints

Innitedomain entities and constraints

Representing constraint problems

Example constraint representation schemes

Algebraic representation

Relationship graph representation

Undirected graph representation

Hyp ergraph representation

Bipartite representation

Valid representation schemes

Reductions

Conclusions

Constraint Satisfaction

Constraint solution

Solution spaces

A framework for the solution pro cess

Solution steps

Prop erties of solution steps

Solution pro cesses

Solution pro cesses always head towards a solution

Solution pro cess prop erties

Using lo cal prop erties to draw conclusions ab out pro cesses

Consequences of the Lo calGlobal Theorem

Enrichment of the constraint satisfaction framework

Constraint priorities

Variabledriven satisfaction

Backtracking

Incremental satisfaction

Conclusions

Hybrid Collab oration

Using domain sp ecic knowledge in constraint solvers

Using domain sp ecic knowledge is fast

Using domain sp ecic knowledge is not enough v

Hybrid constraint solvers

BALI

Enhanced solution spaces

A simple example hybrid constraint solver

Paradigms of collab oration

Sequential hybrids

Limitations of serial hybrids

Solver collab oration language

An example of many solvers in serial

Case study

The solvers used

Results

Conclusions

New Directions

Decomp osition strategy

Ordering strategy

Solution and recombination

Advantages of the ErepIGCS hybrid

Limitations of the ErepIGCS hybrid

Incremental implications of new solver

Conclusions

Future Work

The interactive constraint solver

The ErepIGCS hybrid solver

A standard interface for solvers

Complex case studies

Incremental issues

The mathematical framework

Inequality constraints

Probabilistic constraints

The Virtual Environment

Parallelconcurrent collab oration

Direct manipulation issues

Summary vi

Conclusions

A Dimensions

B CRS Reductions

C Lo cal Global Theorem

D Enhanced solution spaces

E Paradigms of collab oration

E Parallel hybrids

E An example of solvers in parallel

E Concurrent hybrids

F Solver collab oration language

G An example of many solvers in serial

G Case study

G The solvers used

G Exp ected b ehaviour of hybrid

G Results

G Conclusions

H Glossary vii

List of Figures

A Racing Car in a with Obstacles

The Conguration Space Map for the Racing Car

The Pro duct Design Pro cess

A Hierarchy of Constraint Solvers

An Arm with Two Joints and the Relationship Graph for the Problem

An Example of Lo cus Analysis

A Pentagon Dened by Distance and Angle Constraints

The Constraint Graph for the Pentagon

Equation Graph for Constraints C to C

Treelike Representation for Equation Graph

Typical result of Gaussian elimination on linearised constraint problem

Example of Incremental Insertion of Constraint Arrows in Graph

Indicate Order of Satisfaction

Example Constraint Graph for Hierarchical Constraint Problem

Constraint problem P describing a p entagon

Decomp osed subproblems of problem P

Recombined subproblems of constraint problem P

ConstraintEntity graph of gure

Decomp osed subproblems of gure

The inverse op eration metho d in IGCS from

A connectivity graph for constraint problem P

Residual sets for constraint problem P

Graph of tradeo b etween complex decomp osition and complex solvers

An rigid b o dy comp osed of two triangles

An Arm with Two Joints and the Relationship Graph for the Problem

Placing a queen on a chessb oard

A p oint a line and a line segment on a plane viii

An equality constraint and a distance constraint

A solution to constraint problem G

A solution to constraint problem F

A Puma Rob ot Arm

A Hierarchy of Constraint Representation Schemes

An Example of a Relationship Graph with a Solution to the Graph

An example of an undirected constraint graph with a solution to the

graph

An example of a constraint hyp ergraph with a solution to the graph

Example of a ConstraintEntity Graph

ConstraintEntity Representation for Constraint Problem

New Construct for Constraint Edges

New Construct for Constraint Lo ops

Representing Quaternary Constraints in a ConstraintEntity Graph

A Hierarchy of Constraint Representation Schemes

Solving the queens problem

Two Blo cks with an Against Constraint

A Chain of Blo cks with Against Constraints

Two Ro ds

Problem G

A solution to constraint problem G of example

Solutions of constraint problem G with l m n

The Internal Combustion Engine

A Serial Hybrid of INCES and IGCS

Sequential Collab oration

INCES as a sequential hybrid

IGCS as a sequential hybrid

Two Ro ds

The bar linkage problem

Case Study of n Piston Problems Linked Together

Serial Hybrid used to Solve n Piston Problems Linked Together

A comparison of the CNBC function and INCES algorithm with

the hybrid solver

Constraint problem Q using distance and angle constraints ix

ConstraintEntity graph for constraint problem Q

Constraint problem R with three tangent circles

ConstraintEntity graph for constraint problem R

Decomp osition of ConstraintEntity graph for problem R

A constraint problem with and constraints

Two triangles with a common edge

Constraint graph for gure

Iteration two of incremental solution of gure

Iteration ten of incremental solution of gure

E Parallel Collab oration

E A simplication of the internal combustion engine

E Concurrent Collab oration

G Case Study of n Piston Problems Linked Together

G Serial Hybrid used to Solve n Piston Problems Linked Together

G NAG function with bad initial guess

G NAG function with go o d initial guess

G Solving with INCES

G Hybrid solution using IGCS and INCES

G Solving the functional problem only using INCES without global

parametric constraint list

G Solving the geometric problem only using IGCS without the dep en

dency hierarchy list

G Solution using a hybrid algorithm of IGCS without depH list and

INCES without global parametric constraint list

G A comparison of the CNBC function and INCES algorithm with

the hybrid solver x

List of Tables

Some Relations b etween Two Finite Domain Variables

Control scheme for solving constraint problems

Control scheme for solving constraint problems using domain sp ecic

knowledge and hybrid constraint solvers

Valid Constraint Representation Schemes

Two database tables from

The result of joining the book and sales tables from

Results for Solving ICE engine times on an SGI Indy

Solver collab oration language adapted from BALI

Constraints that can b e handled by Erep and IGCS

F Solver collab oration language adapted from BALI xi

Nomenclature

General nomenclature

IR the set of real numb ers

Q the set of rational numb ers

Z the set of integer numb ers

N the set of natural numb ers

the empty set

jAj the numb er of elements in set A

D D the Cartesian Pro duct of the sets of

1 n

D D

1 n

the union of two sets

the intersection of two sets

n the set minus of two sets

max the larger of two numb ers

min the smaller of two numb ers

is a memb er of

if and only if

A B A is not equal to B

A B A is a subset or equal to B

logical and

Constraint denition

D a domain a set

E an entity

D the domain of entity E

E

v a value for an entity v D

E xii

E v an assignation for entity E to the value v

so that D fv g

E

E S an assignation of entity E to the set of val

ues S so that D S

E

aR b a binary relation R b etween a and b R

D D

a b

S a a an nary relation S b etween a a a

1 n 1 2 n

D S D

a a

n

1

f x x a b o olean test function for a relation S

1 n

f x x x x S

1 n 1 n

CTP Constraint test pro cedure the b o olean test

function for a relation

C a constraint

f x x a constraint test pro cedure for a constraint

C 1 n

C f x x x x

C 1 n 1 n

C

a set of entities

a set of constraints

P a constraint problem P

P a constraint subproblem

i i i i

i

fx y x y g a conguration for a constraint problem

1 1 n n

P fx x g

1 n

E

C j the enhanced constraint of C with resp ect

E

to E C j C D where D is the

E E

C C

domain of those entities not relevant to C

the imp osed set of C

C

j j the arity of C the numb er of variables

C

that aect C

dim a function from domains to the natural

numb ers

e usually an entity

c usually a constraint

Constraint representation xiii

CRS a Constraint Representation Scheme

constraint representation schemes

A B problems in representation schemes

a function from representation scheme to representation

scheme a representation

representation scheme is equivalent to representation

scheme

a ConstraintEntity graph

E the set of entities in the algebraic representation

C the set of constraints in the algebraic representation

n m usually used to represent integer counters

e an edge in a graph

Constraint satisfaction

D a solution space a set of congurations

D the initial domain of the solution pro cess

D D

1 n

k i j an integer usually representing an inter

mediary step

a subset of usually used to represent

k

intermediary constraints to consider

D k the domain of p ossible solutions at step k

k

D k a solution step with resp ect to D k

k

T

C the intersection of all C in

C

subset of usually representing a lo cal set

of constraints

C the set of solutions to all of the constraints

T

in equivalent to C

C

an integer representing a terminal step in

a pro cess

D nal domain of the solution pro cess the

terminal solution space

0

D D a sequence of solution steps a solution pro

cess

f D k a function equivalent to a soluton step

k k xiv

Constraint priorities

a constraint priority strength a lower i is more imp or

i

tant

a required constraint strength

0

a constraint priority variable

i

H a constraint hierarchy

i

H the set of all constraints in the constraint hierarchy

better a comparator b etween two solutions

S the set of solutions to the required constraints

S the set of solutions to the constraint hierarchy using

the comparator better

a set of constraint priority constraints

Variable driven satisfaction

a set of entities

k



k

D k D k a variable driven solutoin step

Backtracking

r s integers used to represent intermediate

steps in a solution pro cess

r

(r s+1)

D r D r s backtracking by s steps

Incremental solution

C

D k D k an incremental solution step adding a new

constraint

E

D k D k an incremental solution step adding a new

entity

Hybrid constraint solvers

S a constraint solver

i

D i the domain at step i of the entities in

 xv

0



i the enhanced domain of D i with re D j

 

sp ect to

0

i the emb edded domain of in at step i D j

 

g eom x y z a geometric variable g eom which has x ro

tational degrees of freedom y scalar de

grees of freedom and z translational de

grees of freedom

P a geometric subproblem

g eom

P an algebraic subproblem

al g

f a function for combining solution spaces

found in a parallel collab oration

a choice function for selecting solutions

spaces in a concurrent collab oration

A constraint management system

P S A subproblemsolver pair P is

i i i

a subproblem S is a set of con

i

straint solvers

AB C A triangle formed from three ver

tices A B and C

A B C D E F G H I J Typically entities in a constraint

problem Sometimes residual sets

A partial order

P S P S Sequential collab oration

i i j j

P S k P S Parallel collab oration

i i j j

D e A decomp osition strategy De

comp oses a constraint problem

and a set of solvers into a set of

subproblemsolver pairs

D e Decomp ose a constraint problem

str ong components

into subproblems that are strongly

connected and subproblems that

are not strongly connected xvi

D e Decomp ose a constraint problem

connected components

into subproblems that are con

nected

C l Typically a cluster of constraints

and entities describing a rigid

b o dy

s Typically a constraint solver

sP D D i Initiating constraint solver s on

i

constraint problem P using initial

i

solution space D results in solu

tion space D i

y ; z A path from y to z in a graph

T A typ e of constraint

Typ es of constraint capable of b e

ing solved by Erep or IGCS

Q R Typically constraint problems

C C C Typically constraints

1 2 3

C ir c A circle

1 xvii

Glossary of Solvers

Solver Reference Description

Concept Mo deler Solves triangular systems of equations us

ing lo cal propagation Solves simulta

neous subproblems using numerical tech

niques

Connectivity Analysis Solves geometric constraint problems by

splitting problems into residual sets and

then solving residual sets in order

DCM Solves wellconstrained geometric prob

lems by identifying subproblems consist

ing of only three ob jects that can b e xed

Erep Very similar to DCM Solves well

constrained geometric problems by build

ing up clusters of ob jects that can b e rela

tively xed and combining clusters to give

rigid b o dies

GCE Geometric constraint solver using lo cus

analysis to solve simultaneous subprob

lems and action analysis to solve simple

subproblems by lo cal propagation

Grobner bases Symb olic algebraic solver acting on sys

tems of equations

ICBSM Geometric constraint solver using lo cal

propagation to solve D geometric prob

lems without lo ops using lo cal propaga

tion xviii

Solver Reference Description

IGCS Improvement of ICBSM to handle lo ops

and more complex problems

INCES Incremenal version of Concept Mo deler

Allows geometric constraint problems to

b e describ ed and solved

MechEdit Geometric constraint system for solving

systems of planar linkages Uses lo cal

propagation and numerical techniques

NewtonRaphson Numerical solver that takes a system of

equations and nds solution using itera

tive techniques

SkyBlue Solves hierarchical constraint problems

using lo cal propagation Can solve for

constraints added incrementally xix

Chapter

Intro duction

Constraints have b ecome p opular in the engineering design eld as a means of de

signing and building complex pro duct mo dels The p ower of constraints as a

mo delling paradigm lies in their descriptive p ower and the implicit knowledge that

lies within a constraints description A constraint can vary from a nonlinear equa

tion to a complex description of the assembly of a geometric mo del Consequently

constraints are used in a numb er of dierent contexts and solutions to constraint

problems are found using many dierent techniques dep ending on the nature of the

constraints involved

A system of nonlinear equations for example with no discernible structure will

typically b e solved using numerical or symb olic techniques General

constraint solvers such as numerical or symb olic techniques are slow but can nd

solutions for a wide variety of constraint problem

On the other hand a geometric constraint problem consisting of relative p osi

tioning instructions for lines p oints and circles can b e solved relatively eciently

using degrees of freedom analysis or rulerandcompass construction tech

niques The geometric constraint solver takes advantage of domain specic

know ledge of the geometric problem domain In the case of degrees of freedom anal

ysis the domain sp ecic knowledge is that the geometric ob jects the lines p oints

and circles can only translate and rotate in space in a very limited numb er of ways

Degrees of freedom analysis uses this knowledge to manipulate the rigid b o dies to

satisfy the constraints applied to them In the case of rulerandcompass construc

tion the domain sp ecic knowledge used is that all geometric constraints can b e

describ ed using distance and angle constraints and that using such constraints any

unknown ob ject can b e p ositioned relative to two known ob jects using two con

straints Rulerandcompass solvers then p osition the geometric ob jects one by one

Chapter Intro duction

until all of the constraints have b een satised Constraint solvers that take advan

tage of knowledge implicit in their domain are referred to as domain specic in this

thesis

Domain sp ecic constraint solvers include nite domain solvers scheduling con

straint solvers functional constraint solvers and physical constraint solvers Finite

domain constraint solvers take advantage of the nite numb er of p ossible solutions

by using sophisticated exhaustive search techniques Scheduling constraint solvers

use the linear nature of time to help simplify the search for solutions Functional

constraint solvers simplify systems of equations to identify subproblems that are

simple to solve Physical constraint solvers take advantage of inertia momentum

and other physical laws to simplify the calculation of new p ositions reusing old in

formation as much as p ossible For reasons of brevity only nite domain geometric

and functional constraint solvers are studied in detail in this thesis

It is generally acknowledged that there is a close coupling b etween functional con

straints and geometric constraints in the design pro cess particularly

in the early stages of A constraint solver for engineering design

must therefore b e capable of handling b oth functional and geometric constraints

simultaneously Similarly nite domain scheduling and physical constraints are

integral parts of the design pro cess and should b e considered simultaneously also

The current state of the art is that domain sp ecic constraint solvers will al

ways outp erform general solvers for problems within their domain Not surprisingly

domain sp ecic solvers are inappropriate for problems outside this domain

Some authors attempt to overcome the expressive limitations of domain sp ecic

solvers by using a general solver as a backup for when the domain sp ecic solver

cannot nd a solution Similar to the terminology adopted by

Prosser solvers which use multiple solution techniques interacting with each

other are referred to as hybrid constraint solvers in this thesis

There has b een a longstanding research pro ject at the University of Leeds to

use constraints to build complex engineering mo dels within a Virtual Environment

Three main constraint solvers have b een develop ed for this

pro ject

ICBSM was develop ed by Fa et al to build geometric constructs of

engineering mo dels The key innovations of ICBSM were the Allowable Mo

tion metho d of solving the constraint problem and the Automatic Constraint

Recognition metho d for using direct manipulation to build the mo del Al

lowable Motion calculates the p ossible movements of geometric ob jects in the

Chapter Intro duction

mo del dep ending on the constraints placed on the ob jects Allowable Motion

is describ ed in more detail in section and Automatic Constraint

Recognition utilised the users manipulation of ob jects within the mo del to

suggest p ossible constraints that could b e applied This simplied the con

struction of the geometric mo del

In ICBSM all geometric ob jects had to b e applied one after the other in a

sequential ICBSM could not cop e with the simultaneous denition

of geometric constraints Consequently IGCS was designed to allow

simultaneous constraints to b e solved

ICBSM could only deal with geometric constraints such as forcing two ob jects

to remain in contact with each other or to have two cylinders concentric

INCES was develop ed in order to solve systems of equations describing

the function of an engineering mo del rather than the physical form INCES

could also solve the geometric constraints describing the engineering mo del

by converting them to equations INCES cannot solve all such systems of

equations and so resorts to a numerical algorithm when it cannot succeed on

its own

The purp ose of this thesis was to investigate existing constraint solvers and to

see if Fas Allowable Motion approach could b e applied to more general problems In

particular it was realised that as it sto o d Allowable Motion could not b e applied to

lo ops and functional problems Since these are integral parts of engineering design

constraint problems it was imp ortant that they b e integrated into any constraint

solver that would handle engineering design constraint problems

A glossary is included in this thesis that can b e used for reference Words denoted

y

by a indicate denitions that can b e found in the glossary The glossary is included

in app endix H

Ob jectives of this thesis

A broad ob jective of the Virtual Working Environment group in the University of

Leeds is to develop an interactive environment for developing engineering

within a Virtual Environment The interactive constraint mo delling subgroup is

mainly involved with developing algorithms and prototyp es that use constraints as

a paradigm for describing and nding solutions to engineering designs Previously

the constraint mo delling subgroup develop ed ICBSM IGCS and INCES and these

Chapter Intro duction

algorithms are capable of describing and solving a variety of constraint problems

The ob jectives of the research in this thesis were to

Investigate ways of generalising the techniques develop ed in ICBSM IGCS

and INCES in such a way that more problems can b e solved at little or no loss

of sp eed

Study the state of the art in constraint solvers and identify commonalities

amongst them that can b e utilised

Create an interactive constraint solver capable of dealing with the needs of

engineers using available technology

Progress on these research goals are rep orted in this thesis

Current engineering design constraint solvers have b een studied and their

strengths and weaknesses identied This allows the creation of a taxonomy of

constraint solvers by their strengths The use of domain sp ecic knowledge to

improve the eciency of these constraint solvers has b een explored Domain

sp ecic knowledge has b een identied as an imp ortant means of improving the

eciency of constraint solvers

The characterisation of current constraint solvers has led to an identication

of the common pro cesses adopted by these constraint solvers The divide

andconquer strategy adopted by virtually all current constraint solvers uses a

decomp osition strategy to identify subproblems to solve an ordering strategy

to decide in which order to solve the subproblems and a set of solution tech

niques to solve the subproblems The use of this divideandconquer strategy

leads to a numb er of issues and questions that need to b e addressed

In order to address these issues a mathematical description of the constraint

pro cess has b een created which is capable of describing general engineering de

sign constraint problems and the representation and solution of engineering

constraint problems The mathematical framework allows the description of

most current constraint solvers and consequently provides a unifying frame

work for the constraint solvers The framework also captures the concepts of

consistency soundness and completeness which describ e the quality of solu

tion of the constraint solvers A theorem has b een devised that allows the

quality of solution of constraint solvers to b e deduced from the workings of

the constraint solver

Chapter Intro duction

Using the mathematical characterisation of the constraint problem and con

straint solution a study of hybrid collab orations has b een carried out The

use of hybrid collab orations such as sequential parallel and concurrent al

lows existing solvers to b e joined together in a formal way that allows new

solvers to b e created The mathematical framework develop ed allows concrete

statements to b e made ab out the nature of these solvers

A new constraint solver has b een dened that consists of a hybrid of Erep

and IGCS This constraint solver combines the ability of Erep to solve well

constrained geometric constraint problems with lo ops and the ability of IGCS

to solve underconstrained geometric constraint problems

Incremental constraint solvers

Constraint solvers take a set of constraints and variables and nd a numb er of so

lutions to the constraint problem dened by the constraints and variables Most

constraint solvers solve a constraint problem from scratch That is the whole prob

lem is dened b efore solutions to the problem are found

However this is not how designs are created Most designs evolve over a p erio d

of time as add new ob jects or new constraints The specifythensolve

approach of existing constraint solvers means that every time a new constraint is

added the whole constraint problem needs to b e resolved

To counter this problem incremental constraint solvers have b een develop ed

Incremental constraint solvers assume that a constraint problem will evolve over time

and that at every iteration of the design pro cess a set of variables and constraints

is added to the existing constraint problem and new solutions to the constraint

problem need to b e found

The challenge for incremental solvers is to nd solutions to the new problem as

quickly as p ossible Most current incremental constraint solvers try to do this by

reusing the information found by solving the previous constraint problem

For example assume that a constraint problem P has b een solved for and a set

1

of solutions S has b een found Then a set of new constraints and variables is added

1

to P to give P Solutions must now b e found for P as quickly as p ossible

1 2 2

There are several sources of information that can b e used to assist incremental

constraint solution The numb er typ e and quality of solutions in S can help to

1

indicate solutions to P For example if P has no solutions and S is empty then

2 1 1

Chapter Intro duction

adding more entities and constraints cannot increase the numb er of solutions and

so P will have no solutions either

2

The most useful source of information to assist incremental solution is the pro cess

whereby P was solved If P is a similar problem to P then it will probably b e

1 2 1

solved in a similar fashion Consequently it may b e p ossible to reuse some of the

information used to solve P in order to solve P

1 2

For example supp ose P was solved by splitting it into a numb er of subproblems

1

that were solved in the order

P P P P

1 2 3 4

Supp ose also that the new constraints and variables are added to subproblems P

3

Assuming that P can b e solved in the same way as P then it can probably b e split

2 1

into a similar set of subproblems

P P P P P

1 2 3 4 5

In particular P and P are the same b ecause they are not aected by the new

1 2

constraints and variables Thus P and P do not need to b e resolved saving time

1 2

and eort

Incremental solvers such as INCES and SkyBlue try to take advantage of

this structure and so sp eed up solution of each iteration of the design pro cess IGCS

tries to solve for a new constraint by manipulating ob jects whilst maintaining

old constraints Thus when a new constraint is added only that constraints needs

to have solutions found for as all other constraints have already b een solved for

In general the aim of a sp ecifythensolve constraint solver is to b e able to

solve a constraint problem in time On where n is the numb er of constraints An

incremental constraint solver aims to solve for a new constraint in time O

A constraint problem is wel lconstrained if it has as many constraints as vari

ables A wellconstrained problem usually has a nite numb er of solutions A

constraint problem is underconstrained if it has more variables than constraints

An underconstrained problem usually has an innite numb er of solutions A con

straint problem is overconstrained if it has more constraints than variables An

overconstrained problem usually has no solutions A more precise denition of

these terms is left to later in this thesis

A constraint problem usually progresses from b eing underconstrained to b eing

wellconstrained to b eing overconstrained Initially a constraint problem has no

Chapter Intro duction

variables and no constraints The user will then add a numb er of variables At

this p oint the problem is underconstrained as no constraints have b een created

Gradually the user will add more and more constraints to the problem until it

b ecomes wellconstrained The user may then add more constraints and the problem

b ecomes overconstrained

Thus an incremental solver that allows the user to add constraints and variables

one at a time must b e able to deal with under well and overconstrained prob

lems However few constraint solvers can do this Most constraint solvers can only

solve problems that are one of under well and overconstrained ICBSM for

example cannot cop e with cycles in constraint graphs In fact cycles corresp ond

to wellconstrained subproblems and ICBSM is particularly well suited to under

constrained problems

Therefore a go o d incremental constraint solver will b e one that reuses previous

information well and also can handle under well and overconstrained problems

Since incremental solvers are an imp ortant means of solving constraint problems

quickly and therefore in an interactive environment they form a signicant part of

this thesis

Thesis organisation

This thesis is divided into ten chapters including this intro duction Chapter

presents a detailed study of current constraint solvers with an aim of categoris

ing them and understanding their underlying principles Chapter also discusses

subsidiary research on set theory dimensions and some basic relational algebra

Chapter takes the characterisation of the constraint solvers in chapter and

identies the common features of these constraint solvers In particular this chap

ter notes that most existing constraint solvers use a divideandconquer approach

whereby a decomp osition strategy is used to identify subproblems an ordering strat

egy is used to determine in which order subproblems are to b e solved and a set of

solution techniques nd solutions to the subproblems A detailed study of each

strategy leads to a numb er of issues that need to b e addressed In order to study

these issues thoroughly it is rst necessary to understand the constraint solution

pro cess in detail In particular the incremental issues asso ciated with each strategy

are identied

Consequently chapters and formalise the constraint pro cess with an aim

of capturing the various prop erties of constraint solvers Chapter denes the

Chapter Intro duction

constraint problem in terms of its constituent parts Chapter also discusses the

notion of the of a set and uses this to describ e certain typ es of constraint

problem Chapter discusses the problems of representing a constraint problem on a

computer The various dierent representation schemes currently used are compared

and a representation scheme capable of describing general constraint problems is

identied

Chapter presents an abstraction of the constraint satisfaction pro cess whereby

constraint solvers take as input a constraint problem and pro duce as output a set

of solutions The imp ortance of prop erties such as consistency completeness and

soundness of constraint solvers is highlighted and a theorem is presented that allows

statements to b e made ab out constraint solvers prop erties dep ending on individual

steps In order to prove the exibility of the constraint satisfaction abstraction it is

used to describ e several advanced constraint solution techniques such as backtrack

ing constraint priorities and incremental techniques

The constraint pro cess abstraction built up over chapters and is then used

in chapter to discuss the use of domain sp ecic knowledge in constraint solvers

and also the use of more than one constraint solver to build up hybrid systems The

various paradigms available for joining solvers together are intro duced in terms of the

satisfaction framework and demonstrated using examples A hybrid collab oration

language is used to describ e the interaction of constraint solvers in a hybrid

Chapter uses the hybrid collab orations identied in chapter to build a new

hybrid constraint solver consisting of IGCS and Erep Since IGCS can solve under

constrained geometric constraint problems and Erep can solve wellconstrained geo

metric constraint problems with lo ops the hybrid should b e able to solve constraint

problems consisting of well and underconstrained subproblems Corresp ondingly

the p ower of IGCS has b een increased at little computational cost and a constraint

solver more appropriate for engineering design has b een created

Chapter discusses future work to realise the goal of an interactive constraint

based system for engineering design Chapter presents conclusions from the work

in this thesis

Chapter

Related Work

This thesis investigates the use of hybrid constraint solvers using domain sp ecic

knowledge using case studies in engineering design This chapter describ es the state

oftheart in constraintbased design hybrids and domain sp ecic constraint solvers

A numb er of constraint solvers have b een studied so that an abstract framework

for constraint solution can b e develop ed which can then b e used to study hybrid

constraint solvers

The abstraction of the constraint satisfaction pro cess leads to the study of di

mensions decomp osition of constraint problems the study of solution spaces and

the use of hybrids to solve constraint problems Work related to these topics is

covered in section

Section discusses the stateoftheart in constraint solution for engineering

design Section describ es a numb er of constraint solvers The solvers are cat

egorised and discussed in terms of gure General constraint solvers consist of

algebraic or numerical techniques and are intro duced in section

Finite domain constraint solvers are a wellundersto o d typ e of domain sp ecic

solver where ob jects in constraint problems have only a nite size Although not

currently used much in engineering design nite domain solution techniques have a

large b o dy of literature and form a useful basis for discussing constraint satisfaction

Finite domain solvers are describ ed in section

Geometric constraint solvers are used in engineering design to capture the de

signers intent For example if a draws a line that happ ens to b e vertical

then it is likely that the designer intended that line to b e vertical no matter what

else happ ened to the mo del Consequently the designers intent to have a vertical

line is retained through the use of constraints The use of geometric constraints is

b ecoming more widespread and they are now available in commercial CAD packages

Chapter Related Work

such as Unigraphics and ProENGINEER Geometric constraint solution

is discussed in section

Functional constraint solvers are also b ecoming p opular in engineering design

Functional constraint solvers are used to describ e the function of an engineering

design in terms of algebraic equations These are discussed in section

Constraints are also b eing used in maintenance and physical simulation This is

an exciting new development for the use of constraints and is still a relatively new

development The stateoftheart is covered in section

Section presents conclusions from this chapter

The theory of constraints

A large numb er of problems in articial intelligence and computer science can b e

describ ed as constraint satisfaction problems As such many researchers have in

vestigated ecient metho ds of solving constraint satisfaction problems and a large

b o dy of literature exists Kumar Dohmen and Meseguer present sur

vey pap ers on constraint satisfaction algorithms and Jaar and Maher discuss

constraint logic programming the merger b etween constraint satisfaction and logic

programming

A constraint problem consists of a set of ob jects and a set of restrictions on

the values the ob jects can take A constraint satisfaction algorithm attempts to

nd solutions to the constraint problem using a numb er of heuristic techniques A

simplication of constraint satisfaction is that of relational algebra In relational

algebra a nite numb er of ob jects with a nite numb er of relations on them are

queried and the result is a set of solutions to the query

Finite domain constraint satisfaction is equivalent to relational algebra

although the relations used are more complex For example a relation b etween two

nite domain ob jects that can each take n values is represented by the n n table

of values that are allowed Table demonstrates the denition of the standard

relations x y and x y where x and y b oth have domains f g A in

p osition x a y b means that x a y b is allowed in the relation A in

the same p osition means that x a y b is not p ermitted For example for the

relation x y when x y the value in the table is and so this conguration

is not allowed The other two relations dened x y and x y indicate relations

that cannot b e simply describ ed using relational algebra

The general concept of constraint problems allows ob jects to have innite do

Chapter Related Work

x y x x y x

y y

x x y x x y

y y

Table Some Relations b etween Two Finite Domain Variables

mains Likewise constraints can b e describ ed using an innite numb er of tuples

and are also called innite domain Such a denition allows many more dicult

problems to b e describ ed using constraints such as geometric problems

algebraic problems and scheduling problems However the use of in

nite domain constraints negates the use of the search algorithms prevalent in nite

domain constraint satisfaction b ecome impractical for innite domain constraint

satisfaction

The use of techniques other than search form an imp ortant area of research for

innite domain constraint problems Solvers that tackle innite domain problems

are discussed in more detail later in this chapter

Some authors have compromised b etween nite domain and innite domain con

straint satisfaction by using integer constraints For example Jaar et al discuss

the use of integer constraints and suggest that the restricted class of integer con

straint they use can b e solved more eciently than in the general case but which

remains reasonably expressive

Other authors have generalised constraints to allow more general structures

Bistarelli et al describ e constraint satisfaction problems in terms of semiring

based structures The advantage of such a generalisation is that it describ es not only

the typ e of constraint satisfaction problem discussed ab ove but also fuzzy problems

weighted problems and partial constraint satisfaction The semiring formalisation

is elegant but somewhat cumb ersome for the purp oses of this thesis

In order to combat problems that have to o many constraints Borning et al

intro duce constraint hierarchies which allow the creation of constraint problems

Chapter Related Work

where not all of the constraints need to b e satised Constraint hierarchies have

b ecome an imp ortant weap on in a constraint programmers arsenal and as such are

used in many dierent applications such as SkyBlue Dierential Manipula

tion and MultiGarnet Constraint hierarchies are describ ed in more detail

in section

The common link b etween all of these theories is that a constraint problem is a set

of ob jects with domains and a set of constraints which are relations Many constraint

satisfaction techniques take advantage of the size of the domains of the ob jects or of

decomp osing the constraint problem Consequently the dimension of a domain is

discussed in section and work using the decomp osition of constraint problems is

discussed in section There exist a numb er of constraint satisfaction algorithms

that nd solutions by using hybrid solvers These are investigated in section

The concept of a solution space is also signicant in this thesis and related work on

conguration spaces is presented in section

Dimensions

Researchers such as Latham and Middleditch Fa et al Tsai et

al and Kramer use the dimension of an ob ject as a measurement of

progress towards solution Fa et al Tsai et al and Kramer also use the dimension of

geometric ob jects to provide ecient interactive constraint satisfaction The notion

of dimension is also asso ciated closely with the constrainedness of a problem

The dimension of an ob ject is a measure of the freedom of an ob ject in terms of the

numb er of p ossible values or p ositions that can b e assigned to the ob ject

For example a dimensional ob ject only has a nite numb er of p ossible values or

p ositions whereas a dimensional ob ject can b e assigned values from some subset

of the real line

Dimensions for simple geometric ob jects and constraints are straightforward and

wellundersto o d However the generalisation of dimension to general constraints

and ob jects has received little attention Latham and Middleditch assume that

constraints and ob jects have a dimension but note that it is very dicult to provide

a formal denition of dimensions for general sets due to the existence of Peano curves

and other spacelling curves

3

For example the dimension of a p oint moving in three dimensional space IR

is as the p oint needs three parameters to fully dene it Similarly the dimension

of a variable that can take any value in the set of integers Z is as the variable

Chapter Related Work

needs one parameter to fully dene it However the dimension of a variable that

2

can take any value in the set Z is more dicult to dene Space lling curves such

2

as the Peano curve mean that it is p ossible to dene a mapping from Z to Z such

2

that for all intents and purp oses they are the same set Consequently Z could

have dimension or dimension Such questions need to b e dealt with to have a

common denition of the dimension function

For the purp oses of this thesis the identication of the constrainedness of con

straint problems is very imp ortant The constrainedness of a constraint problem

is related to the numb er of solutions that the constraint problem has Simply put

a constraint problem is wel lconstrained if the constraint problem has only a nite

numb er of solutions A constraint problem is underconstrained if it has an innite

numb er of solutions and is overconstrained if it has no solutions

An investigation has b een made into the denition of a dimension function and

manifolds have b een identied as fullling the most imp ortant prop erties of the

dimension function Since the use of the dimension function is more imp ortant than

the precise denition the denition used in this thesis is given in full in app endix A

The reader is referred to for a more detailed discussion of manifolds

Decomp osition of constraint problems

Many constraint solvers attempt to solve constraint problems by decomp osing a

large constraint problem into a numb er of smaller subproblems and solving them

separately In practice this is a variant of the DivideandConquer strategy em

ployed in computer programming and is very eective The decomp osition allows

the identication of subproblems that can b e solved quickly and easily The results

of solving these subproblems can then have eects for the rest of the problem simpli

fying other subproblems Decomp osition of constraint problems forms an imp ortant

part of the research in this thesis In particular decomp osing a complex constraint

problem into a numb er of subproblems that can b e solved simply using dierent

solution techniques allows exible and ecient solution

Solvers such as DCub ed Erep Connectivity Analysis INCES

and IGCS use decomp osition to subproblems to aid solution For example Erep

identies clusters of geometric ob jects that can b e dened relative to each other

The clusters are then combined recursively to give solutions to the whole problem

INCES identies subproblems that cannot b e solved using lo cal propagation and

then uses numerical solution to solve them

Chapter Related Work

For nite domain constraint satisfaction problems Freuder and Hubb e have

presented an algorithm for extracting a particular subproblem from a constraint

problem This algorithm can b e used to extract a subproblem that is known to

b e unsolvable and discard it restricting the search for a solution to the remaining

subproblems

Latham and Middleditch present an algorithm called Connectivity Anal

ysis that will decomp ose a constraint problem into a numb er of wel lbalanced sets

The wellbalanced sets corresp ond to wellconstrained subproblems This allows the

identication of under and overconstrained subproblems as well as identifying pre

cisely which ob jects need to b e more or less constrained by adding or subtracting

constraints resp ectively

Connectivity Analysis also provides an ordering for the wellbalanced sets so

that the constraint satisfaction pro cess can use information from previously solved

wellbalanced sets to aid solution of other wellbalanced sets

Hybrid constraint solvers

The decomp osition of constraint problems means that a problem P is divided into a

numb er of subproblems P P which are solved using the same algorithm The

1 n

logical extension of this paradigm is to still decomp ose P into P P but to

1 n

solve the various P using dierent solution algorithms This technique is variously

i

called co op eration combination or hybrid constraint solution In this thesis the use

of multiple solvers to solve subproblems will b e called hybrid constraint solution

The use of multiple constraint solvers dates back to the intro duction of con

straints in Sketchpad in There lo cal propagation was used until it could

pro ceed no further and then the problem was relaxed using numerical techniques

Similar techniques followed until Prosser suggested the use of hybrid algorithms

for nite domain constraint satisfaction

At that p oint there existed several constraint satisfaction algorithms in use in

the nite domain eld A collection of algorithms lo oked at the future eect of an

action to investigate p ossible failure Another collection of algorithms lo oked at

past information to backtrack from current failure Prosser presented algorithms

that used b oth typ es of search These hybrid algorithms proved very successful

and were b oth more ecient and less prone to extraordinary failure than

nonhybrid solvers

Although Prossers hybrid algorithms do not decomp ose constraint problems the

Chapter Related Work

concept of using multiple coop erating constraint solvers to help solve the constraint

problems can b e usefully applied to other typ es of constraint problem

The theory of hybrids has b een examined by Baader and Schulz Mon

froy Monfroy et al and Kirchner and Ringeisson Baader and

Schulz discuss the combination of constraint solvers using a highly complex study

of unication theory The principal theories of Baader and Schulzs work are the

notion of a free amalgamated pro duct and a decomp osition algorithm The free

amalgamated pro duct is used to dene a combined solution structure over which

constraint problems are solved The decomp osition algorithm separates a problem

into subproblems that can b e solved by the individual solvers These problems are

presented in a dierent and more approachable form in this thesis

Monfroy intro duced BALI in BALI is a semantic denition of an environ

ment for solver co op eration using the three paradigms of sequential parallel and

concurrent collab oration BALI is a useful environment for describing solver collab

oration but it tries to solve the whole problem using one solver only resorting to

other solvers on failure BALI do es not take into account the strengths of individual

solvers and do es not sub divide a constraint problem so that subproblems are solved

using appropriate subsolvers

BALI has b een used to combine a Grobner basis solver with a linear equation

solver to pro duce COSAC COSAC tries to use the more ecient linear equation

solver as much as p ossible and only resorts to the Grobner basis solver as a last

resort COSAC is an improvement on Grobner bases alone but is heavily dep endent

on the Grobner basis solver which is necessarily slow Monfroy and Ringeisson also

prop ose a metho d of extending the scop e of constraint solvers to pro cess new typ es

of constraint

The hybrid constraint solver presented in this thesis uses constraint solvers to

b est eect by identifying the strengths of a constraint solver and then decomp osing

the constraint problem in such a way that solvers are used on problems that they

are b est suited to Here we assume that the sub division can b e done suciently

quickly that the eciency of the constraint solver is still dominated by the eciency

of the slowest subsolver This is discussed in more detail in chapter

Solution spaces

Finite domain satisfaction techniques typically search through all of the p ossible

combinations of ob ject values in order to nd combinations that are solutions For

Chapter Related Work

nite domain constraint problems the numb er of p ossible combinations is large but

nite In innite domain constraint problems the numb er of p ossible combinations

is typically innite However the concept of a solution space the set of p ossible

combinations at a given time forms a useful abstraction for studying constraint

satisfaction pro cesses

The notion of solution spaces is equivalent to conguration spaces used in path

planning LozanoPerez uses conguration spaces to help calculate constraints

on the p osition of an ob ject in space due to other ob jects This allows the computer

to arrange ob jects in space or to move ob jects without collisions Problems are

reduced from planning a path for a complex ob ject to planning a path for a p oint

and so are much simplied though calculation of the conguration space is very

timeconsuming

1

Wise has built on LozanoPerezs work and used it to build svLism an

algorithm that builds multidimensional conguration spaces representing an ob ject

in every conceivable p osition and orientation Once the conguration space has b een

created it is simple to move ob jects around in the space detecting collisions For

example the problem in gure is to move a racing car in the space without

colliding with any obstacles The car can translate in the x and y directions

The conguration space calculated for the car and obstacles is presented in g

ure The current p osition of the car is describ ed using a reference p oint on the car

and compared with the conguration space map If the x y p oint indicating the

p osition of the car is dark grey in the conguration space map then the car is inside

an obstacle which is not allowed If the p oint corresp onds to a dark grey pixel then

the car is not in contact with any obstacle If the p oint is a light grey pixel then the

car is touching an obstacle Thus the problem of checking for a collision has b een

reduced to a very simple p oint memb ership test Unfortunately creating the cong

uration space map in the rst place to ok some minutes This example was taken

modSvmHtml versvm homehtml from httpwwwbathacuk ensa bG

Constraints in engineering design

Engineering design is currently undergoing a paradigm shift Classical design

as esp oused by Pahl and Beitz typically involves an iterative mo del whereby

sp ecications and information are passed from one stage to another gure taken

from At each stage a large quantity of information needs to b e transferred from

1

httpwwwbathacukensabG modSvmHtml versvm homehtml

Chapter Related Work

Figure A Racing Car in a Space with Obstacles

one stage to the next typically in the form of or design sp ecications

The p otential for loss of design intent and information is very great

Mo dern CAD packages are in common use by designers Many designers use

advanced design supp ort to ols such as knowledge based engineering D CAD and

nite element analysis These supp ort packages help to mitigate the loss of infor

mation by having consistent data structures and p ersistent and concurrent design

development However they do not explicitly retain the designers intent

One paradigm shift identied by Homann and Rossignac is a move from the

advanced supp ort to ols of CAD packages within a traditional design metho dology

to the use of constraintbased design paradigms Constraintbased design allows

the design intent of a designer to b e captured as constraintbased design is oriented

more towards the design pro cess As a design is mo died the constraint solvers

attempt to consistently maintain the designers intent

Anderl and Mendgen discuss the use of constraints in mo delling They iden

2

tify the imp ortance of geometric constraints and engineering constraints in the

mo delling pro cess and discuss the denition representation and solution of con

2

Engineering and functional constraints are used interchangeably in this thesis There is no

consensus in the literature as to which is the correct terminology

Chapter Related Work

Figure The Conguration Space Map for the Racing Car

Chapter Related Work

statement of the problem (client's needs)

design specifications (requirement list) Clarification of the task

concepts variants Conceptual Design

definitive layout Embodiment Design documents for

Detail production Design

Upgrading and Improvements

Figure The Pro duct Design Pro cess

straint problems following a similar structure to this thesis Anderl and Mendgen

also identify a numb er of typical applications of constraintbased design such as

featuremo delling and design with engineering constraints The op en issues they

identify include the automatic generation of constraints and the evaluation of de

sign alternatives as well as the constrainedness of problems

Anderl and Mendgen conclude that

Mo delling with constraints is a mo delling technique which contains

a high p otential for ecient working in all steps of the design cycle

Serrano and Gossard and Lamounier et al concentrate more on the

conceptual design phase and the use of engineering constraints rather than geometric

constraints These techniques are explored in more detail in section

Sap ossnek also advo cates constraintbased design He states that design

can b e viewed as a constraint satisfaction pro cess and notes that constraints can

b e on functionality structure or manufacturability He denes a constraintbased

design system as one that explicitly represents and op erates up on these constraints

Sap ossnek identies the separation of solution techniques from problem sp ecication

as b eing an imp ortant research issue His concept of a general solver using multiple

Chapter Related Work

techniques and separation of sp ecication from solution is addressed in this thesis

Dohmen presents a survey of constraint satisfaction techniques for geometric

mo delling Dohmen identies geometric reasoning solvers using knowledge of the

problem domain in the satisfaction pro cess This is a key issue in this thesis

Constraintbased design allows the denition and solution of problems with tol

erances a problem of great interest to engineers The parameterisation

asso ciated with tolerances is a natural use of constraintbased design and several

authors allow the dimensioning and tolerance of designs

Gorti and Sriram present a framework for conceptual design The frame

work they prop ose allows for incremental evolving descriptions in an ob jectoriented

environment Gorti and Sriram also decouple dierent asp ects of the overall prob

lem to allow multiple reasoning metho dologies similar to the concept of hybrid

solvers discussed in section The framework allows geometric constraints and

the investigation of alternative designs

The use of constraints in design necessitates constraint solvers capable of satisfy

ing the constraints The current stateoftheart in constraint solution is presented

in the next section

Constraint solvers

A constraint solver is an implementation of an algorithm that takes as input a con

straint problem and pro duces as output a set of solutions to the constraint problem

or the empty set if no solutions are found to the problem Currently there exist

many dierent constraint solvers used to solve dierent typ es of problem A large

numb er of constraint solvers from a numb er of dierent elds have b een studied

The constraint solvers investigated are presented in this section

As the stateoftheart was investigated it b ecame apparent that certain solvers

were very go o d at solving particular typ es of problem It is therefore reasonable

to categorise solvers according to the typ e of problem they are b est at solving

Lamounier also categorised constraint solvers but according to the typ e of

solution algorithm used The categorisation used by Lamounier is compatible with

that used in this section The advantages of the categorisation used in this thesis

are that

It is hierarchical and can p otentially b e used to decomp ose a constraint prob

lem automatically

Chapter Related Work

There is a natural mapping b etween typ es of constraint problem and typ es of

solution technique

The categorisation criteria identied in constraint solution are the use or not of

domain sp ecic knowledge the typ e of constraint problem and the constrainedness

of the constraint problem The categorisation of constraint solvers is presented in

gure

The use or not of domain sp ecic knowledge forms the most fundamental dis

tinction b etween solvers Many constraint solvers restrict the typ e of problem they

can solve so that they can take advantage of the structure of the restricted problems

Thus geometric constraint problem solvers can take advantage of the Euclidean space

and rigid b o dies in the problem Alternatively solvers that do not use domain sp e

cic knowledge but instead handle constraints as a system of equations are called

general and are discussed in section

The remaining constraint solvers take advantage of domain sp ecic knowledge

and are called domain specic The particular domain sp ecic knowledge that the

solvers use identies the typ e of problem that they are b est at handling

Finite domain solvers take advantage of the nite nature of the problem size

and typically use advanced search techniques in a nite solution space These are

discussed in section

Geometric solvers take advantage of geometric reasoning There exist many ge

ometric constraint solvers currently and these can b e further identied as those that

solve over well and underconstrained problems Geometric solvers are investi

gated in section

Functional or engineering constraint solvers are used to solve algebraic prob

lems and are typically aimed at describing the functional asp ects of a design at the

conceptual design stage Functional solvers take advantage of the structure of the

equations to aid solution The stateoftheart is presented in section

Maintenance and physical constraint solvers are used to simulate the physical

environment and are intro duced in section

Chung and Schussel compare variational and parametric solvers They dene

a parametric solver as one that uses a predened set of geometric constraints which

are applied to the by the engineer They dene a variational solver as

one that makes no assumptions ab out the way in which geometric constraints are

combined Variational solvers typically use numerical or functional techniques to

solve the system of equations whilst parametric solvers corresp ond to geometric

solvers in this thesis They conclude that the use of one particular typ e of solver

Chapter Related Work Over- DeltaBlue [34] SkyBlue [95] Wolf [120] Houria [81] Gelle [41] Hosobe [51] Well- constrained constrained Concept Modeler [99, 101] INCES [63,65] Baraff [8] Isaac [40] Thompson [109] Over- constrained WAYT [76,77] Shimizu [103] Well- constrained Skecthpad [108] ThingLab [12] DCM [87] Erep [14] GCE [58,59,60] Pro/ENGINEER [20] Unigraphics [116] Dufourd [23] Verroust [117] Yamaguchi [123] Aldefeld [1] Geometric Functional Physical Domain Specific constrained ICBSM [25,26,27] IGCS [111, 112] Gleicher [42, 45] MechEdit [15] Eggli [24] Sohrt [107] Tsai [110] OTP [4] Laakko [62] GCE [58,59,60] Finite Domain Constraint Solvers Over- Under- Jussien [54] Light [69] Lin [70] Lamure [66] General Well/Under- Constrained constrained ILOG Solver [93] Forward Checking [92, 104, 113] Backtracking [92, 104, 113] Arc Consistency [92, 104, 113] Algebraic Numerical

de Pennington [16] Kondo[57]

Figure A Hierarchy of Constraint Solvers

Chapter Related Work

dep ends on the design b eing created Variational solvers tend to b e more suitable

for preliminary work whilst parametric solvers are more suitable for fairly simple

General constraint solvers

General constraint solvers handle constraint problems as systems of typically non

linear equations The systems of equations are then solved using either numerical

or symb olic techniques

Numerical solvers

Numerical solvers take a system of equations and nd a solution by using iterative

techniques such as NewtonRaphson The details of NewtonRaphson are not pre

sented here as they are covered in detail elsewhere Light and Gossard

and Lin et al use numerical techniques for variational geometry in computer

aided design systems Several authors use numerical techniques as a backup to other

approaches for example MechEdit INCES and IGCS

Numerical solution is general and solves a constraint problem as a whole entity

However it suers from a numb er of disadvantages

Numerical solution is not robust and can fail to converge to a solution

Numerical solution typically only nds one solution to a problem

2

Numerical solution is computationally exp ensive typically n complexity

where n is the numb er of constraints

Numerical solution may converge to a ro ot but it may not b e the exp ected

solution to the problem

Lamure and Michelucci present a technique that resolves some of these prob

lems Homotopy avoids the convergence of NewtonRaphson to unpredictable solu

tions as it is much more predictable Using the initial guess of the user corresp onding

to the users initial sketch of the geometric system homotopy interp olates b etween

the system of p olynomials describing the constraint problem and the system of p oly

nomials describing the users initial guess The curve describ ed by the interp olation

can then b e used to guide the solution of the constraint problem so that the ro ots

Chapter Related Work

found are more predictable Homotopy can b e combined with decomp osition tech

niques to sp eed up resolution However the price to pay for a more robust algorithm

is that homotopy is on average some to times slower than NewtonRaphson

Symb olic solvers

In the symb olic approach general solvers use symb olic algebraic metho ds predom

inantly Grobner bases to reduce a system of equations to a triangular system

of p olynomials that can b e solved simply Kondo and Buchanan and de Pen

nington have used Grobner bases to solve systems of equations for geometric

mo dels

Grobner bases are particularly interesting as the nal triangular system of equa

tions is complete in the sense that it describ es al l solutions to the constraint problem

However Grobner bases are very computationally exp ensive and are therefore not

appropriate for interactive applications

Finite domain constraint solvers

Finite domain constraint problems include scheduling resource management and

some integer arithmetic The domain sp ecic knowledge used by nite domain

constraint solvers is that there are only a nite numb er of p ossible congurations

that need to b e studied in order to lo ok for solutions The numb er of congurations

may b e very large but it is invariably nite Thus it is p ossible to exhaustively

examine all of the congurations and search for solutions

Unfortunately even very simple nite domain constraint problems such as

SAT are NPcomplete Consequently it is not usually practical to check all con

gurations and knowledge of the structure of the problem is used to sp eed up the

pro cess Tsang provides a comprehensive description of the various strategies

adopted for nite domain constraint satisfaction

Although nite domain constraint problems are not often considered in the CAD

and engineering design community they form a useful testb ed for studying ideas on

the theory of constraint satisfaction for the simple reason that they are usually small

and wellundersto o d For this reason two nite domain satisfaction techniques will

b e describ ed here in detail as representative of the general pro cess The descriptions

of backtracking and forwardchecking have b een taken from Tsang Smith

and Prosser

Chapter Related Work

Backtracking

Chronological backtracking is the simplest search algorithm used in nite domain

constraint problems A variable v is selected from the set of variables and a value

l is selected from the domain of v Variable v is then instantiated with the value

l so that v l The current values of all of the variables are then checked against

the set of constraints in the problem If a check fails then the value is inconsistent

the algorithm backtracks so that v is not instantiated and another value is tried If

all checks succeed then another variable is chosen If all of the p ossible values for v

fail then the algorithm backtracks to the last variable successfully instantiated and

cho oses another value for it This continues until all variables have b een instantiated

in which case a solution has b een found or all p ossible congurations have b een

exhausted in which case the problem has no solution

Forwardchecking

The forwardchecking algorithm is a lo ok ahead technique A variable is instan

tiated with a value Any values in the domains of other variables that conict with

this instantiation are removed from those domains and this pro cess continues If

the domain of a variable b ecomes empty by this pro cess then the instantiation is

inconsistent and is changed Forwardchecking therefore prunes large parts of the

search space quickly

Other nite domain research

Research on nite domain constraint satisfaction problems is a welldevelop ed eld

see and for survey pap ers on nite domain constraint satisfaction and

has led to many studies of the p erformance of algorithms Tsang et al

have compared a numb er of dierent algorithms and conclude that there is no

universally b est choice of algorithm and heuristic combination They recommend

using a numb er of criteria on the typ e of problem to determine which particular

solution algorithm to use Although the criteria used in are dierent this

principle is applied in this thesis to select algorithms to solve dierent typ es of

constraint problem

Freuder and Hubb e present a control schema for solving constraint problems

Although Freuder and Hubb es schema is primarily aimed at nite domain problems

it do es have implications for the work in this thesis The schema is presented b elow

Place the initial problem on the Agenda

Chapter Related Work

Until Agenda empty

Remove a problem P from Agenda

If P has only instantiated variables

then Exit with their values

else

Decompose P into a set of subproblems Pi

Place each nonempty Pi onto the Agenda

Exit with no solution

For all constraint satisfaction pro cesses the decomp osition technique is the key

Freuder and Hubb e use the schema to formulate descriptions of common algorithms

such as backtracking and forwardchecking Freuder and Hubb e note that a general

schema such as the one given facilitates presentation and comparative analysis

of algorithms and suggests new algorithmic p ossibilities The work done in

this thesis particularly in chapter also allows the description of algorithms in a

common framework

Finite domain problems may also b e inconsistent Jussien and Boizamault

present a solution technique that takes advantage of the constraint hierarchies de

velop ed by Borning et al by using an Assumptionbased Truth Maintenance

System to decide when to relax a constraint which constraints to relax and how

to delete a constraint

Geometric constraint solvers

The original geometric constraint solver was Sketchpad which used lo cal propa

gation and relaxation to solve constraint problems ThingLab extended Sketch

pad by allowing information that was not purely graphical ThingLab used Smalltalk

and allowed constraints to apply to nonnumeric ob jects such as text ThingLab was

a signicant advance in geometric constraint mo delling

Geometric constraint solvers take advantage of domain sp ecic knowledge ab out

rigid b o dies Euclidean space and the actions of geometric ob jects within Euclidean

space Some solvers take advantage of lo cal propagation techniques whilst some use

rulerandcompass construction to solve constraint problems However there are

three identiable strains of geometric constraint solver those that handle under

constrained problems eciently those that handle wellconstrained problems e

ciently and those that handle overconstrained problems eciently

Chapter Related Work

B

2 3 A Coincident Coincident C Line 1 Line 2 Line 3

1

a) b)

Figure An Arm with Two Joints and the Relationship Graph for the Problem

Underconstrained solvers are usually incremental building up a mo del stepby

step frequently taking advantage of the users interaction to help guide the solution

pro cess Underconstrained solvers are discussed in section

Wellconstrained solvers are more usually sp ecifythensolve Instead of building

up a set of constraints gradually the set of constraints is sp ecied all at once These

are then solved using rulerandcompass or rulebased metho ds to give solutions to

the problem Wellconstrained solvers are investigated in section

Overconstrained solvers also tend to b e of the sp ecifythensolve variety How

ever overconstrained solvers sp ecialise in identifying inconsistency in constraint

problems probably caused by having to o many constraints The overconstrained

solver will then select constraints that should b e removed to make the system con

sistent Overconstrained solvers are studied in section

Underconstrained geometric constraint solvers

Fa et al develop ed ICBSM the Interactive ConstraintBased Solid Mo deller

at the University of Leeds ICBSM allows the user to build a constraint

mo del in a virtual environment using direct manipulation of geometric ob jects The

key advances intro duced by ICBSM are the use of Allowable Motion and Automatic

Constraint Recognition Allowable Motion is a lo cal propagation technique that

propagates changes of values of a geometric ob jects as it moves to other geometric

ob jects that are constrained to move with it

For example consider the simple D arm shown in gure a In ICBSM

this has the corresp onding relationship graph in gure b If line is moved

then as it has b een constrained to remain connected to line it can only move in

a circle around p oint B However if line moves then as line is connected to line

and is free to move line rotates with line around p oint A as the movements

of line are propagated to line

Chapter Related Work

Automatic Constraint Recognition is the pro cess whereby the user creates mo d

els within the virtual environment As an ob ject is moved around in the virtual

environment p ossible constraints are continually b eing detected and the user is no

tied of these If the user wishes to activate one of these constraints then the ob ject

is simply released and the constraint is created automatically

However ICBSM is limited by the lo cal propagation technique adopted and

cannot handle cycles in the relationship graph Tsai et al have used lo cus analysis

and other techniques to solve this problem essentially turning ICBSM into the

hybrid constraint solver IGCS the Interactive Geometric Constraint System

ICBSM is also quite slow with b ottlenecks caused by the rendering of the mo del

and the Automatic Constraint Recognition Feng Gao et al have help ed to

alleviate this problem Maxeld has expanded ICBSM into a collab orative dis

tributed virtual engineering environment and Munlin has used ICBSM to

build complex assemblies

ICBSM was heavily inuenced by the Degrees of Freedom Analysis approach

used by Kramer in his Geometric Constraint Engine Degrees of Freedom

Analysis do es not t comfortably into b eing a wellconstrained or underconstrained

approach b ecause it is a hybrid of two techniques action analysis and locus analysis

and can handle wellconstrained problems using lo cus analysis Action analysis is a

lo cal propagation approach equivalent to the Allowable Motion technique describ ed

ab ove

Lo cus analysis is used to determine where in global space certain classes of

partially constraint geometric ob jects must lie Lo cus analysis works by

examining the loci of geometric ob jects The lo cus of an ob ject is the set of p ossible

p ositions that the ob ject can take in space If two ob jects are constrained to b e

coincident then the intersection of their lo ci satises the coincidence constraint

For example consider the problem describ ed in gure taken from

Here line L must remain xed at p oint P Corresp ondingly the lo cus of p oint

2

P is the circle L Also the circle of variable radius C is constrained to remain

2 C 2

tangent to circle C and line L The lo cus of the centre of C is therefore curve L

2 P

Supp ose a new constraint is added that the centre of C is coincident with p oint P

2 2

Then there are two p ossible congurations that satisfy this new constraint as well

as satisfying all of the previous constraints These two congurations corresp ond to

the centre of circle C b eing at p oint P or p oint P found by intersecting L and

2 3 4 C

L P

Chapter Related Work

P 4 C

LC

LP P P 3 L 2 P 2 C2

L

Figure An Example of Lo cus Analysis

Kramers approach is very p owerful and the combination of the two techniques

allows for much more exibility than one technique alone The great b enet of

Degrees of Freedom Analysis and Allowable Motion is that they reduce a system of

highly nonlinear highly coupled equations into a set of simpler discrete highlevel

constraints

Gleicher also investigates the use of direct manipulation in dening constraint

problems Gleicher uses dierential manipulation to couple user controls to

graphical ob jects in a p owerful manner that is closely linked to constraints The

approach provides abstractions that enable new interaction techniques

The constraint solution technique used is an equation solving metho d However

in order to solve the equations quickly and eciently dierential manipulation con

trols the motion of the ob jects over time adding a form of elasticity to the direct

manipulation of ob jects This domain sp ecic knowledge helps to make dierential

manipulation practical

Brunkhart has created MechEdit a geometric constraint system for solving

systems of planar linkages MechEdit uses lo cal propagation and contraction in order

to solve underconstrained systems of linkages quickly Brunkhart has conducted

exp eriments that indicate that his hybrid symb olicnumeric solver is signicantly

faster than a numeric solver alone in some cases improving the numb er of refreshes

p er second from to

Eggli et al use QuickSketch to infer D mo dels given a freehand sketch

with some constraints that can b e inferred from the sketch The geometric con

Chapter Related Work

straint satisfaction technique uses a degrees of freedom approach to guide the

construction steps for the mo del

Sohrt and Bruderlin also use interactive manipulation with constraints

The constraint solver that they use consists of two stages First the geometric

constraints are interpreted as prolog predicates and are translated using rewrite

rules until the geometry can b e determined This is a planning stage Then the

symb olic solution created by the rewrite rules is numerically evaluated each time

an ob ject or constraint is altered This allows fast interaction with the user when

nothing changes However new ob jects or constraints require recalculation of the

symb olic solution

Tsai et al use lo cal propagation techniques for incremental assembly The

constraint graph of a problem is analysed and this is used to decide on whether to

reuse old information or to resolve the problem

Arbab and Wangs approach Op erational Transformation Planning OTP

uses a highlevel understanding of the semantics of constraints and the geometric

implications of op erations for satisfaction planning This use of domain sp ecic

knowledge allows OTP to satisfy a network of constraints incrementally

Laakko and Mantyla use SkyBlue a lo cal propagation solver to create

geometric mo dels in an incremental fashion Their solver EXTDesign uses various

subsolvers to handle cyclic subproblems SkyBlue is discussed in more detail in

section

Wellconstrained geometric constraint solvers

Wellconstrained geometric constraint solvers typically op erate using a sp ecifythen

solve paradigm In this paradigm a set of geometric ob jects and a set of geometric

constraints are dened The set of geometric constraints is sucient for the con

straint problem to b e wellconstrained Then all of the constraints are used to nd

solutions to the problem

DCub ed uses this technique The DCM algorithm takes a set of D or

D geometric ob jects and a set of distance and angle constraints Using Hop croft and

Tarjans sub division algorithm the constraint graph representing the constraint

problem is divided into a numb er of split comp onents These split comp onents

can then b e solved using simple rulerandcompass construction techniques and the

solutions to the subproblems are combined to form a solution to the whole problem

For example the p entagon in gure is wellconstrained and can b e represented

using the constraint graph in gure where lines represent distance or angle

Chapter Related Work

P2

10 10 L1 L2 P3 P1 1000 100 0

L5 L3 10 10 L4

P5 10 P4

Figure A Pentagon Dened by Distance and Angle Constraints

L1 L2 P2

P1 P3

L2 L3 P5 P4

L4

Figure The Constraint Graph for the Pentagon

constraints Then Tarjans algorithm is used to identify the split comp onents of the

graph These split comp onents can b e solved immediately and then recombined to

give the picture in gure

DCM claims to have an approximately linear sp eed of solution though Bouma

et al claim it is in fact quadratic DCM can b e used for under and over

constrained problems though it is not b est suited for such cases as the algorithm

attempts to nd an acceptable solution to an underconstrained problem by changing

as few as p ossible However although it guarantees to nd solutions to

wellconstrained problems it cannot guarantee to nd any solution to an under

constrained problem even though an innite numb er may exist DCM deals with

an overconstrained subproblem by placing it in a subgraph and then solving the

rest of the problem

Erep is very similar to DCM Erep studies the problem of under and

overconstrainedness in some detail However the key strengths of Erep lie in its

ability to solve wellconstrained problems and its ability to cho ose b etween solutions

to a problem to nd the solution the user desires

Chapter Related Work

Pab on et al have extended Kramers GCE engine to allow for feature and

variational mo delling The aim of Pab on et als research is similar to the aims in

this thesis to integrate dierent forms of constraint technique However Pab on

et al do not demonstrate any theoretical basis for their work nor any discussion

of domain sp ecic knowledge nor how solvers interact generally These topics are

covered in this thesis

Commercial CAD packages such as ProENGINEER and Unigraphics

allow wellconstrained geometric constraint problems to b e dened and solved

Dufourd et al handle systems of geometric constraints using multiple con

straint solvers They describ e geometric constraint systems in terms of predicates

describing the constraints By taking advantage of the invariance under displace

ment of constraint problems in a CAD environment Dufourd et al break such

constraint problems into smaller ones which are easier to solve

The smaller constraint problems are then solved using one of three local solvers

Two of the three lo cal solvers use rulebased metho ds to solve the geometric con

straint problems whereas the third is a numerical technique The rst rulebased

metho d assumes that there are no lo ops in the constraint problem and so uses lo

cal propagation to solve the constraint problem The second rulebased metho d

allows lo ops but involves a much more complete set of geometric construction rules

This second solver is not complete but Dufourd et al claim that it is successful

in most cases in achieving sophisticated constructions Dufourd et als constraint

solver is similar in form to the hybrids discussed in this thesis The domain sp ecic

knowledge that they take advantage of is the invariance under displacement of CAD

mo dels

Verroust et al use an exp ert system to identify a sequence of computation

Yamaguchi and Kimura develop a technique for simplifying the construction

of consistent and sucient constraint problems in order to make problems well

constrained A constraint problem is consistent if it has a solution A constraint

problem is sucient if it is wellconstrained Aldefeld uses a rulebased metho d

to solve wellconstrained problems

Overconstrained geometric constraint solvers

Constraint solvers that sp ecialise in overconstrained problems tend to concentrate

on resolving conicts b etween constraints This can involve using constraint hierar

chies or solving by other means

Mantyla has develop ed WAYT WhyAreYouThere WAYT is a mo d

Chapter Related Work

elling environment for assembling pro ducts WAYT uses hierarchical descriptions of

mo dels to capture design information and uses DeltaBlue as the integral con

straint solver used to solve the constraints DeltaBlue can solve only linear equality

constraints but can take advantage of constraint hierarchies to resolve conicts

DeltaBlue and its brother SkyBlue are discussed in more detail in section

Shimizu and Numao use a dierent technique to resolve conicts b etween

constraints They prop ose using an Automated Truth Maintenance System in order

to distinguish b etween redundant and conicting situations

Connectivity Analysis DCub ed and Erep also identify and resolve

overconstrained problems

Functional constraint solvers

Functional or engineering constraint solvers solve constraint problems that de

scrib e the functionality of a design as compared to the physicality of the design As

such they are primarily intended for use in the conceptual design phase when the

functional description of the pro duct is prepared Generally the functional descrip

tion consists of a system of nonlinear equations and as such little domain sp ecic

knowledge can b e applied to solving the system If no domain sp ecic knowledge

can b e applied the system of equations must b e solved by a general solver such as

NewtonRaphson or Grobner bases

However certain systems of equations have a structure that can b e taken advan

tage of For example linear systems of equations can b e solved by taking advantage

of the sparseness of the matrix representing the system of equations and using LUD

decomp osition to solve the problem in a relatively ecient fashion

Serrano has created a system called Concept Mo deler that takes advan

tage of triangular systems of equations Concept Mo deler takes as input a system

of equations such as that given b elow taken from and uses the constraints

Chapter Related Work

C4 Y H

C3

C1 C1 C1 C3 B

C1 σ C1 C3 M C1 C6 I C2 C5 C5 C6 C2 C6 F K C6 Φ C5 C5 C2 C5 C6 C6 C6 L C6 C5 E

C6

C6

Figure Equation Graph for Constraints C to C

to build the equation graph given in gure

MY

C

I

C M FL

3

WH

C I

H

C Y

EI

C K

3

L

2

FL

C

EI

The user then sp ecies which of the variables are known and which are not In

this case variables M K E and are known Using graph matching techniques

this allows the creation of the treelike structure in gure which is used to derive

the sequence of constraint satisfaction for the problem

Serrano then uses the values calculated for variables earlier in the constraint

satisfaction sequence to give values for variables later in the sequence However the

subgraph given by the variables I L F in gure is cyclic and must b e solved

Chapter Related Work

W C3

C3 H SC C4

C6 C1 I Y C5 C5 C1 C6 C5 C1 L σ C2 E K M C2

F M C6 C6

E φ

Figure Treelike Representation for Equation Graph

y

simultaneously It is therefore collapsed into a strong comp onent SC which is

solved separately The sequence of satisfaction for gure is SC Y H W

Serrano presents two metho ds of nding redundancies and conicts within strong

comp onents The rst uses symb olic manipulation of the constraints within the

strong comp onent so that each constraint is describ ed in terms of one variable and

then constraints are successively eliminated by substitution into another constraint

For example if a constraint problem consists of four constraints ff f f f g

1 2 3 4

f x x

1 1 3

3

f x

2

2

2

x A f x

4 3

1

2 4

f x x B

4

3

each constraint can b e describ ed simply in terms of a function of one variable In

2

this case f can b e rewritten as x x f as x f as x A x and f as

1 1 3 2 2 3 4 4

1

p

B x Substitution leads to the expression x

4 3

q

2

B A x x

1

1

If A B then the set of constraints ff f f f g is redundant If A B then the

1 2 3 4

set of constraints is conicting and has no solution However this technique is in

general insucient Most constraint problems cannot b e solved using substitution

Chapter Related Work

r = 0 nxn

J D x -f

Figure Typical result of Gaussian elimination on linearised constraint problem

techniques as constraints are not usually a simple function of a single variable

Grobner bases could b e used to identify redundancies in the strong comp onents and

to solve the strong comp onents However the utility of Serranos approach is then

limited to the use of Grobner bases

The second metho d Serrano uses for nding redundancies and conicts involves

numerical techniques First the strong comp onent is linearised by constructing its

Jacobian matrix to give the following system of equations

J x f

where J is the Jacobian x is the vector of x x where x are the unknowns

i 0 i

and x are the initial guesses and f is the vector of the constraints evaluated at x

0 0

Serrano notes that if the Jacobian is nonsingular then the strong comp onent is

consistent and can b e solved using the ab ove matrix equation for each iteration of a

NewtonRaphson metho d The Jacobian can never b e structurally singular when

the Jacobian is nonsquare as the strong comp onent will always contain as

many constraints as variables

The Jacobian can b e numerically singular if the determinant of the Jacobian is

equal to In this case Gaussian elimination would lead to a matrix of the form in

gure

If an entry in f is zero for i r i n then the corresp onding constraint to

row i is redundant otherwise the constraint is in conict with the other constraints

in the strong comp onent

Numerical inaccuracies in adopting this technique may mean that the determi

nant of the Jacobian is close to and is approximated to Consequently non

singular matrices may b e identied as b eing singular

Serranos approach is very similar to Light and Gossards The chief dif

ference is that Serrano only applies the numerical techniques describ ed ab ove to

strong comp onents that the initial algorithm identies whilst Light and Gossard

apply their numerical approach to the entire constraint set Serranos approach

Chapter Related Work

therefore do es not use the more exp ensive numerical technique for acyclic subprob

lems However as will b e proved later in this thesis the decoupling of the cyclic and

acyclic subproblems in Serranos approach may lead to a failure to nd solutions

where Light and Gossards algorithm will succeed

Serrano states that this graphbased approach has proven to b e more ecient

than numeric and symb olic techniques However the sp eed of the system is dep en

dent on there b eing relatively few cycles in the graph

Lamounier has improved on Serranos algorithm by making it incremen

tal Each time a constraint is added to Serranos system the entire satisfaction

sequence must b e derived from scratch For very large sets of equations this will

take a long time Lamounier has improved the algorithm by ordering the satisfaction

pro cess in such a way that when a new constraint is added it only aects as small

a part of the graph as p ossible For example adding constraint c to the graph

given in gure taken from would only aect constraints c and c and

the variables i h f and g rather than the whole problem

Lamounier has also tried to describ e more general constraint problems by allow

ing geometric constraints in INCES However to do this the geometric constraints

are reduced to systems of equations and this loses all domain sp ecic knowledge

asso ciated with the geometric constraints

Serrano and Lamouniers work dep end on local propagation Lo cal propagation

is equivalent to triangular form in matrices or a tree structure in constraint graphs

Many solvers use lo cal propagation as it is very ecient

However lo cal propagation cannot handle cycles or systems of equations that must

b e solved simultaneously Serrano and Lamounier b oth deal with simultaneous

subproblems by passing them to a numerical solver One of the issues identied

by this thesis is that this may lead to the whole solver b eing inconsistent in the

sense that it may fail to nd solutions when they exist

Overconstrained functional constraint solvers

Overconstrained functional constraint solvers attempt to resolve the conicts caused

by having to o many constraints for the numb er of variables In order to do this

Borning et al devised constraint hierarchies Constraint hierarchies involve as

signing each constraint a strength indicating how imp ortant it is that the constraint

b e satised The constraint problem is then solved using the constraint hierarchy

to satisfy the most imp ortant constraints The precise tradeo b etween strengths

is determined by a comparator

Chapter Related Work

c g b

c1 a c2 d c3

c

f j h c4

c5 i c6

a) Before Inserting Constraint c6

c g b

c1 a c2 d c3

c

f j h c4

c5 i c6

b) After Inserting Constraint c6

Figure Example of Incremental Insertion of Constraint Arrows in Graph

Indicate Order of Satisfaction

Chapter Related Work

strong a required c1 strong weak weak weak b c c3 d weak

c2

Figure Example Constraint Graph for Hierarchical Constraint Problem

Constraint hierarchies have b ecome very p opular as they formalise the means by

which conicts in overconstrained systems can b e resolved in a predictable fashion

One of the rst constraint solvers to take advantage of constraint hierarchies was

DeltaBlue DeltaBlue is an incremental lo cal propagation constraint solver

It uses a bipartite constraint graph of constraints and variables to determine the

ow of propagation from variable to variable and uses the strengths of constraints

to determine which constraints need to b e solved Each constraint has a numb er of

methods used to determine how a constraint is satised Only one of these metho ds

is active at any given time

For example consider the graph in gure Constraints are squares and

variables are circles The direction of the arrows indicates which metho d is to b e

used and dashed arrows indicate that a metho d is not active Here constraint c

has b een sacriced so that c is satised In this case once a and b are known c

can b e used to calculate c Once c is known c can b e used to calculate d

DeltaBlue is fast as it is incremental adding a new constraint will only aect

a small part of the constraint graph However DeltaBlue is limited as it uses lo cal

propagation Any cycle in the constraint graph cannot b e solved DeltaBlue also

only allows single output variables

SkyBlue the successor to DeltaBlue allows solution of cycles by calling

external cycle solvers SkyBlue also allows multioutput constraints SkyBlue and

DeltaBlue have b een used in several other constraint solvers Hosob e et

al prop ose a similar approach to SkyBlue

Gelle and Smith present a system for resolving overconstraint in a dynamic

environment They use a logic framework to determine solutions of the problem

Wolf uses constraint hierarchies to transform an overconstrained constraint

hierarchy problem into a normal constraint problem which can then b e solved

Houria is another solver that uses constraint hierarchies and lo cal propaga

tion but uses a global comparator and satises more constraints than other solvers

Chapter Related Work

Maintenance and physical constraint solvers

Maintenance simulation involves a virtual representation of a real environment in

which an engineer or a mechanic can use virtual to ols to assemble and disassemble

complex machinery Physical simulation involves a virtual representation of the real

world including gravity friction acceleration and forces These two areas of study

are closely linked as forces are involved in maintenance simulation to detect for

example the amount of torque placed on a wrench to turn a screw

Constraints do not play a particularly large part in physical mo delling However

there do exist some constraint metho ds for physically based mo delling Physical

laws such as gravity friction and noninterp enetration of solid b o dies can b e de

scrib ed using constraints and such laws are very imp ortant for realistic engineering

design For example Platt presents a metho d based on constraint stabilisa

tion and dynamic constraints that he uses to describ e deformable mo dels and for

collisions b etween the mo dels

Pro ject Isaac is intended to combine accurate ecient and robust tech

niques for collision and contact detection in order to simulate large and complex

geometric mo dels within a virtual environment Others studying physical mo delling

include Bara and Witkin

Whilst much research has b een done on physical mo delling little has b een done

on investigating the supp ort of maintenance analysis Thompson is currently

investigating to ols and techniques for supp orting maintenance analysis within virtual

environments It is hop ed that Thompson can extend the work done by Fa

and Munlin so that dynamic maintenance analysis can b e carried out in the

constraintbased virtual environment of ICBSM

Conclusions

This chapter has presented the stateoftheart in constraint satisfaction The theory

underlying constraints was investigated including the links with relational algebra

as well as dimensions decomp osition and solution spaces

Constraints are used in many dierent elds and constraint solvers tend to b e

biased towards a particular eld The elds identied in this thesis are general

nite domain geometric functional and physical Other than the general constraint

solvers solvers within a particular eld tend to take advantage of domain sp ecic

knowledge ab out that eld Domain sp ecic knowledge allows more ecient solvers

Chapter Related Work

to b e created as well as solvers that can identify desired solutions more easily and

also can b e guaranteed to converge to solutions

In engineering design the most used typ es of solvers are general geometric

and functional Finite domain and physical solvers are still signicant in terms of

engineering design but form a subsidiary part of this thesis Geometric and general

solvers are frequently joined to form hybrids Functional and general

solvers are also o ccasionally joined as hybrids However it is rare that two

domain sp ecic solvers are used in conjunction

Hybrids are useful as they allow a constraint solver to solve more constraint

problems than would b e p ossible normally In this thesis hybrids will b e describ ed

as b eing more expressive Domain sp ecic solvers tend to b e very ecient but also

quite restricted in the problems they can solve This thesis investigates the use of

hybrids of domain sp ecic solvers

However in order to investigate hybrids of solvers commonalities b etween dif

ferent typ es of solvers must b e found To this end an abstraction of the constraint

satisfaction pro cess is develop ed in the next four chapters This abstraction allows

common elements of constraint solvers to b e identied and then exploited when the

solvers are linked together

The criteria identied for distinguishing constraint solvers as given in gure

allow the asso ciation of constraint solvers with problems that are particularly well

suited to that constraint solver This will allow the denition of a hybrid constraint

solver in chapter that will take b est advantage of domain sp ecic solvers

Chapter

Solving Constraint Problems by

Decomp osition

This thesis investigates the denition representation and solution of engineering

design constraint problems This chapter investigates existing engineering design

constraint solvers and discusses the general metho d of solving constraint problems

that these solvers use

The principle b ehind most existing constraint solvers is that it is easier to solve

lots of small problems rather than one large problem This is the divideandconquer

concept prevalent in computer science

Freuder and Hubb es control scheme for solving constraint problems is an

example of the divideandconquer approach to constraint solution and forms a

useful basis for discussing most current constraint solvers It is rep eated here for

convenience

Place the initial problem on the Agenda

Until Agenda empty

Remove a problem P from Agenda

If P has only instantiated variables

then Exit with their values

else

Decompose P into a set of subproblems Pi

Place each nonempty Pi onto the Agenda

Exit with no solution

A prime consideration of innitedomain solvers though often not explicitly

stated is that ordering a set of subproblems can signicantly simplify their solution

Chapter Solving Problems by Decomp osition

Given constraint problem P

Decomp ose P into a set of subproblems fP g

i

Order the subproblems

Solve the subproblems in the order given

Table Control scheme for solving constraint problems

For example consider the two problems P and P

1 2

2 2 9 2 2

P fx IR y IR z IRg fx y z x y sin z g

1

P fz IRg fz g

2

Solving P rst and then P is extremely hard However if P is solved rst then

1 2 2

P is much simplied The order of solution of the subproblems has signicantly

1

improved solution of the combined problem P P P

1 2

Finite domain solvers also b enet from a careful ordering of subproblems as

evidenced by the use of heuristics to help guide solution Variable and value ordering

can frequently make a hard nite domain constraint problem much simpler

Freuder and Hubb es control scheme can b e adapted to incorp orate the order

ing of subproblems by dividing the solution pro cess into three stages as shown in

table

Note that Freuder and Hubb e do not use constraint solvers per se but decom

p ose until variables are instantiated Thus the decomp osition solves the constraint

problem Here decomp osition is distinguished from solution so that existing con

straint solvers can b e applied to subproblems when it b ecomes p ossible to do so

and b ecause decomp osition to the level of instantiation is not usually p ossible in

innitedomain problems

Note also that Freuder and Hubb e continuously decomp ose the subproblems until

they can b e solved In part this is b ecause the decomp osition is used to solve the

subproblems However in part it is b ecause the decomp osition of subproblems can

lead to other subproblems that can b e decomp osed further The solution pro cess

presented in table assumes that the decomp osition of P into subproblems fP g

i

is comprehensive in the sense that any further decomp osition of a P takes place

i

as part of the solution phase In this way the general constraint solver do es not

reinvent the wheel and can reuse any existing solvers

This approach means that the constraint solver describ ed in table should take

into account the constraint solvers available The constraint solver then decomp oses

Chapter Solving Problems by Decomp osition

Given constraint problem P

Decomp ose P into a set of subproblemsolver pairs fP S g

i i

such that P can b e solved eciently by one of the domain

i

sp ecic solvers in S or P can b e solved by a domain general

i i

solver in S

i

Order the subproblemsolver pairs taking into account hy

brid collab orations and domain sp ecic knowledge

Solve each subproblem using the solver selected and the

hybrid collab oration chosen

Table Control scheme for solving constraint problems using domain sp ecic

knowledge and hybrid constraint solvers

the constraint problem according to the solvers available orders the subproblems

and then initiates the solvers on the subproblems in the order decided Clearly the

decomposition strategy the ordering strategy and the available solvers b ecome the

key elements of the constraint solver

As noted in chapter the use of domain sp ecic knowledge and hybrid col

lab oration have b een identied as b eing p owerful techniques to take advantage of

Consequently it is of particular interest to identify how these two concepts t into

the ab ove constraint solver framework In fact the use of domain sp ecic knowledge

and hybrid constraint solvers forms a natural extension of the solution pro cess in

table

The use of domain sp ecic knowledge manifests itself in the availability of domain

sp ecic solvers The constraint solver should decomp ose the constraint problem

into subproblems that can b e solved by the domain sp ecic solvers advantageously

Consequently the constraint solver must know the strengths of the domain sp ecic

solvers available and how these can b e identied in the constraint problem

Hybrid constraint solvers are useful b ecause they help to make explicit the order

ing of subproblems and also allow solvers to pass solutions amongst themselves in a

controlled fashion Hybrid solvers are therefore particularly useful in stages and

of table The use of hybrid collab orations in stage will b e studied extensively

in chapter

The sp ecialisation of table to take into account domain sp ecic knowledge

and hybrid constraint solvers can therefore b e describ ed as shown in table

This solution pro cess has great p otential for success As discussed ab ove the key

elements of the pro cess are the decomp osition strategy the ordering strategy and

the solvers available Each of these elements is discussed in detail in the following

Chapter Solving Problems by Decomp osition

sections

Section presents four examples discussing currently existing constraint solvers

in terms of the pro cesses discussed in table and table Section discusses the

decomp osition strategy and gives some examples of current decomp osition strategies

In section the ordering strategy is covered in detail giving advantages and

disadvantages of ordering strategies

Section discusses solution of the subproblems using domain sp ecic solvers

and the advantages and disadvantages thereof Section presents conclusions from

this chapter

Examples of current constraint solvers

This section presents four examples of current constraint solvers discussed in terms

of the pro cesses describ ed in the previous section The rst example uses the DCM

solver intro duced in The second example demonstrates the use of a hybrid of

a domain sp ecic solver and a domain general solver using the pro cess in table

This example uses the INCES solver intro duced in The third example discusses

IGCS and the fourth example discusses Connectivity Analysis which is a

hybrid of many domain sp ecic solvers

DCM

The twodimensional constraint solver used by DCub ed DCM solves constraint

problems consisting of twodimensional p oints and lines and distance and angle con

straints The algorithm works by decomp osing the constraint problem into tricon

y

nected comp onents The triconnected comp onents will usually consist of triangles

in a constraint graph constructed of either real or virtual edges Then triangles

of constraints and entities consisting entirely of real edges are solved This xes

the three entities in the triangle relative to each other and allows further triangles

to b e xed and solved relative to these three entities The DCM algorithm can b e

describ ed in three stages

Decomp ose the constraint problem P into a numb er of subproblems fP g

i

where each P is a triconnected comp onent The decomp osition strategy cre

i

ates virtual edges when a complex subgraph is split into two other subgraphs

y

along an articulation pair The edge b etween the two vertices that form the

Chapter Solving Problems by Decomp osition

B A C A C B D E D E F I

F G H I G J H

J

Figure Constraint problem P describing a p entagon

articulation pair is part of one subgraph and is rep eated as a virtual edge in

the other subgraph

Order the subproblems so that triangle A B C is solved b efore triangle

A B D if there is an edge A B common to b oth triangles that is real in

A B C and virtual in A B D This forms the ordering strategy of DCM

Each triangle is solved in turn in the order dictated by the ordering strategy

Solvers nd solutions to three simultaneous equations in three unknowns using

sp ecial case or numerical techniques Since the numb er of p ossible triangles is

small and nite sp ecial case techniques can b e used eciently

For example consider the constraint problem P in gure The decomp osition

strategy in gives the set of subproblems depicted in gure where virtual

edges are represented using dotted lines

The partial order generated for these triangles is

DFG AD F AB D

EHI EIC B E C

The sp ecial case solvers would then b e applied to the triangles in turn maintain

ing this order The sp ecial case solvers are eectively domain sp ecic solvers For

example assuming p oints D and G are xed a p osition for line F can b e calculated

using DFG Since D and F are now xed a p osition for line A can b e calculated

using AD F Finally a p osition for B can b e calculated using AB D Eventually

relative p ositions for B G and H would b e determined as shown in gure

Chapter Solving Problems by Decomp osition

A C B B

A D E

C D E F D E I

F I G G H H

J

Figure Decomp osed subproblems of problem P

A C B B

D E

F G H I

G H

J

Figure Recombined subproblems of constraint problem P

Chapter Solving Problems by Decomp osition

These three comp onents can then b e placed relative to each other xing B G

and H up to rigid b o dy freedom

Note the close corresp ondence here with Erep Erep would solve P in exactly the

same way forming triangles DFG ADF and ABD into a single cluster and triangles

EHI EIC and BEC into another cluster and then xing these two clusters with

triangle GHJ in similar fashion to that ab ove In fact Erep and DCM have recently

b een acknowledged to b e very similar

INCES

The functional constraint solver INCES develop ed by Lamounier at the Univer

sity of Leeds solves constraint problems consisting of variables on the real line and

equations The INCES algorithm solves such problems by examining the constraint

y

graph of the problem and identifying strongly connected comp onents Strongly

connected comp onents are equivalent to subproblems that must b e solved simulta

neously Such subproblems once identied are renamed as a single entity in the

constraint graph so that the constraint graph b ecomes acyclic

The acyclic constraint graph is then solved using lo cal propagation techniques so

that entities that are xed are solved rst and entities that are connected are solved

next until a strongly connected subproblem is encountered

The strongly connected subproblem is solved using a domain general solver In

the current implementation of INCES this is a NewtonRaphson technique The

result of the NewtonRaphson solver is passed downstream to other entities in the

acyclic graph by lo cal propagation and the pro cess continues

This is an example of the pro cess describ ed in table This can b e seen more

easily if the INCES algorithm is describ ed in three stages

Decomp ose constraint problem P into a numb er of subproblems fP g where

i

each P is either a strongly connected comp onent or is a connected acyclic

i

constraint graph

Order the subproblems so that xed subproblems are solved rst followed by

subproblems that are connected to them and so on

Solve the subproblems in the order dictated by the ordering strategy Solve

acyclic subproblems using the lo cal propagation solver and strongly connected

subproblems using the NewtonRaphson solver

Chapter Solving Problems by Decomp osition

C1: s - MY = 0 C8 C4 I Y C1 M C2: M-FL = 0 3 C3: I - WH = 0 H s 12 C2 C4: Y - H = 0 C11 2 C3 F C5: K - 3EI = 0 I L L3 C6: P - FL2 = 0 C6 EI C5 W P C7: P = 10 C8: M = 20 E C9: E = 30 K C10: K = 40 C7 C11: s = 50

C10 C9

Figure ConstraintEntity graph of gure

For example consider the constraint problem in gure where each entity

has domain IR INCES decomp oses this to constraint problems P P P and P as

1 2 3 4

shown in gure The order of solution is given by the partial order

P P

1 3

P P

3 4

P P

2 4

The ordering strategy used by INCES is to solve subproblems that x entities rst

and then use the results from these subproblems to solve connected subproblems In

gure problems P and P are xed and so are solved rst Problem P cannot

1 2 4

b e solved b efore P as it is dep endent on P Consequently the ordering ab ove is

3 3

formed

Problem P is strongly connected and so is solved using NewtonRaphson Prob

3

lems P P and P are solved using lo cal propagation Thus INCES is a hybrid of

1 2 4

the domain sp ecic lo cal propagation algorithm and the domain general numerical

solver

Chapter Solving Problems by Decomp osition

C10 C9 C7 C8 C11 P2 s K E P P1 M

P4 P3 C4 C5 C6 C2 C1 C3

I L F Y H W

Figure Decomp osed subproblems of gure

IGCS

Like INCES IGCS was develop ed at the University of Leeds IGCS was

designed by Tsai as a geometric constraint solver that would serve as a successor to

Fas ICBSM ICBSM was limited in that it could not solve geometric constraint

problems with lo ops and so IGCS was built with this in mind

IGCS consists of three separate solution techniques for a geometric constraint

problem Allowable Motion Lo cus Analysis and inverse op eration The Allowable

Motion metho d is equivalent to ICBSMs Allowable Motion This technique satises

a new constraint by manipulating an ob ject using its Allowable Motion how it can

translate and rotate in space The Allowable Motion can then b e used to maintain

constraints when the mo del is manipulated

Lo cus Analysis is as describ ed by Kramer The Allowable Motion of two ge

ometric ob jects that have a constraint b etween them are examined Each geometric

ob ject has a lo cus of p ossible p ositions it can o ccupy without breaking its current

constraints The intersection of the two lo ci is the set of p ossible p ositions the two

geometric ob jects can o ccupy and satisfy the new constraint as well as all of the old

ones

The nal solution technique is the inverse op eration metho d This technique tries

to satisfy a new constraint b etween ob jects A and B by examining the Allowable

Motion and lo ci of ob jects connected to A and B If the new constraint cannot

b e satised by manipulating A and B alone then the inverse op eration metho d

attempts to satisfy the constraint by manipulating ob jects connected to A and B

Chapter Solving Problems by Decomp osition

point-point coincident

C C B B D D A A

(a) (b)

Figure The inverse op eration metho d in IGCS from

that may give A and B more freedom

For example consider gure a A p ointp oint coincidence constraint is

added b etween the endp oints of C and D This cannot b e satised by moving C

and D alone However line B is free to move and so the inverse op eration metho d

will satisfy the new constraint by rotating B to a p osition where C and D can b e

rotated to solve the constraint see gure b

The algorithm adopted by IGCS is that it tries Allowable Motion to satisfy a

new constraint rst If this fails then it tries lo cus analysis and if lo cus analysis

fails then it tries the inverse op eration metho d Again this is an example of the

decomp osition framework

Decomp ose a constraint problem into subproblems consisting of individual

constraints and the ob jects asso ciated with them

Order the subproblems according to the users interaction

Solve the subproblems by applying Allowable Motion then Lo cus Analysis

and then the inverse op eration metho d in order

Note that IGCS can solve lo ops in the constraint graph by using the lo cus analysis

and inverse op eration metho ds Note also that IGCS is an incremental solver and

can deal with single constraints b eing added very quickly

Connectivity Analysis

Connectivity Analysis was presented by Latham and Middleditch as a means of

solving geometric constraint problems Of the three algorithms presented by Latham

and Middleditch one discusses the identication of over and underconstrainedness

Chapter Solving Problems by Decomp osition

d1(1)

e1(3) L1(6) P1(3) f1(3) h1(1)

a1(1) e2(3)

L2(6) P2(3) f2(3)

e3(3)

Figure A connectivity graph for constraint problem P

of constraint problems and making over and underconstrained problems well

constrained The second algorithm uses constraint priorities to cho ose constraints

to remove to solve overconstraint The third algorithm sub divides a large set of

constraints into small subproblems that can b e resolved indep endently It is this

nal algorithm that has the most direct b earing on this thesis

Connectivity Analysis describ es a constraint problem P using a bipartite con

nectivity graph see gure taken from Each entity has a numb er asso ciated

with it which is the dimension of the entity Each constraint also has its dimension

asso ciated with it

The entities in the problem are

L and L are each line segments with dimension

P and P are each p oints with dimension

The constraints are

f and f are constraints to x the lo cation of P and P

e e and e are endp oint constraints to x the endp oints of L and L

d xes the length of L

a forces L and L to b e orthogonal

h forces L to b e horizontal

Each edge of the connectivity graph has a weight asso ciated with it such that

the sum of the weights of all the edges incident to a no de is not more than the

dimension of the corresp onding entity or constraint Each edge is also directed If

the weight of the edge is zero then the direction of the edge is from an entity no de to

Chapter Solving Problems by Decomp osition

d1(1) 1 A 3 0 e1(3) 3 1 L1(6) P1(3) f1(3) h1(1) 1 0 C

a1(1) 3 e2(3)

0 L2(6) 0 P2(3) f2(3)

B 3 e3(3) D

Figure Residual sets for constraint problem P

a constraint no de If the weight is nonzero the edge is directed in b oth directions

Connectivity Analysis then pro ceeds by identifying a maximal weighting of the

connectivity graph A maximal weighting is a weighting where the sum of weights

on the edges is no smaller than the sum of weights in any other weighting At this

p oint Connectivity Analysis detects residual sets which are strongly connected sets

that are not strict subgraphs of any other strongly connected sets Figure shows

the residual sets of gure Circles represent constraints and rectangles represent

entities

The Connectivity Analysis algorithm is presented b elow

BEGIN

Partition the constraint graph into residual sets

Compute the partial order for the residual sets

FOREACH residual set in order

Solve the constraints in the set treating external entities

as constants

ENDFOR

END

The Connectivity Analysis algorithm is dominated by the time taken to identify the

residual sets which is nonlinear The partial order of residual sets is that residual

set Y is solved b efore residual set Z Y Z if and only if

y Y z Z such that there exists a path y ; z E

where E is the set of edges in the connectivity graph Consequently in gure

Chapter Solving Problems by Decomp osition

the partial order of residual sets is

D B A

C B A

The algorithm for Connectivity Analysis is essentially a sp ecic case of that given

in table The decomp osition strategy is the identication of residual sets The

ordering is given ab ove and the solution is by solvers applied to the residual sets in

the order given Latham and Middleditch do not discuss the sp ecic solvers applied

to the residual sets in much detail but they do note that individual balanced sets

can b e solved using sp ecial or general purp ose algorithms and that sp ecial purp ose

algorithms are usually more ecient than general purp ose algorithms In other

words Connectivity Analysis should use domain sp ecic solvers to solve residual

sets

Although Latham and Middleditch do not discuss hybrid constraint solvers the

partial ordering used to order the residual sets lends itself naturally to hybrid col

lab oration For example in gure residual sets D and C can b e solved in parallel

and then B and then A sequentially

If implemented in such a fashion Connectivity Analysis would b e a hybrid of

domain sp ecic solvers Note however that the decomp osition strategy used in

Connectivity Analysis do es not allo cate solvers to subproblems

Recently Latham has generalised Connectivity Analysis to type analysis

Typ e analysis asso ciates a type with each constraint and decomp oses a constraint

problem into subproblems that can usually b e satised indep endently of other prob

lems Here usually means not considering degenerate cases Typ e analysis nds

complete constraint sets with resp ect to a certain typ e T A constraint set is com

plete if the imp osed set of entities is complete with resp ect to T

A set of entities is complete with resp ect to T if

A new typ e T constraint is compatible with some sequence of entities in that

set

No sequence of entities in that set can have their allowable motion reduced by

a new typ e T constraint

DCM GCE and Erep all exploit distancecomplete sets ie subprob

lems that are wellconstrained if only distance constraints are considered Typ e

Chapter Solving Problems by Decomp osition

analysis detects other complete sets and so is more general However the time com

3

plexity of typ e analysis is On where n is the numb er of constraints in a problem

Corresp ondingly typ e analysis is not suitable for the typ e of scaleable interactive

application of interest to the Virtual Working Environment group at Leeds Note

that typ e analysis also do es not consider the allo cation of solver to subproblem

although the use of typ es helps to narrow the choice of solvers appropriate to a

particular subproblem

Decomp osition strategies

A decomp osition strategy D e is a function that takes a constraint problem and a

set of available solvers and pro duces a set of subproblems with solvers assigned to

them It is formally dened here

Denition Decomp osition Strategy A decomp osition strategy is a func

tion

D e P S fP S g

i i

where P is a constraint problem P are subproblems of P S is a set of constraint

i

solvers and S S 

i

A decomp osition strategy can b e simple or complex One of the most basic

decomp osition strategies that is employed by virtually every constraint solver is

D e P S fP S g

connected components i

where the fP g are the connected comp onents of the ConstraintEntity graph of

i

problem P Elements of a connected comp onent do not aect any elements of a

dierent connected comp onent by the denition of imp osed sets see denition

D e applies the same set of solvers to the connected comp onents of

connected components

P

Decomp osition strategies are imp ortant b ecause they divide a large and complex

problem into a numb er of smaller problems that can b e more easily dealt with

However there are a numb er of diculties asso ciated with decomp osition These

are discussed in more detail in section

The remainder of this section presents some examples of decomp osition strategies

in section Section discusses decomp osition strategies to take advantage of

Chapter Solving Problems by Decomp osition

domain sp ecic solvers Section notes the advantages of decomp osition strate

gies whilst section acknowledges the limitations and dangers of this approach

Section discusses the use of decomp osition strategies in incremental constraint

solvers Section draws some conclusions from the use of decomp osition strate

gies

Examples of decomp osition strategies

Most constraint solvers use decomp osition strategies in order to nd solutions to

constraint problems Note that a further decomp osition strategy can b e applied

to each of the results of a decomp osition strategy and so decomp osition strategies

can b e composed For example Serranos DESIGNPAK decomp oses prob

y

lems into stronglyconnected comp onents and nonstronglyconnected comp onents

Call this decomp osition strategy D e However prior to applying

str ong components

D e DESIGNPAK has already decomp osed the constraint problem

str ong components

into connected comp onents using D e

connected components

Thus the DESIGNPAK decomp osition strategy is

D e D e

str ong components connected components

where the notation is used to denote comp osition of decomp osition strategies

D e D e P S fD e P S g

2 1 2 i i

i

where

D e P S fP S g

1 i i

Erep uses a decomp osition strategy that is very similar in outcome to DCM

but somewhat dierent in application Erep identies clusters of entities and con

straints A cluster is a part of a constraint problem that can b e fully describ ed as

a rigid b o dy and can b e manipulated as a rigid b o dy Erep has two distinct phases

to constraint solution First it builds clusters by p ositioning an entity relative to

two xed entities using two constraints This pro cedure continues until no more

entities can b e placed relative to any pair of entities in the cluster At this p oint

the cluster is a rigid b o dy Clusters can then b e placed relative to each other using

manipulation of the rigid b o dies Three clusters C l C l and C l can b e placed

Chapter Solving Problems by Decomp osition

relative to each other if there exist three entities x C l y C l and z C l and

three constraints b etween x and y y and z and z and x

The decomp osition strategy used by Erep decomp oses a constraint problem into

a numb er of clusters which are solved using the cluster building technique and sets

of three clusters that can b e p ositioned relative to each other

The decomp osition strategies used by INCES IGCS DCM and Connectivity

Analysis have b een discussed in detail in section

Decomp osition to domain sp ecic subproblems

In order to take advantage of the p ower of domain sp ecic solvers a constraint

solver must decomp ose a constraint problem into subproblems that can b e solved

eciently by the domain sp ecic solvers available Such subproblems are referred to

here as domain sp ecic subproblems In order to p erform this decomp osition the

constraint solver must know the strengths of the domain sp ecic solvers and how

the appropriate domain sp ecic subproblems can b e identied within the original

constraint problem This is very dicult to do thoroughly

In order to nd domain sp ecic subproblems it is rst necessary to identify the

domain sp ecic knowledge b eing used by the domain sp ecic solvers This helps

to identify typ es of problem that the domain sp ecic solvers can solve eciently

This in turn leads to metho ds of pulling out domain sp ecic subproblems from the

original constraint problem

For example the domain sp ecic knowledge that Erep and DCM use is ruler

andcompass construction More sp ecically Erep and DCM use the domain sp e

cic knowledge that distance and angle constraints b etween p oints and lines can b e

solved quickly and eciently b ecause a p oint is xed in space by two distance con

straints relative to two other xed p oints and a numb er of similar rules Erep and

DCM exploit such domain sp ecic knowledge by using the constraint graph of the

constraint problem to identify clusters of entities that form rigid b o dies Clusters

y

corresp ond to constraint graphs with no articulation pairs and b oth DCM and Erep

exploit constraint graphs with this structure in order to identify rulerandcompass

subproblems

IGCS ICBSM and GCE use domain sp ecic knowledge related to rigid b o dies

They use the knowledge that rigid b o dies are not deformable and can only translate

rotate and scale in space once created Rigid b o dy subproblems are characterised

by D and D ob jects such as lines planes cub oids and spheres with high level

Chapter Solving Problems by Decomp osition

against coincidence and concentric constraints

Finite domain subproblems are characterised by entities and constraints with

nite domains Scheduling subproblems are characterised by entities with a time

domain and constraints such as before after or concurrently

INCES uses the domain sp ecic knowledge that functional constraint problems

that have a tree graph structure can b e solved using lo cal propagation

A decomp osition strategy to take advantage of these domain sp ecic subproblems

will b e dep endent on the solvers available and the problems to b e solved The

advantages and limitations of such decomp osition strategies are discussed in the

following sections

Advantages of decomp osition strategies

There are several advantages to using decomp osition strategies in general and to

domain sp ecic decomp osition strategies in particular

Smaller problems are simpler to deal with

Decomp osing and solving is usually faster than dealing with problems as a

whole

Decomp osition reuses existing constraint solvers

Domain sp ecic decomp osition takes advantage of very ecient solvers

The nal p oint is the key issue of interest in this thesis The advantages are

covered in more detail b elow

When solving large and complex problems it is dicult to comprehend the

whole problem all at once Small parts of the problem are easier to deal

with and understand b oth for the human op erator and the computer It is

signicantly easier to sp ot patterns and problems in small problems than large

ones

In a similar fashion it is much easier and therefore quicker to nd solutions to

small problems than large problems However actually decomp osing the con

straint problem may take signicantly longer than nding the solutions to the

subproblems if a complex decomp osition strategy is adopted Consequently

it may b e faster to solve the constraint problem as a whole

Chapter Solving Problems by Decomp osition

Since a constraint problem is decomp osed to subproblems that are conse

quently solved using sp ecialist solvers the decomp osition strategy can b e de

signed in such a way as to utilise existing solvers This means that the p ower

and expressibility of old solvers can b e increased at little cost in developing

new co de b eyond developing the decomp osition strategy

Domain sp ecic decomp osition is a particular typ e of decomp osition strategy

that tries to take advantage of p owerful domain sp ecic solvers As noted

in chapter domain sp ecic solvers are very ecient at solving some con

straint problems Consequently they should b e reused and adapted if p ossible

Domain sp ecic decomp osition provides a means of doing this Domain sp e

cic decomp osition is a particular example of the divide and conquer strategy

prevalent in computer science

Limitations of decomp osition strategies

In fact most of the advantages of decomp osition can also b e interpreted as disad

vantages Limitations of decomp osition and domain sp ecic decomp osition include

Small parts of a greater whole frequently provide no information ab out the

greater whole

Decomp osition can fail to nd solutions where some exist

Decomp osition can b e slower than solving a problem as a whole

Domain sp ecic decomp osition may lead to subproblems that cannot b e de

comp osed further and cannot b e solved by any existing domain sp ecic solver

It may b e extremely hard to identify the domain sp ecic knowledge a domain

sp ecic solver uses

It may b e extremely hard to identify domain sp ecic subproblems within a

constraint problem

Recombination of solutions to subproblems into solutions to the combined

problem is hard

These limitations are discussed in more detail b elow

Chapter Solving Problems by Decomp osition

Studying small parts of a problem do es not necessarily give any insight to

the whole At one extreme this has given rise to chaos theory In terms of

constraint problems this means that decomp osing to subproblems and then

studying the subproblems do es not necessarily lead to insight into the prob

lem as a whole This p oint is discussed in more detail in chapter and in

section

One immediate eect of the diculty in applying knowledge of small parts of a

problem to the larger whole is that solving indep endent subproblems may not

lead to solutions of the whole problem This is b ecause one of the underlying

assumptions ab out decomp osition is that there is little or no interdep endency

b etween subproblems The classic manifestation of this in innitedomain

constraint problems is the existence or not of cycles in the constraint graph of

a problem Constraint graphs that can b e structured to form a tree usually

have subproblems that can b e solved indep endently and in a certain order

Constraint graphs that contain cycles have constraints that are dep endent on

each other and must b e solved simultaneously It is sometimes p ossible to

develop decomp osition strategies whereby dep endent subproblems can b e put

into one subproblem which is solved as a whole This b ehaviour is apparent

in Serranos DESIGNPAK and Lamouniers INCES However this

only really sweeps the problem under the carp et as the dep endent subproblem

to b e solved simultaneously now forms the bulk of the eort necessary to solve

the constraint problem

The more complex a decomp osition strategy and the smaller the subproblems

it pro duces the faster solvers can nd solutions to the subproblems However

the bulk of the eort of the general constraint solver has simply b een shifted

from the solvers to the decomp osition strategy and little has b een gained

Conceptually this is like the graph in gure As more eort go es into

the decomp osition strategy less eort needs to b e put into the solution of the

subproblems At a certain p oint however the decomp osition strategy takes

more eort than the solution of the subproblems It is at the tradeo p oint

where equal eort is made by the decomp osition strategy and the solvers that

the most ecient general constraint solver should exist

No eort is made here to discuss the shap e of the curves nor where the trade

o p oint may b e found as this is b eyond the scop e of this thesis It is simply

noted that such a p oint will probably exist

Chapter Solving Problems by Decomp osition

Amount of Trade off point effort (time) Solver effort Decomposition effort

Complex solvers/ Complex decomposition/

simple decomposition simple solvers

Figure Graph of tradeo b etween complex decomp osition and complex solvers

Decomp osing to domain sp ecic subproblems may lead to a situation whereby

a subproblem is highly interdep endent and can b e decomp osed no further

However the subproblem is not suitable for any particular domain sp ecic

solver and so cannot b e assigned to a domain sp ecic solver Such a situa

tion is dep endent on the decomp osition strategy used and may b e countered by

having a backup domain general solver that can b e used to solve the subprob

lem However if the nondecomp osable subproblem is large or a signicant

prop ortion of the whole problem then solution of the constraint problem as a

whole will b e dominated by solution of the subproblem by the domain general

solver which will typically b e very slow This situation is evident in for ex

ample COSAC where constraint problems with few linear equations will

b e solved by the slow Grobner basis solver

Domain sp ecic knowledge is a fairly nebulous concept Some examples of

the use of domain sp ecic knowledge are presented in this thesis but these

are by no means comprehensive However it will not always b e easy or even

p ossible to identify the domain sp ecic knowledge employed by a particular

solver For example what is the domain sp ecic knowledge used by genetic

algorithms If the domain sp ecic knowledge used by a solver cannot b e

sp ecied then it will b e extremely hard to characterise the typ e of problems

that a particular solver can deal with For example what typ e of problems

are genetic algorithms particularly wellsuited to solving

Given characterisations of the typ e of problems domain sp ecic solvers can

Chapter Solving Problems by Decomp osition

handle it may still b e extremely hard to identify domain sp ecic subproblems

within a constraint problem Latham identies an asp ect of this problem as the

dierence b etween identifying graph prop erties and real prop erties For

example the identication of rulerandcompass constructible subproblems is

dicult without p erforming the decomp ositions used by Erep and DCM This

problem is discussed in more detail in section

A side eect of decomp osition strategies is the need for recombination of the

solutions to subproblems into solutions of the combined problem In eect the

recombination is a constraint problem in its own right and is typically hard to

do This problem is discussed in more detail in chapter

Incremental issues in decomp osition strategies

An incremental constraint solver adds a set of constraints and entities to a previously

solved constraint problem and tries to nd solutions to the augmented constraint

problem by reusing the existing solution as much as p ossible

Most of the work carried out in incremental constraint solution takes place in

the decomp osition strategy of the incremental solver Recall that a decomp osition

strategy takes a constraint problem and a set of constraint solvers and splits the

constraint problem into a numb er of subproblems which have constraint solvers

asso ciated with them

The decomp osition strategy of an incremental solver will start with no con

straints and no entities A set of constraints and entities is then added and these

are decomp osed into subproblemsolver pairs When a new set of constraints and

entities is added a new set of subproblemsolver pairs is constructed However the

incremental solver will try to reuse the existing decomp osition as much as p ossible

INCES adopts this incremental approach The decomp osition strategy in

INCES splits the constraint problem into connected comp onents that are either

strongly connected or acyclic If a new entity is added then it eectively forms its

own disconnected constraint subproblem If a new constraints is added then one

of several p ossibilities o ccur

The constraint is connected to entities in a previously acyclic subproblem that

remains acyclic when the constraint is added In this case the constraint is

simply added to the acyclic subproblem which is resolved

The constraint is connected to a previously acyclic subproblem that b ecomes

Chapter Solving Problems by Decomp osition

strongly connected when the constraint is added In this case the constraints

and entities in the new strongly connected subproblem are put into a new

strongly connected subproblem and the remaining constraints and entities form

a new acyclic subproblem

The constraint is connected to a previously strongly connected subproblem

that remains strongly connected when the constraint is added In this case

the constraint is added to the strongly connected subproblem

The constraint is connected to a previously strongly connected subproblem

that is no longer strongly connected when the constraint is added In this case

a new acyclic subproblem consisting of only the new constraint is created and

added to the subproblems found by the decomp osition strategy

Thus when a new constraint is added very little new decomp osition need b e done

IGCS is also an incremental solver However the incremental nature of

IGCS comes from the fact that it tries to solve a newly added constraint by manip

ulating the mo del without breaking any of the existing constraints IGCS works by

trying to satisfy the new constraint by rst manipulating the ob jects identied by

the new constraint directly using Allowable Motion and lo cus analysis If that do es

not work then the inverse op eration metho d applies the same techniques to ob jects

that are upstream in the constraint graph IGCS has a very simple decomp osition

strategy and the incremental decomp osition strategy is exactly the same All of the

incremental work is done in the solution stage

DCM and by implication Erep is not incremental DCM decomp oses

constraint problems to triconnected comp onents that represent rigid b o dies Thus

DCM can only solve problems that consist of rigid b o dies By its nature incremental

solution adds constraints and entities one by one Thus adding a new entity leads to

an underconstrained problem and adding new constraints gradually makes it more

and more constrained until it b ecomes wellconstrained

Since rigid b o dies are always wellconstrained up to rigid b o dy motion DCM

can only solve wellconstrained constraint problems However there are two ways

that it may b e p ossible to make DCM at least partially incremental

Incremental constraint solution adds a numb er of constraints and entities to a

previously solved constraint problem DCM can only solve wellconstrained con

straint problems Thus if a numb er of constraints and entities were added to

a wellconstrained problem to give another wellconstrained problem then DCM

would b e able to solve b oth the original problem as well as the new problem

Chapter Solving Problems by Decomp osition

A B

Figure An rigid b o dy comp osed of two triangles

For example triangle A in gure is wellconstrained and DCM can solve

the constraint problem dening the triangle Similarly the whole gure is well

constrained and so DCM can solve the asso ciated constraint problem Thus DCM

could solve for triangle A rst and then when the remaining elements in gure

are added DCM can solve for the gure as a whole incrementally

This incremental DCM could reuse the decomp osition found for triangle A when

solving for the whole problem and thus save some eort

However this approach is dicult b ecause the user will have to add a numb er of

constraints and entities b efore b eing able to resolve the problem and getting feedback

from the solver Though Erep is not incremental in the sense describ ed here the

metho d of dening constraint problems is the same and the authors exp erience with

Erep underlines the dicult in dening constraint problems using this pro cess

Also in order to make the whole gure wellconstrained a large numb er of

constraints and entities need to b e added and the subproblem that is triangle A

b ecomes a very small part of the whole problem Consequently there has b een little

gain in keeping the decomp osition of triangle A

The second metho d of making DCM incremental is of particular interest in this

thesis DCM is very go o d at nding solutions to wellconstrained geometric con

straint problems However it cannot solve underconstrained geometric constraint

problems and so cannot nd a solution when a single constraint is added to an under

constrained problem On the other hand IGCS can nd solutions when a single con

straint is added to an underconstrained problem Gradually the underconstrained

problem has more and more constraints added to it and b ecomes wellconstrained

At this p oint IGCS is not particularly wellsuited to solving the problem but DCM

is

The two techniques therefore complement each other very well and an obvious

question is whether it is p ossible to combine the two techniques in such a way as to

get the b enets of b oth Investigating this p ossibility is one of the main ob jectives

Chapter Solving Problems by Decomp osition

of this thesis

Conclusions

Decomp osition has proved a p owerful means of tackling problems in computer sci

ence As demonstrated by the constraint solvers in section decomp osition allows

constraint problems to b e solved quickly and eciently Generally the advantages

of decomp osition far outweigh the disadvantages

In particular decomp osing a constraint problem can allow problems that would

take exp onential time to solve using a general constraint solver to b e solved in

p olynomial time

The limitations of decomp osition strategies are serious however Whilst this the

sis do es not attempt to solve all of these problems it do es tackle some of them In

particular chapters and examine the diculties of using decomp osition strate

gies to create and solve subproblems Chapters and identify the key areas that

decomp osition strategies must address in order to nd solutions to the constraint

problem

Chapter examines the use of a simpler decomp osition strategy with more com

plex constraint solvers

Ordering strategies

When a constraint problem has b een decomp osed to a numb er of subproblems it

remains to solve the subproblems and recombine the solutions to the subproblems

into solutions to the whole problem However the order in which the subproblems

are solved in is frequently imp ortant For example lo cal propagation techniques such

as INCES ICBSM and SkyBlue decomp ose a constraint problem into

a triangular format

Example Ordering strategies Consider constraint problem P

P fx IR y IR z IRg fx x y x y z g

Chapter Solving Problems by Decomp osition

Let the subproblems b e

P fx IRg fx g

1

P fx IR y IRg fx x y g

2

P fx IR y IR z IR g fx x y x y z g

3

The order of solution of P P P has signicant rep ercussions on the ease of solving

1 2 3

P Solving in the order P P P using lo cal propagation is much harder than

3 2 1

solving in the order P P P 

1 2 3

Consequently most constraint solvers use an ordering strategy on the subprob

lems once they have b een decomp osed The ordering strategy pro duces a partial

order on subproblems such that is irreexive antisymmetric and transitive

Ordering strategies are dep endent on the constraint solver used and the problems

b eing solved Consequently this section do es not attempt to present a comprehen

sive study of ordering strategies Section gives examples of ordering strate

gies in use in current constraint solvers Section discusses the use of ordering

strategies in general constraint solvers and how hybrid constraint solvers and domain

sp ecic knowledge can b e used to help formulate an ordering strategy Section

discusses the use of ordering strategies in incremental solvers Section draws

conclusions from the use of ordering strategies

Examples of ordering strategies

Fas ICBSM forces an ordering strategy on the user by means of the Relationship

Graph see section The Relationship Graph is a directed constraint graph

that forces one constraint to b e solved b efore another and passes allowable motion

from one entity to another Consider for example the construct in gure with

the asso ciated Relationship Graph

In constructing the gure line is xed at one end and its allowable motion

calculated to b e rotation around the xed end Line is then attached and its

allowable motion calculated to b e rotation around the other end p oint of line

Similarly line when attached is allowed to rotate ab out the end p oint of line

Equally direct manipulation of line is propagated to line following the directions

in the Relationship Graph The directed edges in the Relationship Graph form the

ordering strategy of ICBSM In ICBSM an edge is directed from A to B if the user

directs that A is the reference and B the target entities of a constraint Consequently

Chapter Solving Problems by Decomp osition

B

2 3 A Coincident Coincident C Line 1 Line 2 Line 3

1

a) b)

Figure An Arm with Two Joints and the Relationship Graph for the Problem

the ordering strategy in ICBSM is dictated by the user and this tends to place an

additional burden on the user

Serranos DESIGNPAK uses an ordering strategy of pro ceeding from known

to unknown entities The general principle that Serrano advo cates is the manip

ulation of symb ols knowledge in order to derive infer conclude new facts from

existing known facts Eectively this means solving simple in some sense

subproblems and using the information derived from solving the simple subprob

lems to solve the more dicult subproblems later This principle manifests itself by

having xing constraints of the form x that fully dene an entity and make

it known

The ordering strategies employed by IGCS INCES DCM and Connectivity

Analysis have b een discussed in detail in section

Ordering strategies for a constraint solver

A constraint solver using domain sp ecic knowledge and hybrid constraint collab

oration should also take advantage of ordering strategies in order to improve the

eciency of solution

The ordering strategies given in sections and can b e summarised as

User interaction

Find solutions to easy problems b efore harder ones

Simultaneous subproblems should b e as small as p ossible

All of the ab ove strategies can b e usefully employed in any ordering strategy In

particular the strategies b ecome particularly useful if domain sp ecic knowledge is

employed

Chapter Solving Problems by Decomp osition

User interaction is a useful ordering strategy b ecause it allows the user to state

preferences for solutions alb eit indirectly Unfortunately user interaction places an

additional burden on the user in an already complicated pro cedure The interaction

in ICBSM forces the user to consider not only which shap es and which constraints are

necessary to construct a mo del but also in which order to add the constraints Since

dierent orders of construction might lead to dierent and unintuitive solutions this

is clearly inadvisable

This problem is somewhat oset by using rules to determine the order of con

struction and solution and to determine which solution the user intended For

example DCM Erep and ICBSM try to interpret the users intent in

order to determine which of many solutions the user requires

It is sensible to solve easy problems b efore harder ones b ecause solution of the

easier problems might simplify the harder ones signicantly However the denition

of easy and hard are domain sp ecic and consequently domain sp ecic knowl

edge must b e brought to b ear in order to identify the easy and hard problems

Consequently the ordering strategy must employ a great deal of domain sp ecic

knowledge

INCES identies x constraints that x a variable with a certain value Such

constraints are trivial to solve and so form the easy subproblems Fixing the

value of the variable allows other constraints to b e solved more easily DCM and

Erep use much more sophisticated knowledge to identify easy subproblems The

easy subproblems in DCM and Erep are the triangles identied by the cluster

building algorithm Such triangles can b e solved using simple calculations and so

are considered to b e the simplest class of problems that DCM and Erep identify

Note that nding the triangles and then identifying the order in which they should

b e solved is a complex pro cess and uses the domain sp ecic knowledge that a p oint

or line can b e xed relative to two other p oints or lines using two constraints

Tsai has identied the need to make simultaneous subproblems as small as p os

sible Since simultaneous subproblems will b e the most timeconsuming to solve

it is advantageous to keep them as small as p ossible Note that it will not usually

b e p ossible to limit the size of simultaneous subproblems and so this technique has

only limited p otential

Chapter Solving Problems by Decomp osition

Incremental issues in ordering strategies

Once an incremental solver has decomp osed a constraint problem to subproblem

solver pairs the incremental solver will usually apply an ordering strategy to the

subproblemsolver pairs as normal However there are a couple of issues that an

incremental ordering strategy should take into account

The rst is that the ordering strategy should not try and calculate the order

from scratch but should reuse the ordering previously calculated This should save

some eort

Secondly the ordering strategy should b e aware that a newly inserted set of

constraints and entities may only aect a small part of the constraint problem and

thus solvers need only b e applied to a small part of the constraint problem in order

to nd solutions to the new constraint problem

For example INCES orders subproblems so that solution pro ceeds from the rst

subproblem to the last Thus if the decomp osition gives

P S P S P S P S P S

1 1 2 2 3 3 4 4 5 5

P is solved b efore P b efore P etc

1 2 3

If a new constraint is added and is incorp orated into P then the nature of

3

INCES is such that the solutions of P and P are still valid solutions to the new

1 2

constraint problem and need not b e resolved Thus the ordering strategy needs to

note that only P P and P need to b e resolved

3 4 5

Conclusions

The main advantage of an ordering strategy is that it can b e used to help guide

solution of a constraint problem and hence sp eed up solution of the constraint prob

lem With resp ect to hybrid constraint solvers an ordering strategy can b e used

to describ e an appropriate collab oration For example supp ose that an ordering

strategy pro duces an ordering on subproblemsolver pairs

fP S P S P S P S g

1 1 2 2 3 3 4 4

such that

P S P S P S

1 1 2 2 3 3

P S P S

1 1 4 4

Chapter Solving Problems by Decomp osition

then the subproblems can b e solved in a serial fashion in the order

P S P S P S P S

1 1 2 2 3 3 4 4

The limitations of ordering strategies are more dep endent on their implemen

tation than the concept For example the Relationship Graph ordering used in

ICBSM forces the burden of deciding in which order to build a mo del onto the user

and is an extra complication from a system that is trying to simplify the pro cess

Inadequate ordering strategies may lead to orderings of subproblems that do not

simplify solution of the constraint problem but instead complicate it as seen in

example Care should b e taken when selecting an ordering strategy to ensure

that it is not to o sensitive to the structure of the constraint problem and is applied

correctly

Solution of subproblems

Under the constraint solver framework intro duced in this chapter a constraint prob

lem P is decomp osed to a set of subproblemsolver pairs fP S g The set of

i i

subproblemsolver pairs is then ordered using an ordering strategy to give a partial

ordering on the subproblemsolver pairs It remains to solve the subproblems and

to use the solutions of the subproblems to nd solutions to the original problem P

The set S asso ciated with subproblem P in the set of subproblemsolver pairs

i i

is a set of solvers that have b een identied by the decomp osition strategy as b eing

suitable candidates for solving P Usually S will contain only one candidate and

i i

consequently cho osing the solver to apply is trivial However it is p ossible that a

constraint solver will identify a numb er of p otential subsolvers that can b e applied

equally well If this is the case then a subsolver needs to b e selected at this p oint

for application

The solution and recombination of subproblems using hybrid collab oration will

b e discussed in detail in chapter

Section gives examples of constraint subsolvers and the solution of subprob

lems The use of domain sp ecic subsolvers to solve the subproblems is discussed

in section Section discusses the solution of subproblems in incremental

solvers Conclusions are drawn from the solution of subproblems in section

Chapter Solving Problems by Decomp osition

Examples of solution of subproblems

In ICBSM subproblems are not decomp osed per se For each constraint there

is a subproblem consisting of that constraint and the imp osed entities of the con

straint Consider for example constraint aC b where the ordering imp osed by the

Relationship Graph is a b Consequently a is the reference of the constraint and b

6 6

is the target Solution of the subproblem fa IR b IR g faC bg is by examining

the allowable motion of the target entity and using that allowable motion to try and

satisfy the constraint If b can b e translated or rotated to satisfy constraint C then

the new allowable motion of b is dep endent on C and the previous allowable motion

of b The solver used to solve the subproblem nds the allowable motion of b and

the translation or rotation necessary to satisfy the new constraint The solver then

applies the translation or rotation to b and then up dates the allowable motion of b

DESIGNPAK decomp oses a constraint problem to subproblems that are

either cyclic or acyclic Cyclic subproblems are solved by a numerical technique such

as NewtonRaphson Acyclic subproblems are solved using lo cal propagation Con

sequently DESIGNPAK consists of two constraint subsolvers NewtonRaphson and

lo cal propagation Since b oth subsolvers pro duce only one solution recombination

of solutions is trivial

COSAC eectively decomp oses constraint problems into subproblems that

consist of linear equations and so can b e solved using simple Gaussian elimination

or similar subsolvers and subproblems that cannot b e solved using a linear equation

solver which are solved using Grobner bases Generally the Grobner basis subsolver

will dominate the time to solve a constraint problem as most constraint problems

will not consist of many linear equations Whilst COSAC is mostly a Grobner basis

solver it is the rst hybrid solver designed using Monfroys hybrid collab oration

language

Solving using domain sp ecic knowledge

In order to take advantage of domain sp ecic knowledge domain sp ecic solvers

should b e used to solve the subproblems pro duced by the decomp osition strategy

As noted by Latham and Middleditch Sp ecial purp ose algorithms are usu

ally more ecient and reliable than general purp ose algorithms and they provide

geometrically meaningful information that facilitates useful user feedback and aids

selection from multiple solutions The sp ecial case solvers used by DCM and the

allowable motion used in ICBSM are b oth examples of domain sp ecic solvers The

Chapter Solving Problems by Decomp osition

lo cal propagation technique used in INCES is not domain sp ecic as such However

it do es require a sp ecic structure of subproblem to b e successful In fact lo cal

propagation is generally used as a domain sp ecic algorithm as it is used in ICBSM

sp ecically for acyclic geometric problems and in INCES to solve acyclic equation

problems

The hard work of identifying the domain sp ecic knowledge used by a domain

sp ecic solver to pro duce subproblems appropriate for that domain sp ecic solver

is carried out by the decomp osition strategy Domain sp ecic solvers are applied to

the subproblems to pro duce solutions quickly and eciently

Incremental issues in solving subproblems

The use of subsolvers in an incremental constraint solver is usually the least of the

three phases Nearly always the bulk of the work in an incremental solver is carried

out by the decomp osition and ordering strategies The subsolvers generally act in

the same fashion as describ ed in this section and nd solutions to the subproblems

There are exceptions to this rule of course IGCS in particular puts most of the

eort of incremental solution into solving the constraints as they are added The

algorithms used by IGCS are describ ed in more detail in section

Conclusions

Since a subproblem must b e solved in order to nd solutions to the whole problem

the advantages and limitations of solving subproblems are related to the advantages

and disadvantages of using domain sp ecic solvers and hybrid constraint solvers

However the advantages and disadvantages of domain sp ecic solvers and hybrid

constraint solvers are not obvious The use of domain sp ecic solvers is discussed in

section The use of hybrid constraint solvers is discussed in section

Conclusions

This chapter has presented a discussion of the general nature of constraint solvers

and in particular the creation of constraint solvers that explicit domain sp ecic

knowledge and hybrid constraint solvers The general outline of a constraint solver

can b e describ ed simply as a sequence of three strategies

A decomp osition strategy takes as input a constraint problem and pro duces

as output a set of subproblems and constraint solvers assigned to them The

Chapter Solving Problems by Decomp osition

decomp osition strategy is signicant as it splits a large complicated constraint

problem into a numb er of smaller more manageable subproblems As noted

by Latham the key to ecient constraint solution is to partition a large

set of constraints into smaller sets that can b e solved indep endently

An ordering strategy takes as input a set of subproblemsolver pairs and pro

duces as output a partial order in which the subproblems should b e solved

The ordering strategy is not always necessary However the ordering strategy

do es allow a constraint solver to inuence the sequence of solution of subprob

lems Since the result of subproblems can b e used to simplify solution of later

subproblems an ordering strategy is an imp ortant to ol to aid solution of the

whole constraint problem

A solution strategy takes the partially ordered set of subproblemsolver pairs

and initiates a solver on the subproblem maintaining the order given by the

ordering strategy Solutions are passed from subproblem to subproblem in

order to take advantage of known solutions

This outline lends itself naturally to the use of domain sp ecic knowledge and

hybrid constraint solvers The decomp osition strategy can make use of domain sp e

cic knowledge inherent in domain sp ecic solvers and ensure that the subproblems

are selected to take b est advantage of domain sp ecic solvers available

The ordering strategy can then b e used to order subproblems in order to take

advantage of domain sp ecic solvers hybrid collab oration strategies

The solution strategy then initiates the domain sp ecic solvers on the appropriate

subproblems and the hybrid collab oration paradigms are used to make explicit the

recombination of solutions to the subproblems

The advantages of using a decomp osition strategy are that large and complex

constraint problems are sub divided into a numb er of smaller and more manageable

subproblems This divideandconquer approach is frequently faster than trying to

deal with a problem as a whole Decomp osing to subproblems amenable to domain

sp ecic solution also sp eeds up the solution pro cess

Conversely decomp osition strategies are sub ject to consistency problems as well

as diculties identifying domain sp ecic subproblems Identifying domain sp ecic

subproblems is also hard b ecause it is frequently dicult to identify the domain

sp ecic knowledge used by a domain sp ecic solver Once the domain sp ecic knowl

edge is identied it is hard to nd domain sp ecic subproblems that explicate that

domain sp ecic knowledge without solving the whole problem

Chapter Solving Problems by Decomp osition

Ordering strategies allow solvers to help guide solution of a constraint problem

in order to improve the sp eed of the constraint solver Ordering strategies also lead

naturally to the use of hybrid collab orations Unfortunately ordering strategies can

b e very sensitive to the ordering chosen and care needs to b e taken when selecting

a strategy

Many examples of constraint solution by decomp osition were given such as

DCM INCES IGCS Connectivity Analysis and Erep The

strategies adopted by each such algorithm were explored in detail

Several issues and questions were raised by study of the decomp osition framework

in this chapter

Is it p ossible to lose solutions by decomp osing and recombining

What eect do es decomp osition have on incremental techniques

Is it more ecient to decomp ose and recombine or solve as a whole

Is it p ossible to have a fast decomp osition strategy and a fast solution of

subproblems or must one always dominate

In order to investigate these questions thoroughly it was necessary to study the

constraint solution pro cess in more detail For this study the decomp osition of a

constraint problem is not necessary and it merely complicates the pro cedure The

constraint solution pro cess is split into three stages constraint denition constraint

representation and constraint solution

Chapter addresses constraint denition and identies the key terms and ele

ments that comprise a constraint problem Chapter studies the use of constraint

representation schemes which are metho ds of describing and storing constraint prob

lems Chapter uses the denition of constraint problems from chapter to build

a framework for constraint solution that can b e used to study the ab ove questions

Chapter

Constraint Denition

Constraints are used in many dierent situations People frequently refer to con

straints on their nancial p osition so cial life or p ersonal habits In one week in

1

June the BIDS Uncover Service found references in the following journals

mentioning the word constraints

Omega

Soil Biology and Bio chemistry

Duke Mathematical Journal

Applied geo chemistry journal of the international

Asso ciation of Geo chemistry and Cosmo chemistry

Physical review e statistical physics plasmas uids

and related interdisciplinary topics

Tectonophysics

Physical review d particles elds gravitation and cosmology

International journal of control

Journal of symb olic computation

Journal of East Asian linguistics

Ecology

Pharmaceutical research

Geo chimica et cosmo chimica acta

The serials librarian

Eclogae geologicae Helvetiae

Physical review B Condensed matter

Such a wide variety of sub ject areas and uses means that there are many dierent

denitions of a constraint with dierent means of describing and dealing with them

Even in the somewhat more limited context of this thesis such diversity is ev

ident In fact most pap ers on the nite domain constraint satisfaction problem

1

httpwwwbidsacuk

Chapter Constraint Denition

dene the problem using a dierent denition and terminology The fact that none

of these denitions are contradictory leads to the concept of a nite domain con

straint problem

Other typ es of constraints such as geometric constraints or scheduling con

straints however do not at rst glance app ear to resemble the nite domain

denition at all

Example Denitions of Constraint Problems From a denition of

a nite domain constraint problem

The binary constraint satisfaction problem b csp involves a set of

variables fV V g a set of binary constraints fC C g

1 2 11 nm

where the constraint C is a relation b etween V and V and if C is

ij i j ij

null then there is no constraint acting from V to V

i j

From a denition of a geometric constraint problem

Topological constraint A top ological constraint denes the top ol

ogy of a primitive solid itself by sp ecifying the connection b etween the

geometric elements

Structural constraint A structural constraint gives the primitive solid

for example prisms and cylinders the character of a particular feature

Gro ove square hole and step features have the same top ological structure

of sided prism

Dimensional constraint Dimensional constraints dene the size and

lo cation of a feature There are two constraints the distance and angle

b etween geometric elements These corresp ond to dimensions in draw

ings

From a denition of a scheduling problem

The pro cess of driver scheduling is the construction of a set of legal

shifts which together cover all the blo cks in a particular vehicle sched

ule Blo cks may b e considered as b eing divided into units of work which

start and nish at relief opp ortunities pass agree changeover p oints

Driver scheduling is sub ject to a set of rules which is sp ecic to

an organisation Typically there are restrictions on the total time

worked on the length of time that may b e worked without a meal break

on the total spreadover duration b etween b eginning and end of a shift etc

Chapter Constraint Denition



It is in fact p ossible to dene constraints in such a way that all the dierent typ es

of constraint are merely sp ecialised cases of the general denition This chapter

presents a formal denition of the general constraint problem The set theoretic

denition used is in fact not new Finite domain constraint problems are frequently

dened in terms of relations and the denitions used there carried to their

logical extreme are equivalent to the denitions in this chapter

However there has b een very little research into the unication of the various

dierent typ es of constraint problem The denition presented here is capable of

describing all typ es of constraint problem and hence to an extent unifying the

dierent denitions currently used

As well as dening the general constraint problem this chapter presents the

notion of dimension which is used to capture the size of a set Dimensions form a

key part of the theories esp oused later in this thesis Although used in many forms

in the literature for example dimension is equivalent to degrees of freedom as used

by Kramer and Fa no formal denition has b een given in the literature

Section presents a formal denition of dimensions and discusses the concept in

some detail

This chapter denes the terms entity constraint constraint problem constraint

solver and dimension In order to demonstrate the eectiveness of the set theoretic

approach examples of b oth nite and innite domain problems will b e given How

ever the chief b enet of this chapter is that the set theoretic approach simplies

the results and pro ofs presented in the rest of this thesis

Entities

A constraint problem is a compromise b etween ob jects giving freedom of action and

ob jects taking it away

Example Comp onents of constraint problems A nite domain const

raint problem consists of variables and constraints The variables provide freedom

as they can take many values and they increase the p ossible choices available The

constraints restrict freedom as they reduce the numb er of values a variable is allowed

to have

A geometric constraint problem consists of geometric entities and geometric con

straints The geometric entities provide freedom as they can take many p ositions

Chapter Constraint Denition

1 3 5 7 10 12 14 16 17 19 21 23 26 28 30 32 33 35 37 39 42 44 46 48 49 51 53 55

58 60 62 64

Figure Placing a queen on a chessb oard

in space The geometric constraints restrict freedom as they reduce the numb er of

p ositions a geometric entity is allowed to take 

Entities are the ob jects providing freedom In example entities are the

variables in the nite domain problem and the geometric entities in the geometric

constraint problem

Denition Entities An entity E is a pair l abel D where l abel is a unique

identier for the entity and D is the domain of E where D is any set A value for

an entity is an instance in the domain of the entity An assignation for an entity

is a formula of the form E fv g determining that entity E is to b e assigned the

set with the single value v where v is in domain D The notation E S denotes

the fact that E is assigned the set S of values for E 

Where the meaning is unambiguous or the domain unimp ortant an entity will

sometimes b e referred to in this thesis by its lab el alone

Throughout this thesis two examples will b e studied in detail One is a nite

domain problem that of queens b eing placed on a chessb oard The other is a

geometric problem that of constructing a triangle These examples will help to

demonstrate the ideas esp oused in the thesis

Example Finite domain A queen can take p ositions when placed on an

empty chessb oard If the squares on the b oard are numb ered to left to right

top to b ottom then the queen can take a value from to Thus the domain of the

queen is f g see gure Note however that there are many ways of

describing this domain For example by using rows and columns the queen can take

p ositions f g In fact for reasons that are apparent in nite

Chapter Constraint Denition

P = (2, Π)

LS

L

Figure A p oint a line and a line segment on a plane

domain research the latter metho d is a much more ecient means of describing the

chessb oard

A value for the queen is any memb er of the domain for example An

assignation to this value would b e of the form Queen f g If the queen can

b e p ositioned on any square in a row then an assignation of the form Queen

f g is appropriate 

2 2

Example Geometric domain A p oint P IR on a plane has domain IR

A value for a p oint is any pair of numb ers x y such that x y IR for example

An assignation for P would b e P f g gure

2 2

An innite line L IR in a plane also has domain IR as it is uniquely deter

mined by the p oint on the line closest to the origin provided that the line do es not

pass through the origin A value for L is any pair x y x y IR and an assignation

is L fx y g

4 4

A line segment LS IR on a plane has domain IR as it is uniquely determined

2

by its two end p oints As each end p oint has domain IR and can move indep endently

4

of the other LS has domain IR 

Constraints

Where entities provide freedom constraints restrict it Constraints are describ ed in

many dierent ways but these all reduce to the concept of relations in set theory In

Chapter Constraint Denition

example the constraints are the relations in the nite domain constraint problem

and the geometric constraints in the geometric constraint problem

Denition Relations A relation R b etween a pair of entities a b with

y

domains D D is a subset of the Cartesian pro duct of the domains D D

1 2 1 2

For a b R the notation aR b is used An nary relation S on a set of

variables a a with domains D D is a subset of the Cartesian pro duct

1 n 1 n

D D For a a S the notation S a a is used 

1 n 1 n 1 n

Since the sets dening a relation are typically innite it is not usually p ossible to

explicitly list the memb ers Thus implicit means such as set construction notation

are normally used In this thesis the standard notation for relations will b e used

whereby a relation is referred to using the symb ol aR b rather than the list of tuples

dening the relation

A useful denition of a relation is in terms of a test function Each relation

S a a has a b o olean test function f D D f g asso ciated

1 n 1 n

with it where f x x x x S This denition is consistent

1 n 1 n

with Frasse

Denition Constraints A constraint C D on a set of entities E is a

C

restriction of the p ossible values that the entities in E can simultaneously take C

is a lab el representing the constraint and D is a relation on E A tuple of values

C

v v for entities fx D x D g satises constraint C D if

1 n 1 1 n n C

v v D

1 n C



Asso ciated with every constraint is a constraint test procedure A constraint test

pro cedure CTP for a constraint C D with resp ect to the set of entities

C

fx D x D g is the b o olean function f D D f g asso

1 1 n n C 1 n

ciated with C such that f v v v v D

C 1 n 1 n C

In fact it is normally very dicult to dene constraints explicitly as relations

and they are normally describ ed using only the CTP which also doubles as the lab el

for the constraint This convention will b e adopted in the remainder of this thesis

and so where it is unambiguous constraints will b e denoted only by the function

describing them

Chapter Constraint Denition

Example Finite domain One of the simplest constraints p ossible is the

equality constraint b etween two entities Simply put the equality constraint means

that whatever value one entity takes the second entity must also take The CTP

for the equality constraint for two queens on a chessb oard is

CTP f Q Q if Q Q

=

if Q Q

Function f has value if and only if b oth queens are in the same p osition

The infamous nqueens problem however utilises the opp osite of the equal

ity constraint the disequality constraint The disequality constraint b etween two

queens is satised if the two queens are not on the same square The CTP for the

disequality constraint is

CTP f Q Q if Q Q

=

if Q Q

The nqueens problem involves p ositioning n queens on an n n chessb oard so

that no queen attacks another The constraints involved are usually split into the

following typ es

No queen is on the same square as another

No queen attacks another horizontally

No queen attacks another vertically

No queen attacks another diagonally

Intelligent denition of the domains of the queens typically removes constraint

and one of or However it is still necessary to describ e the remaining two sets

of constraints

For example when n the queens problem consists of the four entities

fQ D Q D Q D Q D g with domains D f g where the

4 4 4 4 4

value of Qi represents the p osition of the queen in row i Note that it is not

necessary to say which row each queen is in as they are in separate rows already

Q is in row Q is in row etc

Chapter Constraint Denition

The constraints necessary to prevent each queen b eing attacked vertically are

C Q Q

C Q Q

C Q Q

C Q Q

C Q Q

C Q Q

The constraints necessary to prevent each queen attacking along a diagonal are

C Q Q Q

C Q Q Q

C Q Q Q

C Q Q Q

C Q Q

C Q Q

C Q Q Q

C Q Q Q

C Q Q Q

C Q Q Q

C Q Q Q

C Q Q Q

C for example can b e describ ed as a set as follows

C f

g

Thus the only combinations of values for Q Q not allowed by C are

and 

Example Geometric problem The simplest geometric constraint is also

an equality constraint but is usually referred to as a coincident constraint For

2 2

example two p oints P IR and P IR are coincident if and only if P P see

1 2 1 2

Chapter Constraint Denition

P 4

P P = P

3 1 2

Figure An equality constraint and a distance constraint

gure

2 2

An extension of this is the distance constraint Two p oints P IR and P IR

3 4

satisfy a distance constraint dP P a if and only if jjP P jj a see gure

3 4 3 4

Here jj jj is the normal metric in Euclidean space

p

2 2

x x y y jjx y x y jj

1 2 1 2 1 1 2 2

Note that the equality constraint is a degenerate case of the distance constraint with

a

The equality constraint restricts the freedom of two indep endent p oints from

4 2

IR to IR as the two p oints are no longer indep endent The distance constraint

restricts the freedom of the second p oint relative to the rst to the D lo cus of a

2

circle radius a around the rst p oint Since the rst p oint is free in IR it has

2

domain IR Since the second p oint relative to it has domain IR the construction as

3

a whole has domain IR

Although the coincident constraint lo oks similar to the equality constraint of the

nite domain problem in example the distance constraint do es not However

the distance constraint is a relation as it can b e written in the following form

n o

p

2 2

dP P a x y z w j x z y w a

3 4

Thus b oth nite domain and geometric constraints can b e describ ed as relations 

Chapter Constraint Denition

Constraint problems

A constraint problem is the fundamental structure in this thesis A constraint

problem consists of a set of entities and a set of constraints on those entities A

solution to a constraint problem is a set of values for the entities that satises the

constraints

Denition Constraint problems A constraint problem is a pair

where is a set of entities and is a set of constraints 

Finite domain constraint problems are sometimes dened as a triple of variables

domains and constraints This is equivalent to the ab ove denition

Example Finite domain The pair

F fQ D Q D Q D Q D g fC C C C g

4 4 4 4

describ es the queens constraint problem 

Example Geometric problem Let LS LS LS b e three line segments

with end p oints LS LS LS LS LS LS resp ectively Then the con

a b a b a b

straint problem

4 4 4 2 2 2

G fLS IR LS IR LS IR LS IR LS IR LS IR

a b a

2 2 2

LS IR LS IR LS IR g

b a b

fLS LS LS LS LS LS LS

a b a b a b a

dLS LS dLS LS dLS LS

a b a b a b

endpointLS LS endpointLS LS

a b

endpointLS LS endpointLS LS

a b

endpointLS LS endpointLS LS g

a b

describ es the right angled triangle in a plane shown in gure Here the con

straint endpointLS pt is used to indicate that the endp oint of a line segment LS

is coincident with a p oint pt 

A solution to a constraint problem is a set of values that the entities in the

problem take simultaneously such that all of the constraints in the problem are

satised This is formalised b elow

Chapter Constraint Denition

(0,3)

LS2 LS1

LS3 (4,0)

Figure A solution to constraint problem G

Denition Solutions A conguration of problem P is a set of assignations

for all of the entities in Conguration fx fy g x fy gg is a solution

1 1 n n

to a constraint problem P fx D x D g if and only if

1 1 n n

y y C

1 n

C

or equivalently

f y y

C 1 n

C

where f is the CTP for constraint C 

C

Note that the intersection of the constraints requires that the tuples dening

the constraints are all in terms of the same entities In general this is not so as

constraints are describ ed only in terms of the entities signicant to them Thus the

ab ove denition requires enhanced constraints which are used to translate constraints

dened in terms of the entities signicant to them to constraints dened in terms of

the whole set of entities in the constraint problem Enhanced constraints are dened

in the following paragraphs

Denition Notation for Many Congurations The notation

fx D x D x D g

1 1 2 2 n n

Chapter Constraint Denition

Figure A solution to constraint problem F

is used to represent the set

fx fy g x fy g x fy gjy D y D y D g

1 1 2 2 n n 1 1 2 2 n n



Example Finite domain A conguration for F is

fQ fg Q fg Q fg Q fgg

However this is not a solution to F as Q fg Q fg breaks constraint C

A solution for F is the conguration

fQ fg Q fg Q fg Q fgg

shown in gure as this satises all of the constraints in F



Example Geometric problem A conguration for G is

fLS f g LS f g LS f g

LS f g LS f g LS f g

a b a

LS f g LS f g LS f gg

b a b

This conguration is a solution to G as it satises all of the constraints in G as

shown in gure In fact there are an innite numb er of other solutions to G

found by rotating triangle A ab out the origin Constraint problem G is in fact

underconstrained dened in section

If the constraint LS is added to G to form G then only two congu

a

rations of G are solutions These two solutions are the triangle in gure and its

reection in the y axis G is said to b e wellconstrained see section 

Chapter Constraint Denition

A constraint C is a subset of the Cartesian Pro duct of the domains of the entities

describing C Each constraint is typically describ ed in a lo cal sense in that each

constraint is usually only describ ed by a subset of the total set of entities E For

example the constraint C in problem F of example is dened only in terms of

entities Q and Q Thus C is dened as a subset of the Cartesian Pro duct of Q

and Q However a constraint problem will have more than one constraint usually

and each constraint will have a dierent set of entities relevant to it

According to denition the solutions to two constraints are the intersection

of the two constraints However since the entities relevant to each constraint are

dierent there is no way of taking the intersection of the two constraints For

example constraint C in problem F is dened using Q and Q but constraint C

is dened using Q and Q The intersection of the two constraints is meaningless

Consider problem P consisting of the three nite domain entities x D y D

and z D with domains D f g and two constraints A and B dened by

xAy x y

y B z y z

If A and B are enumerated explicitly then the solutions to P are

A f g

B f g

However the intersection of these sets is the empty set Clearly there are solutions

for P fx y z g is one but simply taking the intersection of the two

constraints is not enough to identify them However if constraint C is dened in

a global sense with resp ect to E rather than just the set of entities that aect it

then it is p ossible to take the intersection of the constraints to nd solutions

Denition Enhanced constraints If the set of entities not relevant to C

E

is E then the enhanced constraint C with resp ect to E C j is

C

E

C j C D

E

C

where D is the Cartesian Pro duct of the domains of E 

E C C

Chapter Constraint Denition

For the example ab ove then

E fz g

A

E fxg

B

and the enhanced constraints are

E

Aj A D

E

A

A D

z

f g f g

f g

E

B j B D

E

B

B D

x

f g f g

f g

E E E

However the intersection of Aj and B j is still The reason for this is that Aj

E E E

and B j are arranged in dierent orders Aj is in the order x y z whilst B j is in

the order y z x In order for the intersection to make sense they must b oth have

the same ordering of variables In order to ensure this we enforce an ordering on

the Cartesian Pro ducts so that in the example ab ove with ordering x y z

E

Aj ff g f gg

f g

E

B j ff g f gg

f g

E E

Clearly the intersection of Aj and B j is sensible and the result

f g

is the set of all solutions to P and using the assignations for x y z can simply

b e read o For simplicity it is assumed that all constraints in P are enhanced

constraints with resp ect to E The ordering on Cartesian pro ducts will b e assumed

from now on and omitted for clarity

Chapter Constraint Denition

If a constraint is presented as an enhanced constraint then it is imp ortant to

b e able to identify the entities that are signicant to that constraint The entities

that are signicant to a constraint and whose values aect a constraint are called

the imposed entities

Denition Imp osed entities Assuming that constraints are describ ed in

terms of tuples with an ordering v v v v corresp onding to variables fx

1 2 3 n 1

D x D x D x D g resp ectively then constraint C is imp osed on

1 2 2 3 3 n n

entity x D if and only if

i i

v v v v v C such that

1 i1 i+1 n

u D such that v v u v v C

i 1 i1 i+1 n



The intuitive explanation of this is that the constraint C is imp osed on x if and

i

only if varying the value of x may violate the constraint

i

In fact it is somewhat clearer to examine the negative statement A constraint

C is not imp osed on an entity x D if and only if

i i

v v v v v C

1 i1 i+1 n

u D v v u v v C

i 1 i1 i+1 n

Thus C is not imp osed on x if the value of x do es not really aect C In this case

i i

we need not include x in our description of C as it is essentially sup eruous

i

E E

In the example ab ove constraint Aj is imp osed on x as is in Aj but

E E

is not However Aj is not imp osed on z as z and z are in Aj

whether z is or

Normally constraints are describ ed only in terms of the entities they are imp osed

on There is thus a subset of fx x g asso ciated with each constraint consisting

1 n

of the entities imp osed on by the constraint This subset is denoted by the symb ol

Denition Imp osed sets The set C of imp osed entities for a constraint

C is called the imp osed set of C 

E E

In the example ab ove the imp osed set of Aj Aj is fx y g and the imp osed set

E

of B j is fy z g

Chapter Constraint Denition

The size of C for a constraint C j C j is usually referred to as the arity of

C see for example A constraint is called unary if j j binary if j j

etc Intuitively a unary constraint only aects and is aected by one entity binary

constraints aect and are aected by two entities etc Unary constraints are simply

a restriction on the domain of the imp osed entity and as such are usually dealt with

by prepro cessing

Since a constraint C is normally only describ ed in terms of the imp osed set of

C C it is imp ortant that C is known for each C Since the ordering for C

is also imp ortant this to o is asso ciated with each constraint

This thesis studies the use of subproblems of constraint problems A subproblem

is a constraint problem that is part of a larger constraint problem

Denition Subproblems of constraint problems Constraint problem

P is a subproblem of constraint problem P if

1 1 1

1

1

For each c c

1 1



Notation will b e abused in this thesis so that set op erations can b e p erformed

on subproblems In particular

P P

1 2 1 2 1 2

Constraint solvers

A constraint solver is an algorithm or technique that takes as input a constraint

problem and pro duces as output a set of solutions that satisfy that constraint prob

lem This set can b e empty consist of one all some or the b est solution dep ending

on the algorithm used

Example Finite domain Constraint solvers for the nqueens problem in

clude forward checking FC and backtracking BT These algorithms have b een

describ ed in section 

Example Geometric problem Constraint solvers for geometric problems

include DCub ed Erep ICBSM and IGCS These algorithms

have b een describ ed in sections and 

Chapter Constraint Denition

Dimensions

Degrees of freedom analysis uses the degrees of freedom asso ciated with geomet

ric ob jects to help guide the solution The degrees of freedom describ e the motion

of a rigid b o dy to translate rotate and scale in space As the solution of a problem

progresses the overall degrees of freedom decrease When the solver terminates

there may b e no degrees of freedom left in which case the solution space describ es

a rigid b o dy or there are degrees of freedom left in which case the terminal solution

space is said to b e underconstrained An underconstrained solution space contains

an innite numb er of congurations

Example Geometric problem The triangle describ ed in problem G in

example is underconstrained as it is allowed to rotate ab out the origin and has

one degree of freedom The triangle describ ed in problem G has no degrees of

freedom left although it has two p ossible solutions



Middleditch and Latham use concepts similar to Kramer which they re

fer to as overconstrained wellconstrained and underconstrained geometric con

straint problems The issue of whether a constraint problem is over under or

wellconstrained is referred to as the constrainedness of the constraint problem in

this thesis The identication of constrainedness of a problem is very imp ortant

as it aects the choice of solver used to solve the problem For example ICBSM

is optimised for solving underconstrained problems whilst DCub ed is primarily

aimed at solving wellconstrained problems and Skyblue at solving overconstrained

problems

This section presents a formal denition of dimensions and constrainedness Di

mensions form the extension of the concept of degrees of freedom to the general

constraint problem With dimensions it is p ossible to dene constrainedness strictly

as shown in section Since certain constraint solvers are b etter suited to under

constrained problems and others are b etter suited to wellconstrained problems it

is imp ortant to b e able to identify the constrainedness of a constraint problem

Denition of dimensions

Degrees of freedom are dened as the translation rotation and scaling a geometric

3

entity is allowed to p erform in IR In a sense this is equivalent to describing the

size of the domain of the entity

Chapter Constraint Denition

3 3

For example consider a cub e in IR The cub e can translate anywhere in IR so

3

has a translational domain of IR and translational degrees of freedom The cub e

3 3

can also rotate in IR and has rotational domain of IR and rotational degrees of

freedom Since it is a cub e all sides must have the same length However the cub e

is free to b e as large as desired and so can b e scaled by any factor It therefore has a

scaling domain of IR and scaling degree of freedom Overall the cub e has domain

7

IR and degrees of freedom

Unfortunately simply counting the p ower of IR in the domain of an entity is not

sucient for the general constraint problem

2

Consider for example an entity x which takes values in Z The size of the

domain of this entity is unsp ecied Following the example of the cub e ab ove since

2

2

Z IR and Z IR a size of would not b e unreasonable However Z is a

2 2

countable set as is Z and so Z and Z are in fact equivalent in a certain sense and

should have the same size In this case the domain of x would have size

This ambiguity means that for the general constraint problem a stricter deni

tion of the size of a domain is needed This is the dimension of a set In fact this

is dicult to determine Ideally the dimension function should b e a function

dim domain N

with the following prop erties

dimIR dimQ dimZ dimN

dim dimA

where A is an arbitrary nite set

These prop erties agree with the denitions of degrees of freedom and constrained

ness used elsewhere It is also imp ortant for the dim function to have the following

additional prop erties

dimD D dimD dimD

1 2 1 2

dimA B maxdimA dimB

dimA B mindimA dimB

dimA n B dimA

These prop erties mean that for example if a set A is a subset of another set B

Chapter Constraint Denition

then the dimension of A is no bigger than the dimension of B

If the domain is a linear space then the denition of dimension should b e the

same as the denition of dimension for linear spaces ie the size of the smallest

linearly indep endent spanning set

As was noted ab ove it is very dicult to dene dim in such a way that prop

2

erty is satised This is precisely b ecause Z and Z are equivalent in a mathe

2

matical sense and so dimZ not as required by prop erty

Manifolds can b e used to deal with this problem providing it is assumed that

the sets used in constraint problems are within a metric space In practice this is not

a serious restriction Manifolds are discussed in brief in app endix A The reader is

referred to for more discussion of manifolds Dimensions as used in this thesis

are therefore dened as follows

Denition Dimensions A set S in a metric space M has dimension n

dimS n if and only if n is the smallest numb er such that S is an nmanifold in

M 

This denition gets over the problem discussed ab ove to do with countable sets

However prop erty must b e slightly altered to

dimD D dimD dimD i

1 2 1 2

(dim(D )+dim(D ))

1 2

D D is not homeomorphic to a prop er subset of IR

1 2

Notice that b oth entities and constraints are characterised by sets However the

dimension of entities and constraints as commonly used are slightly dierent

Denition Dimension of entities The dimension of an entity E D

E

dimE is given by

dimE dimD

E



Denition Dimension of constraints The dimension of a constraint

C D dimC is given by

C

dimD D dimC dimD

C x x

n

1

g  x D where C fx D

n x 1 x

n 1

Chapter Constraint Denition

Constrainedness

The constrainedness of a problem is related to the numb er of constraints in the

problem Since constraints are sets also they to o have a dimension Whilst entities

provide extra dimension for a problem constraints consume dimensions

Example Geometric problem Problem G consists of entities and

constraints The three line segment entities each have dimension as the domain of

4

line segments is IR The six p oint entities each have dimension as the domain of

2

the p oints is IR The constraints consume dierent numb ers of dimensions Fixed

p oint constraints such as LS when describ ed as enhanced constraints have

a

dimension and consume dimensions from LS as once the constraint is satised

it has one end p oint xed By tradition the dimension of a constraint is describ ed as

the numb er of dimensions it consumes Equality constraints such as LS LS

b a

similarly consume dimensions Distance constraints such as dLS LS

a b

consume only dimension The endp oint constraints each consume dimensions

as they restrict the freedom of a p oint relative to a line segment so that the p oint

must move with the line segment

Thus G creates a total of dimensions but consumes only The remaining

single degree of freedom accounts for the innite numb er of solutions to G

Problem G creates dimensions but consumes This do es not corresp ond

to the fact that solutions to G do exist though there are a nite numb er of them



Given the denition of dimensions in section it is now p ossible to dene

the terms wel lconstrained underconstrained and overconstrained These terms

are very imp ortant and are used to give an indication of the numb er of solutions

to the constraint problem The denitions presented here are adapted from the

denitions used by Middleditch and Latham

A constraint problem is wellconstrained if the dimension consumed by every set

of constraints is exactly equal to the dimension created by the set of entities in the

imp osed sets of the constraints A wellconstrained problem would b e exp ected to

have a nite numb er of solutions though it is p ossible for a wellconstrained problem

to have no solutions or an innite numb er of solutions By denition nite

domain constraints and entities always have a dimension of and so nite domain

constraint problems are always wellconstrained Finite domain constraint problems

can have no solutions and they are then sometimes referred to as overconstrained

This should not b e confused with the denition b elow

Chapter Constraint Denition

Denition Wellconstrained constraint problem Constraint problem

P is wellconstrained if

C

E fe je c c C g

X X

dime dimc

eE cC



A constraint problem is underunconstrained if the dimension created by any set

of entities is greater than the dimension consumed by the set of constraints imp osed

on by the entities An underconstrained problem would b e exp ected to have an

innite numb er of solutions though it is p ossible for an underconstrained problem

to have no solutions

Denition Underconstrained constraint problem Constraint

problem P is underconstrained if

E

C fc je c e E g

X X

dime dimc

eE cC



A constraint problem is overconstrained if the dimension consumed by any set

of constraints is greater than the dimension created by the set of entities imp osed

on the constraints An overconstrained problem would b e exp ected to have no

solutions though it may have any numb er

Denition Overconstrained constraint problem Constraint

problem P is overconstrained if

C

E fe je c c C g

X X

dimc dime

cC eE 

Chapter Constraint Denition

According to these denitions as noted by Middleditch it is p ossible for a con

straint problem to b e b oth overconstrained and underconstrained at the same

time This is b ecause a part of the constraint problem can b e oversp ecied and

therefore b e overconstrained whilst another part of the constraint problem can b e

undersp ecied and therefore underconstrained

Example Constrainedness of problems In example problem G is

underconstrained as

4 4 4 2 2

E fLS IR LS IR LS IR LS IR LS IR

a b

2 2 2 2

LS IR LS IR LS IR LS IR g

a b a b

C fLS LS LS LS LS LS LS

a b a b a b a

dLS LS dLS LS dLS LS

a b a b a b

endpointLS LS endpointLS LS

a b

endpointLS LS endpointLS LS

a b

endpointLS LS endpointLS LS g

a b

X

dime dimLS dimLS dimLS dimLS

a

eE

dimLS dimLS dimLS dimLS

b a b a

dimLS

b

X

dimc dimLS dimLS LS dimLS LS

a b a b a

cC

dimLS LS dimdLS LS

b a a b

dimdLS LS dimdLS LS

a b a b

dimendpointLS LS dimendpointLS LS

a b

dimendpointLS LS dimendpointLS LS

a b

dimendpointLS LS dimendpointLS LS

a b

X

dime

eE

Thus problem G should have an innite numb er of solutions and this is true as

the triangle formed can b e rotated ab out the origin In fact the dierence b etween

Chapter Constraint Denition

and indicates that there should b e one degree of freedom in the solution which

is provided by rotation ab out the origin

Problem G is overconstrained as

4 4 4 2 2

E fLS IR LS IR LS IR LS IR LS IR

a b

2 2 2 2

LS IR LS IR LS IR LS IR g

a b a b

C fLS LS LS LS LS LS LS

a b a b a b a

dLS LS dLS LS dLS LS

a b a b a b

LS endpointLS LS endpointLS LS

a a b

endpointLS LS endpointLS LS

a b

endpointLS LS endpointLS LS g

a b

X

dime dimLS dimLS dimLS dimLS

a

eE

dimLS dimLS dimLS dimLS

b a b a

dimLS

b

X

dimc dimLS dimLS LS dimLS LS

a b a b a

cC

dimLS LS dimdLS LS

b a a b

dimdLS LS dimdLS LS

a b a b

dimLS

a

dimendpointLS LS dimendpointLS LS

a b

dimendpointLS LS dimendpointLS LS

a b

dimendpointLS LS dimendpointLS LS

a b

X

dime

eE

However problem G has a nite numb er of solutions when overconstrained

problems typically have none This is b ecause some of the constraints in G are

redundant in that they are simply rep eating information that can b e deduced from

other constraints More sp ecically the constraint dLS LS is redundant

a b

as it can b e deduced from the constraints LS LS and LS

a a a

Chapter Constraint Denition

LS In fact this is the only redundant constraint in the example If the constraint

b

dLS LS is removed from G then and the problem b ecomes

a b cC

wellconstrained 

A constraint is redundant if it adds no information b eyond what can b e deduced

from other constraints

Identication of the constrainedness of a constraint problem is a nontrivial task

Middleditch and Latham present an algorithm for doing this in This algorithm

y

is fast and incremental and op erates on a bipartite graph representation scheme

see chapter

Conclusions

This chapter has presented a formal denition of constraint problems The set

theoretic approach adopted means that the denition used is rich enough to describ e

all kinds of constraint problem as demonstrated by the nite and innitedomain

examples running through the chapter

Entities are dened in terms of the values that they are allowed to take This

means that entities are not restricted to ob jects that have numeric values but can

also include ob jects such as strings or enumerated values This general description

means that entities can describ e many dierent typ es of ob jects

Constraints restrict the values that entities can take The denition of con

straints as relations allows constraints from many dierent elds to b e describ ed

Although constraints are normally describ ed lo cally in terms of a few entities the

denition of enhanced constraints allows description of congurations and solutions

of sets of constraints

Constraint problem s consist of a set of entities and a set of constraints Sets of

many congurations form a kind of search space that constraint solvers use to nd

solutions to constraint problems

The dimension of a set forms an imp ortant guide as to how close a constraint

solver is to nding a solution to the constraint problem If there are an innite num

b er of congurations under consideration then the constraint solver is probably not

near nding a solution to the problem If there are a nite numb er of congurations

under consideration then the constraint solver is probably near to nding a solution

As constraint solution progresses the dimension of the search space under consid

eration will gradually shrink until hop efully only a nite numb er of congurations remain

Chapter Constraint Denition

Dimensions of constraint problems also form an imp ortant metho d of categorising

constraint problems in terms of constrainedness The precise denition of dimen

sions is complex due to the existence of space lling curves and mappings b etween

countable sets However dimensions as dened in this thesis will b ecome increas

ingly imp ortant in later chapters

As dimensions categorise constraint problems in terms of constrainedness it

is apparent that certain constraint solvers are b etter at dealing with problems of

a certain constrainedness For example ICBSM is targeted more at solving

underconstrained problems ie those with an innite numb er of solutions whilst

DCM is targeted more at solving wellconstrained problems ie those with a

nite numb er of solutions This categorisation will b e exploited in chapter

Middleditch and Lathams Connectivity Analysis is an imp ortant means

of identifying well over and underconstrained subproblems within a constraint

problem Connectivity Analysis identies balanced sets of constraints and enti

ties that are eectively wellconstrained Connectivity Analysis also identies over

and underconstrained subproblems and the p ossible means of making them well

constrained Connectivity Analysis will b e used in chapter to identify subproblems

of a constraint problem according to constrainedness in order to exploit the cate

gorisation of solvers according to constrainedness given in chapter

Not only do es the settheoretic approach provide a unifying structure for diverse

constraint problems but it also makes it p ossible to identify the key structures

necessary for constraint representation and makes the abstraction of the constraint

solution pro cess logical and transparent as will b ecome clear in the next two chap ters

Chapter

Constraint Representation

Constraint problems are meant to b e solved Solution may involve nding one

or a numb er of congurations that satisfy the constraints in the problem It is

imp ortant to realise that human b eings deal with constraint problems all the time

simply travelling from A to B involves negotiating a path sub ject to the constraints

of available time transp ort routes trac and weather A problem of this nature

is very dicult to describ e and solve on a computer Paradoxically the movements

necessary for a Puma rob ot arm see gure taken from to reach an ob ject

may b e dicult for a human but simple to describ e and solve on a computer The

signicance of this is that not all constraint problems can or should b e solved on a

computer and that it should never b e assumed that any given problem will b e b est

solved by a computer For the purp oses of this thesis however it is assumed that

there are interesting constraint problems to b e solved that are b etter solved on a

computer

Once a constraint problem is dened using the building blo cks of the previous

chapter it is necessary to represent the problem in some way so that a computer

can understand the problem and then solve it Dierent constraint solvers use

dierent representation schemes and these schemes are not obviously equivalent In

fact some schemes seem to b e only appropriate for sp ecic typ es of problem For

example nite domain problem solvers use a representation scheme that app ears

to b e totally unsuitable for innite domain problems and Lamouniers Equation

Graph is very dierent from Fas Relationship Graph

As the title suggests this thesis is primarily interested in solving a general con

straint problem one not restricted to particular typ es of problem In order to solve a

general problem it is rst necessary then to represent the problem on a computer

To this end this chapter presents research to nd generic metho ds of describing

Chapter Constraint Representation

Figure A Puma Rob ot Arm

constraint problems Section discusses the problems of representing the basic

constituents of constraint problems entities and constraints Section presents a

formal denition of constraint representation schemes and the prop erties necessary

for a valid constraint representation scheme Constraint representation schemes will

b e used to represent constraint problems Section also intro duces the notion of

a generic constraint representation scheme Section discusses CRS schemes cur

rently in use including an algebraic representation which is generic Other schemes

studied are Relationship Graphs undirected graphs bipar

tite graphs and hyp ergraphs This section also intro duces the

ConstraintEntity graph a bipartite graph representation that includes all of the

prop erties necessary for a constraint representation scheme

Section presents reductions a technique develop ed to compare constraint

representation schemes and to prove if a scheme is generic Reductions have b een

used to compare the constraint representation schemes in section and identify

generic constraint representation schemes Using reductions it is p ossible to form a

hierarchy of constraint representation schemes in terms of expressiveness Figure

presents the hierarchy of constraint representation schemes in section It is worth

Chapter Constraint Representation

P 1 P 1 L 1 d 1 d L 1 1

70 P 2 P angle 2 L 2 L coincident 2 PP 3 4 d 2 PP 3d 4

2

Figure A Hierarchy of Constraint Representation Schemes

noting that more than one generic representation scheme exists

The signicance of gure is discussed in section and conclusions drawn

from this chapter

Representing entities and constraints

The representation of entities and constraints on a computer is fundamentally the

problem of representing sets on a computer since entities and constraints are b oth

eectively sets Sets are dicult to represent on a computer b ecause they are usually

innite and thus imp ossible to represent explicitly on a nite machine Some success

has b een achieved by representing nite entities and constraints and this has led to

much research b eing fo cused on nite constraint problems

Finitedomain entities and constraints

Finite entities are usually describ ed by simply listing the domain of the entities

explicitly Thus an entity E that can take values f g will typically b e rep

resented using a data structure such as a one dimensional array If the domain

is fragmented or nonsequential such as the set f g then it will b e

necessary to store the domain in such a way that it is p ossible to quickly and e

ciently check whether the entity is allowed a certain value in the domain This will

entail the use of a sorted array or hash table or p erhaps a linked list Finite domain

algorithms will frequently use a large array which is simply left blank at lo cations

not in the domain

Chapter Constraint Representation

Finite constraints can always b e expressed as binary constraints as noted in

The key comp onent of a constraint is to know which of the tuples in the

Cartesian pro duct satisfy the constraint and which do not It must therefore b e

p ossible to say quickly whether a particular tuple satises the constraint or not

In random nite domain problems this is usually a matter of constructing a two

dimensional array so that an entry is if the tuple satises the constraint

and if the tuple do es not satisfy the constraint

The array data structure is useful b ecause it allows fast lo okup of entries is

simple to construct and also allows random constraints to b e constructed easily and

with certain prop erties

However the array will frequently b e sparse in the sense that it will have many

more s than s For example only ten tuples satisfy the constraint x y for

the entities x y with domains f g Corresp ondingly a array

is constructed which is full of s Sparse matrix techniques would help this

problem

Innitedomain entities and constraints

Whilst it is p ossible to explicitly enumerate the domains of nite entities and con

straints it is imp ossible to do so for innite entities and constraints It is therefore

imp ortant to identify implicit means of describing these structures

Since sets are dened using a test function see section the simplest metho d

of describing an innite set is to co de a function that implements the test function It

is therefore p ossible to query whether a particular tuple is in the set and is therefore

in the domain of the entity or satises the constraint

More sophisticated techniques involve taking advantage of the type of constraint

or entity ie by using domainsp ecic knowledge appropriate to the constraint or

entity For example it is p ossible to capture the movements of rigid b o dies in space

by describing them in terms of degrees of freedom Using degrees of freedom

reduces an innite domain to a nite one and greatly simplies description of the

problem space

Representing constraint problems

A constraint representation scheme CRS is a metho d of describing a constraint

y

problem typically using graph techniques A CRS should b e such that given a

Chapter Constraint Representation

problem in the CRS no more information is needed to examine understand and

attempt to solve that problem other than that provided by the scheme A problem

in a valid CRS will therefore always b e wel lposed in the sense that there is sucient

information to solve the problem given that a solution exists Thus ob jects rep

resenting constraints would b e linked to the actual constraints themselves in some

way and ob jects representing entities would b e linked to the actual entities Having

examined several CRSs in the literature with resp ect to the very formal framework

for the constraint problem dened in the previous chapter it is apparent that there

exists a common set of prop erties that a CRS should have

Denition Constraint representation schemes A data structure for de

scribing constraint problems is a Constraint Representation Scheme It satises

all of the following prop erties

There should b e an identiable set of entities together with their domains

There should b e an identiable set of constraints with a constraint test pro

cedure imp osed set and an ordering asso ciated with each constraint

There is a connection b etween a subset of entities if and only if there is a

constraint imp osed on the subset ie a connection corresp onds to the imp osed

set of a constraint

There should b e a onetoone corresp ondence b etween the constraints and the

connections in the representation

There should b e a denition of what a solution in the representation lo oks like



The denition of connection will vary from scheme to scheme For example in the

constraint graph representation of Owen a connection is just an edge whilst in

the ConstraintEntity graph representation section a connection is the set

of edges incident to a particular constraint vertex

A generic constraint representation scheme is a representation scheme capable of

describing all constraint problems Generic representation schemes are imp ortant as

they allow a general purp ose constraint management system to store and represent

general constraint problems

Chapter Constraint Representation

Denition Generic representation schemes A generic CRS is a CRS in

which every constraint problem can b e describ ed where a constraint problem is as

dened in section The algebraic CRS presented in section is generic as all

constraints can b e describ ed in terms of relations A generic constraint represen

tation scheme will b e useful as it can b e used to describ e all problems that will b e

encountered 

Example constraint representation schemes

This section provides sample CRSs and intro duces the ConstraintEntity graph

Algebraic representation

The algebraic representation of a constraint problem is the pair E C where E

fx D x D g is the set of entities with domains and the set

1 1 n n

g C fc f c f

c c 1 c c c m c

m m m

1 1 1

is the set of constraints where f is the Constraint Test Pro cedure for constraint

c

i

c is the imp osed set of constraint c and is an ordering on

i c i c c

i i i

A connection b etween elements of F E exists i c C such that F

i c

i

The ntuple v v is a solution of an algebraic representation i

1 n

c C f v v j v D

i 1 n j j

c

i

where

f v v f v v

1 n c i i

m

1

c i

i

g fx x

c i i

m

1

i

and x x x

i c i c c i

m

1 2

i i i

From here notation will b e abused so that f is equivalent to f

c

i c

i

Given the denition of generic CRSs in section the algebraic representation

scheme ab ove is generic

Chapter Constraint Representation

on(A,B) C AB D on(B,C)

C on(A,D) B

D A

Figure An Example of a Relationship Graph with a Solution to the Graph

Relationship graph representation

y

The Relationship Graph intro duced by Fa et al is a directed graph consisting

of vertices V and directed edges E

The set V is the set of entities and asso ciated with each vertex is the domain of

the relevant entity

The set E is the set of directed edges Each edge u v represents a constraint

b etween vertex u and vertex v The CTP for the constraint is the function asso ciated

with the geometric constraint represented by the edge The imp osed set of the

constraint is fu v g with ordering u v preserved by the direction of the edge

Thus nonsymmetric constraints can b e reconstructed from the graph

A solution of the Relationship Graph is a conguration such that the CTP of

each edge is satised Figure shows an example of a relationship graph and a

solution to the relationship graph

Undirected graph representation

y

Undirected graphs are used in b oth innite and nite domain constraint solvers

Innite domain solvers that use undirected graph structures such as DCub ed

y

and Erep currently only handle symmetric constraints such as distance

or angle constraints Any change to the representation to handle unsymmetric

constraints would necessitate intro ducing an ordering and would eectively change

the undirected graph into a directed graph It is therefore appropriate to treat the

undirected graphs of DCub ed and Erep as separate constructions from directed

graphs such as Relationship Graphs and investigate them as such

Finite domain solvers do not app ear to distinguish b etween symmetric and un

symmetric constraints Since the matrices used to describ e constraints can handle

unsymmetric constraints it is therefore assumed that the undirected graphs used

Chapter Constraint Representation

L L 10 10 P

108 108

P P

10 10

L L 10 P P

L

Figure An example of an undirected constraint graph with a solution to the

graph

in nite domain problems do in fact contain an ordering and are eectively directed

graphs

An undirected graph G consists of a set of vertices V and a set of undirected

edges E A vertex v represents an entity with its domain An undirected edge u v

represents a constraint b etween vertices u and v with the CTP asso ciated with the

constraint The imp osed set of the constraint is fu v g with no ordering ie u and

v are interchangeable

A solution to an undirected graph is a conguration such that the CTP of each

edge is satised Figure shows a simplied example of an undirected constraint

graph and a solution to the graph from Note that the actual constraint graph

will contain descriptions of the constraints that are represented by the edges in the

graph and will also have the domains of the entities

Hyp ergraph representation

Serrano uses a hyp ergraph representation for constraint problems A hyp er

y

graph CRS is a pair V HE where V is a set of vertices and HE is a set of

Chapter Constraint Representation

4 Y H

3

1 1 1 3 F B

σ 1 1 3 M 1 I H 2 5 2 5 F K LB

5 5 2 5

L 5 E

Figure An example of a constraint hyp ergraph with a solution to the graph

y

hyp eredges

A vertex v represents an entity with its domain

A hyp eredge he fv v v g represents a constraint with a CTP asso ciated

1 2 n

with the constraint and imp osed set fv v v g Serrano do es not mention an

1 2 n

ordering on the edges but it must exist as the constraints he describ es are not

symmetric Hence an ordering is assumed to exist on fv v v g

1 2 n

A solution to a hyp ergraph is a conguration such that the CTP of each hyp er

edge is satised Figure shows a simplied example of a constraint hyp ergraph

and a solution to the graph from The hyp ergraph shown do es not show the

descriptions of the constraints or the domains of the entities in order to simplify the

picture

Bipartite representation

y y y

The ConstraintEntity graph CE graph is a lab elled undirected bipartite

connected graph C V E with two typ es of vertices constraints and entities Note

that the ConstraintEntity representation is adapted from the bipartite representa

tions used by Serrano and Latham and Middleditch An example Con

straintEntity graph is given in gure

The set C is the set of constraint vertices Each c label f C consists

c

of a unique lab el identifying the constraint and a CTP for checking p ossible solu

tions Constraint vertices are represented as circles in the graph For example C

in gure is a constraint vertex with CTP f x y C

Chapter Constraint Representation

D f (x,y) D x C y 1 2 x C y

1 2 A f (x,y,z) A 3

1 2 z B w

D f (z,w) z D

B w

Figure Example of a ConstraintEntity Graph

The set V is the set of entity vertices Each v label D V consists of

v

a unique identifying lab el and the domain of the entity D Entity vertices are

v

represented as squares in the graph for example x in gure is an entity vertex

with domain D

x

The set E is the set of lab elled undirected edges in the graph In a CE graph

there exists an edge b etween a constraint no de and an entity no de i the asso ciated

constraint is imp osed on the asso ciated entity ie c v n E c label f and

c

v is a parameter of f Each edge is lab elled with a numb er n b etween and the

c

numb er of parameters of f denoting the p osition of the adjacent entity vertex in

c

the list of parameters of f The set of entity no des adjacent to constraint no de c

c

is denoted For example in gure the edge A z is lab elled as z is the

c

third parameter in f

A

A solution of a ConstraintEntity graph is a value v v D D

1 n 1 n

such that f v v c C

c 1 n

Valid representation schemes

Table illustrates the various schemes discussed in this section and catalogues the

prop erties necessary for a valid CRS All of the schemes presented in this section

are valid CRSs

Chapter Constraint Representation

Scheme Reference Entities Constraints Imp osed Set

Algebraic Section E C Imp osed set of C

CE Section V C The set of edges

incident to con

straint vertex

Directed V E Edge

Undirected V E Edge

Hyp ergraph V Set of edges with Set of edges with

dierent lab el same lab el

Table Valid Constraint Representation Schemes

Reductions

The various graph representation schemes have signicant advantages over the al

gebraic CRS For example the nite domain arc consistency and path consistency

solution techniques take advantage of an undirected graph structure and ICBSMs

Allowable Motion takes advantage of the directed graph nature of the Rela

tionship Graph to help guide solution Erep and DCM take advantage of

the structure of undirected graphs Concept Mo deler takes advantage of the

hyp ergraph representation and Connectivity Analysis takes advantage of the

structure of a bipartite graph representation

Whilst the algebraic CRS is generic it is not immediately obvious which of the

other CRSs are It is also useful to b e able to compare the expressiveness of CRSs

directly so that the relative expressiveness of constraint solvers can b e identied

This section presents a metho d of comparing CRSs such that not only can more

expressive schemes b e identied but also so that there exists a metho d of translating

one scheme to another To this end the concept of reducing one CRS to another

is intro duced The concept of reduction is analogous to reductions in complexity

theory

Denition Reductions A CRS can b e reduced to a representation if

There exists a mapping from to A B such that A B

Every solution of A is also a solution of B and every solution of B is also a

solution of A In other words A and B the reduced problem have the same

solutions

and are valid constraint representation schemes

Chapter Constraint Representation

The reduction can b e done in p olynomial time

The last criterion is necessary to ensure that the problem do es not b ecome in

tractable due to the reduction 

Reductions form a to ol by which it is p ossible to compare and contrast constraint

representation schemes in terms of their expressiveness

The intuitive notion of reductions is that any problem in can b e describ ed

in and that every solution of the reduced problem is a solution of the original

problem Thus the reduced problem is describing the same problem as the original

Since every problem in can b e describ ed in is capable of describing at least

as many problems as and p ossibly more This is usually denoted by saying that

is at least as powerful as It is natural therefore to wonder when two constraint

representation schemes are equally p owerful

Denition Equivalent constraint representation schemes The two

representations and are equivalent if and only if can b e reduced to and

can b e reduced to The notation is used to denote equivalence 

Since generic representation schemes are the goal of this chapter constraint rep

resentation schemes that are equivalent to generic representation schemes will b e

particularly imp ortant

Theorem If and is generic then is generic 

Pro of If then such that B A B A Hence B can b e

describ ed and solved in and since B is arbitrary is generic 2

Two example reductions are given b elow These reductions are imp ortant as

they prove that there are constraint representation schemes other than the algebraic

representation scheme that are generic and also that there are constraint represen

tation schemes that are not generic This allows the construction of a hierarchy

of constraint representation schemes in terms of expressiveness The two sample

reductions prove that

The algebraic representation is equivalent to the Constraint Entity represen

tation

The Relationship Graph representation is not as expressive as the Constraint

Entity representation

Chapter Constraint Representation

These reductions allow construction of part of gure The remaining reductions

necessary to pro duce gure are presented in app endix B

The reductions presented in theorem and theorem combined with the re

ductions presented in app endix B lead to the conclusion that the ConstraintEntity

graph presented in section is generic Since this thesis studies the solution of

general engineering design constraint problems a generic constraint representation

scheme is necessary to represent the general problem The ConstraintEntity graph

is also equivalent to the Connectivity graph used by Middleditch and Latham

and so can b e used for Connectivity Analysis The identication of the constrained

ness of subproblems is an imp ortant issue in this thesis and the direct use of Con

nectivity Analysis is a signicant advantage for the ConstraintEntity graph Con

sequently the ConstraintEntity graph will b e the constraint representation scheme

of choice for this thesis

Theorem The algebraic representation is equivalent to the Constraint Entity

graph representation 

Pro of The pro of is in two parts First a reduction is formed from the Algebraic

Representation to the ConstraintEntity Representation

A mapping is dened as follows

For every x D E create x D in V

i i i i

For every c f C create c f in C

c c c c

Create E such that c f x D n E x and x is in

c x c

position n in

c

By insp ection the resulting graph is a ConstraintEntity graph As an exam

ple consider the simple constraint problem b elow The ConstraintEntity graph

resulting from the reduction is as in gure

fx D y D z D w D g

x y z w

fA f B f C f g

A A A B B B C C C

such that fx y z g fy z w g fx w g

A B C

and x y z y z w x w

A B C

The entity vertices fx y z w g the constraint vertices fA B C g and the edges

fA x A y A z B y B z B w C x C w g

Chapter Constraint Representation

D y

y

2 Af (x,y,z) 1 D A D x 1 3 z

x z

2 1 B

3 f (y,z,w) C D B w f (x,w)

C 2 w

Figure ConstraintEntity Representation for Constraint Problem

are created The reduction criteria are demonstrated b elow

Mapping is dened ab ove

A solution y y of E C is a solution of the Constraint Entity graph

1 n

by the denition of a solution of the Constraint Entity graph and that of the

algebraic representation and vice versa

Both are valid CRSs by table

For every constraint in the constraint problem a constraint vertex is created

taking Om where m is the numb er of constraints For every entity in the

constraint problem an entity vertex is created taking On where n is the

numb er of entities For every constraint in the constraint problem an edge for

each entity the constraint is imp osed on is created taking Omn Hence the

reduction is p olynomial

Secondly the reverse reduction from a ConstraintEntity graph to the algebraic

representation is proved using the following mapping

Chapter Constraint Representation

Given ConstraintEntity graph C V E construct E V Con

struct for each c C by

c

fx x x g

c i i i

1 2

k

such that c f x D n E Then construct for each c C

c i x c

j i

j

by

x y c x n E and c y m E and n m

c

Then dene

C fc f jc f C g

c c c c

Then the pair

E C

is the algebraic representation as dened in section

The reduction criteria are now checked to make sure the reduction is valid

Map is dened ab ove

By the denition of the solutions of a ConstraintEntity graph and of the

algebraic representation the solutions are the same

Both are valid CRSs from table

For each entity vertex in the CE graph an entity in E is created taking On

where n is the numb er of entities For each constraint in the CE graph a

constraint in C is created There may b e On edges incident to each constraint

and Om constraints so reconstructing the imp osed sets is Omn Hence

the reduction is p olynomial

Therefore the algebraic representation for constraint problems is equivalent to

the ConstraintEntity graph representation This is as exp ected and means that

every problem that can b e describ ed in terms of relations can b e describ ed as a

ConstraintEntity graph So ConstraintEntity graphs are generic 2

Chapter Constraint Representation

f (u,v) DDC u v 1 2

u C v

Figure New Construct for Constraint Edges

f (u) C D u 1

C u

Figure New Construct for Constraint Lo ops

Theorem The Relationship Graph is not equivalent to the Constraint

Entity graph and is strictly less p owerful than it 

Pro of The pro of is in two parts First a reduction is formed from the Rela

tionship Graph to the ConstraintEntity representation demonstrating that the

ConstraintEntity Graph is at least as p owerful as the Relationship Graph The

Relationship Graph is a directed graph in which constraints are represented by

directed edges and entities are represented by circular vertices

The mapping used to reduce a directed constraint graph V E to a CE graph

V C E is as follows

B B B

Create V V

B

For each edge e in E with CTP f create constraint vertex e f in

e e

C

B

For each edge e u v in E create edges e u and e v in

E Eectively this means replacing al l edges u D v D with

B u v

the construct in gure where u D v D represents constraint

u v

C with fu v g and u v C has CTP f As edges in the

C C

Relationship Graph are directed there is an implicit ordering which is

captured by having the edge from C to u label led with a and C v

label led with a

For each edge e u u in E create edge e u in E Eectively

B

this means replacing al l edges u D u D with the construct in

u u

gure

Chapter Constraint Representation

Entity

1

4 2 Entity Const Entity

3

Entity

Figure Representing Quaternary Constraints in a ConstraintEntity Graph

The resultant graph is clearly a CE graph Checking the reduction criterion

The mapping is dened ab ove

A solution to the constraint graph will result in values b eing assigned to the

various entity vertices The assignment of the same values to the entity vertices

in the reduced CE graph will form a solution to the CE graph problem since

the same CTPs are used in b oth schemes

Both are valid CRSs as in table

The reduction can b e done in linear time in the numb er of edges in the con

straint graph It is therefore p olynomial time

So the relationship graph can b e reduced to a CE graph

Secondly it is necessary to prove that ConstraintEntity graphs cannot b e re

duced to Relationship Graphs This implies that ConstraintEntity graphs are

strictly more p owerful than Relationship Graphs The weakness of RGs lies in

the fact that only binary and unary constraints can b e describ ed

It is however p ossible to represent ternary or nary constraints in a Constraint

Entity graph by the numb er of edges e E such that the constraint vertex is incident

to e see gure

Since more complex nongeometric constraints will probably require nary con

straints such a representation is clearly desirable

Chapter Constraint Representation

Since nary constraints n cannot b e describ ed using a Relationship Graph

it follows that the ConstraintEntity representation is more p owerful or more general

than Relationship Graphs 2

Conclusions

This chapter has discussed the problems of representing constraint problems on a

computer The problems of representing constraints and entities corresp ond to the

problems of representing large or innite sets of values Sparse matrix techniques

can b e used in the case of nite entities and constraints provided that there are few

nonzero values In general implicit set notation is used for innite domain entities

and constraints Equations and inequalities can b e describ ed using explicit symb olic

mathematical descriptions for example using Maple It is also p ossible to use

domain sp ecic knowledge to simplify description of constraints and entities For

example the movements of rigid b o dies in space can b e describ ed using degrees of

freedom which allows description of an innite domain to b e simplied to a

nite one

Constraint problems are represented using constraint representation schemes

Constraint representation schemes are a means of abstracting out relevant informa

tion ab out a constraint problem for example the imp osed set of constraints in such

a way that they can b e exploited by a constraint solver Most constraint representa

tion schemes take advantage of graph representations in order to use the large b o dy

of graph algorithms that already exist

For example the nite domain arc consistency and path consistency solution

techniques take advantage of an undirected graph structure and ICBSMs Allowable

Motion takes advantage of the directed graph nature of the Relationship Graph

to help guide solution Erep and DCM take advantage of the structure

of undirected graphs Concept Mo deler takes advantage of the hyp ergraph

representation and Connectivity Analysis takes advantage of the structure of a

bipartite graph representation

Some constraint representation schemes are generic A generic constraint rep

resentation scheme is capable of describing all constraint problems The algebraic

representation scheme describ ed in section is generic but there is no direct

means of identifying which of the other representation schemes presented are Con

sequently the notion of reductions was intro duced Reductions can b e used to

convert b etween constraint representation schemes and also to compare two con

Chapter Constraint Representation

P 1 P 1 L 1 d 1 d L 1 1

70 P 2 P angle 2 L 2 L coincident 2 PP 3 4 d 2 PP 3d 4

2

Figure A Hierarchy of Constraint Representation Schemes

straint representation schemes Two constraint representation schemes and are

equivalent if can b e reduced to and vice versa

Theorem proves that a constraint representation scheme that is equivalent to

a generic representation scheme is generic This theorem p erforms an imp ortant role

in identifying the constraint representation scheme that will b e used to represent

the general engineering design constraint problems of interest to this thesis

Using reductions it is p ossible to form a hierarchy of constraint representation

schemes in terms of expressiveness The hierarchy describ ed in gure is repro

duced here for convenience

This hierarchy indicates that the ConstraintEntity graph presented in sec

tion is generic The ConstraintEntity graph is also equivalent to the Connec

tivity graph used by Middleditch and Latham and so can b e used for Connectiv

ity Analysis The identication of the constrainedness of subproblems is an imp or

tant issue in this thesis and the direct use of Connectivity Analysis is a signicant

advantage for the ConstraintEntity graph Consequently the ConstraintEntity

graph will b e the constraint representation scheme of choice for this thesis

Chapter

Constraint Satisfaction

Once a constraint problem is dened and represented on a computer it only remains

to nd the required numb er of solutions to the problem a pro cess normally referred

to as constraint satisfaction Currently there exist many dierent constraint satis

faction techniques ranging from trying every p ossible conguration to sophisticated

heuristic and reasoning metho ds

The purp ose of this thesis is to investigate the p ossibility of dening representing

and solving a general constraint problem eciently on a computer No single algo

rithm currently available can handle al l constraint problems Even versatile numer

ical algorithms such as NewtonRaphson cannot solve all constraint problems

as not all constraint problems can b e describ ed using equations see Kramer

p As noted in

There are no go o d general metho ds for solving systems of more than

one nonlinear equation Furthermore it is not hard to see why very

likely there never wil l be any go o d general metho ds

Consequently b ecause the general constraint problem may consist of a numb er of

nonlinear equations and inequalities it is unlikely that any single algorithm will b e

able to solve the general constraint problem However there exist many algorithms

capable of solving sp ecic typ es of constraint problem It is logical therefore to

wonder whether the sp ecialised constraint solvers could b e combined in some fashion

and what kind of problem the combined solver could handle

This gives rise to the concept of hybrid constraint solvers which is discussed in

more depth in chapter However in order to study hybrid solvers it is necessary

to investigate the constraint satisfaction pro cess to identify common prop erties of

satisfaction algorithms that will allow hybrids to b e constructed

Chapter Constraint Satisfaction

Consequently this chapter presents a mathematical framework of the constraint

satisfaction pro cess This framework has several b enets b eyond the identication

of common prop erties

The framework helps to clarify current constraint satisfaction algorithms

The framework allows formal denition of prop erties such as consistency

soundness and completeness and provides a p owerful metho d of proving their

existence in a given algorithm

The framework is suciently rich to allow the integration of previously un

connected topics such as constraint priorities backtracking variabledriven

algorithms and incremental techniques

Section presents a denition of constraint satisfaction solvers and discusses so

lution spaces in this context Solution spaces are the set of congurations to b e

searched for solutions at any given time An extensive study of constraint satisfac

tion algorithms has led to the concept of solution steps and these are intro duced

in section Solution steps may have the prop erties of consistency soundness or

completeness asso ciated with them and these prop erties are dened also A satisfac

tion scheme however is not typically a single solution step but is instead a sequence

of solution steps Consequently the notion of a solution process is dened These

also may b e consistent sound or complete and the link b etween individual steps hav

ing a prop erty and a pro cess having a prop erty is a p owerful to ol for categorising a

constraint satisfaction scheme

Section demonstrates the p ower of the framework as it allows the description

of techniques used to improve the p ower of constraint satisfaction such as constraint

priorities backtracking variabledriven and incremental techniques

Section presents conclusions from this chapter

Constraint solution

As dened in section a constraint solver is an algorithm or technique that takes

as input a constraint problem and pro duces as output a set of solutions that satisfy

that constraint problem This set can b e empty consist of one all some or the b est

solution dep ending on the algorithm used

Constraint solvers typically work by searching through a large p ossibly innite

space of p ossible congurations trying to nd sp ecic congurations that satisfy the

Chapter Constraint Satisfaction

constraints The set of congurations b eing explored is usually called the solution

space of the problem

Solution spaces

The purp ose of a constraint solver is to identify a numb er of solutions from within a

much larger set of congurations most of which are not solutions As the constraint

solver progresses it gradually narrows down the set of congurations by eliminating

congurations

The set of congurations at any given p oint in the solution pro cess is the solution

space This is a generalisation of no des in search trees in nite domain problems

and Cspaces in spatial planning problems

Search trees are semigraphical representations of a search algorithm as it ex

amines the p ossible congurations of a nite domain problem The branches of the

tree corresp ond to diering choices of values for variables at that p oint No des cor

resp ond to partial solutions to the constraint problem and are equivalent to a set of

congurations Since innite domain problems will typically not use explicit search

techniques search trees are not appropriate

A conguration space or Cspace is the multidimensional space of p ossible con

gurations of an ob ject Cspaces are of particular interest in spatial planning

problems If an ob ject in a domain is to avoid a set of obstacles then the problem

of nding a p osition for the ob ject reduces to the problem of identifying a p oint

not within any of the pro jections of the ob ject with resp ect to the obstacles into

Cspace

Solution spaces will b e used to describ e the current state of a solution pro cess

Denition Solution space A solution space is a set of congurations

Solution spaces will b e denoted by the symb ol D 

Once a constraint problem is dened there is an initial solution space of all

p ossible congurations

Example Solution space Consider constraint problem G of example

The set of all p ossible congurations of LS LS LS LS LS LS LS

a b a b

LS LS is

a b

4 4 4 2 2

D fLS IR LS IR LS IR LS IR LS IR

a b

2 2 2 2

LS IR LS IR LS IR LS IR g

a b a b

Chapter Constraint Satisfaction

This is the initial solution space of G D represents the three line segments b eing

allowed to take any p osition in the plane Note that since this is the initial solution

space the notation D is used to indicate the solution space at time The

reason for this notation will b ecome clear in section 

As a constraint problem is solved and congurations are eliminated the solution

space shrinks Eventually the constraint solver terminates and outputs a solution

space The contents of this solution space dep end on the constraint solver It

may consist of all one or no solutions It may contain congurations that are not

solutions It may nd no solutions though some exist or it may nd solutions where

none exist

Example Geometric terminal solution space Using a constraint solver

such as DCub ed on problem G would result in a terminal solution space of the

form

D ffLS f g LS f g LS f g

fLS f g LS f g LS f g

a b a

LS f g LS f g LS f gg

b a b

fLS f g LS f g LS f g

LS f g LS f g LS f g

a b a

LS f g LS f g LS f ggg

b a b



The notation D will b e used to denote a terminal solution space in the remainder

of this thesis

A framework for the solution pro cess

As discussed in section constraint solvers convert an initial solution space to a

terminal solution space hop efully consisting of solutions to the constraint problem

Although all constraint solvers work in dierent ways it is p ossible to examine the

inner workings of a variety of constraint solvers and extrap olate common features

to give a framework for describing constraint satisfaction

This section presents the results of such a study Having examined the algorithms

for all of the constraint solvers in chapter it seemed that all of the constraint

Chapter Constraint Satisfaction

solvers studied worked in an incremental fashion gradually rening their knowledge

of the constraint problem until it was p ossible to identify solutions This principle

translates well into the language of solution spaces The framework that was devel

op ed to describ e the constraint satisfaction pro cess allows concrete statements to b e

made not only ab out individual constraint solvers but also ab out the combination

of constraint solvers to handle the general constraint problem

Note that this is very similar to the description of incremental solvers such as

INCES and IGCS Incremental solvers try to reuse as much previous

knowledge of the solution of a constraint problem as p ossible when a new constraint

is added Incremental solvers are discussed as a renement of the satisfaction frame

work in section

This section intro duces the solution step the basic structure in any solution

pro cess Solution processes consist of a series of solution steps combined to gradually

rene the solution space of a problem The denition of solution steps allows a

natural description of the prop erties of consistency soundness and completeness

imp ortant prop erties of constraint solvers

As a solution pro cess is a series of solution steps it is natural to apply the

prop erties of consistency soundness and completeness to solution pro cesses The

link b etween prop erties of solution steps and solution pro cesses forms an imp ortant

to ol in making statements ab out constraint solvers

Solution steps

A solution step is the building blo ck of constraint solvers A solution step takes a

solution space and uses a set of constraints to rene the solution space by eliminating

some congurations

k

Denition Solution step A solution step is a mapping

k

D k D k

where is a set of constraints C C and D i is the solution space of the set

k 1 m

of entities at step i For each step

D k D k 

Chapter Constraint Satisfaction

Example Solution step Consider the rst solution step taken by Kramers

degrees of freedom analysis constraint solver to solve problem G of example

The initial solution space is

4 4 4 2 2

D fLS IR LS IR LS IR LS IR LS IR

a b

2 2 2 2

LS IR LS IR LS IR LS IR g

a b a b

as all three line segments oat freely in space Let the rst solution step b e

LS 1 =0

a

D D

where

4 4 4 2

D fLS IR LS IR LS IR LS f g LS IR

a b

2 2 2 2

LS IR LS IR LS IR LS IR g

a b a b

This solution step can b e read thus

From an initial solution space of D the constraint that one p oint

is xed at the origin is pro cessed and this results in a solution space of

D D can b e interpreted that all three line segments and all six

p oints are free to move in the plane whereas D can b e interpreted so

that one of the p oints is xed at the origin

2

This is a solution step as f g IR and so D D 

Prop erties of solution steps

Constraint solvers are frequently describ ed in terms of prop erties that they have

These prop erties usually describ e the format of the terminal solution space pro duced

by the constraint solver and it is very useful to b e able to say that a solver will

pro duce a terminal solution space with a particular prop erty no matter what problem

is solved Another desirable prop erty is that a constraint solver terminate at all

The most common prop erties desired of constraint solvers are

Consistency The terminal solution space contains a solution to the problem

given if any solution exists

Soundness The terminal solution space consists only of solutions to the prob

lem given

Chapter Constraint Satisfaction

Completeness The terminal solution space contains al l solutions to the prob

lem given

For example numerical solution is not consistent as it may fail to converge to a

solution Many nite domain techniques such as forward checking backtracking or

backmarking search through the entire solution space and are consistent sound

and complete However it is not always obvious whether a particular constraint

solver has any or all of the ab ove prop erties

It is very desirable to b e able to characterise constraint solvers with these prop

erties b oth so that concrete statements can b e made ab out the terminal solution

space found by the constraint solver and also to help categorise combined solvers

Consequently it is imp ortant that the framework for constraint satisfaction b e

able to capture the three prop erties describ ed ab ove This section presents the

formal denitions of consistency soundness and completeness of solution steps

A solution step is consistent if it always retains at least one solution to the prob

lem if any solution exists Solvers such as forward checking or backtracking are

consistent as they search exhaustively for a solution but hillclimbing is not

Hillclimbing is a constraint solution technique that tries to nd solutions using opti

misation techniques Hillclimbing examines the constraint problem and then typi

cally uses the derivatives of the nonlinear equations to identify the most promising

direction for a solution However hillclimbing can get stuck on lo cal minima and

will then not pro ceed to a solution as it do es not think one exists Consequently

hillclimbing is not consistent

k

is lo cally Denition Consistent solution step A solution step

g and consistent if fC C C

k

k k k

m

1 2

D k C C C C C C

k k k k k k

m m

1 2 1 2

That is there is always at least one solution that satises the lo cal set of constraints

k

A solution step is globally consistent if fC C C g and

1 2 r

C C C C C C D k

1 2 r 1 2 r

That is there is always at least one solution that satises the global set of constraints 

Chapter Constraint Satisfaction

In the rest of this thesis the shorthand notation

0 0 0

C C C C C

2 1

k

0

C

represents the intersection of all the constraints in a constraint subset This

intersection represents all the values that satisfy all the constraints in the subset

A solution space D k contains many p ossible solutions of the constraint prob

lem Dep ending on the problem many of these p ossible solutions may b e valid or

very few may b e or none at all Given that D k may b e innite it would not b e

desirable to search through D k to nd all of the valid solutions It is therefore

desirable that the nal solution space D contain only valid solutions This gives

rise to the notion of soundness

k

A solution step is local ly sound if D k contains only valid solutions of

k

in D k A solution step is sound if D k contains only valid solutions of the

constraint problem

k

is lo cally sound if Denition Sound solution step A solution step

g and fC C C

k

k k k

m

1 2

D k C D k

k

That is only lo cal solutions in D k are in D k

k

is globally sound if fC C C g and A solution step

1 2 r

D k C D k

That is only global solutions in D k are in D k 

The prop erty of completeness of a solution step is signicant as it means that

no solutions to the problem have b een lost as a result of the solution step In

some circumstances we may only want one solution to a problem in which case

completeness is not an issue and we need only enforce consistency

k

Denition Complete solution step A solution step is lo cally com

g and plete if fC C C

k

k k k

m

1 2

C D k D k

k

That is all lo cal solutions in D k are in D k

Chapter Constraint Satisfaction

k

is globally complete if fC C C g and A solution step

1 2 r

C D k D k

That is all global solutions in D k are in D k 

LS 1 =0

a

Example Prop erties of solution steps The solution step in ex

ample is lo cally consistent as the constraint LS is satised in D It

a

is also lo cally sound as there are no congurations in D that do not satisfy

LS It is lo cally complete as well as any conguration in D not in D

a

will not satisfy the constraint LS

a

Unfortunately it is much harder to gauge global prop erties of the solution step

for this example Without knowing what the solutions of the problem are it is not

usually p ossible to say in this way whether the solution step is consistent sound or

complete In fact the solutions of G are known They are

ffLS f g LS f g LS f g

LS f g LS f g LS f g

a b a

LS f g LS f g LS f gg

b a b

fLS f g LS f g LS f g

LS f g LS f g LS f g

a b a

LS f g LS f g LS f ggg

b a b

Thus the solution step is in fact globally consistent sound and complete How

ever it is not usually easy to nd al l of the solutions to a problem and consequently

it is not usually p ossible to say whether a solution step has a global prop erty 

Solution pro cesses

A solution process is constructed from a sequence of solution steps A solution

pro cess forms the basis for most constraint satisfaction algorithms

Denition Solution pro cess Given constraint problem P with

a set of entities fx D x D g with domains D D a set of

1 1 n n 1 n

Chapter Constraint Satisfaction

0

constraints on and a solution pro cess is a sequence of mappings

1

D D D D

1 n

2

D

D

such that

is nite

1 2

i j i j i j

i j

S

m

i

i=1



Example Solution pro cess Constraint solvers such as degrees of freedom

analysis DCub ed Erep ICBSM FC MAC are solution pro cesses

For example solving constraint problem G of example using degrees of

Chapter Constraint Satisfaction

freedom analysis may give a solution pro cess of the form b elow

4 4 4 2

D fLS IR LS IR LS IR LS IR

a

2 2 2 2 2

LS IR LS IR LS IR LS IR LS IR g

b a b a b

LS 1 =0

a

4 4 4

D fLS IR LS IR LS IR LS f g

a

2 2 2 2 2

LS IR LS IR LS IR LS IR LS IR g

b a b a b

LS 1 =LS 2

a

b

4 4 4

D fLS IR LS IR LS IR LS f g

a

2 2

LS fx y g LS fx y g LS IR LS IR

b a b a

2

LS IR x y IRg

b

LS 2 =LS 3

a

b

4 4 4

D fLS IR LS IR LS IR LS f g

a

LS fx y g LS fx y g LS fz w g

b a b

2

LS fz w g LS IR x y z w IRg

a b

LS 3 =LS 1

a

b

4 4 4

D fLS IR LS IR LS IR LS f g

a

LS fx y g LS fx y g LS fz w g

b a b

LS fz w g LS f g x y z w IRg

a b

d(LS 1 LS 1 )=3

a

b

4 4 4

D fLS IR LS IR LS IR LS f g

a

LS fx y g LS fx y g LS fz w g

b a b

2 2

LS fz w g LS f g x y z w IR x y g

a b

d(LS 2 LS 2 )=5

a

b

4 4 4

D fLS IR LS IR LS IR LS f g

a

LS fx y g LS fx y g LS fz w g

b a b

2 2

LS fz w g LS f g x y z w IR x y

a b

2 2

x z y w g

d(LS 3 LS 3 )=4

a

b

4 4 4

LS IR LS IR LS f g D fLS IR

a

LS fx y g LS fx y g LS fz w g

b a b

2 2

LS fz w g LS f g x y z w IR x y

a b

2 2 2 2

x z y w z w g

LS 2=(03)

4 4 4

D fLS IR LS IR LS IR LS f g

a

LS f g LS f g LS f g

b a b

LS f g LS f gg

a b

Chapter Constraint Satisfaction

endpoint(LS 1LS 1 )

a

4 4

D fLS f IR IRg LS IR LS IR

LS f g LS f g LS f g

a b a

LS f g LS f g LS f gg

b a b

endpoint(LS 1LS 1 )

b

4 4

D fLS f g LS IR LS IR

LS f g LS f g LS f g

a b a

LS f g LS f g LS f gg

b a b

endpoint(LS 2LS 2 )

a

D fLS f g LS f IR IRg

4

LS IR LS f g LS f g LS f g

a b a

LS f g LS f g LS f gg

b a b

endpoint(LS 2LS 2 )

b

D fLS f g LS f g

4

LS IR LS f g LS f g LS f g

a b a

LS f g LS f g LS f gg

b a b

endpoint(LS 3LS 3 )

a

D fLS f g LS f g

LS f IR IRg LS f g LS f g

a b

LS f g LS f g LS f g

a b a

LS f gg

b

endpoint(LS 3LS 3 )

b

D fLS f g LS f g

LS f g LS f g LS f g

a b

LS f g LS f g LS f g

a b a

LS f gg

b

Note that

D D D D

as required 

Solution pro cesses always head towards a solution

In most cases it is desirable for a solution pro cess to head towards a solution space

that is manageable In terms of dimension this will involve having a solution space

whose dimension is as small as p ossible The actual size of the solution space found

will dep end on the algorithm and problem solved However it is p ossible to prove

that the dimension of a solution space tends to decrease due to a solution step

Chapter Constraint Satisfaction

Lemma proves this

Corollary A B dimA dimB 

Pro of Assume A B then B A C for some C

A B B A C

dimB dimA C

maxdimA dimC

dimA

2

Lemma If there is a solution step

i

D i D i

then

dimD i dimD i



Pro of Immediate since

D i D i dimD i dimD i

2

Solution pro cess prop erties

The denitions for solution prop erties for solution steps given in section do not

necessarily allow corresp onding prop erties to b e inferred ab out solution processes

In fact a solution pro cess can b e interpreted as a single solution step as lemma

demonstrates

Lemma A solution process D D is a single solution step 

Pro of A solution step is a function f such that

D k f D k k

Chapter Constraint Satisfaction

A solution pro cess is a sequence of functions f such that

k

D k f D k k

k k

Thus for solution pro cess

D f D

D f D

1 1

D f D

1 1

For each f create f such that

k

k

f D k f D k

k k

k

Then it is p ossible to redene D so that

D f f f D

1 1

Since a comp osition of functions is a function there exists a function g such that

D g D

It remains only to show that

D D

which follows immediately due to the nature of the solution pro cess 2

Consequently it is natural to wish to ascrib e certain prop erties to solution pro

cesses However since pro cesses can b e interpreted as b oth a single solution step

and as a sequence of solution steps there exist two p ossible ways of dening the

prop erties desired

One metho d is to interpret a solution pro cess as a solution step and this gives

rise to consistency soundness and completeness of solution processes and the cor

resp onding lo cal prop erties

The other metho d is to interpret a solution pro cess as a sequence of solution steps

and examine the prop erties of each solution step in the pro cess This gives rise to

strong consistency strong soundness and strong completeness of solution processes

Chapter Constraint Satisfaction

as well as corresp onding lo cal prop erties

Denition Solution pro cess consistency A solution pro cess is glob

ally consistent i for all constraint problems P

0

D D D

1 n

is consistent where fx D x D g and fC C g That is

1 1 n n 1 r

C C D

A solution pro cess is globally strongly consistent i for all constraint prob

lems P each solution step is consistent

Pro cess is lo cally consistent i for all constraint problems P and subsets

0

D D D

1 n

0

0

is lo cally consistent That is for fC C g and

m

1

C C D

Pro cess is strongly lo cally consistent i for all constraint problems P each

solution step is lo cally consistent 

Denition Solution pro cess soundness A solution pro cess is glob

ally sound i for all constraint problems P

0

D D D

1 n

is sound where fx D x D g and fC C g That is

1 1 n n 1 r

D C D D

1 n

A solution pro cess is globally strongly sound i for all constraint problems

P each solution step is sound

Solution pro cess is lo cally sound i for all constraint problems P and subsets

Chapter Constraint Satisfaction

0

D D D

1 n

0

0

is sound That is fC C g and

m

1

D C D D

1 n

Solution pro cess is strongly lo cally sound i for all constraint problems P each

solution step is lo cally sound 

Denition Solution pro cess completeness A solution pro cess is

globally complete i for all constraint problems P

0

D D D

1 n

is complete where fx D x D g and fC C g That is

1 1 n n 1 r

C D D D

1 n

Solution pro cess is globally strongly complete i for all constraint problems

P each solution step is complete

Solution pro cess is lo cally complete i for all constraint problems P and

subsets

0

D D D

1 n

0

0

C g and is lo cally complete That is fC

m

1

C D D D

1 n

Solution pro cess is strongly lo cally complete i for all constraint problems P

each solution step is lo cally complete 

Example Degrees of freedom analysis The most desirable solution pro

cess would b e one that was consistent sound and complete as the terminal solution

space would consist only of solutions and would contain all solutions However it

is extremely dicult to prove that a pro cess has a prop erty directly Although it

Chapter Constraint Satisfaction

seems likely that degrees of freedom analysis is sound for example there is no easy

way of justifying that statement

On the other hand it is p ossible to examine a single arbitrary solution step In

degrees of freedom analysis for example the solution step

k

D k D k

is always lo cally sound as only solutions to are retained in D k Since an

k

arbitrary solution step is lo cally sound each solution step in a sequence is lo cally

sound Corresp ondingly degrees of freedom analysis is strongly lo cally sound 

Unfortunately without a metho d of linking strong lo cal prop erties to global

prop erties knowing that a pro cess is strongly lo cally sound is not particularly useful

Using lo cal prop erties to draw conclusions ab out pro

cesses

As discussed in section it is desirable to b e able to say whether a solution

pro cess has a certain global prop erty Unfortunately it is not usually p ossible to

make concrete statements ab out global prop erties directly It is however frequently

p ossible to comment on lo cal prop erties of individual solution steps

Theorem provides the link b etween strong lo cal prop erties and global prop

erties Theorem means for example that if a solution pro cess is strongly lo cally

complete then it is globally complete Theorem allows concrete statements to

b e made ab out solution pro cesses

Chapter Constraint Satisfaction

Theorem For solution pro cess

a Strongly Consistent Consistent

b Lo cally Consistent Strongly Lo cally Consistent

Strongly Lo cally Consistent Lo cally Consistent

c Lo cally Consistent Consistent

d Strongly Sound Sound

Sound Strongly Sound

e Lo cally Sound Strongly Lo cally Sound

Strongly Lo cally Sound Lo cally Sound

f Lo cally Sound Sound

g Strongly Complete Complete

h Lo cally Complete Strongly Lo cally Complete

Strongly Lo cally Complete Lo cally Complete

i Lo cally Complete Complete



Pro of Pro of is deferred to app endix C 2

Example Degrees of freedom analysis Since degrees of freedom analysis

is strongly lo cally sound by theorem it is globally sound This means that any

conguration in a terminal solution space found by Degrees of Freedom Analysis is

a solution 

Consequences of the Lo calGlobal Theorem

Theorem forms a signicant contribution to the understanding of constraint

solvers The quality of solution of a constraint pro cess is an imp ortant issue for

designers The three prop erties of consistency soundness and completeness capture

the concepts of a solution only solutions and al l solutions and as such describ e vital

prop erties of constraint solvers

Chapter Constraint Satisfaction

For example if a designer is using a sound constraint solver then they can

guarantee that any results from the solver are solutions to the constraint problem

However if the constraint solver is not consistent then the designer cannot draw

any conclusions from the fact that the solver failed to nd a solution to the problem

Previously it was dicult to b e able to make concrete statements ab out con

straint solvers Statements ab out the prop erties of nite domain constraint solvers

dep ended on b eing able to say that the solver exhaustively searched the solution

space Owen used Galois theory to prove that the DCM algorithm was sound

and complete Theorem allows for signicantly simpler pro ofs of the prop erties

of constraint solvers as demonstrated in example

However the p ower of theorem do es not lie solely in the ability to state

whether simple constraint solvers are consistent sound or complete Hybrid con

straint solvers can also b e studied using theorem and this allows several imp or

tant and interesting conclusions to b e drawn ab out existing hybrid solvers and also

ab out hybrids in general For example INCES IGCS and MechEdit

are not consistent The use of theorem to study hybrid constraint solvers is

discussed in more detail in section

Enrichment of the constraint satisfaction

framework

Although the constraint satisfaction framework in section is rich enough to de

scrib e many constraint solvers there exist some techniques that cannot b e describ ed

using the framework as it stands In fact the techniques of constraint priorities

backtracking variabledriven and incremental satisfaction are p owerful enhance

ments of the general constraint problem The satisfaction frameworks inability to

handle them unaltered should not b e taken as a weakness Just as the denition of

what a constraint problem is must b e enhanced to describ e these cases the basic

satisfaction framework can b e enhanced to describ e all four sp ecial cases and this is

an indication of the p ower of the framework

This section describ es the enhancements that can b e made to the constraint

satisfaction framework in order to incorp orate constraint priorities variabledriven

backtracking and incremental satisfaction

Chapter Constraint Satisfaction

Constraint priorities

Borning et al intro duced the concept of constraint priorities in order to allow

over constrained problems to b e solved Intuitively a strength is asso ciated with each

constraint This strength is an indication of how imp ortant it is that the constraint

b e satised Thus less imp ortant constraints are sacriced and not satised so

that the more imp ortant constraints are satised This is a means of dealing with

problems that are overconstrained

Denition Constraint priority problem Given an ordering

0 1

of strengths a constraint priority problem is a pair where

z

is a set of entities and a set of constraints The set is enhanced so that each

memb er of is a pair C where C is a constraint and f g is the

0 z

strength asso ciated with constraint C



The concept of a solution to a constraint priority problem is somewhat dierent

to the concept given in denition

Denition Solution to a constraint priority problem Given

constraint priority problem

P fx D x D g fC C g

1 1 n n 1 1 m m

dene sets of constraints H as follows

i

H fC j i C g

i j j j j j

H H

i

i

Eectively this gathers the constraints into sets of equal strength Given a com

parator better conguration u is a solution to P i

S fv jC H v C g C H

0 j 0 0 j 0

S fv jv S w S better w v H g

0 0

u S 

Chapter Constraint Satisfaction

The choice of comparator better signicantly aects the solutions to the problem

Borning et al give examples of several such comparators and demonstrate the

dierences in the solution spaces for various problems Consequently this will not b e

gone into in detail here However it is worth noting that constraints with strength

called r eq uir ed in will always b e satised if p ossible

0

Prop osition If p ossible all constraints with priority will b e satised 

0

Pro of Any constraint with priority will b e in the set S By the construction

0 0

of set S any solution to the constraint priority problem must b e in C H and

0

consequently must satisfy all constraints with priority 2

0

The prop erties asso ciated with solution steps and pro cesses are slightly dierent

as it is p ossible for a new constraint to b e pro cessed incrementally and for this to

alter the solution space For example consider the constraint priority problem

P fa IR b IRg fa r eq uir ed b w eak b str ong g The

2

initial solution space is D IR Supp ose that there exists a solution pro cess as

follows

a=2

D D fa fg b IRg

b=2

D fa fg b fgg

b=3

D

Since the strength of the constraint b is greater than the strength of the con

straint b the former should b e satised to the detriment of the latter However

this violates the denition of a solution pro cess as no matter what choice is made

to satisfy b D D

The denitions of solution steps and pro cesses are much the same for constraint

priority problems as dened in section except that prop erty is relaxed as

follows Thus each solution space in a pro cess is only a subset of the initial solution

space and not the previous solution space as nding solutions to a new constraint

may violate previous constraints without upsetting the constraint pro cess

Denition Solution step for constraint priority problems For

k

constraint priority problem P a solution step is a mapping

k

D k D k

Chapter Constraint Satisfaction

where is a set of constraints and D i is the solution space of the set of

k

entities at step i For each step

D k D



For solution step prop erties the comparator better is used to indicate correct

solutions The case of consistent solution steps is presented here sound and complete

solution steps and solution pro cesses are similar

Denition Consistent solution step for set of constraints Given a

solution pro cess for constraint priority problem P with

0

D D D j

1 n



D j

where fC C g with comparator better the solution step

1 1 k k



D j D j

is globally consistent if

S S D j

0



Variabledriven satisfaction

The constraint satisfaction framework presented in section can b e describ ed as

constraintdriven as the solution progresses a set of constraints is chosen to b e

pro cessed to pro duce the next solution space Thus the choice of constraints drives

the solution pro cess However nite domain algorithms such as FC typically work

slightly dierently Finite domain techniques can b e describ ed as variabledriven as

it is the choice of variable to b e pro cessed next that drives the solution pro cess It is

relatively easy to describ e the variabledriven constraint satisfaction pro cess Only

the variabledriven solution step is describ ed here extension to the other structures

of the constraint satisfaction pro cess is trivial

Chapter Constraint Satisfaction

Denition Solution step variabledriven For constraint problem



k

P a variabledriven solution step is a mapping



k

D k D k

where is a set of variables that are instantiated with subsets of their appro

k

priate domains 

In fact variabledriven satisfaction is a subset of constraintdriven satisfaction as

the variable chosen for the variabledriven solution step is instantiated with a value

For example if a variable x in is assigned the set fv g then this is a constraint of

k

the form x v and can easily b e describ ed using a constraintdriven solution step

However the constraints pro cessed in variabledriven satisfaction are not normally

known when the constraint problem is created and are added dynamically as the

constraint problem is solved This means that variabledriven constraint satisfaction

involves some degree of incremental satisfaction see section

Backtracking

Backtracking is a p opular metho d of searching through a solution space Finite

domain constraint solvers use backtracking extensively Backtracking itself is very

simple to describ e but its inclusion in the basic satisfaction framework complicates

descriptions of pro ofs and for this reason it is included here Backtracking involves

undoing a solution step and restoring the previous solution space In some tech

niques such as backjumping it is necessary to jump back several solution steps

Consequently the denition of backtracking allows undoing several steps

Denition Backtracking For constraint problem P with

fx D x D g assume there exists a sequence of solution steps

1 1 n n

1

D D D

1 n

2

D

r

D r

with i r i

Chapter Constraint Satisfaction

(a) (b)

(c) (d)

Figure Solving the queens problem

Then the solution pro cess backtracks by s steps by intro ducing the step

r

r 1

(r s+1)

D r D r s

The pro cess can then pro ceed with a dierent choice of 

r s+1

Example Finite domain backtracking Consider the queens problem

dened in example This involves placing queens on a by chessb oard The

initial solution space D is that none of the queens has b een placed on the

chessb oard A solution step could b e placing the rst queen in the rst column see

gure a

Q1:=1

D D fQ fg Q D Q D Q D g

4 4 4

The next solution step could then involve placing the second queen so that it do es

not attack the rst queen for example in the third column gure b

Q2:=3

D D fQ fg Q fg Q D Q D g

4 4

However it is now not p ossible to place the third queen without attacking any

other queen The solution pro cess has reached a dead end Finite domain search

techniques backtrack at this p oint to a previous state Since there is another choice

Chapter Constraint Satisfaction

for Q there are another two p ossible steps see gure c

Q2:=3

D D

Q2:=4

D fQ fg Q fg Q D Q D g

4 4

There is one p ossible choice for p ositioning Q see gure d

Q3:=3

D D fQ fg Q fg Q fg Q D g

4

However there are no p ositions to place Q without violating the constraints Since

there are no further choices for Q or Q it is necessary to backtrack further

Q3:=3Q2:=4

D D

and pro ceed with another choice of Q Thus the solution pro cess so far is

Q1:=1

D D fQ fg Q D Q D Q D g

4 4 4

Q2:=3

D D fQ fg Q fg Q D Q D g

4 4

Q2:=3

D D

Q2:=4

D fQ fg Q fg Q D Q D g

4 4

Q3:=3

D fQ fg Q fg Q fg Q D g

4

Q3:=3Q2:=4

D



Currently the intro duction of backtracking to a solution pro cess means that

theorem cannot b e applied to the pro cess as D k D k after applying

a backtracking solution step However since all that a backtracking solution step

do es is reintro duce an old solution step it is not hard to see how theorem can

b e generalised to cover backtracking

Incremental satisfaction

Many constraint solvers use an incremental paradigm to improve eciency such

as The incremental paradigm means that as new constraints are

added they are solved immediately rather than waiting for the whole constraint

Chapter Constraint Satisfaction

problem to b e dened and then solved The solution pro cess framework presented

ab ove easily captures the concept of incremental addition of constraints as this is

an integral part of the framework As each constraint is added the next solution

step is to pro cess the newly added constraint to nd the next solution space Thus

constraint C is added incrementally to constraint problem P

D D k

C

D k

and constraint problem P C is formed

Adding a new entity E is slightly more complex as this will aect the rest of

the constraint problem and the solution spaces The constraint problem is altered

so that the new entity is added to to give E Since constraints are

already dened as enhanced constraints with resp ect to section the new set

of constraints is given by

fC D jC g

E

These changes b ecome part of the solution pro cess so that when a new entity is

added to the constraint problem a new solution space is calculated to take into

account the new entity

E

D k D k D k D

E

Example Incremental geometric constraint satisfaction Consider

solving problem G of example In an incremental solver such as ICBSM

the initial constraint problem would b e an empty set and constraints and entities

would b e added to it Thus the initial problem P and the initial solution

1

space D If line segment LS is added to the problem then P fLS g

2

4

and solution space D D fLS IR g

LS 1

Chapter Constraint Satisfaction

A p ossible solution pro cess then would b e of the form

LS 1

4

D D fLS IR g

LS 2

4 4

D fLS IR LS IR g

LS 1 =0

a

4

D fLS f IR IRg LS IR g

LS 1 =LS 2

a

b

D fLS f x y g LS fx y IR IRg

x y IR g

LS 3

D fLS f x y g LS fx y IR IRg

4

LS IR x y IRg

LS 2 =LS 3

a

b

D fLS f x y g LS fx y z w g

LS fz w IR IRg x y z w IR g



Conclusions

This chapter has presented a formal abstraction of the constraint satisfaction pro

cess This abstraction is suciently rich to describ e all of the constraint solvers

describ ed in chapter The concept of solution spaces was intro duced Solution

spaces consist of the set of p ossible congurations of a constraint problem under

consideration at a particular time Solution spaces are equivalent to the search

spaces used in nite domain constraint satisfaction and the conguration

spaces used in spatial planning

Extensive study of the constraint solution algorithms of chapter led to com

monalities of their approaches All of the constraint algorithms studied gradually

rene an initial solution space consisting of all the p ossible congurations in the

constraint problem using solution steps until a terminal solution space is reached

The terminal solution space then consists of a numb er of congurations that may or

may not b e solutions The sequence of solution steps transforming an initial solution

space to a terminal solution space is a solution process

The quality of the terminal solution space is critical for a constraint solver It

is not hard to identify constraint pro cesses that will work eciently but do not

nd solutions to the constraint problem In such cases the terminal solution space

consists of congurations that are not solutions to the constraint problem The most

Chapter Constraint Satisfaction

imp ortant prop erties of solution spaces are to know whether they contain a solution

whether they contain only solutions and whether they contain al l of the solutions

A consistent solution step ensures that the solution space contains a solution if

one exists A sound solution step ensures that the solution space contains only solu

tions A complete solution step ensures that the solution step contains al l solutions

to the constraint problem

However a constraint pro cess consists of a numb er of solution steps It was by

no means certain that b ecause one solution step has a prop erty then the solution

pro cess has that prop erty It was not even certain that if al l solution steps in the

pro cess have a prop erty then the solution pro cess has that prop erty Consequently

the prop erties of solution pro cesses were examined

Theorem can b e used to identify prop erties of constraint pro cesses given

prop erties of solution steps The key results of theorem are that

Even if every solution step retains a lo cal solution to the current set of con

straints the terminal solution space may not have a solution to the whole

constraint problem even though many may exist

If every solution step retains only solutions to the current set of constraints

then the terminal solution space will consist only of solutions to the whole

constraint problem

If every solution step retains al l of the solutions to the current set of con

straints then the terminal solution space will contain al l of the solutions to

the whole constraint problem

Theorem is a signicant and p owerful to ol in describing the quality of results

of a constraint pro cess However note that theorem cannot b e used to describ e

constraint priority and backtracking solvers directly as these solvers do not have to

satisfy all of the constraints they imp ose

The descriptive p ower of the framework is apparent as it can b e used to de

scrib e a numb er of p owerful enhancements of the basic constraint denition and

satisfaction mo dels Using the framework presented in this chapter it is p ossible to

describ e backtracking constraint priority problems incremental constraint solution

and variabledriven constraint solution The framework also makes transparent the

similarities and common elements b etween constraint solvers

With the abstraction built up over the past four chapters it is now p ossible to

study in detail the use of domain sp ecic knowledge in constraint solvers and also

Chapter Constraint Satisfaction

the use of hybrid constraint solvers In particular theorem develop ed in this

chapter allows concrete statements to b e made ab out the nature of hybrid constraint

solvers that were not previously p ossible

Chapter

Hybrid Collab oration in

Constraint Solvers

As mentioned in chapter one of the purp oses of this thesis is to investigate the

use of a hybrid of domain sp ecic constraint solvers to solve complex engineering

design constraint problems eciently on a computer

A hybrid constraint solver is a constraint solver that employs more than one

metho d to solve a constraint problem The strategy of a hybrid is usually to decom

p ose a problem into a numb er of smaller subproblems and then apply the various

solution metho ds to solve the subproblems Using solutions to the subproblems

solutions to the original constraint problem can b e found

Hybrid constraint solvers are a particular example of the divideandconquer

strategy frequently employed in Computer Science There are many advantages to

using hybrids including sp eeding up solution increasing the numb er of constraint

problems that can b e solved and making more exible constraint solvers

Nonhybrid constraint solvers include ICBSM Grobner basis and Newton

Raphson solvers Hybrid constraint solvers include DCM Connectivity Analysis

Erep MechEdit INCES and IGCS

DCM Connectivity Analysis and Erep use very small sp ecialised solvers to

handle the subproblems created Most of the work done in these algorithms go es

into the decomp osition strategy that identies the subproblems On the other hand

MechEdit INCES and IGCS use fairly simple decomp osition techniques to identify

large subproblems that are then handled by complex constraint solvers

For example DCM reduces a geometric constraint problem to a numb er of tri

angular subproblems consisting of lines and p oints xed by three constraints Very

simple and fast routines are used to nd the solutions to each triangular subproblem

Chapter Hybrid Collab oration

Most of the eort in DCM go es into identifying the subproblems in the rst place

The decomp osition strategy used by INCES is to determine cyclic and acyclic

subproblems of the constraint problem Acyclic subproblems are solved using a

lo cal propagation constraint solver whereas cyclic subproblems are solved using a

sp ecialised simultaneous equation solver typically NewtonRaphson

Although hybrids are extensively used in the literature they are rarely identied

as such This chapter uses the framework built up over the previous four chapters

to investigate hybrids and study the key asp ects of hybrid constraint solvers

Using the description of the constraint solution framework in chapter hybrid

constraint solvers work along the following lines

Decomp ose a constraint problem into a numb er of subproblems

Order the subproblems

Solve the subproblems in order and recombine solutions to the subproblems

into solutions to the original problem

This chapter concentrates on the pro cess of solving constraint problems using hybrid

constraint solvers and then recombining solutions Eric Monfroy has studied means

of combining constraint solvers and he has created the BALI framework for

describing solver collab orations

BALI has b een adapted for use in this chapter as a means of formalising the way

in which a hybrid constraint solver solves subproblems and recombines solutions

to the subproblems BALI is a particular means of describing this relation It is

primarily useful b ecause it makes explicit the typ es of collab oration available and

the way they interact

It is assumed for the purp oses of this chapter that decomp osition and ordering

strategies already exist This chapter is primarily concerned with metho ds of solv

ing subproblems and recombining solutions Decomp osition strategies and ordering

strategies are covered in more detail in chapter

Section discusses using domain sp ecic knowledge in constraint solution and

uses the particular example of geometric reasoning to show why domain sp ecic

knowledge helps to create ecient constraint solvers

Section discusses hybrid constraint solvers Hybrid constraint solvers are the

combination of more than one constraint solver acting together Hybrid solvers can

p otentially b e used to solve problems that cannot typically b e handled eciently

by other solvers There is very little on hybrid solvers in the research literature

Chapter Hybrid Collab oration

Monfroy has develop ed a framework called BALI which is discussed and adapted

to pro duce a description of hybrid constraint solvers that decomp ose constraint

problems

Section presents an example demonstrating the p ower of a hybrid constraint

solver constructed from two domain sp ecic solvers develop ed at Leeds This simple

study of an internal combustion engine demonstrates the feasibility of combining

domain sp ecic constraint solvers and gives some empirical evidence that the hybrid

solver is as hop ed very ecient

Section discusses the paradigms for collab oration intro duced by Monfroy

These are serial parallel and concurrent collab oration The serial paradigm is de

scrib ed using the constraint satisfaction abstraction and the pros and cons of the

paradigm are discussed in detail App endix E debates the parallel and concurrent

collab oration approaches

Section intro duces the solver collab oration language used by Monfroy in

BALI The collab oration language is extended so that decomp osition strategies can

b e used by the hybrid and a new op eration the conditional branch is intro duced so

that dierent solver expressions can b e used dep ending on the result of a test

Section presents an example demonstrating the asymptotic b ehaviour of the

hybrid system develop ed in section This involves using the serial collab oration

paradigm to combine many instances of the two domain sp ecic solvers together

When these failings are addressed and handled empirical evidence obtained from

the case studies indicate that the hybrid solver is very fast when compared to other

solvers

Section draws conclusions from this chapter

Using domain sp ecic knowledge in

constraint solvers

Using knowledge that is implicit in a problem is a common way of eciently solving

that problem For example supp ose one wishes to nd the word toadsto ol in a

dictionary If one op ens the dictionary at a page with the word mushro om in it

then one can use ones implicit knowledge of the alphab et and dictionaries to reason

that toadsto ol is probably after mushro om in the dictionary This is not usually

actually stated but the implicit knowledge is used to direct the search

Many constraint solvers use domain sp ecic knowledge to help aid solution For

Chapter Hybrid Collab oration

example FC uses domain sp ecic knowledge of the nature of nite domains and

that a failed partial instantiation implies a failed full instantiation ICBSM

and Degrees of Freedom Analysis use the implicit knowledge that rigid b o dies

can only translate and rotate in space In this thesis solvers that take advantage

of implicit knowledge are called domain specic Solvers that do not are called

domain general

A domain general solver may use for example numerical solution General

solvers are typically more expressive than domain sp ecic solvers Numerical solu

tion of linear and nonlinear equations though sub ject to convergence and numerical

conditioning restrictions is nevertheless capable of nding a solution to a much

wider variety of problems than say a solver that uses implicit geometric knowledge

on geometric constraint problems

However there are four chief disadvantages to numerical solution

Convergence Numerical solvers are not robust in the sense that they can

fail to converge to a solution when one exists They also suer from numerical

conditioning problems and the use of oating p oint arithmetic leads to nu

merical accuracy problems These problems can b e addressed at a considerable

cost in computational eort

Multiple ro ots Numerical solvers typically only nd one solution at a time to

a problem Users frequently wish to lo ok through all of the solutions in order

to identify the most desirable Erep is an excellent example of a solver

that allows multiple ro ots and solutions Numerical solvers can b e adjusted

to nd more than one ro ot but it would b e very dicult to create an algorithm

that could guarantee to nd all ro ots due to convergence diculties see

pp unless the constraint problem consists of p olynomials

2

Eciency Generally sp eaking numerical solution is On complexity where

n is the numb er of constraints whilst domain sp ecic solvers are faster fre

quently On complexity For example NAGs CNBC function can b e con

2

sidered typical for our purp oses and is n The use of exact arithmetic

to counter the inaccuracies resulting from oating p oint arithmetic will result

in an increase in the complexity of the numerical solver

Unintuitive Numerical solvers may converge to a ro ot but it may not b e the

exp ected solution to the problem

Chapter Hybrid Collab oration

AB

Figure Two Blo cks with an Against Constraint

The third criterion is of great interest if ecient general purp ose solvers are to

b e constructed In particular this thesis concentrates on the solution of engineering

constraint problems that are to b e solved quickly and the results presented in real

time Because of this domain sp ecic solvers are very imp ortant Domain general

solvers are still imp ortant as a fal lback p osition

Example Geometric constraint solvers Solvers that take advantage of

1

the nature of rigid b o dies and Euclidean space such as are do

main sp ecic Typically problems are describ ed in terms of geometric entities and

constraints

For example consider two blo cks A and B with an against constraint so that

the blo cks remain in contact gure Blo cks A and B are rigid b o dies and as

such have the following implicit knowledge asso ciated with them

The size of A or B cannot b e altered

A and B can translate in X Y Z directions

A and B can rotate ab out the X Y Z axes

A and B have no other allowable congurations

It is the use of this implicit knowledge that marks out a domain sp ecic solver

Degrees of freedom analysis ICBSM and IGCS make use of this

knowledge to convert a complex nonlinear continuous domain problem into a com

pact discrete problem Erep and DCub ed also take advantage of this

information though in a dierent way 

Using domain sp ecic knowledge is fast

Numerical solution to the problem in gure is p ossible as the constraint is simple

to describ e as an equation the distance b etween A and B is and they have the

same orientation However the implicit geometric knowledge is lost in making this

1

The restriction to rigid b o dies is not always necessary see Kramers GCE for example

but for the purp oses of this example only rigid b o dies are allowed for simplicity

Chapter Hybrid Collab oration

AAA1 2 3 An-1 An

A0

Figure A Chain of Blo cks with Against Constraints

step Domain sp ecic solvers can use the implicit geometric knowledge and are

typically much faster and more robust but are restricted to a smaller variety of

problems than general solvers

Example Solution of blo cks Consider a long chain of blo cks joined by

against constraints gure

2

Commonly used numerical techniques would solve this problem in n time

where n is the numb er of constraints in the constraint problem Kramers

action analysis uses lo cal propagation to nd the p ositions of the blo cks Action

analysis is a domain sp ecic solver as it uses the geometric knowledge of the p ossible

p ositions and orientations of the blo cks in order to p osition them Action analysis

can nd p ositions for the blo cks in linear time On top of this adding a new

constraint in degrees of freedom analysis can b e an O op eration provided certain

conditions hold The incremental addition of blo ck A to the chain for example

n+1

would involve only satisfying ag ainstA A in O time 

n n+1

Using domain sp ecic knowledge is not enough

Domain sp ecic constraint solvers are very imp ortant as they are fast However

they are not usually expressive in the sense that they are restricted to a relatively

small class of problems with sp ecic structures For example action analysis cannot

solve the simple example b elow

Example Coincident ro ds Consider two ro ds grounded at p oints G and

1

G resp ectively gure If coincident constraints are placed on the two opp osite

2

endp oints A and B then there are two p ossible congurations of the ro ds that

satisfy that constraint However knowing that either ro d can rotate ab out their

grounded endp oint is not enough to allow calculation of those two p ositions For

example line can rotate through radians and not have A coincident with B

The problem must b e solved simultaneously in order to nd the two p ositions Line

is rotated a little bit and line a little bit in order to solve the constraint

In fact this example shows a problem with most constraint solvers Fast algo

rithms can b e develop ed for simple cases such as action analysis lo cal propagation

Chapter Hybrid Collab oration

A B

P 1 1 2

G G 1 2

P

2

Figure Two Ro ds

or triangular form More complex problems must usually b e solved simultaneously

and this is much less ecient and in general harder 

Kramer had to enhance action analysis with locus analysis in order to solve

problems such as in the ab ove example Both action analysis and lo cus analysis are

domain specic but neither is eective on its own Action analysis cannot solve

problems simultaneously whilst lo cus analysis must deal with the lo ci of ob jects

which may b e complicated and timeconsuming

Hybrid constraint solvers

A constraint solver that consists of two or more constituent solvers acting together

is called a hybrid solver This section studies the underlying structure of hybrid

solvers Using the framework of chapter it is p ossible to describ e hybrid solvers

in a simple and elegant manner and to draw conclusions ab out prop erties of hybrid

solvers

This section discusses hybrid solvers in terms of the framework and compares

this approach with that of Monfroy The example b elow intro duces the concept of

hybrid constraint solvers

Example Geometric constraint problem At the University of Leeds two

constraint solvers have b een develop ed indep endently INCES was develop ed

by Lamounier et al and is capable of nding a solution to a system of equations

though it is most ecient at nding solutions to a triangular system of equations

IGCS was develop ed by Tsai et al and is capable of nding all solutions to a

geometric constraint problem though it is b est suited to problems without cycles

Chapter Hybrid Collab oration

LS2 LS1 LS2

m l LS2 LS1 LS1 LS3a

n

LS3

LS3b

Figure Problem G

A hybrid of these two solvers would hop efully b e able to solve any system of

equations and any geometric problem that can b e solved by INCES and IGCS indi

vidually However the hybrid should also b e capable of solving a constraint problem

that contains b oth variables and geometric entities and b oth equations and geomet

ric constraints

Consider for example a mo died version of problem G of example as de

picted in gure

4 4 4 2 2 2

G fLS IR LS IR LS IR LS IR LS IR LS IR

a b a

2 2 2

LS IR LS IR LS IR l IR m IR n IRg

b a b

fLS LS LS LS LS LS LS

a b a b a b a

dLS LS l dLS LS m dLS LS n

a b a b a b

endpointLS LS endpointLS LS

a b

endpointLS LS endpointLS LS

a b

endpointLS LS endpointLS LS g

a b

and the simple system of equations

2 2 2

E fl IR m IR n IRg fl n m l m m n g

In words G consists of three line segments and six p oints in D space The rst

constraint xes a p oint at the origin The next three constraints make three pairs

of p oints coincident The next three constraints set the lengths of the three line

segments and the nal six constraints asso ciate p oints with the ends of the line

segments E uses a system of equations to x the variables that describ e the

Chapter Hybrid Collab oration

(0,3)

LS2 LS1

LS3 (4,0)

Figure A solution to constraint problem G of example

lengths of the line segments in G

IGCS can nd an underconstrained solution space for G but this solution space

is not particularly useful as it is simply the set of all triangles with one vertex at

the origin see gure for one such solution INCES can nd all of the solutions

to E but on their own these are not particularly useful either

However consider the combined problem

H E G

4 4 4 2 2 2

fLS IR LS IR LS IR LS IR LS IR LS IR

a b a

2 2 2

LS IR LS IR LS IR l IR m IR n IRg

b a b

fLS LS LS LS LS LS LS

a b a b a b a

dLS LS l dLS LS m dLS LS n

a b a b a b

endpointLS LS endpointLS LS

a b

endpointLS LS endpointLS LS

a b

endpointLS LS endpointLS LS

a b

2 2 2

l n m l m m n g

IGCS cannot nd solutions to H as it cannot solve the set of equations which are

from E INCES can solve H but only by converting the geometric constraints in

G into equations losing all domainsp ecic knowledge in the pro cess However if

INCES is used to nd all solutions of E then the values of l m n found could b e

Chapter Hybrid Collab oration

8

LS1a = LS1b = LS2 = LS3a LS2a = b LS3b

(0,0)

Figure Solutions of constraint problem G with l m n

used by IGCS to solve G

In this case INCES would nd the following solutions to E

fl fg m fg n fgg or fl fg m fg n fgg

Using either of these solutions IGCS can solve G when l m and n are instantiated

to the values in the solutions Solving for the rst solution gives the same solutions

as problem G Using the second solution results in a degenerate case for G with

solutions as shown in gure For this problem the hybrid has found all solutions

to the combined problem H eciently where the constituent solvers were either

not expressive enough or would b e much slower 

In this example the combined problem H was split into two subproblems G

and E by manual insp ection In general the decomp osition of a constraint problem

is a nontrivial task However decomp osition of a problem to subproblems is one of

the most imp ortant issues that a hybrid will face This chapter do es not discuss the

decomp osition issue but assumes that decomp osition of the constraint problem has

already taken place Chapter deals with decomp osition techniques in more detail

In a similar vein in general recombination of the solutions to subproblems is also

a dicult task In the ab ove example there were only two solutions to E Both

solutions could b e studied by using them as input to problem G and then solving

G In general there may b e an innite numb er of solutions to a problem or it may

Chapter Hybrid Collab oration

not b e p ossible to use solutions as input to another problem The recombination

problem dep ends on the hybrid collab oration used and this is discussed in more

detail in section

BALI

Monfroy has studied the problem of hybrid solvers for continuous domain constraint

problems This has resulted in an environment called BALI for describing solver

collab orations Monfroy denes solver collab oration as either combination or

co op eration Solver combination fo cuses on a solver for the union of constraint

problems that is a solver combination of two solvers op erates on mixtures of the

constraint problems the solvers individually op erate on Solver co op eration concen

trates on communications problems b etween solvers on a single domain but dealing

with dierent sets of constraints

Monfroy denes constraint systems as a language for describing constraint prob

lems A constraint system consists of a quadruple D V where

is the set of symb ols in the language

D is the domain of the union of all the domains of the symb ols in

V is the set of variables in the language

is the set of constraints in the language consisting of all p ossible

y y

quantier free rst order formulae built over and V

A solver in Monfroys notation is a function

n

S such that

n

c D j S c D j c

n n+1 n

and c n N S c S c

The notation D j S c is used to represent S c b eing a valid solution in D Thus

a solver is a function which pro duces a valid solution terminates and has a xed

n

p oint at S c

The denition of a solver is interpreted thus

A solver S is a function that maps a conjunction of constraints to a

single constraint such that for all conjunctions of constraints if S c is a

Chapter Hybrid Collab oration

valid solution to the conjunction of constraints then so is c Also there

exists a numb er n N such that if the solver S is applied n times to c

then the result is the same as if S were applied n times Consequently

no renement is achieved by applying S more than n times and so S

n

terminates when applied n times and S c is a xed p oint of S

A constraint C in Monfroys denition is reduced to a simpler constraint by

the application of a constraint solver However Monfroys constraints are the con

junction of a numb er of formulae In the terms of this thesis a single constraint of

Monfroy is equivalent to the set of constraints in a constraint problem

Under denition a constraint solver do es not transform a set of constraints

to a simpler set but instead transforms a solution space to a simpler solution space

Since a conjunction of constraints is equivalent to a solution space Monfroys de

nition of a comp onent solver is equivalent to the following

Denition Comp onent solvers A comp onent solver is a function S

S D k D k

such that

n

C D k D D k D



The denition of a constraint pro cess in chapter do es not enforce the termi

nation or xed p oint conditions of Monfroys constraint solvers explicitly However

since the set of constraints in the pro cess is nite and since each is pairwise

i

disjoint the numb er of steps in a solution pro cess is nite and the solver will always

terminate if each step takes a nite amount of time

Further application of solution pro cesses to the terminal solution space D

will not rene D any further Consequently D represents the xed p oint of

the solution pro cess The denitions of constraint solvers are therefore equivalent

Note however that Monfroy do es not discuss the structure of the solution space

The advantage of the solution framework develop ed in chapters and is that

the nature of the solution space can b e investigated and conclusions drawn from it

Monfroy also forces the output of a constraint solver to b e smaller in the

following sense taken from

Chapter Hybrid Collab oration

b o ok Bo okCo de Author Title Price

Dante Inferno

Joyce Ulysses

Tolstoy War and Peace

Greene The Third Man

sale Salesman Bo okCo de Quantity

Jones

Smith

Robinson

Smith

Table Two database tables from

b o ok 1 sale Bo okCo de Author Title Price Salesman Qty

Tolstoy War and Peace Jones

Greene The Third Man Smith

Greene The Third Man Robinson

Tolstoy War and Peace Smith

Table The result of joining the book and sales tables from

Denition Comp onent solver ordering Let S b e a comp onent solver on

the constraint system CS D V Then the relation is dened on CS as

S

n

follows C C if n N st C S C 

1 S 2 1 2

Given the denition of comp onent solvers ab ove in the terms of this thesis it is

obvious that the relation used on solution spaces is a ordering

S

Monfroy also identies the need to enrich constraint problems so that solvers

designed for simpler problems can b e applied to problems designed for hybrid solvers

without losing any solutions This concept is signicant in terms of the framework

outlined in this thesis and so is adapted in the next section

Enhanced solution spaces

In relational algebra it is sometimes necessary to form queries on ob jects that are

spread over two tables In order to satisfy this query the two tables are joined

together and the query acts on the merged table For example given the two tables

in table the join of the two tables is table

Chapter Hybrid Collab oration

Similarly given two constituent constraint solvers and solving constraint

problems P and P resp ectively the hybrid of and

1 1 1 2 2 2

op erates on P P P It is useful to b e able to talk ab out

3 1 2 1 2 1 2

the solution space of P

3

If is empty then P and P are unrelated and can b e solved separately

1 2 1 2

In this case there is no diculty in using a hybrid constraint solver to deal with P

3

However if is nonempty then P and P share common entities In this

1 2 1 2

case the solution space of P is not simple

3

For example supp ose that P fx f g y f gg P

1 1 1 2 2

fy f g f gg Then the solution space of P D P is

2 1 1

f g f g

and the solution space of P D P is

2 2

f g f g

Here fy f gg The solution space of P is therefore not D P D P

1 2 3 1 2

as might b e exp ected Instead it is f g f g f g

Given and the solution space of P is called the enhanced solution space of

1 2 3

 

1 2

with respect to denoted in this thesis as D j The enhanced solution

1 2 

1

space is dened in app endix D Enhanced solution spaces and emb edded solution

spaces which are also dened in app endix D are useful as they allow discussion

of the structure of solution spaces used in hybrid constraint solvers Emb edded

solution spaces are denoted as D j For simplicity however the precise

  

1 2 1

denition is left to the app endix

A simple example hybrid constraint solver

A simple hybrid solver based on two existing solvers at the University of Leeds was

constructed in order to study the interaction and communication necessary for the

solvers to work in concert and also as an exemplar case study to show some of the

b enets of a hybrid of domain sp ecic solvers

The two solvers combined were INCES and IGCS INCES is a domain

sp ecic solver for linear triangular equations b etween entities in the real domain

IGCS is a domain sp ecic solver for simple geometric ob jects in two dimensions

In his thesis Lamounier describ ed the implementation of an internal com

Chapter Hybrid Collab oration

bustion engine in INCES The internal combustion engine contained some geometric

constraints describing the geometric structure of the engine and some algebraic con

straints describing the op eration of the engine However the geometric part of

the problem had to b e converted into algebraic equations in order to b e solved by

INCES Unfortunately this meant that INCES did not take advantage of the domain

sp ecic knowledge incorp orated into the geometric problem This made b oth the

interactive manipulation of the entities dicult and solution of the combined prob

lem dep endent on the sp eed of INCES at solving geometric constraints converted

into quadratic equations IGCS could have handled the geometric problem quickly

and intuitively

A simple solution to this problem presented itself This was to construct a hybrid

of IGCS and INCES which allowed direct manipulation of the geometric problem

through IGCS and communicated values of entities in b oth problems b etween the

two solvers

In the following example the notation x y z is used to describ e the degrees

of freedom available for a geometric entity The x comp onent refers to the numb er

of rotational degrees of freedom y to the numb er of scalar dimensional degrees

of freedom and z to the numb er of translational degrees of freedom This notation

is used so that the geometric solver IGCS can take advantage of this information

2 2

is free to move ab out the plane IR and has a domain of IR Thus a p oint cr ank

However the p oint has only two translation degrees of freedom and no rotational or

scalar degrees of freedom Consequently the domain of the p oint can b e describ ed as

representing rotational degrees of freedom scalar degrees of freedom and

translational degrees of freedom For simplicity all of the geometric ob jects in the

following case study are p oints For this case study let P b e

g eom g eom g eom

the geometric constraint problem in gure The set describ es the entities

g eom

in the problem where

cr ank connecting r od fcr ank

g eom

connecting r od piston piston

f r ame a IR r IRg f r ame

Chapter Hybrid Collab oration

The set describ es the constraints in the problem where

g eom

fcr ank

g eom

cr ank connecting r od

connecting r od piston

f r ame piston

distancecr ank cr ank a

f r ame distancef r ame

r od connecting r od distanceconnecting

piston r g distancepiston

Connecting Rod Frame a r

Crank Piston

Figure The Internal Combustion Engine

The piston and frame are assumed to b e of constant shap e and length for this

case study and so can b e represented by line segments

Chapter Hybrid Collab oration

One solution P for a,r solutions for lines alg INCES IGCS P using allowable

geom motion

Figure A Serial Hybrid of INCES and IGCS

Let P b e the asso ciated algebraic constraint problem where

al g al g al g

fpow er IR IR displ acement IR c r atio IR

al g

g ap IR a IR IR r IR n IRg top

fpow er displ acement c r atio

al g

top g ap

r atio c

top g ap

2

displ acement r n

pow er

g ap top

displ acement

n

g

r atio In is a constant used in the computation of the engine p ower c

al g

is the approximate ratio b etween the maximal and minimal pressures during the

compression part of the cycle displ acement is the volume of mixed air and fuel

consumed p er engine cycle a is the length of the rotary part of the crankshaft

g ap is the length of the minimal distance b etween the top of the cylinder and top

the piston top during the cycle n is the numb er of engine cylinders and r is the

radius of the engines cylinders

Communication b etween the two solvers dep ends on the common entities

g eom

fa IR r IRg Since P has three equations in three unknowns it is well

al g al g

constrained and there are a nite numb er of solutions for a and r in fact only one

Consequently a hybrid was constructed that solved P using INCES rst and then

al g

used the values of a and r found to solve P using IGCS see gure

g eom

Note that go o d use is made of the domain sp ecic knowledge of the two constraint

problems so that domain sp ecic solvers are used to b est eect Note also that the

fact that P was wellconstrained was used to decide the order in which P and

al g al g

Chapter Hybrid Collab oration

Hybrid INCES NAG Grobner basis

s s s s

Table Results for Solving ICE engine times on an SGI Indy

P were solved

g eom

In general determining whether a particular subproblem is wellconstrained or

not is dicult In particular determining the constrainedness of a subproblem will

typically involve decomp osing the subproblem to such an extent that it is already

solved defeating the purp ose of determining the constrainedness Latham and Mid

dleditchs Connectivity Analysis determines the constrainedness of subproblems

by decomp osing to residual sets However the residual sets are suciently small that

they are simple to solve Consequently most of the work has gone into decomp osing

the constraint problem to determine the constrainedness Using constrainedness as

a guide to determining in which order subproblems should b e solved is therefore

counterpro ductive This issue is dealt with in more detail in chapter

The hybrid was constructed and solution timed on a Silicon Graphics Indy ma

chine The hybrid was compared with INCES a numerical solver from NAG and

a Grobner basis package within Maple See table for the results of running

the exp eriments Although the hybrid is in fact an order of magnitude faster than

the other constraint solvers and a thousand times as fast as the Grobner basis no

rm conclusion should b e drawn from this table as timing is highly dep endent on

algorithm compiler and system use at the time

However the numerical algorithm used NAGs CNBC is probably one of the

fastest available and it is relevant that an optimised numerical algorithm a domain

general constraint solver takes a hundred times as long as the simple hybrid

These results corresp ond to what one would exp ect Grobner basis algorithms

2

are very slow with an exp onential complexity The NAG algorithm is n INCES

uses the NAG algorithm on cyclic subproblems but a linear algorithm for acyclic

2

subproblems Consequently the worst case complexity for INCES is On but the

average case complexity is less than this Similarly the hybrid has worst case com

2

plexity On but has average case complexity less than INCES This corresp onds

to table

Chapter Hybrid Collab oration

(Φ , Ψ ) (Φ , Ψ ) (Φ , Ψ ) 1 1 Solutions 2 2 Solutions

D(0) Solver 1 D(1) Solver 2

Figure Sequential Collab oration

Constraint Triangular Solutions Cyclic Solutions Problem D(0) INCES D(1) NAG

Subproblem Subproblem

Figure INCES as a sequential hybrid

Paradigms of collab oration

Monfroy cites three paradigms of collab oration that can b e used to construct

hybrid solvers sequential parallel and concurrent In fact these paradigms follow

naturally from the satisfaction framework presented in this thesis In this section

the sequential paradigm is discussed in detail in terms of the constraint satisfac

tion framework The advantages and disadvantages of the paradigm are discussed

particularly in terms of practical issues

The parallel and concurrent collab orative paradigms are presented in app endix E

Sequential hybrids

The most obvious collab oration paradigm is sequential In this case solvers op erate

on the solution space pro duced by the preceding solver Since solution pro cesses can

b e describ ed as solution steps lemma sequential collab oration is the solution

pro cess formed by using constituent solvers as solution steps see gure

Theorem applies directly to sequential hybrids Consequently even if all

constituent solvers in a sequential hybrid are lo cally consistent then the hybrid is

not necessarily consistent If all constituent solvers are complete sound then the

hybrid is complete sound

This is particularly signicant for most current sequential hybrids For example

INCES solves linear triangular algebraic constraint problems However when

INCES comes across equations that must b e solved simultaneously it resorts to

numerical solution of the simultaneous equations Thus INCES is a sequential

hybrid of the form in gure

However numerical solution is not globally consistent Convergence problems

mean that numerical solution is not robust and sometimes the solver will not nd

a solution even if one exists Since the numerical subsolver used by INCES is not

globally consistent by theorem the hybrid is not globally consistent It is also

Chapter Hybrid Collab oration

signicant that numerical solution may converge to a solution but that this may not

b e the right solution for the rest of the problem

Example Sequential hybrid inconsistency For example consider the se

quential hybrid of gure INCES Let P b e the constraint problem P

where and are as dened b elow

fa IR b IR c IR d IR e IRg

2 2 4 4

fa b c a b c d d b e e g

INCES will solve P by rst creating an Equation Graph describing the problem

Study of the Equation Graph results in INCES solving the triangular problem P

1

fc IR d IRg fc d d g rst to give solution d fg c fg

2 2 4 4

INCES cannot solve the problem P fa IR b IRg fa b a b g

2

using lo cal propagation and so resorts to numerical solution There are actually four

solutions to P

1

fa fg b fgg fa fg b fgg

fa fg b fgg fa fg b fgg

However numerical solution will only nd one The solution found dep ends on

the precise numerical technique used and the initial starting p oint Let us assume

that the solution found is fa fg b fgg The remainder of P to b e solved is

now triangular and is equivalent to P fe IRg f e e g which is

3

inconsistent

However if the numerical solver had found solution fa fg b fgg or

solution fa fg b fgg then a consistent solution to P could have b een

found This problem arises b ecause the numerical solver is not globally consistent

nor is it lo cally complete 

Similarly IGCS is not consistent IGCS consists of a numb er of dierent

algorithms for dealing with certain situations For example IGCS uses allowable

motion to nd solutions to simple problems by lo cal propagation and lo cus analysis

to solve simultaneous problems Thus IGCS is a sequential hybrid of the form in

gure

However the lo cus analysis used by IGCS is not lo cally complete Consider

example rep eated here as gure for convenience

Chapter Hybrid Collab oration

Constraint Acyclic Allowable Solutions Cyclic Locus Solutions Problem D(0) Motion D(1)

Subproblem Subproblem Analysis

Figure IGCS as a sequential hybrid

A B

P 1 1 2

G G 1 2

P

2

Figure Two Ro ds

There are two solutions to this problem However the lo cus analysis in IGCS

will only consider the solution which involves moving the ro ds the least to P Lo cus

1

analysis is local ly consistent and IGCS is not globally consistent For example if

the only solution to the whole constraint problem involves the ro ds b eing coincident

at P then IGCS will not nd it

2

Previously INCES and IGCS were not known to b e inconsistent

Limitations of serial hybrids

Serial solution is dicult primarily b ecause the output from one solver may not

b e valid input to the next solver For example if a nite domain solver pro duces

solutions such that a line can take only lengths f g then there are very

few constraint solvers that allow this kind of line It is of course p ossible to run

the second solver four times for each of the solutions but this approach is clearly

infeasible if there are a large numb er of solutions Such an approach would also

eliminate many of the advantages of using a serial hybrid

In fact there is only a limited dep endency b etween the two solvers Any entity

in the rst problem not in the second problem do es not need to b e communicated

to the second solver Corresp ondingly the second solver only needs to use as input

solutions for the intersection of entities b etween the two problems Even so this

may b e many p ossible congurations

Chapter Hybrid Collab oration

Serial collab oration will work b est when only one solution is found to a subprob

lem P and passed on to the next subproblem P In this

1 1 1 2 2 2

case serial collab oration is very simple All entities in are assigned a value

1 2

from the solution to P Thus the size of P has b een reduced by the numb er of

1 2

entities in which are now xed Hop efully some of the constraints in

1 2 2

will have b een made trivial or easier by this reduction Unfortunately as is the case

with INCES and IGCS this serial collab oration is not globally consistent

If a subproblem has only one solution as is usually the case in linear program

ming then serial collab oration is an obvious choice as it will b e globally consistent

The more solutions a subproblem can b e exp ected to have the less likely it is a

solution will b e chosen that is globally consistent Therefore serial collab oration

b ecomes less attractive

In fact many constraint solvers such as DCM Erep and MechEdit

use rules or heuristics to determine the likely intent of the user in constructing the

constraint problem

For example Erep insists that when a user sets a distance b etween a p oint and a

line the p oint will have to b e on the same side of the oriented line b efore and after

constraint solution Thus a single solution is selected from two p ossible solutions

If such rules are applied throughout the constraint subproblem a single solution is

selected from amongst an exp onential numb er The key p oint here is that this single

solution is the one most likely to satisfy the users intent and so is a go o d candidate

to b e a globally consistent solution to the combined constraint problem

If a constraint subproblem can b e exp ected to have an innite numb er of so

lutions then the use of serial collab oration b ecomes more problematic Cho osing

just one solution from an innite numb er is unlikely to provide a globally consistent

solution Consequently all of the solutions should b e passed to the next solver in

the collab oration Whether this is p ossible or not dep ends on the nature of the

solutions and the allowable domains of entities in the second subproblem If the

solutions provided by the rst solver are continuous and simple then this transfer

may b e quite straightforward For example if fx IR y IRg and the

1 2

solutions to P are fx fg y IRg then P can b e adjusted accordingly

1 2

However if the solutions provided by the rst solver are complex then it may

not b e p ossible to transfer the solutions For example if fx IR y IRg

1 2

3 5

and the solutions to P are fx fag y fbgja b g then it is not simple

1

to alter P to take into account this information other than adding it as another

2

constraint at which p oint a parallel collab oration b ecomes more appropriate

Chapter Hybrid Collab oration

In conclusion serial collab oration should b e considered when

Global consistency is not imp ortant

Rules or heuristics can b e used to bias solutions towards globally consistent

solutions

Only one or a small nite numb er of solutions are exp ected from each sub

problem

An innite numb er of solutions are exp ected but these will b e continuous and

simple

If serial collab oration is not appropriate then a parallel collab oration or concur

rent collab oration may b e helpful In some cases however no collab oration may b e

appropriate and the problem must b e solved as a whole using a general solver such

as NewtonRaphson or Grobner bases

Solver collab oration language

Monfroy uses a solver collab oration language to build complex solvers using the col

lab orative primitives intro duced in the previous section and app endix E However

Monfroys collab oration language is predicated only by the solvers available and not

by the constraint problem b eing solved In order to take advantage of domain sp e

cic knowledge implicit in a constraint problem the problem must b e solved using

a constraint solver capable of handling that domain sp ecic knowledge Since do

main sp ecic solvers can also sometimes fail to nd solutions it is also imp ortant to

provide backup solvers should a rst attempt fail Domain sp ecic solvers can fail

to nd solutions when they are asked to solve problems that are not within their

sp eciality For example lo cal propagation algorithms cannot solve cyclic problems

and so ICBSM cannot nd solutions to the bar linkage problem gure

Unfortunately the only conditional statement in Monfroys collab oration lan

guage is the conditional guard which calls another constraint solver when a previous

expression of constraint solvers terminates with a particular solver Monfroy gives

no example of the conditional guard in use and its purp ose is dicult to fathom

Decomp osition strategies as discussed in chapter assign a set of subsolvers

to a subproblem The hybrid constraint solver then applies the subsolvers to the

subproblems using the sequential parallel or concurrent collab oration

Chapter Hybrid Collab oration

B coincident(A,B) coincident(B,C) A C coincident(C,D) coincident(D,A) fixed(D)

D

Figure The bar linkage problem

I d Identiers

S Solvers

Conditional selection

P Constraint problems

D Solution spaces

C ol I d E

E jI djB jE E jEP j rep eat E j EC j if T then E else E

1 2 1 2

T E D

B P S jP S k B

EP E jE k E P

EC E jE EC

Table Solver collab oration language adapted from BALI

Monfroys solver collab oration language is an imp ortant means of designing and

building hybrid constraint solvers that use the hybrid collab oration paradigms How

ever Monfroys language only uses solvers it do es not allow for subproblems to b e

assigned to sp ecic subsolvers

Monfroys collab oration language has b een extended so that subsolvers op erate

on sp ecic subproblems rather than the whole problem The extended solver col

lab oration language used in the remainder of this thesis is explicated in table

An instance of this language is a solver collab oration The addition of subsolvers

to act on subproblems is witnessed by the inclusion of constraint problems P in ta

ble and the denition of basic solvers B which is enhanced to include constraint

problemsolver pairs

The language given in table also includes a conditional branch statement that

can b e used to drive backup constraint solvers The branch op erator is describ ed in

more detail in app endix F For ease of comprehension Monfroys conditional guard

has b een dropp ed from the language in table

A more detailed description of the collab oration language is given in app endix F

Chapter Hybrid Collab oration

The extended language in table will b e used to describ e example constraint

solvers in the remainder of this thesis

An example of many solvers in serial

This section describ es an exp eriment carried out to study the asymptotic b ehaviour

of various constraint satisfaction algorithms on a simple case study The algorithms

studied were INCES a numerical algorithm and a sequential hybrid The

purp ose of this exp eriment was to give empirical as well as theoretical evidence

that the hybrid algorithm was sound complete and more ecient than the other

two algorithms as well as to investigate sequential collab oration It was anticipated

that the hybrid would b e approximately linear in complexity whilst the other two

algorithms would b e quadratic This would help to underline the advantages of

using hybrid algorithms

This section presents the case study used discusses the algorithms used to solve

the case study and gives results App endix G presents a more detailed examination

of the case study

Case study

The case study chosen was an extension of Lamouniers internal combustion engine

case study see and section That problem studied the integration of some

algebraic equations with the geometric constraints describing the construction of

the piston The two problems were linked so that the size of the piston and the

length of the crankshaft were variables b oth in the functional problem and also in

the geometric problem However this is a xed size of problem In order to study

the asymptotic b ehaviour of the algorithms n piston problems were joined together

as in gure

In this case study the n pistons are linked by coincident constraints at each

end of the piston Thus the problems are all connected and the complexity of the

problem do es increase as the size of n increases The functional problems are not

linked and are eectively lots of small xed problems solved indep endently

The solvers used

Three solvers were examined The NAG CNBC function was used as a numer

ical solver It was passed the whole set of constraints and used numerical techniques

Chapter Hybrid Collab oration

Functional Problem Functional Problem

Functional Problem

crankshaft piston piston piston

crank

crank

Figure Case Study of n Piston Problems Linked Together

Constraint Functional Solutions Geometric Solutions D(0) INCES D(1) IGCS Problem

Subproblem Subproblem

Figure Serial Hybrid used to Solve n Piston Problems Linked Together

to converge towards a solution The sp eed of convergence dep ended heavily on the

2

initial guess but the b est case complexity of the NAG function is n where n is

the numb er of constraints

Lamouniers INCES solver is also capable of solving the problem as a whole

However INCES deals only with equations and not geometric constraints Geo

metric constraints can b e handled if they are reduced to the constituent equations

INCES was exp ected to b e quadratic as it dealt with the problem as a whole and

resorted to numerical solvers if lo ops app eared

These constraint solvers were compared with a hybrid formed from combining

the functional solver INCES and the geometric solver IGCS much as in case study

section Each functional problem was solved using INCES and the results

were passed to IGCS by varying the size of the lines in IGCS see gure It was

hop ed that the hybrid would b e able to take b est advantage of the domainsp ecic

knowledge incorp orated in the INCES and IGCS solvers and would b e linear

The decomp osition strategy D e used in this case is to decomp ose problem

P into a set fS P g where solver S is IGCS if subproblem P is geometric

i i i i

and S is INCES if subproblem P is algebraic Decomp osition is p erformed by rst

i i

identifying constraints as geometric or algebraic These form two sets of constraints

and Constructing and takes time On where n is the numb er of

1 2 1 2

constraints

Chapter Hybrid Collab oration

5 Hybrid solution with dependency hierarchy list Hybrid solution without dependency hierarchy list 4.5 Solution of combined problem using INCES NAG c05nbc with consistently close guess

4

3.5

3

2.5

Time in seconds 2

1.5

1

0.5

0 0 500 1000 1500 2000 2500 3000 3500 4000

Number of constraints

Figure A comparison of the CNBC function and INCES algorithm with the

hybrid solver

Set is then decomp osed further into sets of connected comp onents where

i j

and are connected if there is a path b etween and in

1 2 1 2

i i

the constraintentity graph of constraint problem n j i Finding the

j

connected comp onents can b e done in a simple graph traversal algorithm that takes

time Om where m is the numb er of edges in the constraintentity graph Since

the imp osed sets of constraints are usually quite small m will typically b e a multiple

of the numb er of constraints in P Thus decomp osition of P takes time On

With this decomp osition strategy the hybrid can b e describ ed in the solver

collab oration language of section as

S P S P S P S P

1 1 2 2 3 3 n n

Results

The case study was run for problem sizes b etween and This gave problems

with b etween and variables All case studies were run on a Silicon Graphics

Indy with an R MHz IP pro cessor and Mbytes of memory The results

of the case study are presented in gure In the graph the xaxis is the numb er

of variables in the problem and the yaxis is the amount of time taken to solve the

problem in seconds

From the graph it is apparent that the hybrid constraint solver is very fast

Chapter Hybrid Collab oration

indeed It is linear whereas the other solvers compared were quadratic at b est It is

three or four orders of magnitude faster than the NAG function Even for problems

of or so variables the hybrid is much faster

Conclusions

Hybrid constraint solvers are an imp ortant means of solving constraint problems

Many current constraint solvers use hybrid techniques to solve constraint problems

Constraint solvers such as DCM Erep and Connectivity Analysis de

comp ose a constraint problem into a large numb er of very small subproblems that are

solved using small sp ecialised domain sp ecic solvers Solvers such as MechEdit

INCES and IGCS decomp ose a problem to a small numb er of large sub

problems that are solved using more complex solvers

In general constraint solvers work by decomp osing a constraint problem into

a numb er of subproblems ordering the subproblems solving the subproblems and

recombining the solutions of the subproblems into solutions to the original problem

This chapter has investigated the last stage of this pro cess solving and recom

bining In particular the chapter has analysed the use of domain specic know ledge

and hybrid constraint solvers in solving complex constraint problems Domain sp e

cic knowledge is added knowledge that is implicit in a problem Many constraint

solvers take advantage of domain sp ecic knowledge to guide the satisfaction pro cess

towards solutions For example Degrees of Freedom Analysis takes advan

tage of the nature of rigid b o dies in Euclidean space and the fact that such b o dies can

only rotate and translate in a very limited numb er of ways Rulerandcompass con

struction takes advantage of the fact that angle and distance constraints can

b e resolved using only simple construction steps Finite domain solution techniques

take advantage of the nite nature of the solution space to exhaustively explore it

Domain sp ecic knowledge allows the construction of fast ecient solvers such

as those describ ed ab ove However domain sp ecic knowledge is very limited in the

problems that it can solve Precisely b ecause domain sp ecic solvers take advantage

of the structure of a problem domain problems outside that domain cannot b e

solved easily

Hybrid constraint solvers use two or more constraint solvers in col laboration to

solve problems that the individual solvers could not solve on their own The most

prevalent form of hybrid solver is one that uses domain sp ecic knowledge to solve

as much of a constraint problem as p ossible and then uses a general solver such as a

Chapter Hybrid Collab oration

numerical solver to solve the remainder of the problem Solvers such as COSAC

INCES and MechEdit adopt this approach The advantage of this approach

is that the domain sp ecic solver helps to make the hybrid solver faster than the

general solver would have b een on its own

Monfroys BALI environment is an abstract framework for describing col

lab orations of multiple constraint solvers The BALI framework provides a p owerful

means of describing complex hybrid constraint solvers BALI tries to solve the en

tire problem using a single constraint solver When it can pro ceed no further it

switches to another solver according to the semantics of the hybrid Thus BALI

do es not take into account the structure of the constraint problem and do es not use

any domain sp ecic knowledge implicit in the constraint problem

Consequently this chapter has used the denition representation and satisfac

tion framework develop ed over the previous three chapters to describ e a more sat

isfactory collab orative framework for constraint solvers The advantages of this

framework are that it has all the descriptive p ower of BALI but allows the con

straint problem to b e decomp osed using a decomp osition strategy and then solved

using a hybrid

In order to discuss the hybrid framework develop ed the notions of enhanced

and embedded solution spaces were intro duced Enhanced solution spaces allow

the discussion of constraint pro cesses in relation to a wider problem Emb edded

solution spaces allow the discussion of constraint pro cesses in relation to smaller

subproblems Both denitions are evident in BALI and have b een adapted to the

framework develop ed in this thesis

The sequential paral lel and concurrent collab orative paradigms identied by

Monfroy were then describ ed using the framework of this thesis Using the three

collab orative paradigms it is p ossible to construct complex and elegant hybrid con

straint solvers Several case studies of sequential collab oration were presented in the

chapter and app endix E contains an example of parallel collab oration

It is then p ossible to use theorems and E to investigate the prop erties of

hybrid constraint solvers Theorem can b e used to study sequential collab oration

and is used to identify problems with INCES and IGCS INCES turns

out to b e not consistent as the numerical subsolver used to handle cyclic sets of

constraints only nds one solution that may not b e the solution necessary for a

solution to the whole constraint problem Similarly IGCS is not consistent as the

lo cus analysis of IGCS only takes into account one p ossible solution when there

may b e many

Chapter Hybrid Collab oration

Serial collab oration is simple to implement and understand It is also p owerful as

it can use knowledge from subproblems solved early to simplify subproblems solved

later However serial collab oration is dep endent on passing very few solutions from

one subproblem to the next and this means that it is much more likely that any

serial hybrid will suer from global inconsistency

Parallel and concurrent collab orations are discussed in app endix E

Monfroy uses a solver collab oration language to describ e the collab oration of

solvers using the various paradigms of collab oration However Monfroys language

do es not allow solvers to work on subproblems nor do es it contain an op erator for

cho osing new solver expressions dep ending on the result of an expression Conse

quently BALI has b een extended to allow solver expressions to act on subproblems

and a conditional branch statement has b een added to increase the p ower of the

language

The main contributions of this chapter are a deep er understanding of the na

ture of hybrid collab orations identication of the imp ortance of domain sp ecic

knowledge and the extension of BALI to conditional solution and subproblems

The mathematical framework built up in chapters and provide insight into

the solver collab orations suggested by Monfroy In particular theorems and E

identify the imp ortance of global consistency in serial and parallel collab oration The

inability to guarantee global consistency for serial collab oration is a signicant p oint

as it means that most current constraint solvers that use hybrid techniques such

as INCES IGCS Erep and DCM are not globally consistent Similarly parallel

hybrids are typically not globally consistent The choice of when to use serial

parallel concurrent or no collab oration is dep endent on the typ e and numb er of

solutions exp ected

Domain sp ecic knowledge is very imp ortant in constraint solution as it is intu

itive fast and robust within the class of problems it can handle Most constraint

solvers use domain sp ecic knowledge as much as p ossible In particular solvers

that decomp ose to small subproblems such as Connectivity Analysis DCM and

Erep advo cate the use of domain sp ecic solvers to handle the subproblems

The addition of subproblems to Monfroys BALI allows the description of the

hybrid collab orations presented in this chapter to b e formalised and made robust

This means that any hybrids constructed from the techniques in this chapter should

b e welldened The conditional branch statement allows for complex hybrids to b e

built that involve backup solvers when things go wrong

Chapter asked a numb er of questions ab out the pro cess of solving constraint

Chapter Hybrid Collab oration

problems by decomp osition Some of these questions can now b e answered

In fact it is p ossible to lose solutions by decomp osing and recombining Theo

rems and E b oth conclude that solving subproblems individually will usually

lead to a hybrid constraint solver that is not consistent and may lose solutions or

may fail to nd solutions when many exist However theorems and E also sug

gest that constraint solvers that retain all solutions ie are lo cally complete can b e

safely linked together using hybrid collab orations However few current constraint

solvers are lo cally complete Grobner basis solvers are the most appropriate as they

are b oth sound and complete However they are to o slow for interactive use

The question as to whether it is more ecient to decomp ose and recombine or

to solve as a whole is more dicult to answer To solve a constraint problem as a

whole requires a general solver such as Grobner bases or NewtonRaphson Since

2

numerical solvers such as NAGs CNBC function are n complexity where n

2

is the numb er of constraints decomp osing and recombining must b e at most On

in order to comp ete

In fact nearly all current constraint solvers such as DCM Erep IGCS INCES

2

and MechEdit are On complexity and averagecase complexity n Incremental

constraint solvers such as IGCS INCES and SkyBlue have worst case complexity

On but average case complexity O to add a new constraint Empirical evidence

therefore suggests that decomp osing and recombining is more ecient than solving

as a whole

The use of domain sp ecic knowledge has b een identied in this chapter as the

key element in making the solution of subproblems fast The combination of domain

sp ecic solvers using a welldened hybrid collab oration leads to hybrid solvers that

are faster than solving as a whole

The fourth questions that was asked was whether it was p ossible to have a

fast decomp osition strategy and fast solution of subproblems or must one always

dominate Chapter addresses this question by building a new constraint solver

that uses coarsegrain decomp osition to identify subproblems and then solves the

subproblems using complex constraint solvers

Chapter

New Directions

With the exception of INCES the solvers presented in the examples in this thesis

have mostly concentrated on complex decomp osition strategies The subsolvers they

have used have b een small and simple For example the constraint subsolvers used

in DCM are the sp ecial case solvers for dealing with each set of three quadratic

equations in three unknowns The constraint subsolvers used in Connectivity Anal

ysis nd solutions to each residual set Although Middleditch and Latham do not

explore the issue in much detail it seems likely that residual sets will b e fairly small

and amenable to simple solvers

One of the questions asked in chapter was whether it was b etter to have complex

decomp osition and simple solution or simple decomp osition and complex solution

Most existing constraint solvers adopt the former approach and put most of their

eort into the decomp osition strategy However this thesis is primarily concerned

with improving the p erformance of existing solvers such as IGCS and ICBSM

Of particular interest is the p ossibility of improving the p erformance of IGCS

so that it can handle lo ops and wellconstrained problems b etter Study of exist

ing constraint solvers such as Erep suggest that the IGCS algorithms such as

lo cal propagation and lo cus analysis are not as wellsuited for solving lo ops and

wellconstrained problems as Erep is Chapter suggests that the domain sp ecic

knowledge used by IGCS and Erep limit their use to their own particular sp ecialities

However chapter also suggests that a hybrid of IGCS and Erep could p otentially

handle constraint problems that are a mix of problems that IGCS and Erep can

individually solve

In general it is dicult for a decomp osition strategy to identify domain sp ecic

subproblems as the strategy will need to employ domain sp ecic knowledge to nd

the subproblems Using such domain sp ecic knowledge will usually necessitate

Chapter New Directions

the same complex decomp osition that the domain sp ecic solvers will themselves

undertake and this will duplicate the eort involved However if knowledge ab out

the combined problem can b e exploited it may b e p ossible to p erform a simple

decomp osition to identify the domain sp ecic subproblems

At this p oint it is worth recalling that INCES adopts such an approach The

decomp osition strategy used in INCES is very simple a constraint problem P is

split into subproblems whose constraint graph is a tree and subproblems that form

strongly connected comp onents Tree subproblems are solved using lo cal propaga

tion and strongly connected subproblems are solved using NewtonRaphson Note

that most of the eort in nding solutions to P is taken up by the constraint solvers

particularly the NewtonRaphson solver

This chapter explores the p ossibility of constructing a new hybrid constraint

solver comp osed of two existing constraint solvers Erep and IGCS The

hybrid will use coarsegrain decomp osition to identify the domain sp ecic subprob

lems suitable for Erep and IGCS The natures of Erep and IGCS have b een discussed

extensively elsewhere in this thesis see sections and for example and so

are not discussed in detail here This section notes the reasons and pro cesses b ehind

the design of such a solver in order to characterise the imp ortant steps in designing

a new hybrid solver Note that the prop osed solver has not b een implemented

The prop osed solver will b e a hybrid of Erep and IGCS The solver must dene

a decomp osition strategy

an ordering strategy and

a solution strategy

Decomp osition strategy

The decomp osition strategy for the ErepIGCS solver is the key to its success The

strategy must b e simple enough that it is fast to implement and yet suciently useful

that it can identify subproblems suitable to b e solved by either Erep or IGCS In

order to identify subproblems that are b est solved by either Erep or IGCS it is rst

necessary to identify the strengths of each solver in particular the domain sp ecic

knowledge used by each solver

Erep uses a rulerandcompass approach to solve constraint problems consisting

of distance and angle constraints b etween p oints and lines Typically rulerand

Chapter New Directions

Erep IGCS

nonzero p ointp oint distance p ointp oint coincidence p ointp oint distance

p ointline distance p ointline coincidence p ointline distance

lineline angle lineline angle

circlecircle tangent

circleline tangent

Table Constraints that can b e handled by Erep and IGCS

compass constructs manifest themselves as clusters see and section in

a constraint graph

IGCS uses rigid b o dy allowable motion to solve constraint problems consist

ing of coincidence tangent and angle constraints b etween p oints circles and lines

Typically such problems manifest themselves as trees or lo ops in constraint graphs

In particular it is p ossible to describ e the constraints that each solver can handle

explicitly It is p ossible to decomp ose circlecircle tangent and circleline tangent

constraints to distance constraints that Erep can handle However doing so loses

domain sp ecic knowledge that IGCS exploits Consequently tangent constraints

will remain as highlevel constructs The constraints each solver can handle are

describ ed in table

Note that these constraints can b e divided into three groups and Group

consists of nonzero p ointp oint distance and nonzero p ointline distance con

straints Group consists of p ointp oint coincidence circlecircle tangent and circle

line tangent constraints Group consists of p ointline coincidence and lineline an

gle constraints Constraints in group can only b e solved using Erep Constraints

in group can only b e solved by IGCS Constraints in group can b e solved using

either Erep or IGCS In this way the strengths of Erep and IGCS are identied and

corresp ondingly the subproblems that can b est b e handled by Erep or IGCS

Each constraint in a constraint problem can then b e asso ciated with a group

and therefore with the constraint solvers that can handle it For example g

ure shows the ConstraintEntity graph for the constraint problem Q in gure

from Each constraint has a group identier asso ciated with it to show which

constraint solver can handle it Note that all of the constraints in gure can b e

solved by Erep

The constraint problem R in gure has the ConstraintEntity graph in g

ure This problem consists of a numb er of constraints that can b e solved in Erep

and a numb er that can only b e solved in IGCS

The decomp osition strategy should place constraints of typ e in subproblems

Chapter New Directions

Pt4

Sg5 90o Sg7

Pt2 o 70 Pt10 70o Pt6 90 90 Sg3 Sg9 200 200

Pt1 Pt8

Figure Constraint problem Q using distance and angle constraints

g Pt4 p-l 0 p-l0 g Sg5 Sg7 g l-l90 p-l 0 p-l 0 g g l-l70 l-l70 Pt2 a a Pt6 p-p200 p-p200 g p-l 0 p-l 0 a a Sg3 Sg9 p-l90 p-l90 g p-l 0 p-l 0 g Pt1 Pt8

ap-p90 Pt10 p-p90 a

Figure ConstraintEntity graph for constraint problem Q

Chapter New Directions

200 P2 P1 coincident LS1 LS1 P3 P2 coincident LS1 P3 coincident LS2 P1 C1 P4 coincident LS2 C2 200 P2 coincident P3 LS2 C1 tangent LS1 C3 C1 tangent LS2 C2 tangent LS1 C2 tangent C1 C3 tangent C2 C3 tangent LS2 P4 C3 tangent C1 d(P1, P2) = 200

d(P3, P4) = 200

Figure Constraint problem R with three tangent circles

P2p-p0 P3 b a a p-l0 p-l0 p-p200 g g p-p200

LS1 LS2 tangent b tangent b g C1 g p-l0 tangent p-l0 tangent tangent tangent b b b b

P1 C2 tangent C3 P4

b

Figure ConstraintEntity graph for constraint problem R

Chapter New Directions

that will b e solved by Erep and constraints of typ e in subproblems that will b e

solved in IGCS It remains to decide what to do with constraints of typ e and how

to form the subproblems

Erep solves constraint problems by identifying clusters of entities Conse

quently all typ e constraints should b e part of a cluster so that Erep can nd

solutions for them In theory clusters could b e determined using the same cluster

nding techniques adopted by Erep itself using typ e constraints when necessary

For example gure can b e divided into two clusters with typ e and con

straints and one with only typ e constraints Figure has two clusters with typ e

and constraints However using the cluster nding techniques of Erep to nd

the subproblems to pass to Erep is a duplication of eort as the clusters will b e

found twice once in the decomp osition strategy and once in the solution strategy

It is dicult to identify any simple decomp osition strategy that will identify

clusters but not need to p erform the cluster nding algorithm using in Erep This

is a general p oint the only way to identify domain sp ecic subproblems may b e to

decomp ose the problems to such a degree that the decomp osition strategy has in

eect solved the subproblems and the solvers have no work to do

Consequently it is prop osed that the ErepIGCS hybrid uses a slightly less dis

criminatory decomp osition strategy

Algorithm Decomp osition strategy for ErepIGCS hybrid

Remove all typ e constraints

Place the remaining connected comp onents into subproblems fP g

i

Restore all typ e constraints

Remove all typ e constraints

Place the remaining connected comp onents into subproblems fP g

j

Restore all typ e constraints



At this p oint each P contains subproblems consisting only of typ e and typ e

i

constraints Each P contains subproblems consisting only of typ e and typ e

j

constraints Inevitably there will b e some typ e constraints that will b e in b oth a

P and a P However each typ e constraint will b e in at most one P and at most

i i

j

one P j

Chapter New Directions

P2 P1 p-p0 P2 P3 P3 P2 a b p-l0 g a p-p200 p-l0 g p-l0 p-l0 P3 g g p-p200 LS1 LS1 LS2 b LS2 g tangent tangent g b C1 p-l0 g g p-l0 tangent p-l0 tangent tangent tangent p-l0 b b b b P1 P1 C2 tangent C3 P4 P4

b

Figure Decomp osition of ConstraintEntity graph for problem R

The output of the decomp osition strategy is therefore

fP fE r epgg fP fI GC S gg

i

j

For example the constraint problem in gure consists only of typ e and typ e

constraints It will therefore b e passed as a whole to Erep and solved using Erep

only as would b e exp ected

The constraint problem in gure is split into three subproblems P P and

1 2

P as shown in gure P and P are solved using Erep P is solved using IGCS

3 1 2 3

The output of the decomp osition strategy is

fP fE r epg P fE r epg P fI GC S gg

1 2 3

Note that constraints such as P lying on LS will b e solved for twice The

2

ordering and solution strategies will deal with this problem Note also that this

decomp osition strategy takes On time where n is the numb er of constraints

This decomp osition strategy is simple and p owerful In this example hybrid it

is used to split a complicated problem into a numb er of subproblems each of which

has b een asso ciated with a constraint solver to solve it A similar approach could

b e used to separate any constraint problem that has b een lab elled with constraints

suited to a particular solver

The most dicult part of this decomp osition strategy will b e determining the

domain sp ecic knowledge and sp ecialities of the various constraint solvers in such

Chapter New Directions

a way that constraints can b e asso ciated with particular solvers

The fact that the decomp osition strategy takes linear time in the numb er of

constraints means that the overall time for the hybrid will not b e dominated by the

decomp osition as is frequently the case In fact the time complexity of the hybrid

is dominated by the time complexities of the individual solvers Erep and IGCS

Ordering strategy

A common ordering strategy is to go from known values to unknown values That

is to say solve easy problems rst and use the solutions to the easy problems to

nd solutions to harder problems This strategy has b een usefully applied to such

solvers as DESIGNPAK DCM INCES Erep and MechEdit

Connectivity Analysis uses this approach in order to guide solution of residual

sets In eect residual sets that are xed are solved rst followed by residual sets

that can b e xed using solutions from previous residual sets and so on

The known to unknown strategy generalises to solving overconstrained sub

problems rst followed by wellconstrained subproblems and underconstrained sub

problems Overconstrained subproblems should b e solved rst as they are most

likely to have no solutions If an overconstrained subproblem has no solution then

the problem as a whole has no solution and so the overconstrained subproblem might

as well b e studied rst If an overconstrained subproblem does have solutions it is

likely that it will have only a very few of them Overconstrained subproblems are

more known than wellconstrained subproblems

In a similar vein wellconstrained subproblems will likely have only a nite

numb er of solutions and are more likely to have no solutions than underconstrained

subproblems

It is p ossible to identify the constrainedness of the subproblems generated by

the decomp osition strategy However the identication of constrainedness is nearly

always as much work as the decomp osition adopted by subsolvers For example

Connectivity Analysis eectively identies the residual sets of a constraint problem

as a sideeect of investigating the constrainedness of the problem

In order to avoid this eort the ordering strategy for the prop osed hybrid of

Erep and IGCS is very simple Since Erep only nds solutions to wellconstrained

subproblems it can b e assumed that the subproblems passed to Erep are well

constrained extraneous typ e constraints that are not part of a cluster confuse

this argument but this case is discussed in the next section Similarly subproblems

Chapter New Directions

solved by IGCS can b e considered to b e underconstrained as such problems play to

the strengths of IGCS Consequently all Erep subproblems should b e solved b efore

all IGCS subproblems

In the case of gure this results in a partial order

P P

1 3

P P

2 3

Note that this ordering strategy is very simple and do es not capitalise on the struc

ture of the subproblems at all This is b ecause the ordering strategy like the de

comp osition strategy should b e simple enough that it can b e p erformed quickly and

yet useful enough to help guide solution of the whole problem

Solution and recombination

Recall that each subproblem P to b e solved using Erep may contain extraneous

i

constraints that are not part of a cluster It is assumed here that Erep should solve

P by trying to nd as many clusters as p ossible nd solutions for each cluster and

i

then stop Extraneous typ e constraints and imp osed entities will therefore not b e

solved for and will b e left oating

There are two situations whereby a typ e constraint may not b e part of a cluster

but may b e part of a subproblem to b e solved using Erep The rst is that the

constraint lies in a subgraph of only constraints b etween an constraint and a

constraint and is not in a cluster In this case the constraint will also b e in a

subproblem P due to b e solved using IGCS and so can b e dealt with there

j

Consider for example the constraint problem in gure Constraints C C

1 2

and C are not in cluster C l but are in subproblem P When Erep tries to solve for

3 1

C C and C it fails and leaves them However as C C and C are part of the

1 2 3 1 2 3

all subgraph b etween C and C they are all also part of subproblem P which is

0 4

2

due to b e solved using IGCS Consequently Erep do es not need to deal with them

The other circumstance whereby a constraint may not b e part of a cluster

but may b e a part of a subproblem due to b e solved using Erep is when there is

a subgraph consisting only of constraints connected to a cluster For example if

circle C ir c and constraint C are removed from gure then constraints C C

1 4 1 2

and C will not b e solved by Erep and are also not part of a subproblem due to b e

3

solved by IGCS

Chapter New Directions

P1 P1 coincident LS1 P2 coincident LS1 LS1 200 P3 coincident LS2 Circ1 P4 coincident LS2 P2 coincident P3 Circ1 tangent LS2 P4LS2 P3 P2 d(P1, P2) = 200

P 1 g P P1p-l0 LS1 1 P'2 Cl g Cl p-p200 p-l0 C0 a P2

C1 C p-p0 4 b g Circ1 C tangent 2 P' 2 LS2 p-l0 P3 g p-l0 P4 g

C3

Figure A constraint problem with and constraints

Chapter New Directions

The subgraph containing C C and C can b e solved by IGCS Corresp ondingly

1 2 3

C C and C should b e made into a new subproblem that is due to b e solved by

1 2 3

IGCS and added to the stack of subproblems to b e solved

If a subproblem P exists that contains a subgraph containing constraints

i

that is not part of a cluster then Erep will not b e able to nd solutions to the

constraints in the subgraph IGCS cannot solve constraints and so cannot solve

the subgraph either Consequently a hybrid of Erep and IGCS will not b e able to

solve such subproblems unless a backup domain general solver such as Newton

Raphson or Grobner bases is added Such a situation is not addressed in this thesis

but could form a p owerful constraint solver

The crudity of the ordering strategy means that no ne control of the hybrid

can b e deduced Since the partial order only dictates that all Erep subproblems b e

solved b efore all IGCS subproblems the following hybrid can b e deduced

P fE r epg k P fE r epg k P fE r epg k k P fE r epg

1 2 3 n

P fI GC S g k P fI GC S g k P fI GC S g k k P fI GC S g

1 2 3 m

Note that each P is disjoint with each other P and similarly for each P and

i i

j

so each Erep subproblem can b e solved indep endently and each IGCS subproblem

solved indep endently

Recombination of solutions o ccurs when all Erep subproblems have b een solved

At this p oint only one solution is pro duced by all of the applications of the Erep

algorithm and so cho osing the solution to pass to the IGCS subproblems is trivial

Note that it will certainly b e p ossible to use the ro ot identication algorithms of

Erep to select other solutions to the Erep subproblems and that this will lead to

other solutions of IGCS subproblems Note also that the underconstrained nature

and use of direct manipulation for the IGCS subproblems can b e utilised with no

eect on the Erep subproblems

The ordering strategy forces subproblems to b e solved by Erep completely rst

and then subproblems by IGCS Consequently there can b e no cycles b etween Erep

subproblems and IGCS subproblems

Note that clusters in Erep describ e rigid b o dies with two translational degrees of

freedom and one rotational degree of freedom Since IGCS acts on rigid b o dies with

degrees of freedom it seems likely that IGCS and Erep can b e even more closely coupled

Chapter New Directions

Advantages of the ErepIGCS hybrid

There are a numb er of advantages of the ErepIGCS hybrid

Reuses existing constraint solvers The hybrid reuses existing solvers and so

has less risk than developing a new system from scratch It also allows for fast

development

Fast and ecient The hybrid uses very simple decomp osition and ordering

strategies that each take time On where n is the numb er of constraints In

2

contrast Erep and IGCS take time On each

Simple to implement Since the decomp osition and ordering strategies are so

simple the hybrid should b e simple to implement The hybrid has not b een

implemented b ecause the author has no access to the internal workings of Erep

and has not had the time to construct the Erep algorithm from scratch

Keeps strengths of individual solvers The hybrid allows the use of b oth the

ro ot identication of Erep and the direct manipulation of IGCS Both tech

niques have proved extremely p opular and useful in exploring the solution

space of a constraint problem

Success when individual solvers fail The hybrid will nd solutions to con

straint problems containing b oth typ e and typ e constraints Individually

neither constraint solver handles b oth typ es and so the hybrid can handle

more constraint problems Although Erep can solve typ e constraints by

describing constraints using degenerate distance constraints this approach

is discounted b ecause it loses the domain sp ecic knowledge that can b e used

to advantage in IGCS

Limitations of the ErepIGCS hybrid

There are limitations to the ErepIGCS hybrid

Inconsistent Since only one solution is found for the Erep subproblems and

passed on to the IGCS subproblems by theorem the hybrid is inconsistent

Nonlinear time complexity Although the decomp osition and ordering strate

gies are fast the solution of the subproblems dominates the hybrid Since b oth

Chapter New Directions

2

algorithms have On complexity where n is the numb er of constraints the

2

complexity of the hybrid is On

Although the time complexity of the ErepIGCS hybrid is equivalent to the

time complexities of Erep and IGCS it is imp ortant to rememb er that IGCS

is not equivalent to the hybrid as IGCS cannot solve many of the constraints

the hybrid can Erep can solve all of the constraints the hybrid can but only

if tangent constraints are reduced to distance constraints and the zero p oint

p oint distance constraint is removed by prepro cessing Both activities remove

domain sp ecic knowledge from the constraint problem that IGCS exploits

Thus one would exp ect the average case time complexity of the hybrid solver

2

to b e b etter than n as it can exploit that domain sp ecic knowledge

Incremental implications of new solver

In section the p ossibility of an incremental version of DCM was suggested

The solver develop ed in this chapter satises this vision of an incremental DCM

For the purp oses of this discussion Erep and DCM are used interchangeably In

fact Erep and DCM are equivalent as rep orted in

An incremental constraint solver starts with a blank sheet of no entities and no

constraints A this p oint entities are added so that the constraint problem b ecomes

underconstrained Then constraints are added one by one so that the constraint

problem b ecomes more and more constrained until it b ecomes well and then over

constrained

The ErepIGCS hybrid cannot b e made fully incremental for the same reasons

that DCM cannot b e made fully incremental However the hybrid as describ ed in

this chapter can take advantage of the incremental nature of IGCS and the compat

ibility of Erep and IGCS

Starting with no entities and no constraints the incremental ErepIGCS hybrid

works as follows

If a new entity is added it forms a separate disconnected constraint subproblem

and is treated as such

If a new constraint is added of typ e then the new constraint can only b e solved

by Erep A new subproblem is therefore formed consisting of the new constraint

together with any subproblems due to b e solved by Erep connected to the new

constraint This new subproblem must b e solved by Erep also Consequently the

decomp osition strategy is simple and uses most of the previous decomp osition and

Chapter New Directions

the order of solution is much the same

Solution of the new subproblem may not b e p ossible in Erep as the subproblem

may not form a rigid b o dy If this is so then the subproblem is left in an undened

state until more constraints are added A problem consisting entirely of typ e

constraints pro cessed in this way will lead to the rst typ e of incremental DCM

describ ed in section

In a similar fashion a new typ e constraint is put into a new subproblem

consisting of the new constraint plus any connected subproblems due to b e solved

using IGCS Solution of the new subproblem can happ en incrementally as IGCS

pro cesses the new constraint alone and tries to solve it

If the new constraint is of typ e then it can b e solved by either Erep or IGCS

Similar to the ab ove two techniques the new constraint is used to form two new

subproblems to b e solved using Erep and IGCS resp ectively The Erep subproblem

is solved rst and will lead to some of the constraints in the subproblem b eing

satised to give rise to rigid b o dy clusters

These rigid b o dy clusters are wellconstrained and are unlikely to b e changed in

the future However the rest of the subproblem will b e solved by IGCS and will

almost certainly change as the constraint problem evolves

Therefore the rigid b o dy cluster should b e separated from the underconstrained

part of the subproblem and put into a separate subproblem to b e solved using Erep

alone In this way the rigid b o dy is not resolved every time the underconstrained

part is changed This will save a great deal of eort on the part of the solver

Thus a constraint problem evolves from b eing underconstrained to b eing well

constrained and more of the problem b ecomes welldened rigid b o dies that have

b een solved using Erep and need not b e resolved

For example consider the constraint problem in gure For the purp oses of

this example since all constraints are binary the constraint graph of the problem

is describ ed using edges as constraints and vertices as entities This helps to make

the problem concise and clear in this case The constraint graph for the problem is

presented in gure

This problem is wellconstrained and can b e solved entirely using Erep Apart

from the distance constraint b etween p and p it can also b e solved entirely using

1 2

IGCS However it can also b e solved incrementally using b oth solvers This incre

mental metho d is b oth intuitively obvious to a user and also an ecient means of

reusing past solutions

At the rst iteration the constraint graph consists of no entities and no con

Chapter New Directions

p 2 l2 p 3 l l1 3 l5 p 1 l p

4 4

Figure Two triangles with a common edge

l p l 1 2 C 2 C7 11 C C C 5 8 C13 16 C3 p C l p 1 1 C C 3 C 3 2 4 C 15 C 14 C6 10 C17 C 9 C12 l p l5

4 4

Figure Constraint graph for gure

straints At the second iteration all of the entities are added On the third it

eration the p ointp oint distance constraint C is added to give a new subproblem

1

P fp p g fC g see gure

1 1 2 1

On the next eight iterations the lineline angle constraints C C and C and the

2 3 4

p ointline coincident constraints C C C C and C are added so that the graph

5 6 7 8 9

now lo oks like gure Currently there are two subproblems consisting of

P fp p p l l l g fC C g

1 1 2 4 1 2 3 1 9

l p 1 2 l2

C p 1 p 1 l3 3

l p l5

4 4

Figure Iteration two of incremental solution of gure

Chapter New Directions

l p 1 2 l2 C7

C5 C8

C3 p C l p 1 1 C 3 3 2 C4 C6 C l p l5

4 4

Figure Iteration ten of incremental solution of gure

to b e solved using Erep and

P fp p p l l l g fC C g

2 1 2 4 1 2 3 2 9

to b e solved using IGCS

At this p oint Erep cannot solve P at all and so P is b eing solved using IGCS

1 2

This allows the user to directly manipulate the lines and p oints as desired and so

explore the solution space The status of C is undened

1

On the next iteration constraint C is added and the decomp osition strategy

1

places C in b oth P and P P can now b e solved fully using Erep to give a rigid

10 1 2 1

b o dy the left most triangle in gure IGCS no longer solves any of the problem

Note that the constraint problem has suddenly gone from b eing underconstrained

to b eing wellconstrained

Since the triangle is a rigid b o dy and unlikely to b e changed it need never b e

resolved Unfortunately the sudden switch from the underconstrained geometry

solved by IGCS to the wellconstrained geometry solved by Erep means that all of

the previous work done by IGCS has b een discarded in place of the solution found

by Erep A b etter idea would b e to use the information develop ed by IGCS to assist

the solution found by Erep

In successive iterations constraints C C C C C and C are added At

11 12 13 14 15 16

this p oint there exist two subproblems

P fp p l l g fC C g

1 1 4 1 5 1 16

and

P ftr iang l e p l l g fC C g

2 3 2 5 11 16

Chapter New Directions

C C are solved using IGCS so that the user can still manipulate the lines

11 16

and p oints and the triangles as a rigid b o dy However when C is added the

17

geometry is again wellconstrained and is all solved using Erep

However note that the decomp osition to identify the cluster representing the left

most triangle has already b een done and need not b e recalculated Only the con

straints that are added need b e solved for This is equivalent to the rst incremental

DCM suggested in section

This is a p owerful incremental algorithm and is a natural extension of the hybrid

develop ed in this chapter

Conclusions

This chapter has presented the design of a new hybrid constraint solver This solver

is a hybrid of two previously existing constraint solvers Erep and IGCS Erep can

nd solutions for wellconstrained geometric constraint problems whereas IGCS can

nd solutions for underconstrained geometric constraint problems The advantage

of a hybrid b etween these two solvers is that it can nd solutions to geometric

constraint problems consisting of well and underconstrained subproblems

However the identication of well and underconstrainedness of subproblems

is dicult Middleditch and Latham identify under and overconstrained sub

problems as part of identifying the residual sets used to solve the constraint problem

Since identifying the constrainedness of subproblems app ears to b e just as dicult

as decomp osing to residual sets it was decided that the hybrid of Erep and IGCS

would not try and identify well and underconstrained subproblems

Instead the domain sp ecic knowledge employed by each constraint solver was

captured and studied It was obvious from the list of constraints that each solver

could handle that there were some constraints that Erep alone could solve some

that IGCS alone could solve and some that b oth could solve The decomp osition

strategy assigns Erep constraints to subproblems to b e solved using Erep and IGCS

constraints to subproblems to b e solved using IGCS

It remained to determine what to do with constraints that could b e solved by

either constraint solver Again the domain sp ecic knowledge used by b oth solvers

could b e used to solve this dilemma Since Erep builds up subproblems into clus

ters and eectively clusters are the most basic elements of an Erep solution Erep

subproblems must have all of the constraints necessary to build a cluster Since

identifying a cluster would eectively mean solving it all constraints that can b e

Chapter New Directions

solved by b oth Erep and IGCS are placed in b oth Erep and IGCS subproblems

In this way Erep will always have all of the constraints that it can p ossibly use

to build a cluster and any that are left over will b e solved using IGCS

The ordering strategy that is used by the hybrid is that all Erep subproblems are

solved rst followed by all IGCS subproblems This is b ecause all Erep subproblems

are assumed to b e wellconstrained and therefore have fewer solutions than the

underconstrained IGCS subproblems

The subproblems can then b e solved using the appropriate solvers and solutions

recombined to give solutions to the original constraint problem

The advantages of the ErepIGCS hybrid are that it reuses currently existing

constraint solvers has fast decomp osition and ordering strategies and go o d average

time complexity for solving constraint problems retains the ro ot identication of

Erep and the direct manipulation of IGCS and will solve more problems than the in

dividual solvers will The disadvantages are that the hybrid may fail to nd solutions

to a constraint problem when some exist It also has nonlinear time complexity

Whilst the ErepIGCS hybrid is new and p owerful it is untested The pro cess

that this chapter followed to build the ErepIGCS hybrid is signicant as it has high

lighted the principle areas that anyone constructing a coarsegrain decomp osition

hybrid must consider

The incremental version of the hybrid constraint solver is also very p owerful

The incremental version allows b oth the direct manipulation of IGCS and the ro ot

identication of Erep in an incremental context The incremental hybrid allows con

straint problems to b e dened and evolved in an intuitive manner but also provides

an ecient means of solving the constraint problem as it is created

Chapter asked whether it was b etter to have a complex decomp osition strategy

and simple solvers or a simple decomp osition strategy and complex solvers This

chapter has demonstrated that it is p ossible to build ecient coarsegrain decomp o

sition hybrid constraint solvers However the complexity of the ErepIGCS hybrid is

2

dominated by the complexity of Erep and IGCS themselves which is On where

n is the numb er of constraints Consequently it is unlikely that the ErepIGCS

hybrid lies on the tradeo p oint of gure

Chapter

Future Work

The work presented in this thesis represents a step towards the goal of the Virtual

Working Environment group at the University of Leeds This goal is to develop an

interactive environment for developing engineering designs within a Virtual Environ

ment This chapter intro duces further research that must b e carried out b efore this

goal can eventually b e realised The research necessarily can b e divided into three

areas the interactive constraint solver the mathematical framework and the Virtual

Environment used to develop the engineering designs These areas are discussed in

more detail b elow

The interactive constraint solver

The interactive constraint solver suggested in this thesis takes advantage of domain

sp ecic knowledge as much as p ossible Hop efully this will make the constraint

solver suciently fast that it will b e p ossible to use it for interactive use However

there are a numb er of factors that need to b e studied further b efore the interactive

constraint solver can b e realised

As a pro of of concept the ErepIGCS hybrid solver should b e implemented and

a numb er of case studies should b e tested on it to see how it p erforms This work

is explored in section

In order to have an interactive constraint solver consisting of subsolvers commu

nicating with each other there must b e a common standard for describing constraint

problems This is discussed in section

The case studies presented in this thesis help to demonstrate the p ower of hybrid

constraint solvers However more complex case studies need to b e explored in order

to examine the constraint solver under pathological conditions This is discussed in

Chapter Future Work

more detail in section

The incremental nature of constraint solvers such as INCES and IGCS

help to improve the eciency of the solver Since the interactive constraint solver

requires very ecient constraint solution the use of incremental constraint solvers as

part of the interactive constraint solver should b e studied in detail This is describ ed

in section

The ErepIGCS hybrid solver

The ErepIGCS hybrid intro duced in chapter is an example of the typ e of inter

active constraint solver prop osed in this thesis As such it should b e implemented

if only as a pro of of concept solver In fact the ErepIGCS hybrid promises to b e

quite a p owerful solver and so should b e tested on a numb er of case studies

In particular the ErepIGCS hybrids p erformance should b e studied for con

straint problems consisting mainly of constraints that can b e solved only by Erep

typ e constraints mainly of constraints that can only b e solved IGCS typ e

constraints mainly of constraints that can b e solved by either solver typ e con

straints and mixtures of all three constraints Problem cases will probably b e

constraint problems consisting of mainly constraints that the constraint solver

solves twice

A standard interface for solvers

In order for an interactive constraint solver comprising of a hybrid of domain sp ecic

solvers to b e implemented there must rst b e some form of standardised commu

nication b etween the interactive constraint solver and the subsolvers used to solve

the subproblems Just as graphical standards were used to allow pictures to b e

shared and engineering design standards were develop ed to allow CAD designs to

b e shared it will b e necessary to have a standard format for describing constraints

entities and constraint problems so that they to o can b e shared amongst designers

Complex case studies

The case studies presented in this thesis are not trivial Case study section

has upwards of entities and constraints Case study is also very simple

as the constraints can all b e solved using lo cal propagation However in order to

study the scalability of the concepts in this thesis even larger case studies must b e

Chapter Future Work

considered Also more pathological case studies are necessary The case studies

presented here had only a few solutions from each subproblem passed onto the next

Case studies with s of solutions from each subproblem should b e considered so

that techniques of communication and collab oration of such cases can b e explored

Incremental issues

For p erformance reasons incremental constraint solvers are b ecoming signicant

Incremental constraint solution involves using previous knowledge to solve a

constraint problem when a new constraint is inserted Typically this means that

the constraint problem is analysed so that the smallest part p ossible of the problem

needs to b e resolved when a new constraint is inserted or deleted For obvious

reasons the incremental approach is ideal for interactive constraint solution Not

only do incremental approaches allow for a b etter averagecase sp eed but they also

provide a natural paradigm for users to progressively add and remove constraints

and entities The other alternative to incrementally dening a mo del is the sp ecify

thensolve approach used by many other constraint solvers

Incremental constraint solvers have b een studied in detail in this thesis They

have great p otential for improving the p erformance of constraint solvers and also of

providing more useful feedback to users In particular constraint solvers that can

follow a constraint problem from b eing underconstrained to b eing wellconstrained

to b eing overconstrained will b e valuable The constraint solver describ ed in chap

ter can handle geometric constraint problems as they progress from b eing under

constrained to b eing wellconstrained The incremental version of the ErepIGCS

algorithm should therefore b e implemented and tested The next stage would then

b e to enhance the incremental ErepIGCS hybrid so that overconstrained constraint

problems can b e dealt with

The mathematical framework

The mathematical framework presented in this thesis is capable of capturing many

dierent typ es of constraint problem and constraint solver However there remain

certain typ es of constraint that are dicult to describ e and dicult to solve These

include inequality constraints and probabilistic constraints which are discussed in

sections and

Chapter Future Work

Inequality constraints

As noted by Lamounier during the design pro cess many design sp ecications

and p erformance measures are dened as inequalities For example in mathemat

ical programming many of the constraints are describ ed using inequalities In the

framework given in this thesis the dimension of an inequality constraint is frequently

as there will often b e a homeomorphism from the original solution space to the

restricted solution space caused by the inequality For example if a constraint

x is imp osed on the real line to give a solution space of

x

then there is a simple homeomorphism x e

Consequently the dimension of the constraint x is

The fact that most inequality constraints have a dimension of means that they

are rarely used to progress towards a wellconstrained solution Instead inequality

constraints are usually used to rene solutions and to select b etween them Con

sequently they form an imp ortant typ e of constraint to deal with However little

research has b een done on the implications of inequality constraints within a larger

problem

Probabilistic constraints

Bistarelli et al use the general semiring framework to describ e many dierent

typ es of constraint problem One of the typ es of constraint problem covered by the

semiring formalisation is fuzzy constraint problems Fuzzy constraint problems are

equivalent to the constraint priority constraint problems presented in section

Bistarelli at al also use the semiring construction to describ e probabilistic constraint

problems Probabilistic constraints have a certain probability to b e part of the given

problem This allows reasoning ab out problems which are only partly known It

should b e p ossible to mo del probabilistic constraint problems and solutions using

the framework in this thesis

The Virtual Environment

Although the Virtual Environment used is not directly signicant to this thesis there

are a numb er of issues that are relevant to b oth the Virtual Environment and the

framework presented in this thesis These include the use of parallel and concurrent

collab oration discussed in section and the use of direct manipulation to interact

with the interactive constraint solver explored in section

Chapter Future Work

Parallelconcurrent collab oration

Sequential collab oration is quite common and most hybrids currently in use adopt

this paradigm However there are advantages to parallel and con

current collab oration Parallel collab oration can b e simply implemented on parallel

with the obvious p erformance advantages available from such a move

Concurrent collab oration allows the investigation of design alternatives an imp or

tant issue for designers

The implementation of a parallel collab oration would require careful considera

tion of the intersection of the solution spaces found by the parallel solvers Imple

mentation of a concurrent collab oration would require study of the use of the choice

function and how it could b e incorp orated into a realtime algorithm

Direct manipulation issues

One of the great advantages of ICBSM is that it allows direct manipulation

of geometric entities to build up complex assemblies This proved to b e a p owerful

means for designers to build mo dels Consequently it would b e advantageous if the

direct manipulation approach could b e used for the interactive constraint solver

Obviously direct manipulation only applies to entities that have some sort of visual

representation

The ErepIGCS hybrid develop ed in chapter retains the use of the direct

manipulation of IGCS and the ro ot identication of Erep for the subproblems they

resp ectively solve Research needs to b e done to see how well these two approaches

interact and whether either can b e applied to other constraint problems

Summary

The work presented in this thesis describ es work done towards the goal of develop

ing an interactive environment for developing engineering designs within a Virtual

Environment The mathematical framework develop ed here allows the description

of complex hybrid constraint solvers consisting of a numb er of collab orating domain

sp ecic constraint solvers The sound mathematical framework develop ed allows for

an investigation of the structure of hybrid constraint solvers and of the quality of

solution provided by hybrid constraint solvers

The next key step in this research will b e to investigate incremental hybrid con

straint solvers of domain sp ecic solvers such as the ErepIGCS hybrid develop ed

Chapter Future Work

in chapter This will involve complex engineering design case studies which can

b e used to investigate the interaction of the domain sp ecic solvers and the p ower

of the hybrid constraint solver

Chapter

Conclusions

The construction of constraint problems in engineering design is supplanting more

traditional design techniques Consequently many constraint solvers have b een

develop ed to handle the constraint problems b eing constructed The constraint

solvers range from geometric constraint solvers capable of nding solutions to com

plex descriptions of geometry and relative p ositioning of geometric constructs to

functional constraint solvers capable of nding solutions to descriptions of the func

tion of designs

It is generally acknowledged that there is a close link b etween geometric and

functional constraint problems It is inadvisable to separate the ge

ometric and functional parts of the constraint problem as they aect each other

closely Corresp ondingly practitioners attempt to solve the combined constraint

problem as a whole In a similar vein other typ es of constraint problem such as

nite domain scheduling and physical constraint problems should b e considered

within a general framework

Constraint solvers handle complex combinations of dierent typ es of constraint

problem in one of two ways Either the combined problem is converted into a large

system of equations and inequalities and then solved using numerical or symb olic

techniques or a part of the combined problem is tackled by a solver go o d at solving

that particular typ e of problem and when the solver gets stuck it is assisted by

numerical or symb olic techniques

Numerical solution is slow and prone to numerical convergence problems as well

as a tendency to converge to nonintuitive solutions and only to nd one solution

Symb olic solution using Grobner bases whilst b eing much more robust and

nding al l solutions to the combined problem is far to o slow for use in interactive

design

Chapter Conclusions

The use of a domain specic constraint solver as far as p ossible leads to a sig

nicantly faster algorithm However the domain sp ecic solver used is usually

quite limited in the problems it can handle and the symb olic or numerical backup

solver will b e consulted frequently Using two collab orating constraint solvers in this

way results in a hybrid constraint solver

The use of domain sp ecic solvers leads to very fast constraint solvers such as Fas

ICBSM ICBSM is capable of solving geometric constraint problems without

lo ops in time On where n is the numb er of constraints in the problem It is

therefore suitable for interactive use In addition ICBSM is incremental and will

nd solutions to the constraint problem when a new constraint is added in time

O

However ICBSM is very restricted in the typ e of geometric constraint problems

it can solve ICBSM cannot solve geometric constraint problems with lo ops in them

ICBSM is also unable to solve functional constraint problems and so is not an ideal

candidate for an engineering design constraint solver

The purp ose of this thesis was to study ways of applying Fas Allowable Motion

to more general constraint problems In particular engineering design constraint

problems consist of lo ops and functional constraints

In order to study the p ossible applications of Allowable Motion to more general

constraint problems it was rst necessary to investigate the current stateofthe

art in constraint solution Chapter presents the result of this study Constraint

solvers in the nite domain geometric functional and physical elds were examined

in detail and the strengths and weaknesses of each solver were identied This study

identied the sp ecialisation of current solvers in terms of typ e of problem solved and

also the constrainedness of problem handled

The characterisation of constraint solvers in chapter brought to light the com

mon nature of most constraint solvers In particular most existing constraint solvers

use a divideandconquer approach to solve a constraint problem First a decom

p osition strategy is used to split the constraint problem into smaller subproblems

Then the subproblems are ordered Finally the subproblems are solved in the order

given by the ordering strategy

Several issues were raised by the divideandconquer approach and in order to

study these issues the constraint pro cess was examined in detail by dividing it into

constraint denition constraint representation constraint satisfaction and repre

sentation of solutions Since the representation of solutions to constraint problems

is a complex issue in itself it was not studied in this thesis The reader is referred

Chapter Conclusions

to for a discussion of the ro ot identication problem in geometric constraint

problems

The constraint denition phase of the constraint pro cess was studied in chapter

Intensive study of many dierent typ es of constraint solver and the problems that the

solvers can handle led to a coherent comprehensive denition of general constraint

problems This denition is capable of describing many dierent typ es of constraint

problem as well as constraint problems that consist of a numb er of dierent typ es of

constraint The settheoretic approach used in the denition allows the development

of a detailed and abstract framework for the constraint satisfaction pro cess The

dimension of a constraint was also intro duced as a means of identifying the progress

towards solution of a constraint pro cess

Chapter explored the second phase of the constraint pro cess constraint repre

sentation In order to solve constraint problems eciently many constraint solvers

rely on a constraint representation scheme that allows structure of a constraint

problem to b e investigated Most such constraint representation schemes use graph

techniques as there already exists a comprehensive selection of literature on the

prop erties of graphs However dierent constraint solvers use dierent constraint

representation schemes If a constraint solver capable of solving general engineer

ing design constraint problems were to b e develop ed it would ideally b e capable of

describing general constraint problems using the denition develop ed in chapter

Consequently chapter studied the various constraint representation schemes

currently in use and how they were related to each other This led to the identica

tion of a generic constraint representation scheme one capable of describing general

constraint problems Using reductions it was p ossible to identify which constraint

representation schemes were generic and which were not Reductions can also b e

used to translate b etween representation schemes as and when required

Dierent constraint solvers use dierent solution techniques dep ending on the

structure and typ e of constraint problem b eing solved However the investigation

of the stateoftheart in chapter indicated that all of the constraint solution tech

niques studied followed much the same underlying pattern Chapter explicitly

captured this underlying structure by dening solution steps and solution processes

Using the notion of a solution space it was then p ossible to describ e the prop erties

of a solution pro cess

The quality of solution of a solution pro cess is very imp ortant to a designer and

is dep endent on the prop erties of the solution pro cess For example if a solution

pro cess is consistent then the designer knows that there is a solution to the con

Chapter Conclusions

straint problem in the terminal solution space If a solution pro cess is sound then

the terminal solution space contains only solutions to the constraint problem If

the solution pro cess is complete then the terminal solution space contains al l so

lutions to the constraint problem However it was very dicult to determine if a

sp ecic constraint solver was sound complete or even consistent Theorem can

b e used to identify the quality of solution of a solution pro cess Theorem is

also a signicant to ol in the study of hybrid constraint solvers as it allows design

ers to identify the quality of solution of hybrid constraint solvers as well as simple

constraint solvers

The p ower of the satisfaction abstraction was demonstrated by using it to de

scrib e a numb er of dierent extensions of the basic constraint problem including

constraint priority problems incremental constraint satisfaction backtracking and

variabledriven constraint satisfaction

Using the abstractions of the constraint denition representation and satisfac

tion phases chapter studied the use of hybrids and domain sp ecic constraint

solvers Domain sp ecic solvers were identied as b eing fast and ecient but not

general enough for general engineering design Hybrid constraint solvers were inves

tigated using an adaptation of Monfroys BALI environment Monfroy identies

three dierent paradigms for the collab oration of constraint solvers These are se

quential parallel and concurrent collab oration All three collab oration paradigms

were dened in terms of the satisfaction framework of chapter Theorem can

then b e used to study the quality of solution found by sequential collab oration

whilst an equivalent theorem theorem E can b e used to study the quality of

solution found by parallel collab oration

Several examples were then explored using these collab oration paradigms The

example in section demonstrated that even a very simple hybrid constraint solver

of two domain sp ecic solvers could pro duce a marked increase in sp eed for solving a

constraint problem consisting of functional and geometric constraints The example

in section investigated the asymptotic b ehaviour of the sequential collab oration

and found that the hybrid of domain sp ecic solvers was linear in complexity whereas

other solvers were not A constraint problem with constraints was solved in

seconds using the hybrid but seconds using INCES and seconds

using a numerical algorithm

The discussion of the incremental version of DCM in section along with the

solution framework presented in chapter and the work done on hybrid constraint

solvers and domain sp ecic solvers in chapter naturally suggested a collab oration

Chapter Conclusions

of two existing constraint solvers IGCS and Erep The ErepIGCS hybrid

was dened in terms of a simple decomp osition strategy a simple ordering strategy

and a description of how solution would pro ceed The ErepIGCS hybrid has not

currently b een implemented but serves as a useful demonstration of the pro cess of

constructing a new constraint management system as discussed in chapter It also

has the p otential to b e a p owerful solver in its own right

In particular the ErepIGCS hybrid can b e implemented to give a p owerful

incremental constraint solver This incremental solver allows a constraint problem

to b e develop ed an manipulated from an initial state of b eing underconstrained

to b eing wellconstrained The incremental solver retains the ro ot identication of

Erep and the direct manipulation of IGCS and so allows the user to explore the

solution space of the problem as desired

In chapter a numb er of issues were raised regarding the decomp osition frame

work

Is it p ossible to lose solutions by decomp osing and recombining

What eect do es decomp osition have on incremental techniques

Is it more ecient to decomp ose and recombine or solve as a whole

Is it p ossible to have a fast decomp osition strategy and a fast solution of

subproblems or must one always dominate

These questions have b een addressed throughout this thesis Progress on the answers

are presented b elow

Is it possible to lose solutions by decomposing and recombining It is p ossible

to lose solutions b e decomp osing and recombining Theorems and E

prove that if a constraint solver is not globally consistent then it cannot b e

linked with other constraint solvers and exp ect to b e globally consistent In

fact few current constraint solvers are globally consistent and so few hybrid

constraint solvers are globally consistent In particular INCES and IGCS were

b oth identied as b eing inconsistent

What eect does decomposition have on incremental techniques It is p ossible

to apply an incremental approach to decomp osition ordering and solution

Incremental decomp osition strategies need to reuse information from a previ

ous decomp osition as much as p ossible Incremental ordering strategies need

to order any new subproblems in such a way as to not need to resolve as

Chapter Conclusions

many subproblems as p ossible Incremental subsolvers can nd solutions to

problems with newly added constraints quickly The ErepIGCS hybrid is a

go o d example of an incremental constraint solver and it makes go o d use of

the natures of b oth Erep and IGCS to give a p owerful solver that can b e used

interactively

Is it more ecient to decompose and recombine or solve as a whole Generally

sp eaking it is b etter to decomp ose and recombine than to solve as a whole

General constraint solvers such as Grobner bases or numerical techniques are

to o slow for interactive use However the choice of which approach to take

may not b e predicated by sp eed alone The lack of global consistency in

hybrid constraint solvers means that general constraint solvers may b e more

appropriate for some problems

Is it possible to have a fast decomposition strategy and a fast solution of sub

problems or must one always dominate The hybrid ErepIGCS constraint

solver is an example of a constraint solver with a fast decomp osition strategy

but slow solution Most other constraint solvers have a slow decomp osition

strategy but fast subsolvers The graph in gure suggests that there may

b e a tradeo p oint where solvers have fast decomp osition strategies and fast

subsolvers but the ErepIGCS hybrid is probably not at this tradeo p oint

The contribution of this thesis is the study of hybrids of domain sp ecic con

straint solvers using coarsegrain decomp osition for solving general engineering de

sign constraint problems To this end

A new categorisation of constraint solvers in terms of type of problem solved

and constrainedness of the solver was intro duced and used to categorise a

numb er of current constraint solvers

The characterisation of constraint solvers led to the identication of the divide

andconquer approach used by most current constraint solvers and the pros

and cons of this approach were studied in detail

An abstraction of the constraint pro cess was created that allows the deni

tion representation and satisfaction of general engineering design constraint

problems in a highlevel general fashion

A study of the quality of solution provided by constraint pro cesses led to

theorem which allows statements to b e made ab out the quality of solution

Chapter Conclusions

of constraint solvers and sequential hybrid constraint solvers by examining the

individual steps used by the solver Theorem E allows similar statements to

b e made ab out parallel hybrid solvers

A study of the various hybrid collab oration paradigms suggested by Monfroy

was made and the advantages and disadvantages of each investigated The

mathematical framework develop ed allows concrete statements to made ab out

the nature of these collab orations Monfroys solver collab oration language was

extended to allow for the decomp osition framework and to allow conditional

application of solvers

A new constraint solver has b een dened that consists of a hybrid of Erep

and IGCS This constraint solver combines the ability of Erep to solve well

constrained geometric constraint problems with lo ops and the ability of IGCS

to solve underconstrained geometric constraint problems

The framework develop ed in this thesis can b e used to help bridge the gap b e

tween geometric and functional constraints and consequently forms an imp ortant

to ol towards ecient interactive engineering design by constraints However the

framework is suciently general that it is not restricted to geometric and func

tional constraints and can also include relational algebra nite domain constraints

scheduling constraints and physical constraints

App endix A

Dimensions

This app endix presents a denition of the dimension function dim domain N

The dimension function should have the following prop erties

dimIR dimQ dimZ dimN

dim dimA A is a nite set

dimD D dimD dimD

1 2 1 2

dimA B maxdimA dimB

dimA B mindimA dimB

dimA n B dimA

The dimension function dened here is taken from It uses manifolds to

capture the ab ove prop erties It is assumed that all of the relations and sets used

in the constraint problem exist within a metric space M with metric d It is also

assumed that the reader is familiar with the concept of metric spaces Readers

unfamiliar with metric spaces are referred to Given the metric space M then

the following denitions are imp ortant for dening a manifold

Denition A Op en Ball Given a metric space M fA dg a p oint a in A

and a strictly p ositive real numb er the op en ball neighb ourho o d of a in M

is the set

B a fx A dx a g



An op en ball in the real line is equivalent to an op en interval of size The

App endix A Dimensions

interval x x in the metric space fIR dg where dx y jx y j is an op en

2

ball in the neighb ourho o d of x In IR op en balls take the form of circles of

3

radius ab out a p oint and in IR op en balls take the form of spheres of radius

ab out a p oint

Denition A Op en Sets A set U is op en in metric space M if y U

such that B y U 

In the metric space fIR dg as ab ove any op en interval a b is an op en set Any

half op en interval such as a b or a b or any closed interval a b is not op en

Denition A Homeomorphisms Bijection f T T is a homeomor

1 2

phism if

U op en in T f U op en in T

1 2



Two sets which are homeomorphic to each other are equivalent in most resp ects

For example N is homemorphic to Z and Q and the op en interval is homem

2

orphic to the real line IR However IR is not homeomorphic to IR

Given these denitions it is p ossible to dene an nmanifold as follows

Denition A nmanifold An nmanifold is a metric space M such that for

all x M there is some neighb ourho o d U of x and some integer n such that U

n

is homeomorphic to IR 

An nmanifold is said to have dimension n Manifolds form an ideal candidate

for the dimension function desired

Denition A Dimension A set S in a metric space M has dimension n

dimS n if and only if n is the smallest numb er such that S is an nmanifold in

M 

From this denition it is immediate that

dimN

dimZ

dimQ

dimIR

0

dimA asIR nite sets

dim

App endix A Dimensions

However by this denition if a set B is countable then

dimB B dimN

as there is always a homeomorphism b etween a Cartesian pro duct of countable sets

and the set of natural numb ers This contradicts prop erty A ab ove

Standard results from manifold theory can b e used to prove that the dimension

function ab ove do es have all the prop erties desired In particular the following

theorem can b e used to satisfy prop erty A taken from

Theorem A If M and M are manifolds of dimension n and n resp ectively

1 2 1 2

then M M is an n n manifold 

1 2 1 2

2

However note that this theorem do es not quite clear up the ambiguity of Z

Spivak notes the example of a torus which is the Cartesian pro duct of two circles

4

Spivak says that the torus is homeomorphic to a subset of IR thus making it a

3

manifold However it is also homeomorphic to a subset of IR meaning that it is

also a manifold

The dimension function clears up this amibiguity by insisting that the set S has

dimension equal to the smal lest nmanifold that it is homeomorphic to Corresp ond

ingly not all Cartesian pro ducts satisfy prop erty A and the prop erty is amended

to reect this see section

App endix B

Constraint Representation Scheme

Reductions

This app endix presents the details of the remaining reductions necessary to form

the hierarchy of constraint representation schemes in gure They are

Undirected graph directed graph

Bipartite graph hyp ergraph

Bipartite graph binary graph in nite case

Theorem B Undirected constraint graphs for example those used by Owen

and Erep are strictly less p owerful than the directed graphs used by for example

ICBSM 

Pro of The pro of is in two parts First a reduction is formed from the undirected

constraint graph to the directed constraint graph demonstrating that the directed

graph can describ e at least as many problems as the directed graph

The weakness of the undirected graph is that it cannot describ e nonsymmetric

y

constraints The vast ma jority of constraints are nonsymmetric However there

are a signicant numb er of symmetric geometric constraints and some constraint

representation schemes such as undirected constraint graphs take advan

tage of this

The signicance of symmetric constraints is that the ordering asso ciated with

the constraint is only a partial ordering For example for the constraint x y it

do es not matter which order the values of x and y are checked in the constraint is

still the same Testing and gives the same result

App endix B CRS Reductions

In an undirected graph there is no concept of ordering of binary constraints

It is not therefore p ossible to describ e anything but symmetric constraints and so

it is assumed that all constraints in an undirected constraint graph are symmetric

constraints It is this fact that will b e exploited in this pro of

The mapping used to reduce an undirected constraint graph V E to a directed

constraint graph V E is as follows

D D

Create V V

D

For each edge e E choose an orientation of that edge randomly so

that for example u v in the undirected graph becomes v u Place the

directed edge in E

D

By insp ection the resultant graph is a directed constraint graph Checking the

reduction criterion

The mapping is dened ab ove

Since the constraints in the undirected graph are symmetric and b oth graphs

use the same CTP any solution to the directed graph is a solution to the

undirected graph Similarly any solution to the directed graph must b e a

solution of the undirected graph

Both are valid CRSs

The reduction can b e done in linear time in the numb er of edges in the undi

rected constraint graph It is therefore p olynomial time

So the undirected graph can b e reduced to a directed graph representation

Secondly it is necessary to prove that the directed graph cannot b e reduced to

the undirected graph This implies that directed graph representations are strictly

more p owerful than undirected graph representations as required It suces to nd

a counter example The weakness of undirected graph representations is that they

require all of the constraints to b e symmetric

Consider then the following problem

P E C

E fx IR y IR z IR g

C fx y y z z xg

App endix B CRS Reductions

There is an obvious directed graph representation of the problem but no obvi

ous undirected representation as the two constraints x y and z x are non

symmetric It is necessary to retain an ordering in order to describ e these con

straint nonambiguously Since an undirected graph do es not preserve order not

all problems that can b e describ ed using a directed graph can b e describ ed in an

undirected constraint graph representation Thus it follows that the directed graph

representation is more p owerful than the undirected graph representation as desired

2

Theorem B The bipartite graph CRSs such as the ConstraintEntity graph in

this rep ort and the schemes of Tsang and Middleditch and Latham are

equivalent to hyp ergraph representation schemes such as Serranos Connectivity

Network 

Pro of Again the pro of is in two parts First a reduction is formed from a bipartite

graph representation scheme to a hyp ergraph representation scheme The mapping

used is as follows

Given the bipartite graph C V E create hypergraph V HE

H

For each vertex x V create entity vertex x in V

i i H

For each c C construct such that fx x x g the

i c c i i i

1 2

i i

k

set of entity vertices adjacent to c in E Then construct the hyperedge

i

he in HE

he

c

i

label led as constraint c with CTP f and ordering

i c c

i i

By insp ection the resulting graph is a hyp ergraph Checking the reduction

criterion

Map is dened ab ove

Since the relation c is b orrowed and the ordering of the entities retained

i

the same problem is b eing solved so all solutions in the bipartite graph are

solutions in the hyp ergraph and vice versa

Both are valid CRSs

App endix B CRS Reductions

For each entity in E a vertex in the hyp ergraph is created taking On For

each constraint in C one hyp eredge is created taking Omn in all This is a

p olynomial time algorithm

Secondly a reduction is formed from the hyp ergraph to the bipartite graph as

follows

Given the hypergraph V HE create bipartite graph V C E

B B B

For each variable x V construct entity vertex x in V

i i B

For each constraint c HE construct a constraint vertex labeled c

i i

in C

B

Create edge x c k x V c C k Z if he H E x he

i j i B j B i

c he and x is in the k th position of

j i c

j

The resultant graph is a bipartite graph Checking the reduction criterion

Map dened ab ove

Since the constraints are tested using the same test pro cedures in b oth repre

sentations a solution in one will b e a solution in the other

Both are valid CRSs

For each entity in V an entity vertex in the bipartite graph is created taking

On For each constraint in C a constraint vertex in the bipartite graph is

created taking Om Each constraint is imp osed on at most On entities so

at most On edges p er constraint are created hence Omn in total Hence

the reduction is p olynomial

Hence the bipartite and hyp ergraph representation schemes are equivalent 2

Theorem B When dealing only with nite domain problems hyp ergraph graph

representations and binary constraint graph representations are equivalent 

Pro of This is a pro of oftquoted in the literature though not explicitly called a

reduction It is usually discussed as a metho d of describing nary constraints in

binary graphs but can b e interpreted as a reduction from a hyp ergraph represen

tation scheme to a binary graph representation scheme see Tsang p for

example The reverse reduction is of course trivial as binary graphs are already

hyp ergraphs 2

App endix C

Using lo cal prop erties to draw

conclusions ab out pro cesses

Theorem C We wish to prove the following

a Strongly Complete Complete

b Lo cally Complete Strongly Lo cally Complete

Strongly Lo cally Complete Lo cally Complete

c Lo cally Complete Complete

d Strongly Consistent Consistent

e Lo cally Consistent Strongly Lo cally Consistent

Strongly Lo cally Consistent Lo cally Consistent

f Lo cally Consistent Consistent

g Strongly Sound Sound

Sound Strongly Sound

h Lo cally Sound Strongly Lo cally Sound

Strongly Lo cally Sound Lo cally Sound

i Lo cally Sound Sound



App endix C Lo cal Global Theorem

Lemma C Given solution process D D and constraint problem P

a D l D l l

b A B C A C B

c A B C B C A A B



Pro of

a Trivial from denition of solution pro cess

b Assume A B

x C A x C x A

x C x B as A B

x C B

C B C A by denition of

c Let A f g B f g Then

A A B B

1 1

k l

C A x C B y

xA y B

If A B then we can reorder C B such that

C B C A y

y B nA

Then we have

y x C B x

y B

x C A y

y B nA

x C A from denition of

C B C A

App endix C Lo cal Global Theorem

2

Pro of of theorem C

a Strongly Complete Complete

Given

C D l D l l C

Required to prove

C D D

Pro of Assume C D D l l then

C C D D l C

C D D l C as S S S

C D D l by C

Hence by induction since C D D we have

C D D

as required 2

Complete Strongly Complete

Given

C D D

Required to prove

C D l D l l

Pro of

C D l C D since D l D

D k as the pro cess is complete

D l by denition of solution pro cess

App endix C Lo cal Global Theorem

as required 2

b Strongly Local ly Complete Local ly Complete

Given

C D l D l l

l l

Required to prove

C D D

Pro of Assume C D D l then

C D C C D

C C D since C C

l l l

C D l induction step

l

D l strong lo cal completeness

Hence C D D as required 2

Local ly Complete Strongly Local ly Complete

Pro of Consider a solution pro cess with step

k

D k D k

where we include v v D k in D k i

1 n

v v D k C

1 n

However if

C C

k

then

u u ju u C u u C

1 n 1 n 1 n k

and by the denition of lo cal completeness this solution step is not lo cally

complete However the solution pro cess itself is obviously lo cally complete

App endix C Lo cal Global Theorem

2

c Local ly Complete Complete

Trivially true if

d Strongly Consistent Consistent

Trivial Given C D l let l

Consistent Strongly Consistent

Given

C C D

Required to prove

C C D l l

Pro of

C D C D l as D D l

Hence

x C D x C D l

C D l

as required 2

e Strongly Local ly Consistent Local ly Consistent

Pro of Consider the problem ffx Zg fx x gg and the solution

pro cess

x1

D Z D f g

x5

D f g

This is an acceptable solution pro cess by the denition of section and

C In fact C f g The pro cess is strongly lo cally consis

App endix C Lo cal Global Theorem

tent as

x D fg

and x D fg

But the pro cess is not lo cally consistent b ecause

x x D

2

Local ly Consistent Strongly Local ly Consistent

Given

C C D

Required to prove

C C D l l

l l

Pro of

C D C D l as D D l and C C

l l

Hence

x C D x C D l

l

C D l

l

as required 2

f Consistent Local ly Consistent

True if

g Strongly Sound Sound

Given

D l C D l l

App endix C Lo cal Global Theorem

Required to prove

D C D

Pro of Assume D l C D then

D l C D l strongly sound

C C D induction step

C D as S S S

Therefore D C D as required 2

Sound Strongly Sound

Pro of Consider the simple solution pro cess where a solution step is as

follows

k

D k D k

where D k C D k

k

Such a pro cess is obviously sound as however it will almost certainly

k k

not b e strongly sound as C C and if C is a strict subset of C

k k

then

D k C D k C

k

D k C D k

That is there wil l b e values in D k which are not valid solutions in C and

so the solution step is not sound and is not strongly sound 2

h Strongly Local ly Sound Local ly Sound

Given

D l C D l l

l

Required to prove

D C D i

App endix C Lo cal Global Theorem

Pro of

D C D

1

C C D

1 2

C C D

1 1

But C C C C as and by denition

1 2 1 i

of C

Hence D C D 2

Local ly Sound Strongly Local ly Sound

Pro of Consider the following solution pro cess

Find v v such that v v C and order f g

1 n 1 n

1

ie v v is not a valid solution to such that v v C n

1 n 1 n

1

the constraint problem We then dene the following solution pro cess

0

1

D D

0

2

D

0

D

Where

D D C v v

1 n

1

D i D i C i i

App endix C Lo cal Global Theorem

Such a pro cess is lo cally sound as

D D C

D C C

1

D C v v C C

1 n

1 2

D v v C v v

1 n 1 n

1

C C

2

D C C

1

v v C C

1 n

2

as D v v D

1 n

D C v v C C

1 n

2

by denition of C

D C by denition of v v

1 n

D C

D C

However the pro cess is not strongly lo cally sound as D contains a value

D 2 not in C

1

i Local ly Sound Sound

Trivially true if 2

App endix D

Enhanced solution spaces

This app endix denes enhanced and emb edded solution spaces Enhanced solution

spaces allow discussion of a solution space within a larger solution space Emb edded

solution spaces allow discussion of subsets of solution spaces

Denition D Enhancement of solution spaces Given two sets of entities

0

resp ectively the enhancement and with solution spaces D and D

 

of D with resp ect to is the solution space of within the solution space



This is written

0



0

D j D D

 

 n

0



0

D j k D k D

   n

Since it is natural to want

0 0

 

0

j D j D

 

an ordering is enforced on the lab els in so that

0



0

D j D D

   n

0

0

D D



n

0



0

j D



In this thesis the ordering is implied unless explicitly stated It is omitted for clarity

Conversely it is sometimes necessary to take the enhanced solution space of a

sup erset and examine the solution space of a subset of This is called the

emb edded solution space of in and is equivalent to the emb edded domains

App endix D Enhanced solution spaces

0

as b elow in The emb edded solution space of in is denoted D j

 

O

0

fD j g D j

 



For relational algebra the enhanced solution space is equivalent to a natural join

The emb edded solution space is similar to a pro jection The ordering is similar to

the notion of an attribute Enhanced solution spaces are also extensions of Monfroys

structure emb edding and constraint system enrichment

Example D Let fx D y D z D g and fy D z D w

x y z y z

D a D g with a lexicographic ordering a w x y z Then

w a l ex

D D D D

 x y z

0

D D D D D

y z w a 

D D D D under

a w y z l ex

Consequently

0



D j D D D D D

 x y z w a

D D D D D under

a w x y z l ex

0



0

j D D D D D D

a w y z x 

D D D D D under

a w x y z l ex



A stated aim of Monfroys enrichments is that no solutions should b e lost How

ever Monfroy treats constraint solvers as black b oxes and do es not consider solution

spaces at all The terminal solution space pro duced by a solver may contain any

numb er of solutions However all solutions that it does contain should b e preserved

Consequently the enhanced solution space within a solution pro cess is dened as

follows

Denition D Enhancement of solution spaces Given two constraint pro

App endix D Enhanced solution spaces

cesses and such that for constraint problems P and P

1 2

D D k

 

0

0 0

D l D

 

the enhanced solution space at step k in pro cess and step l in pro cess

is

0



0 0 0

l D k l D k D D D j

   n n 



Example D Let fw IR x IR y IRg with solution spaces

D IR IR IR



D ffw fg x fg z fgg fw fg x fg z fgg



fw fg x fg z fggg

and fx IR y IR z IRg with solution spaces

0

IR IR IR D



0

ffx fg y fg z fgg fx fg y fg z fgg D



fx fg y fg z fgg fx fg y fg z fggg

with lexicographic ordering w x y z Then

l ex

0



0

0 0

D D j D D D

  

 n n

ffw fg x fg y fgg fw fg x fg y fgg

fw fg x fg y fggg IR

IR ffx fg y fg z fgg

fx fg y fg z fgg fx fg y fg z fgg

fx fg y fg z fggg

ffw fg x fg y fg z fgg

fw fg x fg y fg z fggg

App endix D Enhanced solution spaces

0



only contains congurations that are p ossible solutions to the Thus D j



whole problem For example f g is only a solution to and not and

cannot b e a solution to the whole problem 

App endix E

Paradigms of collab oration

Monfroy has presented three paradigms of collab oration for hybrid constraint

solvers Section has discussed the serial collab oration paradigm in detail This

app endix discusses the parallel and concurrent paradigms in terms of the constraint

satisfaction framework The advantages and disadvantages of each paradigm are

discussed particularly in terms of practical issues

E Parallel hybrids

The second collab oration paradigm suggested by Monfroy is parallel collab oration

In terms of the framework of chapter parallel solvers work in a slightly dierent

fashion to sequential solvers A parallel hybrid splits a large constraint problem into

a numb er of subproblems and then subsolvers solve the subproblems indep endently

of all other subproblems in parallel The solution spaces found by the subsolvers

are combined into a solution space for the problem as a whole using a combination

function

In diagrammatical form see gure E constraint problem P is split

into subproblems P P P to b e solved by

1 1 1 2 2 2 n n n

solvers S S S For the purp oses of this section the decomp osition of P to

1 2 n

the various P is assumed Entities are found by taking the imp osed sets

i i i

The initial solution space D of P is used as input to the subsolvers However

the solvers are each only concerned with the emb edded solution spaces D j

 

i

Each solver then initiates the solution pro cess

i

D j D j

  S  

i i i

App endix E Paradigms of collab oration

The combination function f combines the terminal solution spaces of the subprob

lems into a solution space for P Cho osing the subproblems P is critical for an

i

ecient hybrid The combination function is also vital to determining the terminal

solution space of the hybrid and also to the eciency of the hybrid Monfroy do es

not discuss the practicalities of a parallel hybrid but it seems likely that the combi

nation function will have complexity worse than linear in the numb er of constraints

thus destroying the advantages of using hybrids as the combination function may

have to nd the intersection of two innite implicitly dened sets Eectively this

means solving another nonlinear system of equations If there are only a nite

numb er of solutions to each subproblem then the recombination function will b e of

linear complexity in the numb er of solutions

A theorem similar to theorem can b e constructed for parallel constraint

satisfaction

Theorem E Relation b etween lo cal and global prop erties for parallel

collab oration

Let solution pro cess S act on problem P such that

D D

 S 

Let S b e a parallel collab oration b etween two solvers S and S such that for

1 2

and

1 2 1 2

1

D j D j

S   1  

1 1 1

2

D j D j

S   2  

2 2 2

D f D j D j

   1   2

1 2

where f is a combination function

Then

S is globally sound if S S and f are lo cally sound

1 2

S is globally complete if S S and f are lo cally complete

1 2



Pro of The pro of of this theorem is presented after lemma E 2

App endix E Paradigms of collab oration D(k) Solutions Combination function f Solutions Solutions Solutions 1 2 n 2 1 n D (k ) D (k ) D (k ) Solutions Solutions Solutions Solver 1 Solver 2 Solver n 2 n 2 1 1 n (Φ , Ψ ) (Φ , Ψ ) (Φ , Ψ ) D(0)

(Φ , Ψ )

Figure E Parallel Collab oration

App endix E Paradigms of collab oration

The reader is reminded that a solution pro cess

D D

is consistent if D contains a solution to the constraint problem formed by the

set of constraints The pro cess is sound if D contains only solutions to the

constraint problem and the pro cess is complete if it contains al l of the solutions

to the constraint problem For parallel collab oration the combination function f

satises these prop erties if it preserves the prop erties of the solution spaces it acts

on

By theorem E if the terminal solution spaces provided by pro cesses S S and

1 2

combination function f contain only solutions to the subproblems then S contains

only solutions to the whole problem Similarly if the terminal solution spaces pro

vided by pro cesses S S and combination function f contain al l of the solutions to

1 2

the subproblems then S contains al l of the solutions to the whole problem

Notice that unlike the sequential theorem theorem global consistency is not

decided by this theorem Even if S and S are globally consistent b ecause they are

1 2

op erating indep endently of each other it is p ossible that b oth solvers could nd a

single globally consistent solution but that b oth nd a dierent one Consequently

S is not globally consistent Building a globally consistent parallel hybrid will b e

dicult

Lemma E A B C D A C B D 

Pro of A B x A x B

Similarly

C D x C x D

Therefore

x A C x A x C

x B x D

x B D

2 Pro of of theorem E

S S and f sound S sound

1 2

App endix E Paradigms of collab oration

If S is sound then

1

C D j D j

1     1

1 1

Similarly S and f sound implies that

2

D j C D j

2   2  

2 2

 

D D j D j

2  1  

 

2 1

where

 

0

k j k D j D j

0

  



Given these it remains to prove that S is sound ie

C D D

 

By the denition of enhanced solution spaces

 

C D j D j

1   1

 

1 1

 

C D j D j

2   2

 

2 2

Also by the denitions of enhanced and emb edded solution spaces



D j D i

 



i

Consequently



C D D j

1   1



1



C D D j

2   2



2

Then

C C C D

1 2 

 

D j D j By lemma E and commutativity of

 1  2

 

1 2

D By combination function f



S S and f complete S complete

1 2

App endix E Paradigms of collab oration

If S is complete then

1

C D j D j

1     1

1 1

Similarly S and f complete implies that

2

D j C D j

2   2  

2 2

 

D D j D j

2  1  

 

2 1

Given these it remains to prove that S is complete ie

C D D

 

By the denition of enhanced solution spaces

 

C D j D j

1   1

 

1 1

 

C D j D j

2   2

 

2 2

Consequently



C D D j

1   1



1



C D D j

2   2



2

Then

C C C D

1 2 

 

D j D j By lemma E and commutativity of

 1  2

 

1 2

D By combination function f



2

Parallel solution do es not suer from the same problems as sequential satisfac

tion Since the output of the various solvers is combined using the function f it

do es not matter whether inputs and outputs of solvers are compatible only that f

can handle the various typ es of output

Unfortunately this means that the op eration of f is critical The most p ower

ful combination function is simply the intersection of the various solution spaces

Intersection is sound and complete However the intersection of innite sets is a

App endix E Paradigms of collab oration

nontrivial problem

Another p ossible combination function is to nd a single memb er of the inter

section of solution spaces This would b e a solution to the overall problem P

The combination function is a constraint solver in itself It takes as input two

emb edded solution spaces and tries to pro duce a solution space that is an intersection

of these two solution spaces The two solution spaces provided as input can b e

thought of as constraints and so the combination function is trying to nd solutions

to two complicated constraints Consequently the op eration of the combination

function is vital to the op eration of the parallel hybrid The construction of a

combination function is very hard in general

The chief advantage of a parallel hybrid is that it is trivial to implement on a

parallel pro cessor Since the subproblems are solved indep endently they can b e

solved on separate pro cessors and then recombined as necessary Consequently if

the combination function is fast and ecient then the hybrid should b e fast and

ecient

Parallel collab oration should b e considered if

Use of parallel pro cessors to improve p erformance is p ossible and imp ortant

Subproblems are exp ected to b e relatively indep endent of each other

An ecient combination function is available

The following section presents an example of a parallel collab oration

E An example of solvers in parallel

When joining two solvers in parallel the most imp ortant issues to consider are the

intersection of the entities of the two problems and the nature of the recombination

function The intersection of the two sets of entities gives an indication as to how

dicult it will b e to nd solutions to the general problem The recombination

function as discussed in section E is critical for identifying solutions to the general

problem

Consider the geometric problem P describ ed in gure E

g eom g eom g eom

App endix E Paradigms of collab oration

a

line_1 line_2 r b

(0,0) line_3

c radius

Figure E A simplication of the internal combustion engine

dened by the constraint problem b elow

end l ine end fl ine

g eom

l ine end l ine end

end l ine end l ine

end r adius end r adius

a IR b IR c IR r IRg

fl ine end l ine end l ine end

g eom

end l ine end l ine end l ine end l ine

midpointr adius end r adius end l ine end

end l ine end a distancel ine

end l ine end b distancel ine

end l ine end c distancel ine

distancer adius end r adius end r b c g

where is a set of entities and is a set of constraints

g eom g eom

Simple geometric reasoning by considering the furthest p ossible p oints on l ine

determines that

a c b

a c b

which in this case corresp onds to a range of values for a such that a There

App endix E Paradigms of collab oration

is no restriction on the size of r from the geometric problem Corresp ondingly there

are an innite numb er of solutions to this problem corresp onding to the line l ine

stretching so that it remains coincident rotating ab out the p oint and l ine

The length of r adius is undetermined

Consider also the algebraic problem P with

al g al g al g

fp IR IR d IR cr IR r IR t IR IR n IRg

al g

t

2

fp dcrr cr d r n n

al g

t

p d t g

where is a set of entities and is a set of constraints

al g al g

Solving this problem results in values for cr r and a as b elow

t

cr

t

cr

crr

crr

r

2

r an

a

Now consider the general problem P

g eom al g g eom

An interval solver such as ILOG Solver can solve P but only by convert

al g

ing the geometric constraints in P into a system of equations thus losing any

g eom

geometric knowledge implicit in the problem

However the problem can b e solved using domain sp ecic knowledge in a more

ecient manner If P is studied using ICBSM or IGCS then the range of

g eom

solutions found will b e

a

r

The domain sp ecic knowledge used here is that the rigid b o dies can only move

according to their allowable motions Consequently the solutions to the problem

App endix E Paradigms of collab oration

consist of all the allowable motions of the rigid b o dies

If P is solved in parallel indep endently of P then the solutions to P are

al g g eom al g

cr

1 1

r

21 3

441 3

a

8 8

The recombination function f is then used to nd solutions to P by nding the

intersection of the solutions to P and P

g eom al g

cr

1 1

r

21 3

441

a

8

Parallel solution of P is very ecient and makes go o d use of domain sp ecic knowl

edge

The decomp osition strategy used in this case study is to split P into

P P and P P The hybrid can then b e describ ed in the solver collab o

1 g eom 2 al g

ration language of app endix F as

I GC S P jjI LO GS ol v er P

g eom al g

E Concurrent hybrids

The third collab oration primitive that Monfroy suggests is concurrency A concur

rent hybrid takes as input a constraint problem P The hybrid has a

numb er of solvers at its disp osal as well as a choice function The hybrid solves

problem P simultaneously on all of the subsolvers The choice function is then

used to decide at runtime which solver and terminal solution space to use For

example a choice function may b e to take the solution space of the rst subsolver

that terminates or the most complete solution space which will b e the largest if all

solvers are sound

In diagrammatical form see gure E constraint problem P is copied

to subsolvers S S The subsolvers are initiated on P The choice function is

1 n

then used to decide when to terminate and what solution space is the output of the

hybrid

App endix E Paradigms of collab oration i i D (k ) Choice of solution space ψ Choice function Solutions Solutions Solutions 1 2 n 2 1 n D (k ) D (k ) D (k ) Solutions Solutions Solutions Solver 1 Solver 2 Solver n (Φ, Ψ) (Φ, Ψ) (Φ, Ψ) D(0)

(Φ , Ψ )

Figure E Concurrent Collab oration

App endix E Paradigms of collab oration

Similar to the parallel hybrid the choice function is critical to the terminal

solution space of the hybrid However in this case the function only selects a

solution space from amongst n p ossible solution spaces Indeed since is also time

dep endent in that it may wish to cho ose the rst solver to terminate with a certain

prop erty it is not p ossible to say with certainty what prop erties the terminal solution

space may have unless the function enforces a prop erty such as consistency or

completeness Enforcing such a prop erty will mean that the choice function b ecomes

a constraint solver itself and this will b e dicult to implement

The advantages of concurrent hybrids are that they can guarantee certain prop

erties of the terminal solution space by judicious use of the function and that

since the solvers act indep endently the concurrent subsolvers can b e run in parallel

If a choice function is selected that selects the rst solver to nish and solvers are

run in parallel then the concurrent collab oration will reduce the real time needed

to solve a problem Note that if knowledge of the problem can b e used to deter

mine the b est solver to b e used b efore solution commences this sort of concurrent

collab oration is wasted

However concurrent hybrids involve massive duplication of eort Since eec

tively each solver is trying to do the same job as every other solver that is nd

solutions to P then they will nd the same solutions and duplicate the eort

Concurrent hybrids also do not improve the expressiveness of individual solvers

Since concurrent solvers are only dealing with the same problems it is not p ossible

to improve the expressiveness of an individual solver using the concurrent paradigm

unlike sequential and parallel hybrids

Currently no concurrent hybrids exist in the literature

Concurrent collab oration should b e considered if

It is unknown which of many solvers will work b est

A particular prop erty of a solution space is desired

Sp eed is imp ortant and there is spare parallel pro cessing p ower

App endix F

Solver collab oration language

The extended solver collab oration language used in this thesis is presented in this

app endix The extended solver collab oration language is based on Monfroys solver

collab oration language but has b een extended to allow subsolvers to act on

subproblems and also includes a conditional branch statement to initiate backup

solvers when a rst attempt fails

The extended solver collab oration language is presented in table F The lan

guage is discussed in more detail b elow

The set I d of identiers is used to name solver collab orations and identify them

The symb ol S denotes a set of constraint solvers Note that Monfroy uses only a

single solver in each basic part of a collab oration It is more suitable here to have a

numb er of constraint solvers as a decomp osition strategy may identify a numb er of

p ossible constraint solvers that can b e applied to a subproblem

represents a choice function used in a concurrent collab oration to select from

I d Identiers

S Solvers

Conditional selection

P Constraint problems

D Solution spaces

C ol I d E

E jI djB jE E jEP j rep eat E j EC j if T then E else E

1 2 1 2

T E D

B P S jP S k B

EP E jE k E P

EC E jE EC

Table F Solver collab oration language adapted from BALI

App endix F Solver collab oration language

a numb er of solution spaces as describ ed in app endix E The symb ol P represents

a constraint problem In the terms of solver collab oration each P will typically b e

a subproblem of a larger constraint problem Consistent with the rest of this thesis

solution spaces form an imp ortant part of solver collab oration and are shown as a

D

The remaining terms in table F dene how the basic symb ols can b e formed into

solver collab orations A solver collab oration is describ ed in the solver collab oration

language as an expression E An expression is assigned a name using the form

I d E An expression consists of one of the following

The identity solver which do es not rene a constraint problem at all

An identier indicating a previously dened solver collab oration

A parallel collab oration A parallel collab oration consists of a sequence of

constraint problemsolver pairs or more complicated expressions linked with

a k symb ol This is interpreted that each constraint problemsolver pair

is solved indep endently and the solution spaces combined as describ ed in

section E Thus in the parallel collab oration

P S k P S k P S

1 1 2 2 3 3

problem P is solved by a solver in S problem P is solved by a solver in S

1 1 2 2

and problem P is solved by a solver in S indep endently of each other Solu

3 3

tions are then recombined to give a solution space for the combined constraint

problem formed by P P P

1 2 3

A serial collab oration A serial collab oration consists of a sequence of con

straint problemsolver pairs or more complicated expressions linked with a

symb ol This is interpreted that each constraint problemsolver pair is solved

in sequence and that information from the rst solution is used to solve the

second and so on as describ ed in section Thus in the serial collab oration

P S P S P S

1 1 2 2 3 3

problem P is solved by a solver in S problem P is solved by a solver in S

1 1 2 2

and problem P is solved by a solver in S P is solved rst and information

3 3 1

obtained from this is used in solving P and so on Solutions to P are then

2 3

App endix F Solver collab oration language

combined with the solutions obtained from P and P to give solutions to

1 2

P P P

1 2 3

Rep eated application of a solver collab oration Sometimes information can b e

obtained during a solution pro cess that can b e used to rene the solution even

further However this information is only apparent after the solution pro cess

has completed Rep eated application of a solver collab oration R epeatE can

b e used to force a solver to rep eat a solution pro cess until it can progress no

further Monfroy demonstrates this in by dening the solver collab oration

S M apl e NF R epeatLin

inc E q

NF transforms p olynomials so they can b e used by Lin Lin is a M apl e

E q E q

solver for linear equalities and inequations using an extension of Gaussian elim

ination It is rep eatedly applied until it cannot simplify the linear equations

any more

A concurrent collab oration A concurrent collab oration consists of a numb er

of constraint problemsolver pairs or more complex expressions linked by a

symb ol and selected from using a choice function This is equivalent to the

concurrent collab oration presented in section E Thus

P S P S P S

f 1 1 1 2 1 3

is a concurrent collab oration where P is solved by one of S one of S and

1 1 2

one of S concurrently The choice function selects the concurrent solution

3 f

space given by the rst solver to terminate

A conditional branch The conditional branch statement has b een included in

the language to allow the p ossibility that a constraint solver expression may

pro duce a value dierent than exp ected Should this o ccur the user of the

constraint solver may wish to activate backup solvers

For example supp ose that two solvers S and S can b e applied to nd so

1 2

lutions to problem P Solver S is much more ecient than S but can miss

1 2

solutions o ccassionally whereas solver S is much more thorough but consid

2

erably slower In this case the user may wish to build a hybrid constraint

App endix F Solver collab oration language

solver as b elow

S if S P then S P else

1 2

where is the identity solver P D D

The hybrid solver S will attempt to solve problem P using solver S However

1

if no solutions are found then S is used to nd solutions to P Note that

2

several assumptions are made in the denition of S

S is sound If S is not sound then it may return a solution space which

1 1

is not identically empty but also do es not contain any solutions to P

If S is sound and returns an empty set then S has failed to nd any

1 1

solutions and S should b e used

2

Finding a single solution to P is sucient The conditional test do es not

count the numb er of solutions in order to activate S It is p ossible to

2

imagine a conditional branch statement that is predicated by the numb er

of elements in the solution space and in particular by the numb er of

solutions in the terminal solution space of solver S However such a

1

test would likely b e extremely exp ensive as estimating the numb er of

solutions to even simple constraint problems is dicult

Note that other than the conditional guard op erator which has b een omitted

for clarity the language in table F contains Monfroys BALI

The op erational semantics of the statements in table F are straightforward

to convert from Monfroys descriptions into the terminology of chapters The

conditional branch is describ ed b elow as an example and b ecause it is not part of

Monfroys basic language

App endix F Solver collab oration language

Denition F Conditional branch Successful branch

E

0

D k D k D k D

P if E D then E else E E D k P E D k E E D k

0 1 2 1 1

Unsuccessful branch

E

0

D k D k D k D

P if E D then E else E E D k

0 1 2

P E D k E E D k

2 2



Note that if the conditional branch test is satised the solver expression E op erates

1

on the old solution space D k If the test fails the solver expression E op erates

2

on the new solution space D k This pro duces the desired outcome as in the

example ab ove

The solver collab oration can b e used as Monfroy do es to pro duce hybrid con

straint solvers Some examples of this use are demonstrated in section G and E

Moreover the extensions to the solver collab oration language discussed in this sec

tion combined with a decomp osition strategy allow more complex and p otentially

more p owerful hybrids

App endix G

An example of many solvers in

serial

This app endix describ es in more detail the exp eriment describ ed in section

This exp eriment was carried out to study the asymptotic b ehaviour of various con

straint satisfaction algorithms on a simple case study The algorithms studied were

INCES a numerical algorithm and a sequential hybrid The purp ose of

the exp eriment was to give empirical as well as theoretical evidence that the hybrid

algorithm was sound complete and more ecient than the other two algorithms

as well as to investigate sequential collab oration It was anticipated that the hy

brid would b e approximately linear in complexity whilst the other two algorithms

would b e quadratic This would help to underline the advantages of using hybrid

algorithms

For convenience the description of the case study is rep eated in the following

section A detailed description of the manner in which the exp eriment was conducted

is then explained and the problems encountered are describ ed in full

G Case study

The case study chosen was an extension of Lamouniers internal combustion engine

case study see and section That problem studied the integration of some

algebraic equations with the geometric constraints describing the construction of

the piston The two problems were linked so that the size of the piston and the

length of the crankshaft were variables b oth in the functional problem and also in

the geometric problem However this is a xed size of problem In order to study

the asymptotic b ehaviour of the algorithms n piston problems were joined together

App endix G An example of many solvers in serial

Functional Problem Functional Problem

Functional Problem

crankshaft piston piston piston

crank

crank

Figure G Case Study of n Piston Problems Linked Together

as in gure G

In this case study the n pistons are linked by coincident constraints at each

end of the piston Thus the problems are all connected and the complexity of the

problem do es increase as the size of n increases The functional problems are not

linked and are eectively lots of small xed problems solved indep endently

G The solvers used

Three solvers were examined The NAG CNBC function was used as a numer

ical solver It was passed the whole set of constraints and used numerical techniques

to converge towards a solution The sp eed of convergence dep ended heavily on the

2

initial guess but the b est case complexity of the NAG function is n where n is

the numb er of constraints

Lamouniers INCES solver is also capable of solving the problem as a whole

However INCES deals only with equations and not geometric constraints Geo

metric constraints can b e handled if they are reduced to the constituent equations

INCES was exp ected to b e quadratic as it dealt with the problem as a whole and

resorted to numerical solvers if lo ops app eared

These constraint solvers were compared with a hybrid formed from combining

the functional solver INCES and the geometric solver IGCS much as in case study

section Each functional problem was solved using INCES and the results

were passed to IGCS by varying the size of the lines in IGCS see gure G It was

hop ed that the hybrid would b e able to take b est advantage of the domainsp ecic

App endix G An example of many solvers in serial

Constraint Functional Solutions Geometric Solutions D(0) INCES D(1) IGCS Problem

Subproblem Subproblem

Figure G Serial Hybrid used to Solve n Piston Problems Linked Together

knowledge incorp orated in the INCES and IGCS solvers and would b e linear The

theoretical complexity analysis of the hybrid system is presented in the next section

The decomp osition strategy D e used in this case is to decomp ose problem

P into a set fS P g where solver S is IGCS if subproblem P is geometric

i i i i

and S is INCES if subproblem P is algebraic Decomp osition is p erformed by rst

i i

identifying constraints as geometric or algebraic These form two sets of constraints

and Constructing and takes time On where n is the numb er of

1 2 1 2

constraints

Set is then decomp osed further into sets of connected comp onents where

i j

and are connected if there is a path b etween and in

1 2 1 2

i i

the constraintentity graph of constraint problem n j i Finding the

j

connected comp onents can b e done in a simple graph traversal algorithm that takes

time Om where m is the numb er of edges in the constraintentity graph Since

the imp osed sets of constraints are usually quite small m will typically b e a multiple

of the numb er of constraints in P Thus decomp osition of P takes time On

With this decomp osition strategy the hybrid can b e describ ed in the solver

collab oration language of section as

S P S P S P S P

1 1 2 2 3 3 n n

G Exp ected b ehaviour of hybrid

Each functional problem is solved individually and indep endently of any other and

the results of each problem are then used as input to the appropriate line segments

of the geometric problem Since each problem is indep endent it is solved in con

stant time Therefore n such problems take On time where n is the numb er of

constraints

The geometric problem increases in complexity as the numb er of problem in

stances increases However adding a new instance of the problem due to the nature

of IGCS should only take a constant amount of time to translate each new line

segment so that it is coincident to the previous line segment Since the constraints

are pro cessed in the order they are p ositioned the algorithm should take On time

overall where n is the numb er of constraints

App endix G An example of many solvers in serial

1400 NAG c05nbc with progressively worse initial guess

1200

1000

800

600 Time in seconds

400

200

0 0 200 400 600 800 1000 1200 1400 1600 1800 2000

Number of constraints

Figure G NAG function with bad initial guess

Since there are no lo ops in each constraint subproblem the hybrid of INCES and

IGCS should have a linear b ehaviour Since the functional problems only provide

one solution to the geometric problem the hybrid solver should b e On This

compares favourably with the other two constraint solvers

G Results

The case study was run for problem sizes b etween and This gave problems

with b etween and variables For all of the following graphs the xaxis is the

numb er of variables in the problem and the yaxis is the amount of time taken to

solve the problem in seconds All case studies were run on a Silicon Graphics Indy

with an R MHz IP pro cessor and Mbytes of memory

The NAG CNBC function gave the results in gure G and in gure G

Figure G shows that with an initial guess that is progressively further and further

away from the solution the time that the NAG algorithm takes to solve the problem

increases in a nonlinear fashion Divergent results such as those at n were

identied by the NAG algorithm as Not Improving and had not converged to a

solution by the time the algorithm terminated However underlying the divergent

b ehaviour a nonlinear pattern is apparent For a problem size of variables

the NAG solver takes approximately seconds more than minutes

Figure G shows the NAG CNBC function with a consistently go o d guess

App endix G An example of many solvers in serial

180 NAG c05nbc with consistently close guess

160

140

120

100

80 Time in seconds

60

40

20

0 0 200 400 600 800 1000 1200 1400 1600 1800 2000

Number of constraints

Figure G NAG function with go o d initial guess

The curve shown is much more regular but the numerical solver still diverges o cca

sionally for example when n However even with a go o d initial guess the

NAG function is still nonlinear probably quadratic For a problem size of the

NAG function takes seconds

Figure G shows the results for the INCES solver on the problem Again the

solver is obviously nonlinear but the solution is always found Note that the INCES

algorithm app ears to b e ab out times as fast as the NAG solver For a problem

size of INCES to ok ab out seconds

Figure G shows the results for the hybrid solver Even though the curve is

nonlinear the time taken to solve a variable problem is less than a second two

orders of magnitude faster than the INCES algorithm However the nonlinear curve

do es not agree with the exp ected b ehaviour of the hybrid as a linear function was

exp ected Further analysis of the INCES and IGCS algorithms discovered that the

parametric constraint list and dep endency hierarchy lists resp ectively were reducing

the two algorithms to quadratic b ehaviour

In INCES the parametric constraint list is used as a global data structure to

describ e the entire constraint problem Whenever a constraint is referenced the

INCES solver searches through the parametric constraint list to nd the reference

to the appropriate constraint INCES is an incremental solver and corresp ondingly

each time a constraint is added the parametric constraint list is checked The

constraint list is of On size where n is the numb er of constraints in the problem

App endix G An example of many solvers in serial

60 Solution of combined problem using INCES

50

40

30 Time in seconds

20

10

0 0 200 400 600 800 1000 1200 1400 1600 1800 2000

Number of constraints

Figure G Solving with INCES

3.5 Hybrid solution with dependency hierarchy list

3

2.5

2

1.5 Time in seconds

1

0.5

0 0 500 1000 1500 2000 2500 3000 3500 4000

Number of constraints

Figure G Hybrid solution using IGCS and INCES

App endix G An example of many solvers in serial

0.35 Solution of only parametric model

0.3

0.25

0.2

0.15 Time in seconds

0.1

0.05

0 0 500 1000 1500 2000 2500 3000 3500 4000

Number of constraints

Figure G Solving the functional problem only using INCES without global para

metric constraint list

and since each time a constraint is added the parametric constraint list is studied by

the time n constraints have b een added to the problem the parametric constraint

list has b een consulted n times The rst such consultation takes lo okup the

second lo okups until the nal constraint insertion takes n lo okups Thus just

2

studying the parametric constraint list takes On

Removing the parametric constraint list each time the functional problem was

solved resulted in the graph in gure G showing the time taken to solve only the

algebraic mo del

In IGCS the dep endency hierarchy list is used to search for lo ops in the con

straint graph The dep endency hierarchy of an entity is the list of entities for which

solutions must b e found b efore solutions to the entity itself can b e found In order

to nd whether a constraint problem has a lo op or not when a constraint b etween

two entities is added the dep endency hierarchy of b oth entities is compared If they

share a common ancestor in the dep endency hierarchy then a lo op has b een created

Unfortunately the implementation of this dep endency hierarchy list results in the

quadratic b ehaviour of IGCS

As a new constraint is added b etween two entities the dep endency hierarchy lists

of the two entities are compared In the long chain of constraints used in this case

study the constraint is always b etween an entity with a dep endency hierarchy of

the whole problem and an entity with a dep endency hierarchy of only a few entities

App endix G An example of many solvers in serial

0.22 Geometric part only solved with IGCS without dependency hierarchy list

0.2

0.18

0.16

0.14

0.12

0.1 Time in seconds

0.08

0.06

0.04

0.02

0 0 500 1000 1500 2000 2500 3000 3500 4000

Number of constraints

Figure G Solving the geometric problem only using IGCS without the dep endency

hierarchy list

However IGCS as currently implemented searches through the whole set of entities

in each dep endency hierarchy to nd common elements This takes Om where m

is the numb er of entities in the problem This is rep eated for each new constraint

as it is inserted and since there are n constraints the op eration as a whole takes

Omn Since the numb er of constraints is usually similar to the numb er of entities

2

simply consulting the dep endency hierarchy list in IGCS takes On

Removing the dep endency hierarchy list altogether resulted in the graph of g

ure G showing the time taken to solve only the geometric problem Note that

b oth of these graphs are roughly linear Irregularities can b e asso ciated with the

coarseness of the timing function available

Recombining the new linear versions of IGCS and INCES results in a hybrid

algorithm with results as in gure G Note that the hybrid is approximately

linear in complexity and that the time taken to solve a variable problem is

approximately seconds an order of magnitude improvement over the previous

version

G Conclusions

The hybrid constraint solver is very fast indeed It is linear whereas the other

solvers compared were quadratic at b est It is three or four orders of magnitude

App endix G An example of many solvers in serial

0.6 Hybrid solution without dependency hierarchy list

0.5

0.4

0.3 Time in seconds

0.2

0.1

0 0 500 1000 1500 2000 2500 3000 3500 4000

Number of constraints

Figure G Solution using a hybrid algorithm of IGCS without depH list and INCES

without global parametric constraint list

faster than the NAG function Figure G shows the various graphs in relation

to each other Even for problems of or so variables the hybrid is much faster

It is also signicant that the hybrid with the depH list whilst nonlinear is still

much faster than INCES and CNBC The depH list is used to identify lo ops

and as IGCS cannot handle lo ops without it something equivalent will have to b e

implemented Disjoint forests would increase the complexity of the current On

2

algorithm to On log n for example rather than On where n is the numb er of

constraints

App endix G An example of many solvers in serial

5 Hybrid solution with dependency hierarchy list Hybrid solution without dependency hierarchy list 4.5 Solution of combined problem using INCES NAG c05nbc with consistently close guess

4

3.5

3

2.5

Time in seconds 2

1.5

1

0.5

0 0 500 1000 1500 2000 2500 3000 3500 4000

Number of constraints

Figure G A comparison of the CNBC function and INCES algorithm with the

hybrid solver

App endix H

Glossary

Articulation pair A pair of vertices A B in a graph G are an articu

lation pair if removal of A and B from G along with

all edges incident to A or B disconnects G

Bijections A bijection is a function that is injective and surjec

tive If f is bijective then f has welldened inverse

Bipartite graph A bipartite graph is a graph V E such that V

U W U W and a b E a U b W

Cartesian pro duct The Cartesian pro duct of two sets A and B is the set

of all ordered pairs a b where a A and b B

Connected graph A graph G V E is connected if for every pair of

vertices u and v in V there exists a path from u to

v

Countable sets A set A is countable if it is nite or if there exists a

bijection f N A

Directed edges An edge e of graph G is directed if there is an order

placed on the vertices in the edge Directed edges

are represented using the notation u v where u and

v are vertices in G

First order formulae First order predicate logic formulae

Graph Let V b e a nite set of vertices and E b e a subset of

the unordered pairs of vertices Then a graph is the

ordered pair V E

Hyp eredge A hyp eredge is a nite set of vertices

App endix H Glossary

Hyp ergraph A hyp ergraph V HE is an ordered pair of a nite

set of vertices V and a nite set of hyp eredges HE

Injective functions A function f A B is injective if f x f y

implies x y

Lab elled graph A graph G V E is lab elled if each edge e E is

lab elled with a symb ol

Lo op A lo op in a graph G is an edge u u where u is a

vertex in G

Path A path in a graph G V E is an alternating

sequence of vertices and edges v e v e v

0 1 1 n n

where e v v all edges are dierent and no

i i i+1

vertices are rep eated except p ossibly that the last

and the rst are the same

Quantier free A rst order formula lacking the symb ols and

Simple graphs A simple graph has at most one edge b etween any

two vertices

Strongly connected com A graph is a strongly connected comp onent if there

p onents exists a path from every vertex to every other vertex

Surjective functions A function f A B is surjective if f A B

where f A ff a a Ag

Symmetric constraints A constraint C is symmetric if C fx x g

i i

1

j

is the imp osed set on C v v are values in

i i

1

j

D D of x x resp ectively and

i i i i

1 1

j j

v v v v C

1 i i n

1

j

v v v v C

1 l i l i n

1

j

for all p ermutations of v v A constraint

l i i

1

j

is nonsymmetric if it is not symmetric

Undirected edges An edge e of graph G is undirected if there is no

order placed on the vertices in the edge Undirected

edges are represented using the notation u v where

u and v are vertices in G

Triconnected comp onents A graph is a triconnected comp onent if it contains

no articulation pairs

Bibliography

B Aldefeld Variation of geometries based on a geometricreasoning metho d

ComputerAided Design

Ram Anantha Glenn A Kramer and Richard H Crawford Assembly mo d

elling by geometric constraint satisfaction ComputerAided Design

R Anderl and R Mendgen Mo delling with constraints Theoretical founda

tion and application ComputerAided Design

Farhad Arbab and Bin Wang A constraintbased design system based on

op erational transformation planning In Proceedings of the th International

Conference on the Applications of Articial Intel ligence in Engineering pages

Cambridge UK July

P Atzeni and V De Antonellis Relational Database Theory The Ben

jaminCummings Publishing Company Inc

F Baader and K Schulz On the combination of symb olic constraints solu

tion domains and constraint solvers In Proceedings of the rst International

Conference on Principles and Practice of Constraint Programming CP

volume of Lecture Notes in Computer Science pages Springer

Verlag

F Baader and K U Schulz Combination of constraint solving techniques

An algebraic p oint of view In Proceedings of the th International Conference

on Rewriting Techniques and Applications volume of Lecture Notes in

Computer Science pages SpringerVerlag

D Bara Interactive simulation of solid rigid b o dies IEEE Computer Graph

ics and Applications pages May

BIBLIOGRAPHY

Sanjay Bhansali Glenn A Kramer and Tim J Hoar A principled approach

towards symb olic geometric constraint satisfaction Journal of Articial In

tel ligence Research

S Bistarelli U Montanari and F Rossi Semiringbased constraint satisfac

tion and optimization Journal of the ACM March

A Borning B FreemanBenson and M Wilson Constraint Hierarchies Lisp

and Symbolic Computation

Alan Borning Thinglab a constraintoriented simulation lab oratory Tech

nical Rep ort SSL Xerox Palo Alto Research Center July

W Bouma I Fudos C Homann J Cai and R Paige A Geometric Con

straint Solver Technical Rep ort CSDTr Department of Computer

Science Purdue University August

W Bouma I Fudos C Homann J Cai and R Paige A geometric con

straint solver ComputerAided Design June

Mark W Brunkhart Interactive geometric constraint systems Masters thesis

Computer Science Division Deparment of Electrical Engineering and Com

puter Science University of California Berkeley

SA Buchanan and A de Pennington Constraint Denition System a

ComputerAlgebra based Approach to Solving GeometricConstraint Prob

lems ComputerAided Design Decemb er

B Buchb erger Grobner bases an algorithmic metho d in p olynomial ideal

theory In N K Bose editor Multidimensional systems theory pages

D Reidel Publishing Company

Bruce W Char Keith O Geddes Gaston H Gonnet Benton L Leone Michael B

Monagan and Stephen M Watt Maple V Library Reference Manual Springer

Verlag

JCH Chung and MD Schussel Technical evaluation of variational and

In Proceedings of Autofact pages

C Clarke Proengineer CADCAM January

BIBLIOGRAPHY

Thomas H Cormen Charles E Leiserson and Ronald L Rivest Introduction

to Algorithms MIT Press

Maurice Dohmen A survey of constraint satisfaction techniques for geometric

mo deling Computers and Graphics

JeanFrancois Dufourd Pascal Mathis and Pascal Schrek Formal resolution of

geometric constraint systems by assembling In Proceedings of Solid Model ling

Lynn Eggli Ching yao Hsu Beat Bruderlin and Gershon Elb er Inferring

d mo dels from freehand sketches and constraints ComputerAided Design

M Fa Interactive Constraintbased Solid Model ling PhD thesis Scho ol of

Computer Studies University of Leeds Septemb er

M Fa T Fernando and P M Dew Direct D Manipulation Techniques

for Interactive Constraintbased Solid Mo delling Forum

Proc of EuroGraphics Septemb er

M Fa T Fernando and P M Dew Interactive Constraintbased Solid Mo d

elling using Allowable Motion Proc of ACMSIGGRAPH Symposium on

Solid Model ling and Applications pages May

JC Faugere Resolution des systemes dequations algebriques PhD thesis

Universite Paris

LTP Fernando PM Dew and F Gao Constraintbased interaction tech

niques for supp orting a distributed collab orative engineering environment In

Proceedings of the First Workshop on Simulation and Interaction in Virtual

Environments SIVE pages

LTP Fernando M Fa PM Dew and M Munlin Constraintbased d ma

nipulation techniques within virtual environments In RA Earnshaw editor

Virtual Reality Applications pages Academic Press

T Fernando P M Dew M Fa J Maxeld and N Hunter A Shared Virtual

Workspace for Constraintbased Solid Mo delling EuroGraphics Workshop on

Virtual Environments Septemb er

BIBLIOGRAPHY

T Fernando M Fa P M Dew and Mudarmeen Munlin Constraintbased D

Manipulation Techniques for Virtual Environments In Proc of International

State of the Art Conference BCS on Applications of Virtual Reality Ed by

R A Earnshaw J Vince and H Jones

R Frasse Theory of Relations volume of Studies in Logic and the Foun

dations of Mathematics Elsevier Science Publishers Amsterdam

B N FreemanBenson J Maloney and A Borning An Incremental Con

straint Solver Communications of the ACM January

E Freuder and P Hubb e A disjunctive control schema for constraint sat

isfaction In V J Saraswat and P Van Hentenryck editors Principles and

Practice of Constraint Programming MIT Press

E C Freuder and PD Hubb e Extracting constraint satisfaction subproblems

In th International Joint Conference on Articial Intel ligence

I Fudos Editable Representations for D Geometric Design Masters thesis

Scho ol of Computer Studies Purdue University

I Fudos and C Homann Correctness Pro of of a Geometric Constraint Solver

Technical Rep ort CSD Department of Computer Science Purdue Uni

versity Decemb er

Ioannis Fudos and Christoph Homann A graphconstructive approach to

solving systems of geometric constraints ACM Transactions on Graphics

April

Esther Gelle and Ian Smith Dynamic constraint satisfaction with conict

management in design In Michael Jamp el Eugene Freuder and Michael

Maher editors OverConstrained Systems numb er in LNCS pages

Springer

M Gleicher Integrating Constraints and Direct Manipulation Sympo

sium on Interactive D Graphics pages

M Gleicher A Graphics To olkit Based on Dierential Constraints UIST

pages Novemb er

M Gleicher and AWitkin Dierential manipulation Graphics Interface

pages June

BIBLIOGRAPHY

Michael Gleicher A Dierential Approach to Graphical Interaction PhD

thesis Scho ol of Computer Science Carnegie Mellon University Novemb er

CMUCS

Sreenivasa R Gorti and Ram D Sriram From symb ol to form a framework for

conceptual design ComputerAided Design Novemb er

Nottingham Algorithms Group Nag library manual Mark Fortran

Edition

Christoph Homann and Jaroslaw Rossignac A road map to solid mo del

ing IEEE Transactions on and Computer Graphics

March

CM Homann and RJuan Erep An Editable Highlevel Representation for

Geometric Design and Analysis Technical rep ort Department of Computer

Sciences Purdue University

JE Hop croft and R E Tarjan Dividing a graph into triconnected comp o

nents SIAM Journal of Computation Septemb er

H Hosob e K Miyashita S Takahashi S Matuoka and A Yonezawa Lo cally

simultaneous constraint satisfaction In Alan Borning editor PPCP Sec

ond Workshop on Principles and Practice of Constraint Programming Seattle

WA May

J Jaar M Maher P Stuckey and R Yap Beyond nite domains In Alan

Borning editor PPCP Second Workshop on Principles and Practice of

Constraint Programming Seattle WA May

Joxan Jaar and Michael Maher Constraint logic programming a sur

vey Journal of Logic Programming Special th Anniversary Issue

MayJuly

Narendra Jussien and Patrice Boizumault Implementing constraint relaxation

over nite domains using ATMS In Michael Jamp el Eugene Freuder and

Michael Maher editors OverConstrained Systems numb er in LNCS

pages Springer

NP Juster Mo delling and Representation of Dimensions and Tolerances A

Survey ComputerAided Design January

BIBLIOGRAPHY

H Kirchner and C Ringeissen Combining symoblic constraint solvers on

algebraic domains Journal of Symbolic Computation

K Kondo Algebraic Metho d for Manipulation of Dimensional Relationships

in Geometric Mo dels ComputerAided Design March

G A Kramer Using Degrees of Freedom Analysis to Solve Geometric Con

straints In J Rossignace and J Turner editors Proceedings Symposium

on Foundations and CADCAM Applications pages

G A Kramer A Geometric Constraint Engine Articial Intel ligence

Glenn A Kramer Solving Geometric Constraint Systems MIT Press

Vipin Kumar Algorithms for ConstraintSatisfaction Problems A Survey

AI Magazine pages Spring

Timo Laakko and Martti Mantyla Incremtnal constraint mo delling in a fea

ture mo delling system In J Rossignac and F Sillion editors EUROGRAPH

ICS volume Eurographics Asso ciation Blackwell Publishers

E Lamounier T Fernando and P Dew An Incremental Constraint Equa

tion Solver for Variational Design In Proceedings of the Fourth International

Conference on Computational Graphics and Visualization Techniques COM

PUGRAPHICS pages Decemb er

Edgard Lamounier First Year Rep ort Technical rep ort Scho ol of Computer

Studies University of Leeds

Edgard Lamounier An incremental constraintbased approach to support engi

neering design PhD thesis Scho ol of Computer Studies University of Leeds

Herve Lamure and Dominique Michelucci Solving geometric constraints by

homotopy IEEE Transactions on Visualization and Computer Graphics

March

R Latham and A Middleditch Connectivity Analysis A To ol for Pro cessing

Geometric Constraints Technical rep ort Brunel University UK August

BIBLIOGRAPHY

Richard Latham and Alan Middleditch Connectivity analysis a to ol for

pro cessing geometric constraints Computeraided Design

Novemb er

Richard Samuel Latham Combinatorial algorithms for the analysis and sat

isfaction of geometric constraints PhD thesis Brunel University PhD

L

Rob ert Light and David Gossard Mo dication of geometric mo dels through

variational geometry ComputerAided Design July

VC Lin DC Gossard and RA Light Variational Geometry in Computer

Aided Design Computer Graphics August

G Lop ez B FreemanBenson and A Borning Kaleidoscop e A Constraint

Imp erative Programming Language Technical Rep ort UWCSE

University of Washington

Tomas LozanoPerez Spatial planning A conguration space approach IEEE

Transactions on Computers February

DCub ed Ltd The d dcm technical overview Castle Street Cambridge

CB AJ England

DCub ed Ltd d dcm technical overview Castle Street Cambridge CB

AJ England

DCub ed Ltd An overview of dcub ed and the dcm Castle Street Cam

bridge CB AJ England

M Mantyla A Mo delling System for Topdown Design of Assembled Pro ducts

IBM J Res Develop

M Mantyla WAYT Towards a Mo delling Environment for Assembled Pro d

ucts Intel ligent CAD III pages

J Maxeld LTP Fernando and PM Dew A distributed virtual envi

ronment for collab orative engineering In Proceedings Virtual Reality Annual

International Symposium VRAIS pages

BIBLIOGRAPHY

John Maxeld A Distributed Virtual Environment for Synchronous Col labo

ration in Simultaneous Engineering PhD thesis Scho ol of Computer Studies

University of Leeds July

MBouzoubaa B Neveu and GHasle Houria A solver for equational con

straints in a hierarchical system In Proceedings of the OCS workshop in

conjunction with CP Cassis France

Pedro Meseguer Constraint Satisfaction Problems An Overview AI Com

munications March

E Monfroy and C Ringeissen Domainindep endent constraint solver ex

tension Technical rep ort Centre de Recherche en Informatique de Nancy

Vando euvrelsNancy

E Monfroy M Rusinowitch and R Schott Implementing nonlinear con

straints with co op erative solvers Technical Rep ort Technical Rep ort R

Centre de Recherche en Informatique de Nancy Vando euvrelsNancy

Also as INRIA Technical Rep ort RR

Eric Monfroy An environment for designingexecuting constraint solver col

lab orations Technical rep ort Centre de Recherche en Informatique de Nancy

Vando euvrelsNancy

Eric Monfroy Michael Rusinowitch and Rene Schott Implementing non

linear constraints with co op erative solvers In K M George J H Carrol

land D Opp enheim and J Hightower editors Proceedings of ACM Sympo

sium on Applied Computing SAC pages February

J Owen Algebraic Solution for Geometry from Dimensional Constraints

Symposium on Solid Model ling Foundations and CADCAM Applications

June

J Pab on R Young and W Keirouz Integrating Parametric Geometry Fea

tures and Variational Mo deling for Conceptual Design International Journal

of Systems Automation Research and Applications SARA

G Pahl and W Beitz Engineering Design

John Platt A generalization of dynamic constraints CVGIP Graphical Mod

els and Image Processing Novemb er

BIBLIOGRAPHY

William H Press Brian P Flannery Saul A Teukolsky and William T Vet

terling Numerical Recipes The Art of Scientic Computing Cambridge

University Press

P Prosser Hybrid Algorithms for the Constraint Satisfaction Problem Com

putational Intel ligence

JeanFrancois Puget A C Implementation of CLP In Proceedings of

SPICIS Singapore International Conference on Intel ligent Systems

A A G Requicha Representations of Tolerances in Solid Mo delling Issues

and Alternative Approaches In Solid Model ling by Computers From Theory

to Applications

M Sanella The SkyBlue Constraint Solver and its Applications Proceedings

of the Workshop on Principles and Practice of Constraint Programming

M Sanella and RA Borning MultiGarnet Integrating MultiWay Con

straints with Garnet Technical Rep ort UWCSE University of

Washington

M Sanella J Maloney B FreemanBenson and A Borning MultiWay vs

OneWay Constraints in GUIs Exp erience with the Deltablue Algorithm

Technical Rep ort UWCSEa University of Washington

M Sap ossnek Research on constraintbased design systems In Applications

of AI

D Serrano Managing Constraints in Concurrent Design First Steps ASME

pages

D Serrano Automatic dimensioning in design for manufacturing SM

pages

David Serrano Constraint Management in Conceptual Design PhD thesis

Department of Mechanical Engineering MIT

David Serrano and David Gossard To ols and Techniques for Conceptual

Design In Articial Intel ligence in Engineering Design volume chapter

pages Academic Press Inc

BIBLIOGRAPHY

Shuichi Shimizu and Masayuki Numao Constraintbased Design for D

Shap es Articial Intel ligence

Barbara Smith A Tutorial on Constraint Programming Technical Rep ort

University of Leeds April

Barbara Smith and Martin Dyer Lo cating the phase transition in constraint

satisfaction problems Articial Intel ligence Sp ecial issue

on Frontiers in Problem Solving Phase Transitions and Complexity

Barbara Smith and Stuart Grant Sparse constraint graphs and exceptionally

hard problems In Proceedings of IJCAI volume pages August

W Sohrt and JD Bruderlin Interaction with Constraints in D Mo delling

International Journal of and Applications

Michael Spivak A Comprehensive Introduction to Dierential Geometry vol

ume One Publish or Perish Inc nd edition

Ivan Sutherland Sketchpad A ManMachine Graphical Communication Sys

tem PhD thesis MIT Cambridge Mass

W A Sutherland Introduction to Metric and Topological Spaces Oxford

Science Publications

Martin Thompson Techniques for supp orting maintenance analysis in vir

tual environments First Year Transfer Rep ort Scho ol of Computer Studies

University of Leeds

JC Tsai R Konkar and MR Cutkosky Issues in Incremental Analysis of

Assemblies for Concurrent Design nd International Conference on AI in

Design

Y T Tsai T Fernando and PM Dew Exploiting degrees of freedom anal

ysis for interactive constraintbased design In N M Thalmann and V Skala

editors The Fourth International Conference in Central Europe on Computer

Graphics andVisualization WSCG pages Plzen Czech Re

public February

BIBLIOGRAPHY

YungTeng Tsai Incremental Geometric Constraint Satisfaction Algorithms

PhD thesis Scho ol of Computer Studies University of Leeds

Edward Tsang Foundations of Constraint Satisfaction Academic Press

Edward Tsang and Alvin Kwan Mapping constraint satisfaction problems to

algorithms and heuristics Technical Rep ort CSM Department of Com

puter Science University of Essex

Edward P K Tsang James Borrett and Alvin C M Kwan An attempt to

map the p erformance of a range of algorithm and heuristic combinations In

J Hallam editor Proceedings AISB pages IOS Press Amster

dam

EDS Unigraphics Unigraphics cadcamcae World Wide Web Page

httpwwwugedscomug

G Vanecek Jr and J F Cremer Pro ject isaac Building simulations for

virtual environments Technical rep ort Department of Computer Science

Purdue University

A Verroust F Schonek and D Roller Ruleoriented metho d for parame

terised computeraided design ComputerAided Design Oc

tob er

Roger Westbro ok Structural Engineering Design in Practice Construction

Press

Kevin Wise Using multidimensional csg mo dels to map where ob jects can

and cannot go Technical Rep ort University of Bath January

httpwwwbathacuk ensk dwT ech rep trans rephtml

Andrew Witkin David Bara and Michael Kass An Introduction to Physi

cal ly Based Modeling chapter Constrained Dynamics World Wide Web Page

httpwwwcscmuedu bara ffp bmp bm html

Armin Wolf Transforming ordered constraint hierarchies into ordinary con

straint systems In Michael Jamp el Eugene Freuder and Michael Maher

editors OverConstrained Systems numb er in LNCS pages

Springer

BIBLIOGRAPHY

Anthony Wren and JeanMarc Rousseau Bus driver scheduling an overview

Technical Rep ort Scho ol of Computer Studies University of Leeds

Yasushi Yamaguchi and Fumihiko Kiumra A constraint mo deling system for

variational geometry In J Wozny J Turner and K Preiss editors Geometric

Modeling for Product Engineering pages North Holland