• Aucun résultat trouvé

A Constraint Programming Approach for Solving Rigid Geometric Systems

N/A
N/A
Protected

Academic year: 2022

Partager "A Constraint Programming Approach for Solving Rigid Geometric Systems"

Copied!
15
0
0

Texte intégral

(1)

Rigid Geometric Systems

ChristopheJermann 1

,GillesTrombettoni 1

,BertrandNeveu 2

,andMichel

Rueher 1

1

{jermann, rueher, trombe}@essi.fr

UniversitédeNiceSophiaAntipolis,I3S, ESSI,930routedesColles,B.P.145,06903

SophiaAntipolisCedex,France

2

neveu@sophia.inria.fr

CERMICS,2004routedeslucioles,06902 Sophia.Antipoliscedex,B.P.93,France

Abstract. Thispaperintroducesanewrigidicationmethod-usingin-

tervalconstraintprogrammingtechniques-tosolvegeometricconstraint

systems.Standardrigidicationtechniquesaregraph-constructivemeth-

odsexploitingthedegreesoffreedomofgeometricobjects.Theyworkin

twosteps:aplanningphasewhichidentiesrigidclusters,andasolving

phasewhichcomputesthecoordinatesofthegeometricobjectsinevery

cluster.Weproposehereanewheuristicfortheplanningalgorithmthat

yields ingeneral smallsystems of equations. We also show that inter-

valconstraint techniquescanbeused notonlytoecientlyimplement

thesolvingphase,butalsogeneralizeformerad-hocsolvingtechniques.

Firstexperimentalresultsshowthatthisapproachismoreecientthan

systemsbasedonequationaldecompositiontechniques.

1 Introduction

Modelingby geometric constraintsis apromising method in theCAD eld. It

allowsausertobuild ashapebystatinggeometricconstraintsin adeclarative

way. In practice, geometric systems contain numerous rigid subparts. Recur-

siverigidication techniques[HLS97]allowabottom-upcomputationofarigid

system by discovering and aggregating rigid subsystems. We introduce a new

rigidication algorithmwhichisgeneralenoughtotacklesystemsin 2Dor3D.

Thisalgorithmyieldsadecompositionofarigidsystemintoseveralsubsystems

to besolvedonebyone.Thepaperaimsat showingthat this semantic-guided

approachprovestobeecientwheneverysubsystemissolvedbyintervaltech-

niques. Moreover,whenthesubsystemsaresmall,thesystemmaybetractable

bysymbolictools.

Thepaperisorganizedasfollows.Thenextsubsectionsintroducetheprob-

lem andrecursiverigidication.Section 2describesthenewplanningphasewe

havedesigned.Section 3presentsasolvingphasebasedonintervaltechniques.

Section 4providesrstexperimentalresults.

(2)

Theproblemconsideredinthispaperisthecomputationofallpossiblepositions

andorientationsofgeometricobjectssatisfyingconstraintsthatmakethemrigid

relativeto eachother[FH97].

Denition1 A geometric constraint problem is dened by a set of geo-

metricobjects andasetof geometricconstraints.

Ageometricobjectisdenedbyasetofgeneralizedcoordinatesinarefer-

encesystemof given dimensionsuchasthe Euclideanplaneor 3D-space.Gen-

eralized coordinates areparametersdening thepositionandthe orientation

of anobject.

Ageometricconstraintisarelation betweengeometric objects.

Examplesofgeometricobjectsarepoints,lines,circlesin2D,orpoints,lines,

spheres, cylindersin 3Dspace. Geometric constraints canstatepropertieslike

incidence,tangency,orthogonality,parallelism,distanceorangle.

Althoughthealgorithmsdescribed inthepaperworksin 3Dspace,ourim-

plementationisrestrictedtothefollowingentities intheEuclideanplane:

Geometricobjects:points,linesandcircles,

Geometric constraints: incidence, orthogonality, parallelism, distance and

angle.

Wewillalsoassumethat:

The geometric constraints are binary. Thisis not astrong limitationsince

mostofgeometricconstraintsarebinary.Moreover,norestrictionholdson

thearityofthecorrespondingalgebraicequations. Forinstance, adistance

constraintinvolvesonlytwopointsbutthecorrespondingequationinvolves

fourgeneralizedcoordinates: thepointscoordinates.

Allobjectsarenon-deformable, thatis,theinvolvedgeneralizedcoordinates

cannot be independentfrom thereference system. For example,a circle is

denedbythetwocoordinatesofthecenter,buttheradiusmustbeconstant.

Moreover,constraintscanonlydenerelationswhichinvolvecoordinatesof

objects.Forinstance,adistanceconstraintforwhichthedistanceparameter

isvariablecannotbehandled.

Thesecond limitation is intrinsicto recursiverigidication which performs

rigid-bodytransformations[JASR99].

1.2 Recursive rigidication

Recursiverigidication isbasedonadegreeoffreedomanalysisperformedona

weightedgeometricconstraintgraph[HLS97].

Denition2 A weighted geometric constraint graph G= (O;C) is de-

(3)

the numberof its degreesof freedom, i.e., the number of generalized co-

ordinatesthat mustbedeterminedtox it. Forexample, apointandaline

1

havetwodegreesof freedom in theEuclidean plane.

An edge c 2C represents a geometric constraint. Its weight w(c) gives the

numberof parametersthatarexedbythe constraint;usuallythe numberof

corresponding equations.Forexample, adistanceconstraintxes 1parame-

ter,andthenhas weight1.

So,thedegreeoffreedomanalysis exploitsastructuralpropertyof thegeo-

metricconstraintgraph,called structuralrigidity 2

.

Denition3 Let S be a geometric constraint problem, and let G=(O;C) be

the corresponding weighted geometric constraint graph. Let W be the function

which computes the dierencebetweenthe sum ofobjectweights andthe sum of

constraintweights: W(G)= P

o2O (w(o))

P

c2C (w(c)).

In dimensiond, the systemS isstructurally rigid(in shorts-rigid)i:

W(G)=d(d+1)=2

Forevery sub-graphG 0

of G,W(G 0

)d(d+1)=2

An s-rigid sub-graphof ageometricconstraintgraphwill becalledacluster

in this paper. Intuitively,in 2D, acluster has 3degreesof freedom sinceit can

be translatedandrotated.

ThestructuralrigidityissimilartothepropertyP denedin[LM98]andto

thedensitynotionintroducedin[HLS97].

Recursiverigidicationcreatesiterativelyanewclusterinthegraph:asingle

node replaces the objects in the created cluster, and arcs connecting several

objects in this cluster to one object outside the cluster are condensed into a

single arc labeled by the sum of the weights of the synthesized arcs. Figure 1

illustratestheabovenotions.

Theplanningphaseaims atdecomposing thewhole systemintoasequence

ofsmallblocksofequations.Itinterleavestwostepscalledmergeandextension

stepswhichproduceclustersrecursively:

Themergestepndshowtoformabiggerclusterbasedonseveralclusters

orgeometricobjects.

Theextensionstepextendstheobtainedclusterbyaddingtoitconnected

objectsonebyone.

1

Roughly,theaandbofthecorrespondingequation:y=ax+b

2

Thes-rigidity isa necessarycondition toprove rigidity. However, it is nota su-

cientcondition,exceptfordistanceconstraintsbetweenpointsin2D[Hen92 ].Hence

it should only be considered as a heuristic to detect rigid subparts in a geomet-

ricconstraint system.Severalcounterexamplesin2Dand3D showthatredundant

(4)

A

B C

D

E

F G

I

K (3)

K (3)

G H I

H 1

3 2

Fig.1.Graphsassociatedtoageometricconstraintproblem.

(Left) Allobjects are pointsand distance constraints are postedbetween points.All

edges haveweight1andall vertices haveweight2(theyare notlabeled).Everypair

ofconnectedpointsformsacluster.Everytriangleisalsoacluster.PointsC,D,Edo

notformans-rigidsub-graphsinceithas4degreesoffreedom.

(Right)Anothergraphwhere triangles (A;B;C)and (D;E;F) havebeencondensed

intwoclustersK1 andK2.Thearcofweight3condensesthearcs(A;D),(C ;E)and

(B;F).

Mergestepswouldbesucienttoperformaplan.However,amergestepcan

traversethewholeconstraintgraph.So,anextensionismoreorlessaheuristicto

performanecientmergestep:onechecksincrementallywhetherthes-rigidity

ismaintainedwhenonlyoneobjectisaddedtothecurrentcluster.

Thesolvingphase,alsocalled constructionphase,followstheplan givenby

the previous phase and computes the coordinates of the geometric objects in

everycluster.

1.3 Existing work

Recursiverigidicationtechniqueshavebeendeveloped[VSR92,BFH +

95,FH93]

[FH97,DMS98] to assemblepointsand lines in 2Dsystems constrainedbydis-

tancesandangles.[HV95]and[Kra92]describerstattemptstoworkin3D.In

allthese systems,aspecic algorithmis usedto mergetwoorthree predened

clusters.Thepossibleconstruction"patterns"appearin alibrary.

Homannet al.[HLS97,HLS98] have introduced aow-based algorithm to

perform the merge step. This algorithm nds a minimal dense sub-graph in a

weightedgeometric constraint graph, that is, it computes an s-rigid cluster of

minimalsize(i.e.whichhasnopropers-rigidsub-graph).Ad-hocsolvingmeth-

ods are used to achieve the actual construction. The algorithm works in any

dimension,including 2Dand 3D,and canbeapplied onanytypeof geometric

objects.

The main limitation of Homann's approach comes from the fact that no

generalmethod isproposed toperformthesolvingphase.Symbolictoolscould

also be consideredbut are generallynotecient enoughtohandle these prob-

lems.Of course,ad-hocsolvingmethodscanbeused,but theymustbedened

(5)

Inthispaper,wepropose:

1. Anewextensionstep'sheuristicforHomann'splanningalgorithm[HLS97].

Theaimisto generatesmallersubsystemsofequations.

2. Anewandgeneralsolvingframeworkwhichisbasedonintervaltechniques.

Intervalnarrowingalgorithms[Lho93,HMD97]manageoatingintervalsand

cansolveasystemofnumericequationsbyusinglteringanddomainsplit-

tingmethods. Theyareusedto computesolutionsineverysubsystem.

Usingintervaltechniquestocarryoutaconstructionstepofrecursiverigid-

icationhastwoadvantages:theapproachisgeneralandcanreplacead-hoc

methodsrelatedtospecic patterns,and,nosolutionsarelost.

2 The Planning Phase

Thegoal oftheplanningphaseis to ndanordering which cansolvethe con-

straintsin anincremental way.Moreprecisely, theaimis toidentify rigidsub-

parts,thatcanbesolvedindependently(andthenassembled).

Homannet al.[HLS97] haveintroduced analgorithm which achievessuch

a planning. The main limit of their algorithm comes from the fact that large

blocksofconstraintshavetobeadded in somecases. Thus thesolvingprocess

maybecome verycostly. Weintroducehere aheuristicto limitthe number of

constraintsthat areaddedateachstep.

Nextsub-sectionillustratestheprincipleandthelimitsofHomann'salgo-

rithmonashortexample.Afterwards,wedetailtheproposedheuristic.

2.1 Homann'salgorithm

Homann's planning algorithm builds a reverse tree of clusters called cluster

tree: theroot is thenal cluster coveringthe whole system;the leavesare the

geometricobjects;thereisanarcbetweenaclusterK andalltheclusters that

havebeenmergedto yieldK.

Roughlyspeaking,the algorithmbuildsclusters in sequencebyinterleaving

mergeandextensionsteps.Itstops assoonasthewholesystemhasbeenrigid-

ied or when the system cannot be rigidied further. The algorithm updates

a geometric weighted graph G

m

while achieving merge and extensions steps.

For instance, consider an example in 2D made of 15 points and 27 distance

constraintsbetweenthem(seeFigure2-G 0

m ).

The rst merge step nds the sub-graph G =< A;B > of G

m

. This clus-

ter is extended until ax-point is reached. The set of adjacent points of this

cluster is fC ;H;Ig. Since < A;B;I > is s-rigid, I is added to G. The same

process is performed to addH, C and J to G. Nowthe set ofadjacentpoints

is fD;G;N;Kg. None of these points can be added by extension, so wehave

reachedthe x-pointG=<A;B;I;H;C ;J >. Anew vertexK

1

of weight3is

addedandA;B;I;H;C ;J areremovedfromG

m

aswellasallconstraintsamong

them(seeFigure2-G 1

).K

1

isplacedintotheclustertreeandthenextmerge

(6)

K O

M N

L

G F

E D

K (3)

G F

E D

K (3)

K (3)

G m 1 2

3

m

m

G

G G m 0

K O

N M

L J

G F

E D C B I H A

2(JN,JK)

Cluster Tree

K1

K4 A B C H I J K2

K L M N O

K1 K2 K3 2(JN,JK)2(CG,CD)

2(FL,GL) K3

D E F G 4

G m

1 1

K (3)

K (3) K (3)

K (3)

1

2

2

3

4

Fig.2. Snapshots of the graph G

m

during the execution of Homann's planning

method,andresultingclustertree.

stepis performed.It identies<M;N >asminimal s-rigid sub-graphof G

m .

This cluster isextendedto K

2

=<M;N;O;K ;L>(see Figure2 -G 2

m ). Note

that K

2

could havebeenextended onto J if <M;N >were identied at the

beginning.Finally,G;F;DandEaremergedintoK

3

(noteagainthatCandL

couldhavebeenincludedinK

3

)(seeFigure2-G 3

m ).

Sinceclustersdonotsharepoints,inter-clusterconstraints(i.e.,thedistancecon-

straintsdist(J;K),dist(J;N),dist(G;C),dist(G;L),dist(F;L)anddist(C ;D)

)arehandled bythelast mergestep(seeFigure2-G 4

m

),forwhich thesolving

stepcanhencebeexpensive.

Therefore,wepropose anewheuristic whereclusterscanshare objects,the

aimbeingtomaximizetheextensioncapabilities,andthus,toreducethenumber

ofconstraintswhichhavetobehandledduringthemergingsteps.Thisheuristic

generalizespreviousad-hoctechniques[BFH +

95].

2.2 The proposedheuristic

Like Homann's algorithm, Algorithm Rigidificationinterleavesmerge and

extensionsteps.Tofacilitateobjectsharingitusesthefollowingtwographs:

The merge graph G

m

which corresponds to the graph of clusters used in

Homann'salgorithm. However,in our algorithm,G

m

isused only forthe

mergestep.

TheextensiongraphG

e

whichisspeciallymaintainedfortheextensionstep.

Itcontainsthesharedobjectsaswellastheobjectswhichhavenotyetbeen

includedin acluster.

Thealgorithmperformsthreemainstepsiteratively(withinthewhileloop):

(7)

m e

function rst computesG

1

, a minimal dense sub-graph of G

m

, with the ow-

based algorithm described in [HLS97]. The dense sub-graph is then converted

into asub-graphofG

e

andreturned.TheemptysetisreturnedifG

m

contains

asinglenodeorifnos-rigidsub-graphcanbefound.

One extension step extends the cluster G

1

found by the merge step. The

repeatloopincrementallyaddsoneobjecttoG

1

.Objectsareaddedaslongas

theobtainedgraphremainss-rigid.

ThelaststepupdatesthetwographsG

m andG

e .

Updating the graphG

m

AnewclusterKiscreatedinG

m

andreplacestheincludedclustersandobjects

(sub-graph G

2

). This is performed by the function Condense(G

2 , K, G

m ) as

follows:(a)replaceallverticesinG

2

,thesub-graphofG

m

correspondingtoG

1 ,

byasinglenode K in G

m

;(b) combineall arcsfrom onevertexv of G

m G

2

toverticesofG

2

intoonearcfromv toKwithaweightequaltothesumofthe

combinedarcs.

ThenewlycreatedclusterK maycontainsharedvariableswhichhavebeen

previouslyincludedin otherclusters.Coincidenceconstraintsarethus addedin

G

m

totakethemintoaccount.Intuitively,coincidenceconstraintsareaddedto

preserve the right number of degrees of freedom in G

m

. They state that the

dierent occurrences of a shared object correspond in fact to a single object

(functionAddCoincidences(K,G

m )).

Updating the graphG

e

The nodes in the newly created cluster K are partitioned into two sets: the

interface objects that are connected to other objects in G

e

and the internal

objects. Function RemoveVerticesremovesthe internal objects sincethey are

s-rigidrelativetoeachother(thatresultsfromthefactthattheyareincludedin

thesameclusterK).Intheopposite,interfaceobjectsremainin G

e

sincethey

maypotentiallybesharedbyotherclustersin furthersteps.

Tomaintaintherightnumberofdegreesoffreedom,theinterfaceobjectsin

G

e

mustberigidied.ThefunctionRigidifyaddsinterfaceconstraintsbetween

theminG

e

asfollows:iftheclusterKcontainstwointerfaceobjectso

1 ando

2 ,

aweightedarc(o

1 ,o

2

)isaddedtomakethems-rigid;iftherearemorethantwo

interfaceobjects,everyotherobjecto

i

in K isrigidiedbyaddingarcs(o

i ,o

1 )

and(o

i ,o

2

)(seeforcoming[JTNR00]).

Algorithm Rigidificationterminates sincethe number of objectsin G

m

decreasesat each step.Thecorrectionisensuredbythefact that thes-rigidity

propertyispreservedinG

m andG

e

aslongasthealgorithmruns.

2.3 Example

Figure3illustratesthebehaviorofAlgorithmRigidificationontheexample

(8)

terTree)

{Gistheinitialweightedgeometricgraph; disthedimension oftheproblem(2D,

3D);CT istheplan(clustertree)thatisproducedbythealgorithm.}

CT ;;G

m

G;G

e G

G1 MinimalSRigid(Gm,d,Ge) {Firstmergestep}

whileG

1 6=;do

{Extensionstep}

repeat

forallo2Gej9o12G1 andedge(o;o1)2Edges(Ge)do

if G1[fogiss-rigidthen

{AddoandcorrespondingedgestoG

1 }

AddVertex(G1,o,Ge)

endif

endfor

untilFixPoint{G

1

isnomoremodied}

G2 Convert(G1,Gm) {G2 isasub-graphof Gm correspondingtoG1}

Condense(G

2 ,K,G

m

) {Replace G

2

byanewvertex KinG

m }

AddCoincidences(K,G

m )

InsertCluster(K,CT) {InsertK intheclustertree}

Rigidify(InterfaceObjects(G

1

)) {Addinterfaceconstraints ofG

1 inG

e }

RemoveVertices(InternalObjects(G1),Ge) {RemovefromGe internalobjects

andconnectedarcs}

G1 MinimalSRigid(Gm,d,Ge) {Mergestep}

endwhile

TherstmergeandextensionstepsaresimilartoHomann'soneandyielda

sub-graphG

1

containingthepointsA,B,I,H,C,J.AnewvertexK

1

ofweight

3replacesthesepointsinG

m

.TheinternalpointsA,B,H,I areremovedfrom

G

e

, along with the internal constraints, but an interface constraint is added

betweenJ and C.

TheclusterK

2

isthencreatedinthesameway.ItiscondensedintoG

m .Since

K

2

includes the point J which also belongsto K

1

, acoincidence constraintof

weight2isaddedinG

m

betweenK

1 andK

2 .

Thecluster K

3

isnally created.Itincludesalltheremainingpointsin G

e ,

andinparticular,theinterfaceconstraints.Then,theplanningphaseisnished.

2.4 Comparingwith Homann'sapproach

Homann'salgorithmusesasinglegraphtoachievemergingstepsandextension

stepswhereasAlgorithmRigidificationperformstheextensionsonaspecic

graphthat contains sharedobjects. Thus, Algorithm Rigidificationmay be

abletoachievemoreextensions.Itisimportanttounderstandthatoneextension

impliesthecreationofasystemofequationsthesizeofwhichisnotgreaterthan

3in2D(6in3D),thatis,thenumberofdegreesoffreedomoftheaddedobject.

Sincethis heuristicmaximizesthenumberofextensionssteps,itshould reduce

(9)

K O

N M J L

G F

E D C

J L

G F

E D C K

O

N M L

G F

E D

G F

E D

G m

e

1 2 3

m m

e

1 2

G G

G G

K O

N M J L

G F

E D C

G m

e 0

G 0

B I H A

K O

N M J L

G F

E D C B I H A

2(J)

Cluster Tree

K1

K3

(CJ) (JL)

A B C H I J K2 J K L M N O

C D E F G L J K (3) 1 K (3) 1

K (3) 2

K (3) 3

Fig.3. Snapshots of the graphs Gm and Ge during the run of the algorithm, and

obtainedclustertree.Interfaceconstraintsaredrawnindottedlines.

Forinstance,onthepreviousexample,Homann'salgorithmbuildsclusters

K

1 ,K

2 and K

3

before mergingthem intoK

4

(see Figure2). This corresponds

to9extensionstepsand4mergesteps;thelastonewillhavetomerge3clusters

with 6 distance constraints between them. On the same example, Algorithm

Rigidificationachieves13extensionsandonly3merges.Noneofthesesteps

involvemorethan2distanceconstraints.

3 The Solving Phase

Thissectionshowshowtouseintervalconstrainttechniquesforsolvingthetree

ofclustersbuiltin theplanningphase.

Atomicstepsoftheplanningphasegeneratesubsystemsofequations,called

blocks in the paper, that can be solved in sequence. Interval constraint tech-

niquessolveeveryblockandyieldnumericsolutions 3

.Whenasolutionisfound

inablock,thecorrespondingvariablesarereplacedbytheirvalueinsubsequent

blocks. When the resolution fails, a backtrackingstep occurs and another so-

lution is searched for in the previous block. The next subsections detail how

to generate theblocksof algebraicequationsbasedon acluster tree. Dierent

solvingprocessesofthedecomposedsystemarealsodescribed.

3.1 Generating the equations

A directed acyclic graph (DAG) of blocks is created while the cluster tree is

built.

3

Asuperset ofthesolutionsisinfact obtained:eliminatedpartsofthesearchspace

nevercontainanysolution,buttheremainingnon-emptyintervalsmightcontainno

(10)

respondingto thearcs(geometricconstraints)removedfromG

e

duringone

mergesteporoneextensionstep;

ThereisanarcfromablockAtoablockB ifavariable tobeinstantiated

inAalsooccursin anequationof B.

Notethat interfaceconstraintsareconsidered in thesamewayasothersin

thisprocess.Figure 4providesanexampleofsuchaDAGofblocks.

Xj ,Yj K1 K1 Xc ,Yc K1 K1 Xj ,Yj K2 K2 Xl ,Yl K2 K2

Xj ,Yj K3 K3

Xf Yf Xd Yd

Xe,Ye Xg,Yg

Xc ,Yc K3 K3 Xl ,Yl K3 K3

K1 K2

K3

Fig.4.DAGofblocksassociatedtothe clustertreeofthe exampleinFig. 3.Blocks

arerepresentedbysmallrectanglesshowingthecomputedvariables.Alltheblocksin

K3 areshown. Theblockat the topof K3 is createdby themerge step(mergingD

and F).Descendant blocksare createdbyextension.Thelast block containsthetwo

interfaceconstraintsaddedduringtheprocess.

Now,letusdetailhowinterfaceconstraintsarehandled.Eachblockcomputes

its ownset of variables.The variablescorrespondingto aninterfaceobjectare

replicatedin eachcluster wherethe objectoccurs.ObjectJ sharedby clusters

K

1 , K

2

and K

3

leads to dene variables x

JK

1 , y

JK

1 , x

JK

2 , y

JK

2 , x

JK

3 , y

JK

3 .

Variables x

JK

1 , y

JK

1

(resp. x

JK

2 , y

JK

2

) are computed when solving clusters

K

1

(resp. K

2

). When solving cluster K

3

, the block computing x

JK

3 , y

JK

3 is

madeof the2interfaceconstraintsdist(J

3

;L

3

) =dist(J

2

;L

2

)and dist(J

3

;C

3 )

=dist(J

1

;C

1

).Inthis block,thelastonein clusterK

3

, allthevariablesexcept

x

JK

3 ,y

JK

3

havealreadybeencomputedin previousblocks.

Nowwewilldescribethedierentsolvingprocessesbaseduponintervalnar-

rowingtechniques.

3.2 Domain splitting and lteringperblock

A rstapproachto solveaDAGofblockshasbeendescribedatthebeginning

(11)

whenaninconsistentcombinationofblocksolutionsoccurs.

Performingintervalnarrowingonablockisstraightforward,thevariablesof

the entireblock being subject to domain splitting and ltering. However,one

shouldpayattentiontotheinter-blockprocess:thecomputedvalues,whichwill

bereplacedin asubsequentblock,arenotoating numbers, butanintervalof

oatingpoints(evenverysmall,e.g.,10 8

large).Wecouldhandlesuchconstant

intervalsbyslightlymodifyingtheLNARfunctionofNumerica[HMD97]

4

.We

havechosenanotherprocess:themiddlepointofthereducedconstantinterval

replaces the variable in equations included in subsequent blocks. This middle

pointheuristiciseasyandgeneral.Itiscorrectifthesetofintervalsobtainedat

theendischecked,byalteringprocess, againstalltheequationsintheentire

system. In practice, this nal check is very fast since the intervals are really

small.Ofcourse,thisprocessdoesnotguaranteetondallsolutionsbutwedid

neverloseanysolutioninpracticeonthetestedexamples.

This approach is very ecient because replacing a variable by a constant

simpliesthesystemofequations.

3.3 Performing propagation on thewhole system

Anotheralgorithmcouldbeappliedthatlimitsdomainsplittingin oneblockat

a time, but performs ltering by propagation on thewhole system. There are

twodierentwaysto implementpropagation:

1. Alltheblocksaremanagedbyastandardinter-blockbacktrackingprocess,

just likethe purebacktrackingalgorithmdescribedin theprevioussubsec-

tion.Twosystemsof equationsare thus handled by theinterval constraint

solver:onesystemcorrespondingtothecurrentblockto besolvedbylter-

ingand domainsplitting, and anotheronewhich includes theequationsin

theblocksnotyetsolved.Thesecondsystemcanbelteredbypropagation

when an interval is reduced in the rst one. This approach will be called

blocksolving withpropagationintherestofthepaper.

2. Anotherapproach,where allthesystemisin asingleblock,iscalled global

solving in thefollowing.It considers the givenplan asa heuristicto select

thenext variables for domain splitting with respect to thedecomposition.

Their domains are split until the desired precision is reached. Filtering is

appliedonthefullsystemaftereachsplit.

The global solving algorithm is simpler to design than block solving with

propagation.However, global solvingis less ecient for tworeasons.First, all

blocksarecheckedforlteringanyway.Second,itcannotbenetfromthemiddle

pointheuristic.

Conceptually,itispossibletobringtheinter-blockbacktrackingprocessto-

getherwithanysolvingalgorithmthatcanyieldseveralsolutionsforoneblock.

4

The LNAR function, applied to a variable in an equation, replaces all the other

(12)

tomodelthesystem.Pluggingsuch analgorithminourinter-blockprocessen-

sures completeness and could be considered for solving small blocks. On the

contrary, classicalnumericalalgorithms should not be used in this decomposi-

tion scheme since they provide only one solution per block and those partial

solutionsmaynotbecombinable.

3.4 Unifying reference systems

Once the solving phase is nished, every object in the root cluster has been

placedin the nal reference system.Only internal objectsof clusters havenot

yet been placedin this system. Todo so, rigid-body transformationsmust be

doneontheclustertree.Theclustertreeistraversedfromtheroottotheleaves.

Ateach node, oneperforms arigid body transformation, in thenal reference

system,ofthecoordinatesbelongingtotheinternalobjectsofthecluster.More

precisely:

1. Thecoordinatesoftheinterfaceobjectsareknowninthenalsystem,asthe

treeisfollowed fromtheroot to theleaves,and areused them tocompute

thetransformationcoecients.

2. The internal coordinates of the cluster are then recomputed in the nal

referencesystem,basedontheobtainedtransformationmatrix.

Bytraversingthetreeinreverseorderofitsconstruction,acoordinateofan

objectiscomputedonlyonceasanobjectsbecomesinternalonlyonce.

4 Experimental Results

Thissectionprovidespreliminaryresultsonthreeexamples(seeFigure5).Their

constraint systems contain points and distance constraints. Since we wanted

to compare the time spent for computing all solutions, we have adjusted the

distance values in order to obtain a limited number of solutions per problem

(128forEx1,64forEx2and256forEx3).

Fig.5. From left to right, the three 2D examples we consider, made of points and

(13)

amoregeneralequationaldecompositionwhichworksattheequationandvari-

ablelevelanddoesnottakeintoaccountthes-rigiditypropertyofthegeometric

system [AAJM93,BNT98]. This approach is based upon a structural analysis

of thegraphofvariablesand equations,using amaximummatching algorithm

andaDulmageandMendelsohndecomposition.Wealsoapplyoursolvingtech-

niques onthisequationaldecomposition.Forthesakeofsimplicity,wewilluse

thefollowingabbreviations:

EDstandsfortheequationaldecompositionbasedonamaximummatching;

SD1denotesthedecomposition basedonsharedobjetswehaveintroduced

inSection2(AlgorithmRigidification);

SD2denotesHomann'srigidicationalgorithm.

4.1 Maximal blocksize

Wecanseein Table1that theSD1decomposition leadstosmallerblocksthan

SD2.

The rst two examples are decomposed by SD1 into blocks made of 2 e-

quations.WiththeSD2decomposition,themaximumblocksize is10or12.In

fact,theseblocksofsize 10or12canfurtherbedecomposedbytheequational

decompositiontechniqueandtheblocksnallysolvedhaveamaximumsizeof6

in bothcases(SD2+ED).ForSD1,ED cannotfurtherdecomposetheobtained

blocks.Inthe third example,ablockofsize 8remains in both decompositions

andcannotbedecomposedbyEDanymore.

examples SD1SD1+EDSD2SD2+EDEDND

Ex1 2 2 10 6 14 26

Ex2 2 2 12 6 10 20

Ex3 8 8 8 8 8 20

Table 1.Sizeofthebiggestequationblockobtainedbysemanticdecompositionwith

shared points (SD1) and withoutshared points (SD2), the semantic decompositions

followedbytheequational decomposition(SD1+ED,SD2+ED),equationaldecompo-

sitiononthewholesystem(ED),andnodecomposition(ND,whichalsorepresentsthe

sizeofthecompletesystem)

4.2 Solving with intervalnarrowing techniques

Weprovideherethetimespenttosolvetheexamplesfordierentdecomposition-

s:SD1+ED, SD2+ED,ED andND.TimesforsolvingwithSD1decomposition

areexactlythesameasSD1+EDsincetheplanremainsthesamewithorwithout

applying ED.Times forsolvingSD2+ED are necessarilybetter thantimes for

SD2alonesinceSD2+EDprovidesabetterdecomposition.Forthedecomposed

systems,werunthe3methodspresentedinSections3.2and3.3:theinter-block

(14)

domainto split(M3).

AllexperimentswereperformedonaPentiumIII 500,usingIlog

Solver[ILO98],withtheIlcNumericalibrarywhichimplementsdomainltering

byBox-Consistency[BAH94].

Examples SD1+ED SD2+ED ED ND

M1M2M3 M1 M2 M3 M1M2 M3 -

Ex1 17 9 455 43 28 1322 58 29 3855795

Ex2 1.4 11 77 9 13 178 56 1174676640

Ex3 0.9 3.4 2892.6 12.21646 1.5 3.7 5332744

Table2.ResultsinCPUtime(inseconds)forthedecompositionsSD1+ED,SD2+ED

andEDwiththesolvingmethodsM1,M2etM3andforasolvingwithoutdecompo-

sition(ND)

4.3 Analysis

Theseresultsshowthat:

Any decomposition is always fruitful: without decomposition, the solving

timesmaybe2ordersofmagnitudehigher.

Thesemanticdecomposition (SD1)basedonrigidicationyields ingeneral

smallerblocksthan equationaldecomposition (ED). The performances are

betterwhenthemaximalblocksizeissmaller.

Methods M1 and M2 give even better results than M3, which shows the

interestofthemiddlepointheuristic.

The eect of the propagation depends on the problem itself: when many

inter-blockbacktracksoccur,likein Ex1,the inter-block constraint propa-

gation(M2)doespayo.

5 Conclusion

This paper has introduced acomplete framework for handling geometric con-

straints.Itiscomposedof:

A newheuristic for theplanning algorithmwhich allows us to build small

subsystemsofequations.Thissemantic-guidedphaseyieldsabetterdecom-

position ofarigidsystemthanasyntacticone.

Asolvingphasebasedonintervaltechniques.Thisapproachisgeneraland

doesnotloseanysolution.Itisapromisingalternativetoad-hocorclassical

numericapproaches.

(15)

[AAJM93] SamyAit-Aoudia,RolandJegou,andDominiqueMichelucci. Reductionof

constraintsystems.InCompugraphic,1993.

[BAH94] F.Benhamou,D.McAllester,andP.VanHentenryck.Clp(intervals)revis-

ited. InProc.LogicProgramming,MITPress,1994.

[BFH +

95] William Bouma, Ioannis Fudos, Christoph Homann, Jiazhen Cai, and

Robert Paige. Geometric constraint solver. Computer Aided Design,

27(6):487501,1995.

[BNT98] Christian Bliek, Bertrand Neveu, and Gilles Trombettoni. Using graph

decomposition for solving continuous csps. In Principles and Practice of

Constraint Programming, CP'98, volume 1520 of LNCS, pages 102116.

Springer,1998.

[DMS98] Jean-FrançoisDufourd,PascalMathis,andPascalSchreck.Geometriccon-

structionbyassemblingsubgures. ArticialIntelligence,99:73119, 1998.

[FH93] Iaonnis Fudosand ChristophHomann. Correctnessproof ofa geometric

constraint solver. Technical Report TR-CSD-93-076, Purdue University,

WestLafayette,Indiana,1993.

[FH97] IaonnisFudosandChristophHomann. Agraph-constructiveapproachto

solvingsystemsofgeometricconstraints. ACMTransactions onGraphics,

16(2):179216,1997.

[Hen92] BruceHendrickson.Conditionsforuniquerealizations.SIAMJComputing,

21(1):6584,1992.

[HLS97] Christoph Homann, Andrew Lomonosov, and Meera Sitharam. Finding

solvable subsets of constraint graphs. In Proc. Constraint Programming

CP'97,pages463477,1997.

[HLS98] ChristophHomann,AndrewLomonosov,andMeeraSitharam. Geometric

constraintdecomposition.InB.BrüderlinandD.Roller,editors,Geometric

ConstraintSolvingandApplications,pages170195.Springer,1998.

[HMD97] Pascal VanHentenryck,Laurent Michel, and YvesDeville. Numerica : A

ModelingLanguageforGlobalOptimization. MITPress,1997.

[HV95] C.M. HomannandP.J.Vermeer. Aspatialconstraintproblem. InJ.-P.

MerletandB.Ravani,editors,Computational Kinematics'95,pages8392.

KluwerAcademicPublishers,1995.

[ILO98] ILOG. Ilogsolverreference manual. Technicalreport,ILOG,1998.

[JASR99] R.Joan-ArinyoandA.Soto-Riera. Combiningconstructiveandequational

constraintsolvingtechniques.ACMTransactionsonGraphics,18(3):3555,

1999.

[JTNR00] ChristopheJermann,GillesTrombettoni,BertrandNeveu,andMichelRue-

her.Aconstraintprogrammingapproachforsolvingrigidgeometricsystems.

TechnicalReport00-43,UniversityofNice,France,2000.

[Kra92] G.Kramer. SolvingGeometricConstraintSystems. MITPress,1992.

[Lho93] O. Lhomme. Consistency techniques for numeric csps. In Proc. IJCAI,

Chambery,France,1993.

[LM98] HervéLamureand DominiqueMichelucci. Qualitative studyof geometric

constraints. InBeatBruderlin andDieter Roller,editors, GeometricCon-

straintSolvingandApplications,pages234258.Springer,1998.

[VSR92] A. Verroust, F. Schonek, and D. Roller. Rule oriented method for

parametrizedcomputer aided design. Computer Aided Design, 24(6):531

540,1992.

Références

Documents relatifs

Moreover, when used for xed classes G of graphs having optimum (APSPs) compact routing schemes, the construction of an MDST of G ∈ G may be performed by using interval, linear

L’hématite est un catalyseur qui a montré une grande efficacité lors de la dégradation par UV, cependant nous avons testé son efficacité dans le traitement de méthyl violet 2B par

If the graph variable GV , associated with the digraph G to par- tition, can lead to a tree partition of G, an O(m +n) worst case time complexity algorithm exists to detect and

Given a sequential branching algorithm such as that described in Section 3.2, every node defines one partial transfer plan φ t of size t (t being the number of transfers that have

First, we show that full participation in the multi-instrument compet- itiveness cluster policy has strong positive effects on participating SMEs’ innovation input (private

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

trees, which are parameterised according to different photosyn- thetic types: sun type (exclusively sun leaves), shade type (exclusively shade leaves), adaptive type (sun and