UFDC Home  myUFDC Home  Help 



Full Text  
GRAPH AND COMBINATORIAL ALGORITHMS FOR GEOMETRIC CONSTRAINT SOLVING By ANDREW LOMONOSOV A DISSERTATION PRESENTED TO THE GRADUATE SCHOOL OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY UNIVERSITY OF FLORIDA 2004 Copyright 2004 by Andrew Lomonosov Dedicated to H. ACKNOWLEDGMENTS I am mostly indebted to my advisor, Dr. Meera Sitharam, who has been supervising me with patience and everlasting interest. In the beginning she offered me a very extensive choice of research problems and was willing to spend considerable time explaining the nature and background of these problems, so I was able to choose the area that personally appealed to me. While all these problems were interesting and challenging, the problem statements were easy to understand, so one could start thinking about them right away, learning necessary technical skills along the way. My advisor has given me every opportunity to acquire these technical skills by spending a lot of her time meeting me, running relevant special topics seminars, introducing me to experts in the field and sending me to plenty of conferences and workshops. While allowing for my independent growth, my advisor was trying to make the entire research process as efficient as possible. When working on one problem she always kept another one on "backb, l i i so if the progress on one problem slowed down somewhat then I could always turn to the second problem. This arrangement was made possible by her contagious enthusiasm about the research topics, enthusiasm that was highly motivating whenever I would feel temporarily bogged down. Throughout the research process my advisor was mindful of my future career, and was steering me toward learning proper mix of theoretical and practical skills. Also in all the classes where I was her Teaching Assistant, she always took trouble to explain the intricacies and potential pitfalls of the teaching process. To some advisors the dissertation is not the only final product, the individual growth of a student is at least as important. I am very happy that Dr. Meera Sitharam is one such advisor. I would also like to thank my committee members Drs. Sartaj Sahni, Gerhardt Ritter, Tim Davis, Sanjay Ranka and Ravi Ahuja for discussions we had and their helpful fI, Ht, regarding my research, especially concerning network flow related issues and relationships between various problems considered. I would like to thank Dr. Christopher Hoffman for various assistance he has provided during our joint work. I would like to thank Dr. Pardalos as well as Burak and Sandra Eksioglu for helping me with stepcost function approaches to obtaining approximate solution of minimum dense problem. Finally I would like to thank people with whom I have been working on Geometric Constraint Solving Team: Jianjun Oung, Naganandhini Kohareswaran, Yong Zhou, Aditee Kumthekar, Ramesh Balasubramaniam and Heping Gao for helping me with various aspects of this large research area. TABLE OF CONTENTS page ACKNOWLEDGMENTS ................... ...... iv LIST OF FIGURES ................... ......... viii ABSTRACT .................................. xi CHAPTER 1 INTRODUCTION .................... ....... 1 1.1 Problem Definitions ........... ............... 1 1.1.1 Dense Graphs ......................... 1 1.1.2 Stably Dense Graph .............. ... ....... 1 1.1.3 Minimal Stably Dense Subgraph Problem .......... 2 1.1.4 Maximal Stably Dense Subgraph Problem .......... 2 1.1.5 Maximum Stably Dense Subgraph Problem ......... 3 1.1.6 Minimum Stably Dense Subgraph Problem ......... 3 1.1.7 Examples of various Dense Subgraphs ............ 4 1.1.8 Relationships between various Graph Problems . 5 1.1.9 Optimal Complete Recursive Decomposition . . 5 1.2 Summary of Results .................. ... 8 1.3 Related Work in Algorithms Community ... . 8 2 APPLICATIONS TO GEOMETRIC CONSTRAINT SOLVING ..... 10 2.1 Geometric Background .................. .... .. 10 2.1.1 Geometric Constraint Problems . . . 10 2.1.2 The Main Reason to Decompose Constraint Systems . 11 2.1.3 Decomposition Recombination (DR) Plans . ... 13 2.1.4 Basic Requirements of a DRplan . . .. 14 2.1.5 Desirable Characteristics of DRplanners for CAD/CAM 17 2.1.6 Formal Definition of DRsolvers using Polynomial Systems 22 2.1.7 Formal Definition of a DRplanner via Constraint Graphs 30 2.1.8 Two old DRplanners .................. .. 45 2.1.9 Constraint Shape Recognition (SR) . . ..... 47 2.1.10 Generalized Maximum Matching (i) . .. 57 2.1.11 Comparison of Performance of SR and MM . ... 68 2.1.12 Analysis of Two New DRplanners . . ..... 69 2.1.13 The DRplanner Condense and its Performance ...... 73 2.1.14 The DRplanner Frontier and its Performance ...... ..78 2.2 Relating Problems of Chapter 1 to some Measures of Chapter 2 85 3 MAXIMAL, MAXIMUM AND MINIMAL STABLY DENSE PROBLEMS 87 3.1 Finding Maximum Dense Subgraph ................ 87 3.2 Finding a Stably Dense Subgraph ................. 88 3.2.1 Distributing an Edge .................. .. 88 3.2.2 Finding Dense and Stably Dense Subgraph . ... 93 3.2.3 PushOutside() .................. ..... .. 95 3.3 Structure and Properties of Frontier algorithm . . ... 100 3.3.1 Informal Description of Frontier Algorithm . ... 100 3.3.2 Assumptions .................. .. .... .. .. 101 3.3.3 Joining Pairs of Clusters .................. 101 3.3.4 Relevant Transformation Notation . . ..... 101 3.3.5 Recombination by Frontier Algorithm . .... 101 3.3.6 Removing Undistributed Edges ............... ..103 3.3.7 Pseudocode .................. ..... .. 103 3.3.8 Example of actions by Frontier algorithm . ... 104 3.3.9 Modifying Frontier Algorithm for Minimality . ... 105 3.3.10 Complete Decomposition Property . . ..... 109 3.4 Maximum Stably Dense Property ................. ..109 3.5 Other Properties of Frontier Algorithm .............. ..109 4 MINIMUM STABLY DENSE SUBGRAPH PROBLEM . ... 112 4.1 Relation of Minimum Stably Dense to other Problems ...... ..112 4.1.1 Maximum Number of Edges Problem . ..... 112 4.1.2 Decision Version of Minimum Dense Subgraph ...... ..113 4.1.3 Relationships between two Decision Problems . ... 113 4.1.4 Relationships between Approximation Algorithms . 115 4.2 NPCompleteness of Minimum Stably Dense Subgraph Problem .116 4.3 Special Cases of Minimum Stably Dense . . .... 119 4.3.1 Flowbased Solution for Nooverconstrained Case . 119 4.3.2 Preflowpush based Solution for Nooverconstrained Case .121 4.3.3 Finding Smallest Subgraph of Largest Density ...... ..122 4.3.4 Case of Bounded Number of Overconstraints . ... 123 4.3.5 Size Overconstrained Graphs ................ ..125 4.4 Approximation Algorithms for Minimum Stably Dense . 126 4.4.1 Randomized Approximation Algorithms . . ... 126 4.4.2 Minimum Dense as Minimum Cost Flows . ... 133 4.4.3 Stating Minimum Dense Problem as IP . .... 138 REFERENCES .................. ................ .. 145 BIOGRAPHICAL SKETCH .................. ......... .. 151 LIST OF FIGURES Figure page 11 Nondense and dense graphs (K=1) ................. 1 12 Graph ABCDEF is dense but not stably dense (K=3, w(v)=2,w(e)=l) 2 13 An edge/vertex weighted graph .................. 4 14 Original graph G and a corresponding RDdag . . 6 15 Another possible RDdag .................. .... 7 16 Original graph G and NOT a RDdag ................ 7 17 Original graph G, RDdag and complete RDdag . . ... 7 21 A solvable system of equations .................. ..... 15 22 Step 1 rectangles, Step 3 ovals ................ 16 23 CAD/CAM/CAE master model architecture . ..... 20 24 A constraint graph .................. ......... .. 32 25 Generically unsolvable system .................. ..... 34 26 Generically unsolvable system that has a solvable constraint graph 35 27 Original geometric constraint graph G1 and simplified graph G2 37 28 Geometric constraint graph and a DRplan . . ...... 38 29 Another possible DRplan .................. .... .. 40 210 The original, cluster graph and the simplified graphs . ... 50 211 Action of the simplifier on Gi and C, during Phase One . ... 51 212 Action of the simplifier during Phase Two .............. .. 52 213 This solvable graph would not be recognized as solvable by SR . 52 214 Weight of all vertices is 2, weight of all edges is 1 . ... 53 215 Two triconnected subgraphs not composed of triangles . ... 55 216 Solvable graph consisting of n/3 solvable triangles . .... 55 217 Constraint graph, intended and actual decompositions . ... 58 218 Original graph and it decomposition .............. .. 59 219 Modified bipartite graph and maximum flow in this graph ..... ..60 220 Constraint graph and network flow with 3 extra flow units at AB 61 221 DRplan depends on the initial choice ............. .. 62 222 Maximum flow and decomposition given the bad initial choice . 63 223 Decomposition given the good initial choice . . 63 224 Bad bestchoice approximation ................ ...... 66 225 Sequential extension ............... ........ .. 73 226 Sequence of simplifications from left to right . . ..... 74 227 Original and simplified graphs ................ ...... 76 228 Bad bestchoice approximation ................ ...... 77 229 The simplified graph after three clusters has been replaced by edges .79 230 Original graph BCDEIJK is dense, new graph MCDEIJK is not 81 231 1/n worstchoice approximation factor of DRplanner Frontier . 82 31 Before the distribution of edge ED ................ 90 32 After the distribution of edge ED ................ 90 33 Before the distribution of edge AD .................. .. 91 34 Before the distribution of edge BD ................ 91 35 Locating dense graph instead of stably dense . . ..... 93 36 Before the distribution of edge BD ................ 93 37 Dense graph BCD found instead of maximal dense ABCD . 95 38 Graphs ABCDEF and FGHIJA are maximal stably dense in 3D 97 39 Dense graph ABC found instead of minimal dense BC . ... 97 310 Actions of Minimal() algorithm .................. .. 98 311 Transformation by Frontier Algorithm . . ...... 102 312 General transformation by Frontier Algorithm . . 102 313 Edge CF will not be distributed, edge AC will ..... 314 Initial graph . . . . . . 315 After AC have been distributed .. ........... 316 After AG have been distributed .. ........... 317 After AP have been distributed .. ........... 318 Corresponding complete recursive decomposition . 319 Enforcing cluster minimality .. ............ 320 Example of finding minimal .. ............ 321 Removing AF does not affect solvability of entire graph 41 R education . . . . . . . 42 Gadgets for reduction to CLIQUE .. .......... 43 H(v) representing vertex v .. ............. 44 Counterexample for DRFMA .. ............. 45 N network . . . . . . . 46 Cost functions . .. .. .. ... .. .. .. .. . 47 Network and a flow for p=3 .. ............ 48 Graph corresponding to Figure 47 .. ......... 49 Flow for p=2 ........... Abstract of Dissertation Presented to the Graduate School of the University of Florida in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy GRAPH AND COMBINATORIAL ALGORITHMS FOR GEOMETRIC CONSTRAINT SOLVING By Andrew Lomonosov May 2004 Chair: Meera Sitharam Major Department: Computer and Information Science and Engineering Geometric constraints are at the heart of CAD/CAM applications and also arise in many geometric modeling contexts such as virtual reality, robotics, molecular modeling, teaching geometry, etc. Informally, a geometric constraint problem consists of a finite set of geometric objects and a finite set of constraints between them. The geometric objects are drawn from a fixed set of types such as points, lines, circles and conics in the plane, or points, lines, planes, cylinders and spheres in 3 dimensions. The constraints are spatial and include logical constraints such as incidence, tangency, perpendicularity and metric constraints such as distance, angle, radius. The spatial constraints can usually be written as algebraic equations whose variables are the coordinates of the participating geometric objects. A solution of a geometric constraint problem is a real zero of the corresponding algebraic system. Currently there is a lack of effective spatial variational constraint solvers and assembly constraint solvers that scale to large problem sizes and can be used interactively by the designer as conceptual tools throughout the design process. The requirement is a constraint solver that uses geometric domain knowledge to develop a plan for decomposing the constraint system into small il1 .i' t' in whose solutions can be recombined by solving other small 11.\t' iL" The primary aim of this decomposition plan is to restrict the use of direct algebraic/numeric solvers to ~ll.it iuH that are as small as possible. Hence the optimal or most efficient decomposition plan would minimize the size of the largest such il1 .\t' iI Any geometric constraint solver should first solve the problem of efficiently finding a closetooptimal decompositionrecombination (DR) plan, because that dictates the usability of the solver. In this thesis we state this problem of finding a closetooptimal solution as a problem that deals with weighted graphs and also identify several important subproblems. One class of such subproblem involves finding dense subgraphs  graphs such that sum of weights of its edges is greater than sum of weights of its vertices. Dense graphs that present interest for finding a DRplan are (a) minimum (smallest possible dense graphs), (b) minimal (not containing any other dense subgraphs), (c) maximum (largest dense ones), (d) maximal (not contained in any other dense subgraph). This thesis presents polynomial time algorithms for problems (b), (c) and (d). Problem (a) is shown to be NPcomplete, and various approximation algorithms are 11. .I' 1 as well as explicit solutions for special cases that arise from CAD/CAM applications. CHAPTER 1 INTRODUCTION 1.1 Problem Definitions 1.1.1 Dense Graphs Motivation. Suppose that we wanted to find a smallest subgraph of a given graph that has at least twice the number of edges as vertices. Or three times. Or 5 times more edges than vertices. Given: an edge and vertex weighted graph G = (V, E) and a constant K. Weights of vertices and edges are denoted by w(v), w(e) respectively. A graph G is called dense if LeC, w(e) C,,, w(v) > K Function d(G) = LeGo w(e) EcG w(v) is called 1. ,.i,,',, of G. B 2 B 2 22 1 1 A 2 C A 5 (2 2 )2 2 Figure 11: Nondense and dense graphs (K=1) In many applications we are interested in finding a subgraph whose density is "uniform", i.e., not contributed by some small overly dense part. Density of this graph is "stable" or preserved even when some overly dense part is replaced by a barely dense part. Following definitions describe this concept. 1.1.2 Stably Dense Graph A graph A that has d(A) > K is overconstrained. A graph G such that d(G) = K and VA C G, d(A) < K is wellconstrained. A graph G is .Jll,j dense if d(G) > K and after replacing any of it over constrained nontrivial subgraph of by wellconstrained subgraph G remains dense. For example graph ABCDEF in Figure 12 is dense but not stably dense (K = 3, w(v) = 2, w(e) = 1,Vv, w) because modified graph AFG is not dense anymore. B D A A c 3 G 0E F F Figure 12: Graph ABCDEF is dense but not stably dense (K=3, w(v)=2,w(e)=l) Many applications require finding smallest or largest subgraph unweightedd) which has twice the number of edges as vertices. If we call graphs that have this property "dense" (by setting weights of vertices and edges appropriately) then the problem becomes that of finding "smallest" or "largest dense subgraph." Following definitions formalize these notions. 1.1.3 Minimal Stably Dense Subgraph Problem A stably dense graph A is called minimal f,tlll, dense if /EB C A, s.t. B is stably dense. Given a graph G, a minimal f4,ll,, dense u,,.ii1,.ql, problem involves locating a minimal stably dense subgraph A C G, if such A exists. Note that A is minimal stably dense iff A is minimal stably dense. 1.1.4 Maximal Stably Dense Subgraph Problem A stably dense graph A is called maximal f,tlol,, dense if /EB, A C B C G, s.t. B is stably dense. Given a graph G, a maximal fo'l,l, dense ub,,Ilqil, problem involves locating a maximal stably dense subgraph A C G, if such A exists. 1.1.5 Maximum Stably Dense Subgraph Problem A largest (in terms of the number of vertices) maximal stably dense subgraph is called maximum ,tf,l'l,, dense. Given a graph G, a maximum ,tflll,, dense .,,1.lii ,"l, problem involves locating a maximum stably dense subgraph A C G, if such A exists. Note that a graph G can have several maximum stably dense subgraphs (that have the same size). 1.1.6 Minimum Stably Dense Subgraph Problem A smallest (in terms of the number of vertices) minimal stably dense subgraph is called minimum tf,lbl,, dense. Given a graph G, a minimum tfb,ll,, dense o,,1l.i.,1./, problem involves locating a minimum stably dense subgraph A C G, if such A exists. Note that a graph G can have several minimum stably dense subgraphs (that have the same size). Also note that subgraph A is minimum dense if and only if A is minimum stably dense, and if A is minimum dense, then A is also minimal dense. Minimizing number of edges vs number of vertices There is a modification of Minimum Stably Dense Subgraph Problem, where we want to minimize number of edges (and not vertices) of stably dense subgraph A. Following results demonstrate that optimal solution of modified problem will yield a constant factor approximate solution of the original problem. Let A C G be the dense subgraph d(A) > 1, such that IE(A) is minimum over all dense subgraphs of G. Let B C G be the dense subgraph d(B) > 1, such that V(B)I is minimum over all dense subgraphs of G. Lemma 1 Number of edges E(A) is at most 31V(A), similarly IE(B)l is at most 31V(B)I. Proof Let k be an average degree of A, then d(A) = V(A)I*k/22* V(A) > 1. Since A is minimum dense, then removal of a vertex v E A, such that v has smallest degree in A, will result in nondense graph A \ v. Degree of v could be at most k, so this forces 1 > d(A \ v) > IV(A)l(k/2 2 1) and therefore k < 6, and E(A) = 3V(A). I We can use this lemma to relate sizes of A and B Claim 1 For A and B defined above, IV(A) < 3/21V(B) 1/2. Proof 2V(A) +1 < E(A)I < IE(B) < 3V(B) First inequality is due to density of A, second inequality is due to A having smallest number of edges among all dense subgraphs and third inequality is due to Lemma 1. I 1.1.7 Examples of various Dense Subgraphs Consider Figure 13. If K = 0 then BCDE is minimal stablyy) dense, EDF is minimum stablyy) dense, AGH is maximal stably dense and ABCDEF is maximum stably dense subgraph. B 3 E 2 2 G\ 2 G \2 F 2 2 2C H2 2 /2 A 2 D Figure 13: An edge/vertex weighted graph 1.1.8 Relationships between various Graph Problems Here we will show that the problem of finding minimum (minimal) dense subgraph can be reduced in polynomial time to the problem of finding a maximum (maximal) dense subgraph. Let X be a bipartite graph, comprised of two sets of vertices X1 and X2. Let A be a subset of X1, a set of all vertices in X2 that are connected to some vertex in A will be denoted by I(A). Now let G = (V, E) be given graph. Let BG = (VB U EB, F) be the bipartite graph corresponding to G, where VB represents vertices V of G, EB represents edges E of G, and in this graph BG, vertex v E VB is connected to vertex e E by an edge (in F) if and only if v is an endpoint of e in G. Lemma 2 Let A be a dense o,,io1,il,,i, of G. Let EA C BG be the set corresponding to all edges of A. Then A = I(EA) and therefore IEA 3 I(EA) > K by definition of ~ sfli of A. Hence finding 'i,,., tI EA such that IEA 3 I(EA) > K would find maximum (number of edgeswise) dense iI,,l, Lemma 3 Let A be a dense "oloil,/, of G. Let C = V \ A. Note that I(C) = E \ EA. Hence d(G) = IEA + I(C) 3 IVAI 3 ICI, and since d(A) > K,d(G)I(C)+3C*C > K and 3*,1CI(C) > Kd(G). Therefore finding smallest dense b,,1i,,,l, is equivalent to finding largest C such that 3* CII(C) > Kd(G). Claim 2 From previous two lemmas it follows that the problem of finding minimum (minimal) dense uo,,bp, ,'l, can be reduced in t ,,oj,,;;,il time to the problem of filit,.i a maximum (maximal) dense ,uo/b",'i/ (Note that reverse reduction will not work due to the lack of symmetry in the bipartit vinl,, a vertex can have have any number of adjacent edges, but every edge has ,l, fli two endpoints.) 1.1.9 Optimal Complete Recursive Decomposition A recursive decomposition of a graph G involves constructing a socalled RDdag of G defined below. A RDdag of graph G is directed acyclic graph R = (RE, RV) which has following properties. The first property of R is that OV C RV, where OV is a copy of the entire set of vertices of G. Now let X be a node in R, then U(X) denotes a set of vertices in MV such that there is an oriented path from v to X for every v E U(X). For example in Figure 14 U(S2) = {C, D, E} (in all examples in this subsection all edges of G have weight 1, all vertices have weight 2, constant K = 3). The second property of R is that for every sink vertex X of R, corresponding subgraph U(X) is a maximal stably dense subgraph of G. The third property of R is that for every node Si in R, with exception of nodes in OV, corresponding subgraph U(S1) is stably dense. The final property of R is that every Si has a cluster l!;; i;''aliif property, i.e., that the set P(S1) of all ancestors of Si does not contain a proper nontrivial subset P'(S,) c P(SJ), P'\  1 such that Uxp',(s,)U(X) is stably dense. For example in Figure 16 node S2 does not have cluster minimality property (for proper subset P' = S U B, U(P') = BCDE is stably dense, hence Figure 16 is not a RDdag. Note that a graph G can have several different RDdags, see Figure 14 and Figure 16. S3 B E S 2 A C A B CDE Figure 1 4: Original graph G and a corresponding RDdag A complete recursive decomposition of a graph G involves constructing a socalled complete RDdag of G. A complete RDdag of G is a RDdag of G with A C D A B CDE Figure 15: Another possible RDdag B E S Si A C D AB CDE Figure 16: Original graph G and NOT a RDdag additional requirement that for every maximal stably dense subgraph M of G, there is a corresponding node M' E R such that U(M') = M. For example middle dag in Figure 16 is a RDdag but not a complete RDdag of G while the right dag is a complete RDdag. E S2 F A B C DE F S1 S2 S3 B CD A B CD E F Figure 17: Original graph G, RDdag and complete RDdag Since given graph G can have several possible RDdags, an important mea sure of efficiency of a RDdag R is it maximum fanin defined as a maximum indegree among all vertices of R. We will provide motivation for this criteria in C D Section 2.1.1. For example in Figure 14 maximum fanin is 1. The problem of finding optimal (complete) recursive decomposition of a graph G involves find ing (complete) RDdag of G that has smallest maximum fanin among all other (complete) RDdags of G. Nontrivial subgraphs. In practice we are only interested in finding maximal/minimal/minimum/maximum stably dense subgraphs of size 3 or more (i.e., not vertices or edges). Graphs of size 2 or less will be referred to as trivial. 1.2 Summary of Results Numeric entries are sections where polynomial time algorithms (or NP completeness) are demonstrated. Problem Bounded Parameter Unbounded Version Minimum stablyy) dense NPcomplete, 4.2 NPcomplete, 4.2 special cases and appr 4.3, 4.4 Maximal stably dense 3.2.3 3.2.3 Minimal stablyy) dense 3.2.3 3.2.3 Maximum stably dense 3.4 3.4 Maximum dense 3.1 NPcomplete, 3.1 Maximum number of edges, 4.1.1 N/A NPcomplete Measures and Performance for GCS 2.1.6, 2.1.14 N/A Complete recursive decomposition 3.3.10 Unknown 1.3 Related Work in Algorithms Community Finding densest graph. The problem of finding subgraph A C G of fixed size IAI = k that maximizes Ew(e(A)) is NPComplete (could be shown by reduction from CLIQUE, see Asahiro and Iwama (1995)). The problem of finding A C G that maximizes (A))can be solved in polyno mial time using parametric flow techniques. The problem of finding A C G, s.t A < k for a given k, and A maximizes EZwi(A)) is NPComplete (could be shown by reduction from CLIQUE). is NPComplete (could be shown by reduction from CLIQUE). Section 4.1.1 contains more details on the relationship between these and our graph problems. Cliquelike results. Let v and e be the number of vertices and edges of graph G respectively. It was shown by (Asahiro and Iwama, 1995) that finding a subgraph of G that has at most a vertices and at least b edges is NPComplete for b = a(a 1)/2 NPComplete for a = v/2, b < e/4(1 + 0(1/ )) NPComplete for a < v/2, b < al+6, b < e/4(1 + 0.45 + 0(1)) can be done in polynomial time for a = v/2, b < e/4(1 O(1/v) (by greedy algorithm) Semidefinite programming based approaches. For a maximum number of edges problem (Feige and Seltzer, 1997) gives a semidefinite programming relaxation approximation algorithm with approximation ratio roughly O(n/k). (Goemans, 1996) studied a linear relaxation of the problem, getting approximation ratio of O(n1/2) when k = n/2. (Srivastav and Wolf, 1999) used semidefinite programming relaxation to get approximation factor within .5 for k = n/2 and (Ye and Zhang, 1997) were able to design .5866 approximation factor SDP based algorithm for the case of k = n/2. CHAPTER 2 APPLICATIONS TO GEOMETRIC CONSTRAINT SOLVING 2.1 Geometric Background 2.1.1 Geometric Constraint Problems Geometric constraints are at the heart of computer aided engineering applica tions (see, e.g., Hoffmann (1997); Hoffmann and Rossignac (1996)), and also arise in many geometric modeling contexts such as virtual reality, robotics, molecular modeling, teaching geometry, and so on. In this dissertation we will be looking at geometric constraint systems primarily within the context of product design and assembly. Figure 23 illustrates those (boldface) components within a standard CAD/CAM/CAE master model architecture (Bronsvoort and Jansen, 1994; Kraker et al., 1997; Hoffmann and JoanArinyo, 1998) where our graph problems are relevant. Informally, a geometric constraint problem consists of a finite set of geometric objects and a finite set of constraints between them. The geometric objects are drawn from a fixed set of types such as points, lines, circles and conics in the plane, or points, lines, planes, cylinders and spheres in 3 dimensions. The constraints are spatial and include logical constraints such as incidence, tangency, perpendicularity and metric constraints such as distance, angle, radius. The spatial constraints can usually be written as algebraic equations whose variables are the coordinates of the participating geometric objects. A solution of a geometric constraint problem is a real zero of the corresponding algebraic system. In other words, a solution is a class of valid instantiations of the geometric elements such that all constraints are satisfied. Here, it is understood that such a solution is in a particular geometry, for example the Euclidean plane, the sphere, or Euclidean 3 dimensional space. For recent reviews of the extensive literature on geometric constraint solving see Hoffmann et al. (1998); Kramer (1992); Fudos (1995). 2.1.2 The Main Reason to Decompose Constraint Systems Currently there is a lack of effective spatial variational constraint solvers and assembly constraint solvers that scale to large problem sizes and can be used interactively by the designer as conceptual tools throughout the design process. Almost all current CAD/CAM systems primarily use a nonvariational, history based 3 dimensional constraint mechanism. This basic inadequacy in spatial constraint solving seriously hinders progress in the development of intelligent and agile CAD/CAM/CAE systems. One governing issue is efficiency: computing the solution of the nonlinear algebraic system that arises from geometric constraints is computationally challeng ing, and except for very simple geometric constraint systems, this problem is not tractable in practice without further machinery. The socalled constraint propaga tion based solvers (e.g. Gao and Chou (1998a); Klein (1998)) generally suffer from a drawback that cannot be easily overcome: they find it difficult to decompose cyclically constrained systems, an essential feature of variational problems. Direct approaches to algebraically processing the entire system include the following: 1) standard methods for polynomial ideal membership and locating solutions in algebraically closed fields, for example using Grobner bases or the WuRitt method; 2) numerous algorithms and implementations for solving over the reals based on the methods of, for example, Canny (1993); Renegar (1992); Collins (1975); Lazard (1981) and 3) algorithms for decomposing and solving sparse polynomial systems based on Canny and Emiris (1993); Sturmfels (1993); Khovanskii (1978); Sridhar et al. (1993, 1996). These direct algebraic solvers deal with general systems of polynomial equations: that is, they do not exploit geometric domain knowledge; partly as a result, they have at least exponential time complexity and they are slow in practice as well. In addition, they do not take into account design considerations and as a result, cannot assist in the conceptual design process. These drawbacks apply to direct numerical solvers as well, including those that use homotopy continuation methods, see, for example, Durand (1998). The problem would be further compounded if we allowed constraints that are natural in the design process, but which must be expressed as inequalities, such as "point P is to the left of the oriented line L in the plane." Such additions would necessitate using cylindrical algebraic decomposition based techniques (Collins, 1975), such as Grigor'ev and Vorobjov (1988); Lazard (1991); Wang (1993) which have a theoretical worstcase complexity of 0(2"2), where n is the algebraic size of the problem; or alternatively require the use of nonlinear optimization techniques, all of which are slow enough in practice that they do not represent a viable option for large problem sizes. With regard to efficiency, the following rule of thumb has therefore emerged from years of experimentation with geometric, spatial constraint solvers in en gineering design and assembly: the use of direct algebraic/numeric solvers for solving large i1 .\f' t'i i renders a geometric constraint solver practically useless: (see Durand (1998) for a natural example of a geometric constraint system with 6 primitive geometric objects and 15 constraints, which has repeatedly defied attempts at tractable solution). The overwhelming cost in geometric constraint solving is directly proportional to the size of the largest 'i1l .\t itl that is solved using a direct algebraic/numeric solver. This size dictates the practical utility of the overall constraint solver, since the time complexity of the constraint solver is at least exponential in the size of the largest such i1t \'f int 2.1.3 Decomposition Recombination (DR) Plans Therefore, the constraint solver should use geometric domain knowledge to develop a plan for decomposing the constraint system into small 1 i\ t'i it whose solutions can be recombined by solving other small 111 \t'i i The primary aim of this decomposition plan is to restrict the use of direct algebraic/numeric solvers to iil. \'t ii that are as small as possible. Hence the optimal or most efficient decomposition plan would minimize the size of the largest such l.\t'. iit Any geometric constraint solver should first solve the problem of efficiently finding a closetooptimal decompositionrecombination (DR) plan, because that dictates the usability of the solver. Finding a DRplan can be done as a preprocessing step by the constraint solver: a robust DRplan would remain unchanged even as minor changes to numerical parameters or other such online perturbations to the constraint system are made during the design process. In addition to optimality (efficiency), other equally important (and sometimes competing) issues arise from the fact that a DRplan is a key conceptual compo nent of the CAD model and should aid the the overall design or assembly process. These issues will be discussed under "Desirable characteristics" later in this section. A clean and precise formulation of the DRplanning problem is therefore a fundamental necessity. To our knowledge, despite its longstanding presence, the DRproblem has not yet been clearly isolated or precisely formulated, although there have been many prior, specialized DRplanners that utilize geometric domain knowledge (Bouma et al., 1995; Owen, 1991, 1993; Hoffmann and Vermeer, 1994, 1995; Latham and Middleditch, 1996; Fudos and Hoffmann, 1996b, 1997; Crippen and Havel, 1988; Havel, 1991; Hsu, 1996; AitAoudia et al., 1993; Pabon, 1993; Kramer, 1992; Serrano and Gossard, 1986; Serrano, 1990). See Hoffmann et al. (1998) for an exposition of two primary classes of existing methods of decomposing geometric constraint systems; representative algorithms from these two classes are extensively analyzed in Section 2.1.8. In the next two subsections we informally describe both the basic require ments of a DRplan(ner) that dictate its overall structure, as well as desirable characteristics of the DRplan(ner) that improve efficiency and assist in the design process. 2.1.4 Basic Requirements of a DRplan Recall that a DRplan specifies a plan for decomposing a constraint system into small l l\t iivt and recombining solutions of these l l\t itr later. There fore the first requirement of a DRplan is that the solutions of the small 1i ,\ ti it in the decomposition can be recombined into a solution of the entire system. In other words, it should be possible to substitute the (set of) solutions) of each sub system into the entire system in a natural manner, resulting in a simpler system. Secondly, we would like these intermediate 1i ,'t'i i,t that are solved during the decomposition and recombination to be geometrically meaningful. Together, these two requirements on the intermediate 1i ,'t'i i,t translate to a requirement that the iil.\t'i i, be geometrically rigid. A rigid or solvable ,il \t it of the constraint system is one for which the set of realzeroes of the corresponding algebraic equations is discrete (that is, the corresponding realalgebraic variety is zero dimensional), after the local coordinate system is fixed arbitrarily, that is, after an appropriate number of degrees of freedom D, are fixed arbitrarily. The constant D is usually the number of translationall and rotational) degrees of freedom available to any rigid object in the given geometry (3 in 2 dimensions, 6 in 3 dimensions, and so on.) and in some cases, D depends on other symmetries of the \1 li\t' it An underconstrained system is not solvable, that is, its set of real zeroes is not discrete (nonzerodimensional). A D: (x1x2)^2+(yly2)^2A^2=0 E: (x2x3)^2+(y2y3)^2B^2=0 P2 F: (x3x1)^2+(y3yl)^2C^2=0 A B P1 C P3 Figure 21: A solvable system of equations wellconstrained system is a solvable system where removal of any constraint results in an underconstrained system. An overconstrained system is a solvable system in which there is a constraint whose removal still leaves the system solvable. Solvable systems of equations are therefore wellconstrained or overconstrained. I.e, the constraints force a finite number of isolated real solutions, so one solution cannot be obtained by an infinitesimal perturbation of another. For example, Figure 21 is a solvable i1 .i \t' it" of three points and three distances between pairs of points. A . s;'sit, ,tl,/l overconstrained system is one which has at least one real zero. Note. It is important to distinguish "solvable" from "has a real solution." Although (inconsistently) overconstrained (or even certain wellconstrained) systems may have no real solutions at all, by our definition, since their set of real zeroes is discrete, they would still be considered "solvable." In general, whenever a ,il \t i" of a constraint system is detected that has no real solutions, then the solution process would have to immediately halt and inform the designer of this fact. 0 Informally, a geometric constraint solver which solves a large constraint system E by using a DRplanner to guide a direct algebraic/numeric solver capable of solving small 111. \t'I li proceeds by repeatedly applying the following three steps at each iteration i. (T (ST)( S3 ITTS)) E E2 Tl(E,) E= T2(E2) E = Tn~ T,(E,) Figure 22: Step 1 rectangles, Step 3 ovals 1. Find a small solvable iil .\'f i, Si of the (current) entire system Ei (at the first iteration, this is simply the given constraint system E, i.e, El = E). This step is indicated by a rectangle in Figure 22. The iil \ itl S could be also chosen by the designer. 2. Solve Si using the direct algebraic/numeric solver. 3. Using the output of the solver, and perhaps using the designer's help to eliminate some solutions, replace Si by an abstraction or simplification Ti(S,) thereby replacing the entire system E by a simplification T,(E,) = E,+1. This step is indicated by an oval in Figure 22. Some informal requirements on the simplifiers T, are the following: we would like E to be (real algebraically) inferable from Ei,+; i.e, we would like any real solution of Ei,+ to be a solution of E, as well. A constraint solver that fits the above structural description, which we shall refer to as S in future discussions is called a decompositionrecombination (DR) solver. (Formal definition imposes further requirements on simplifier T see the next section). This solver terminates when the small, solvable iil\ t' in S5 found in Step 1 is the entire polynomial system E. An optimal DRplan will minimize the size of the largest S,. If the whole system is underconstrained, the solver should still solve its maximal solvable l1 i ti in For the purpose of planning a solution sequence apriori, we would like to execute Steps 1 and 3 alone without access to the algebraic solver, and get a DRplan, without actually solving the ii l\t ii I.e, we would like the constraint solver to look as in Figure 23, with the DRplanner driving the direct algebraic/numeric solver. To generate a DRplan apriori, one would have to locate a solvable ii1.\ti il S,, and without actually solving it, find a suitable abstraction or simplification of it that is substituted into the larger system Ei to obtain an overall simpler system Ei+1 in Step 3. On the other hand, such a DRplan would possess the advantage of being robust, or generically independent of particular numerical values attached to the constraints, and of the solution to the Si, and usually only depends on the degrees of freedom of the relevant geometric objects and geometric constraints. 2.1.5 Desirable Characteristics of DRplanners for CAD/CAM We enumerate and informally describe a set C of natural characteristics desirable for a DRplanner. We begin with four criteria that directly follow from the overall structural description of a typical DRplanner S in the previous subsection. (i) The DRplanner should be general, i.e, it should not be artificially restricted to a narrow class of decomposition plans; it should output a DRplan if there is one; and it should be able to decompose underconstrained systems as well. Furthermore, if a DRplan exists, the planner should run to completion irrespective of how and in what order the solvable il1 .\'ti i, Si are chosen for the plan (a ChurchRosser property). (ii) The planner should potentially output a closetooptimal DRplan (i.e, where the size of the largest solvable ll.\ t' i l S, is closetominimal). This dictates efficiency of solution of the constraint system. (iii) The DRplanner should be fast and simple; the time complexity should be low, the planner should be fast in practice, easily implementable, and compatible with existing algebraic solvers, CAD systems, constraint models and manipulators. (iv) The planner should utilize and take advantage of geometric domain knowl edge, as well as other special properties of geometric constraints arising from the relevant design or assembly application or, in some situations, from a downstream manufacturing application. Besides critically affecting the speed of constraint solving, a good DRplan is a key component of the constraint model which participates in the overall process of design/assembly. This is especially so, since the constraint system is a component of the CAD model which the designer directly interacts with, and moreover, a DRplan is nothing but a hierarchical, structural decomposition of the geometric constraint system. Therefore, maintaining a robust DRplan which reflects design intent at every level of refinement is invaluable in improving efficiency, flexibility and transparency in the overall design process. These properties are crucial for intelligent CAD systems to facilitate designer interaction at a conceptual, earlydesign phase; in fact, an effective CAD system based on spatial, variational constraints to be effective must facilitate earlydesign interaction. This motivates adding the following desirable characteristics to the set C. (v) The DRplan should be consistent with the design intent: in particular, the designer often has a multilayered or hierarchical conceptual, design decomposition in mind, reflecting features or conglomerates of features in the case of product design and parts or subassemblies in the case of assembly. See e.g, Klein (1996); Mantyla et al. (1989); Middleditch and Reade (1997). The designer would typically wish to further decompose the components of her design decomposition, as well as treat these components (recursively) as units that can be independently manipulated. For example, the geometric objects within a component are manipulated with respect to a local coordinate system, and a component as a whole unit is manipulated with respect to a global (next level) coordinate system. The DRplan should therefore be a consistent extension and/or refinement of this conceptual design decomposition. (vi) While the DRplan is used to guide the algebraic solver, it should remain unaffected or adapt easily to the designer's intervention in the solution process, which is valuable for pruning combinatorial explosion: the designer can throw out meaningless or undesirable solutions of it1 \ t'i i at an early stage. Such designer interference is also crucial for avoiding the use of inequality constraints: for example, instead of adding on a constraint that point P is to the left of line L, the designer can simply throw out any partial solutions that put P to the right of line L. (vii) The DRplan for solving a geometric constraint system should remain meaningful in the presence of other than geometric constraints, such as equational constraints or parametric constraints expressing design intent. Finally, the CAD system and the CAD model do not stand alone. In standard clientserver based architectures (see e.g, Bronsvoort and Jansen (1994); Kraker et al. (1997); Hoffmann and JoanArinyo (1998)), the CAD model is just one client's view of the product master model (Newell and Evans, 1976; Semenkov, 1976), with which it has to be continually coordinated and made consistent. The master model in turn coordinates with other downstream production client systems which maintain other consistent views. These clients include geometric dimensioning and tolerancing systems (GD& T), and manufacturing process planners (MPP) for automatically controlled machining or assembly. Each client view contains potentially proprietary information that must be kept secure from the master model. Figure 23 illustrates this architecture and those parts that we deal with directly. Each client view contains its own internal view of the constraint model and therefore coordination and consistency checks between the various views Master model SMaster I model SConstraint Decomposition Optional design history consistent with designed conceptual of constraint models Master model server decomposition (for nonvanational case) GD&T Manuf. proc. Other plan CAD Constraint solver View/system View/system downstream I iI View/ Decomp. gebrpcI system pln s GD&T MPP Constraint model manpulato CAD model model constraint coD 0 0 ^ Anodel Figure 23: CAD/CAM/CAE master model architecture crucially involve, and viceversa may affect the DRplan. This leads to the following additions to the set C of desirable characteristics for DRplanners. (viii) The DRplan should be as robust as possible (see e.g. Fang (1992)) to online changes made to the constraint system, and the DRplanner should be able to quickly alter the DRplan in response to such changes. In particular, the DRplan should ideally not change at all with numerical perturbations (within large ranges) to the constraints, thereby permitting the DRplan to be computed as a preprocessing step. Addition, deletion, and modification of constraints and geometric objects to the constraint system occurs in numerous circumstances during the design process. For example: (a) In the process of solving the system using the DRplan, a 1ii1 \ in l Si deemed solvable by a degree of freedom analysis may be found to have no real solutions, or may, in a degenerate case, turn out to be underconstrained or have infinitely many solutions, preventing a continuation of the solution process S; (b) In lhitm t \1 ', I1 CAD systems, the specification of the product takes the form of a progressive sequence of changes being made to successive partial specifications and the associated partial constraint systems; (c) Inferred or understood constraints are often added to an incomplete constraint specification at the discretion of the CAD system; (d) In underconstrained situations, as might occur in designing flexible or moving parts and assemblies, the mapping of the configuration space of the resulting mechanism would require the repeated addition of constraints at the discretion of the constraint solver the solutions to the resulting wellconstrained systems would represent various configurations of the mechanism; (e) For a variational spatial constraint solver to be effective or even usable, it would have to rely on extensive interactive constraint changes being made by the designer, sometimes in the course of solving; and (f) Finally, when one of the various clients in Figure 23 makes a change to its own view of the constraint model, this will result in consistency updates to the master constraint model which will, in turn, result in updates to the other views of the constraint model. (ix) The DRplan should isolate overconstrained ~li\ti iti which arise in assembly problems; furthermore, with multiple (possibly proprietary) views of the constraint model being kept by various clients as in 23, constraint reconciliation often takes place and the DRplan should facilitate this process, and viceversa, should be robust against this process. For a precise description of the constraint reconciliation problem, see Hoffmann and JoanArinyo (1998). The problem requires isolation of overconstrained lli\ti iti and is compounded in the case of nonvariational, hit 't \ 1 .,i .1 design. 2.1.6 Formal Definition of DRsolvers using Polynomial Systems We will formally state the decompositionrecombination (DR) problem for polynomial systems arising from geometric constraints. This requires formal izing the notion of a decompositionrecombination solution sequence, and of decompositionrecombination solvers that fit the description S given in the previous section. In addition, we define the performance measures that capture some of the desirable properties C given in the last section for comparing such sequences and solvers. Note. As was mentioned previously, for the sake of gradual exposition, we will first assume that the constraint system is being solved even as the decomposition is being generated i.e, the DRsolver exactly fits the structural description S given in the previous section. Furthermore, we will define the DRsolver in the general context of polynomial equations that arise from the geometric constraints. In Section 2.1.7 we will shift our attention to the DRplanning problem. The DRplanner generates a decomposition plan apriori, which then drives the direct algebraic/numeric solver together, they form a DRsolver. The DRplanner, however, will be defined in the context of constraint graphs that incorporate geometric degrees of freedom. The DRplanner and its performance measures will be analogous to the italics terms defined here. In order to formally define DRsolvers and their performance measures, we need to specify the model of realalgebraic computation used by the algebraic/numeric solver in Figure 23. However, the issue of the model or how real numbers are represented is entirely outside the focus of this manuscript for the following reason: our DRsolvers and performance measures are robust in that they are conceptually independent of the algebraic/numeric solver being used or how real numbers are represented. The definition of DRsolvers and performance measures adapts straightforwardly to other natural models of computation. In other words, our conceptual definition of DRsolvers and performance measures are such that if DRsolver A performs better than DRsolver B with respect to one of our performance measures, then it continues to do irrespective of the (natural) model of computation being used by the algebraic/numeric solver. Further, as pointed out in an earlier note, we only emphasize the boldface components of Figure 23, specifically the DRplanner, whose operation defined in Section 2.1.7 will be seen to be purely combinatorial. In particular, no emphasis is placed on the nonboldface components, which includes the algebraic/numeric solver, and the model of computation it uses. < Having noted the above, the model of computation we assume for the the sake of completeness and formality of definitions in this manuscript is the BlumShub Smale model of real algebraic computation Blum et al. (1989). Briefly, in this model, real numbers are assumed to be representable as such as entities, without any recourse to rational approximations and finite precision or interval arithmetic. Real arithmetic operations such as multiplication and addition and division can be performed in constant time, and finding unambiguous representation of each real zero of a univariate polynomial p can also be achieved in time polynomial in the degree of p. Furthermore, these unambiguous representations of real zeroes of univariate polynomials are treated as entities just like any other real number, and can for instance, be used as coefficients of other polynomials. A system of equations E is a pair (P, X) where P is a set of polynomial equations with real coefficients, and X is a set of formal indeterminates. The union of two i f. i,,. E1 = (P1, X) and E2 = (P, X2) is the system (P1 U P2, X1 U X2). An intersection El n E2 is the system (P1 n P2, X1 n X2). Within the geometric context, a solved ill vtf' in is a rigid or solvable system where all the variables have already been "solved for," i.e, they have typically been expressed explicitly as polynomials of D free variables, where D represents the number of degrees of freedom of the rigid body (within its local coordinate system) in the prevailing geometry. In some cases, for example when the rigid body is a line in 3 dimensions, the number of free variables, including redundant ones, may be greater than D. Let E = (P, V) with V = {yi,... D} U X be such that every equation in P is of type xj = Fj(yi, ..., yD), for all xj E X and Fj is a rational function (of the form Q1/Q2 where Qi and Q2 are, as usual, polynomials with real coefficients) that can be evaluated in time polynomial in (V, P). Such a system of equations, E, is called a solved system. The variables yi, ..., yD E V of the solved system are free variables of E, and the variables l,.., .., Xk V are explicitly fixed variables. Note that all the variables in a solved system are fixed or free, whereas a general solvable system may have free, explicitly fixed and other, i;,!' li, ,fixed variables. A typical DRsolver that follows the overall structural description S of Sec tion 2.1.4 obtains a sequence E1,... E,, consisting of successively simpler solvable systems. These are general solvable systems and have successively fewer implicitly fixed variables; E = El; and Em is a solved system. New variables yi may be introduced at intermediate stages which represent free variables within ,Ll\ t' ii ,s Si that are solved with respect to these variables. These solved sub systems represent various rigid bodies located and fixed with respect to their local coordinate systems. However, these local coordinate systems are still constrained with respect to each other, and hence in fact only D of the newly introduced vari ables are, in effect, free and the remainder are implicitly fixed. Some of these newly introduced variables may be removed at later stages. Eventually, in the solved system Em, all the original variables and those newly introduced variables that might remain become explicitly fixed with respect to D free variables as well. The set of real solutions to Ei+1 should also be a subset of solutions to Ei, to ensure that the final solutions to Em actually represent solutions to the original system E. We formally define real algebraic equivalence and real algebraic inference of two geometric constraint systems as follows. Given two systems El = (P1, X U Yi) and E2 = (P2, X U Y2) where the set X represent the original variables that are currently implicitly or explicitly fixed, and the sets Y, represent the newly introduced variables (that are "free" within the solved ,1 .\t'fI I S1), we say that the system El = (P1, X U Yi) is real .,i/, 1,,;i, all, inferable (in short, inferable) from the system E2 = (P2, X U Y2), if for any real solution Y2 = A2; X = B that satisfies the equations in P2, there is a corresponding assignment A1 of real values to Y1 such that Y = A1; X = B satisfies P1. Two systems El and E2 are real .,1./i 1i,/ti ,a11, equivalent if El is real algebraically inferable from E2 and E2 is real algebraically inferable from El. Now we are ready to define the notion of a DRsolution sequence. Let E be a system of equations. A DRsolution sequence of E is a sequence of systems of equations E, ..., Em such that E = El, Em is a solved system (so Em has a real solution), every E, is solvable, each E, is inferable from E,+1. Any solvable system E which has a real solution in fact has a DRsolution sequence. A trivial DRsolution sequence E, E* where E* is a solved system equivalent to E will do. (Note that by E, we denote abstract algebraic systems, rather than their computer representations that could only have rational coefficients and therefore may only have approximate DRsolution sequences). The DRproblem is the problem of finding a DRsolution sequence of a given constraint system. A DRsolver is a constraint solver or algorithm that solves the DRproblem. A DRsolver is general if it always outputs a DRsolution sequence when given a solvable system as input. Aside from being general, we would also like a DRsolver to have the CI,,,n, lRosser property, i.e, the DRsolver should terminate irrespective of the order in which the solvable l1 .\'fi i, S, are chosen. In other words, at each step, a solvable ill \tf itl Si can be chosen greedily to satisfy the (easily checkable) requirements of the algorithm. This prevents exhaustive search. Performance measures. Next, we formally define a set of p if, ,ni, i,' measures for the DRsolution sequences and DRsolvers. These performance measures are designed to capture the characteristics C of constraint solvers given in Section 2.1.5, that are desirable for engineering design and assembly applications. (Note that many of these measures are Boolean, i.e, either a certain desirable condition is met or not.) In particular, we would like a DRsolution sequence Q = E, ... E, of a solvable system E to have several properties. To describe these properties we formalize a simplifying map from each system Ei to its successor E,+1. In fact, for generality, we choose these maps T, called subsystem simplifiers  to map the set of i1 .\t' ir, of Ei onto the set of iit \f. ti i of Ei+1. First, in order to reflect the ChurchRosser property in (i), and points (iv) and (vi) of C, we would like these i1l .\t int simplifiers T, to be natural and wellbehaved, i.e, to obey the following simple and nonrestrictive rules. (1) If A is a iil .\ft. of B then T,(A) is a 1.\t. il" of T,(B) (2) T,(A) U T,(B) = T,(A U B) (3) T,(A) n T(B) = T(A n B) Second, in the description of the typical DRsolver S given in Section 2.1.4, each system E1+1 in the DRsolution sequence is typically to be obtained from Ei by replacing a solvable il .\t'i i L S, in Ei (located during Step 1 of S), by a simpler ,ill \ft i (during Steps 2 and 3). For a manipulable DRsolution sequence (again satisfying the points (i), (iv), (v) and (vi) of C), we would like Ei+1 to look exactly like E, outside of S,. This leads to another set of properties desirable for the ,il l'\'f i" simplifiers Ti. (4) Each E = Si U Ri U UI 1 < i < m where S, is solvable, Ri is a maximal ,it.\'t itl such that Si and Ri do not share any variables, Si, Ri, U, do not share any equations, and all variables of Ui are either variables of Si or Ri. For any AC ?R, T,(A) = A. Thirdly, in order to address the points (iv)(vi), and (i) of C simultaneously, i.e, permitting generality of the i t '\t il Si that is replaced by a simpler system during the i h step, while at the same time making it convenient for the designer to geometrically follow and manipulate the decomposition, we would like the i1l '\t' i" simplifiers to satisfy the following property. (5) For each i, all the preimages of S,, T, ...T 1 (Si), 1 < j < i 1 are algebraically inferable from Si, and furthermore, they are solvable or rigid ,1l .'t' iI for the given geometry (recall that the definition of "solvable" depends on the geometry). It follows from (2) and (3) above that the inverse T 1(A) = UB where the union is taken over all B C Ei, such that T(B)C A. The above property says that while the 1i\'t' it simplifiers enjoy a high degree of generality and are completely free to map solvable il 't'.i iut into solvable systems, they should never map (convert) iil \'t. iiv that are originally not solvable into one of the chosen, solvable systems Si, at any stage i. In other words, in the act of simplifying, the 1 ti\t' itl simplifiers should not create one of the solvable l ,\t'i i,t S out of l ,\t'i i,t that were originally not solvable. A DR solution sequence that satisfies the above properties is called valid. Thus a valid DRsolution sequence for a geometric constraint system E is specified as a sequence of El,... Em such that El = E, Em is a solved system, every Ei is solvable and inferable from E,+1, every Ei = Si U Ri U U, as described above. The motivation given for each of the properties above makes it clear that valid DR solution sequences encompass highly general but geometrically meaningful solutions of the original constraint system E. Next we turn to point (ii) of C, i.e, optimality, which also competes with generality (point (i)). For optimality, we would like to minimize the size of the largest solvable i11 \t'i i Si in the DRsolution sequence. Formally, the size of the DRsequence Q is equal to maxl ISl is equal to the total number of it variables less the number of its explicitly fixed variables. The optimal DRsize of the algebraic system E is a minimum size of Q, where the minimum is taken over all possible DRsolution sequences Q of E. An optimal DRsolution sequence Q of E is a solution sequence such that the size of Q is equal to the optimal DRsize of E. The approximation factor of DR solution sequence Q of the system E is defined as the ratio of the optimal DRsize of E to the size of Q. As a general rule for optimality, it is clear that the larger the choice for solvable ,I,vtf I i I S, of Ej available at any stage i, the more likely that one can find a small solvable S, in Ei. In other words, we would like to make sure that the ,1i \tf iul simplifier does not destroy solvability of too many iii \t, i starting from the original system E. Note that while the definition of DRsolution sequence makes sure that the entire system Em is solvable if El is, it does not require the same for iil\ t'i ii s of Ei. (In fact, even if all the Ei in a DRsolutionsequence are algebraically equivalent, this would still not imply that solvability is preserved for the il vti ii). In addition, while the definition of a DRsolution sequence ensures that Ei+1 has a real solution if Ei has one, it does not ensure the same for il. t lii of E,. The next two definitions capture properties of 1i \ti ilL simplifiers that preserve ii \'t iii solvability (resp. solutions) to varying degrees, thereby helping the optimality of the DRsolver, i.e, (ii) of C. The DRsolution sequence Q = E, ..., Em is ,*,1., ,,l1if,i preserving if and only if for all A c Ei, A is solvable (resp. has a real solution) and (An Si= 0 or A c S) c=# T (A) is solvable (resp. has a real solution). A DRsequence Q = E, ..., Em is strictly .l/,,,li,;f1, preserving if and only if for all A C Ei, A is solvable (resp. has a real solution) == T(A) is solvable (resp. has a real solution). Requiring such a solvability preserving simplifier places a weak restriction on the class of valid DRsolution sequences, but on the other hand, this restriction cannot eliminate all optimal DRsolution sequences. Furthermore, solvability preservation helps to ensure the ChurchRosser property in (i) of C. Note. To be more precise, "solvability preservation" should be termed "solvability and solutionexistence preservation," but we choose the shorter phrase. O In fact, for DRsolution sequences to be optimal, we would prefer that for all i > 1, S, does not contain any strictly smaller iii1\'ft it say B that is solvable, and has not been found (during Step 1 of the description S in Section 2.1.4) and simplified/replaced at an earlier stage j < i. The DRsequence Q = E, ..., E, is complete if and only if for every nontrivial solvable B C Si, B = T,_1T_2...Tj(Sj) for some j < i 1. While the completeness requirement restricts the class of valid DRsolution sequences, it only eliminates sequences that either have size greater than optimal or the same size as some optimal sequence that does simplify B. In addition to affecting optimality, i.e, (ii) of C, completeness also strongly reflects (ix): completeness prevents a DRsolver from overlooking an overconstrained 'l .i\ i1 inside a wellconstrained liil ti i" which is also useful for constraint reconciliation (see Hoffmann and JoanArinyo (1998)). Performance measures. So far, we have discussed performance mea sures that measure the desirability of DRsolution sequences. Next we formally define directly analogous performance measures for DRsolvers which generate DRsequences. A DRsolver A is said to be valid, l,.',l1,ilit';, preserving, strictly .,'11,,1ili;f, preserving, complete if and only if for every input constraint system E, every DRsolution sequence produced by A is valid, solvability preserving, strictly solvability preserving or complete respectively. Note. Purely as a tool to help analysis and exposition, often we assume that DRsolvers for producing DRsequences are randomized or nondeterministic in a natural way, i.e those steps in the algorithm where arbitrary choices of equations or variables are made (for example, to be the lowest numbered equation or variable) are now taken to be randomized or nondeterministic choices. O The next definition formalizes performance measures related to the characteristic (ii) of C that differentiates randomized DRsolvers for which some random choice leads to an optimal DRsolution sequence, from inferior DRsolvers where no choice would lead to an optimal DRsolution sequence. The worstchoice approximation factor of a DRsolver A on input system E is the minimum of the approximation factors of all DRsolution sequences Q of E obtained by the algorithm A over all possible random choices. The bestchoice approximation factor of the algorithm A on input E is maximum of the approximation factors of all the DRsolution sequences Q of E obtained by the algorithm A over all possible random choices. 2.1.7 Formal Definition of a DRplanner via Constraint Graphs The DRsolution sequence defined in the previous section embeds a DRplan that is intertwined with the actual solution of the system. Therefore, a DRsolver that simply outputs a DRsolution sequence (even one that is strictly solvability preserving, complete, and so on..), may not be modular as shown in Figure 23. How to construct a DRsolver that first generates a DRplan before using it to drive the general algebraic/numeric solver? First notice that repeatedly applying Steps 1 and 3 of the DRsolver in the description S in Section 2.1.4 could poten tially generate a DRplan without actually solving any I1.\t. 1i (and without applying Step 2), provided that the following can be done: (a) solvability of a l ,\fti i' S, of the system E, in Step 1 can be determined generically, without actually solving it; and (b) a solvable il.\f' i Si can be replaced in Step 3 without actually solving S, i.e, by a hypothetical solved 1il \vf' ilt to give the new system Ei+1. For this we need a consistent and adequate abstraction of the systems Ei, and of their ll\ft ii as well as a way to abstract a hypothetical solved ll \t f iil In other words, we need to adapt the iil vft itl simplifier maps described in the last section, so that the iteration can proceed with Step 1 again. By thus modifying the description S of the DRsolver, we obtain a DRplanner which can be employed as a preprocessing step to output a DRplan instead of a DRsolution sequence. This DRplan can thereafter be used to direct a series of applications of Step 2, leading to a complete DRsolution sequence. This modularity helps, for example, towards maneuverability by the designer (point (vi)), and towards compatibility of the DRsolver with existing solvers (point (v)). In order to formally define such a DRplan, we follow a common practice and view the constraint system as the constraint hypergraph: this abstraction permits us to build the DRplanner on the foundation of generalized degree of freedom analysis which is known to work well in estimating generic solvability of constraint systems without actually solving them. (This is explained more precisely after the formal graphtheoretic definitions are in place). Hence using constraint graphs facilitates both the tasks (a) and (b) described above. In other words a DRplanner that is based on a generalized degree of free dom analysis is robust in the following sense: changing the numerical values of constraints is not likely to affect the DRplan. Thus the motivation for using con straint graphs includes all of the desirable characteristics (iii) to (vi) of the set C in Section 2.1.5. In addition, geometry is more visibly displayed via constraint graphs than via equations, thereby helping interaction with the designer. Note. DRplans and planners and their performance measures could also be defined directly in terms of the algebraic constraint systems, just as we defined 32 1 (2 2 E E D F 1 /1 2 Figure 24: A constraint graph DRsolvers. In this thesis, however, due to the reasons mentioned above, we define DRplans and planners entirely within the context of constraint graphs and degree of freedom analysis. Constraint graphs and solvability. First we define the abstraction that converts geometric constraint system into a weighted graph. Recall that a geometric constraint problem consists of a set of geometric objects and a set of constraints between them. A geometric constraint graph G = (V, E, w) corresponding to a geometric constraint problem is a weighted graph with n vertices (representing geometric objects) V and m edges (representing constraints) E; w(v) is the weight of vertex v and w(e) is the weight of edge e, corresponding to the number of degrees of freedom available to an object represented by v and number of degrees of freedom removed by a constraint represented by e respectively. For example, Figure 24 is a constraint graph of a constraint problem shown in Figure 21. Note that the constraint graph could be a ,,i,, ,iI,,'1, each hyperedge involving any number of vertices. Now we introduce definitions that will help us to relate the notion of solvability of the geometric constraint system to the corresponding geometric constraint graph. A subgraph A C G that satisfies w(e)+D > w(v) (2.1) eeA veA is called dense, where D is a dimensiondependent constant, to be described below. The function d(A) = (CA w(e) EOA w(v) is called /'/;, of a graph A. The constant D is typically ('d+) where d is the dimension. The constant D captures the degrees of freedom associated with the cluster of geometric objects corresponding to the dense graph. In general, we use words "subgraph" and . ILt' t" interchangeably. For planar contexts and Euclidean geometry, we expect D = 3 and for spatial contexts D = 6, in general. If we expect the cluster to be fixed with respect to a global coordinate system, then D = 0. A dense graph with density strictly greater than D is called overconstrained. A graph that is dense and all of whose subgraphs (including itself) have density at most D is called wellconstrained. A graph G is called welloverconstrained if it sat isfies the following: G is dense, G has at least one overconstrained subgraph, and has the property that on replacing all overconstrained subgraphs by wellconstrained subgraphs, G remains dense. A graph that is wellconstrained or wellovercon strained is said to be solvable. A dense graph is minimal if it has no proper dense subgraph. Note that all minimal dense subgraphs are solvable, but the converse is not the case. A graph that is not solvable is said to be underconstrained. If a dense graph is not minimal, it could in fact be an underconstrained graph: the density of the graph could be the result of embedding a subgraph of density greater than D. In order to understand how solvable constraint graphs relate to solvable constraint systems it is important to remember that a geometric constraint problem has two aspects combinatorial and geometric. The geometric aspect deals with actual parameters of the geometric constraint problem, while the combinatorial aspect deals with only the abstractions of objects and constraints. Unfortunately at the moment it is not known how to completely separate the two aspects, except for some special cases. In this thesis we will limit ourselves to the geometric constraint problems where generally there is a correspondence between solvable constraint AcD F Figure 25: Generically unsolvable system systems and solvable constraint graphs. In order to do that, we need to introduce and formalize the notion of generic solvability of constraint systems. Informally, a constraint system is generically (un)solvable if it is (un)solvable for most choices of coefficients of the system. More formally we use the notion of genericity of e.g, Cox et al. (1998). A property is said to hold genet iI ,,ll for polynomials fi,... f, if there is a nonzero polynomial P in the coefficients of the f, such that this property holds for all fl,... f, for which P does not vanish. Thus the constraint system E is generically (un)solvable if there is a nonzero polynomial P in the parameters of the constraint system such that E is (un)solvable when P does not vanish. Consider for example Figure 25. Here the objects are 6 points in 2d and the constraints are 8 distances between them. This system is unsolvable since the edge BC can be continuously displaced, unless the length of AD (induced by the lengths of AE, DE, DF, AF and EF) is equal to the ABI + IBC + CDI. Since we can create an appropriate nonzero polynomial P(AB, BC,... EF), such that P() = 0 if and only if IADI = IABI + BCI + ICDI, this system is generically unsolvable. While a generically solvable system always gives a solvable constraint graph, the converse is not always the case. In fact, there are solvable, even minimal dense graphs whose corresponding systems are not generically solvable, and are in fact generically not solvable (note that the position of the 'not' changes the meaning, B G33 Figure 26: Generically unsolvable system that has a solvable constraint graph the latter being stronger than the former). Consider for example Figure 26. The constraint system is shown on the left, it consists of 8 points in 3d and 18 distances between them. The corresponding constraint graph is shown on the right, weight of all the edges is 1, weight of the vertices is 3, geometry dependent constant D = 6. Note that this system is generically unsolvable since rigid bodies ABCDE and AFGHE can rotate about the axis passing through AE. This example can also be transformed into a constraint problem in 2d, where the objects are circles and the constraints are angles of intersections Saliola and Whiteley (1999). Another example is the graph K7,6 that in 4 dimensions represents distances between pairs of points. The constraint graph is minimal dense but it does not represent a generically solvable system. It should be noted that in 2 dimensions, according to Laman's theorem Laman (1970) if all geometric objects are points and all constraints are distance constraints between these points then any minimal dense subgraph represents a generically solvable system. Also there exists a purely combinatorial characterization of solvable systems in 1 dimension based on connectivity of the constraint graphs. However, as examples above indicate, the generalization of Laman's theorem fails in higher dimensions even for the case of points and distances. There is a matroid based approach to verifying whether solvability of the constraint graph implies solvability of the constraint system. It begins by checking whether a submodular function f(E) = 21VI 3, defined on sets of edges of the constraint graph creates a matroid Whiteley (1992, 1997), i.e checking whether the created function is positive on single edges. Thereafter this approach checks whether the corresponding geometric structure is generically rigid. Some matroid based approaches to determining generic solvability are fast in practice, for example those to be discussed later under "generalized maximum matching". However, so far no match has been established (for all cases) between the created matroid and generic rigidity of the particular geometric problem. There are several attempts at characterization of generic solvability in dimen sion 3 and higher for the case of points and distances Tay (1999); Graver et al. (1993). One such characterization, the so called Henneberg construction, checks whether a given constraint graph can be constructed from the initial basic graph by applying a sequence of standard replacements. A characterization due to Dress checks whether the constraint graph satisfies a certain inclusionexclusion type rule. A characterization due to Crapo examines whether the constraint graph can be de composed into a union of certain edgedisjoint trees. All of these characterizations though interesting and useful, are so far unproven conjectures. Note. Due to the above discussion, we restrict ourselves to the class of constraint systems where solvability of the constraint graph in fact implies the generic solvability of the constraint system. (As pointed out earlier, the converse is always true, with no assumptions on the constraint system). As was indicated above, this class is far from empty, it contains all constraint problems involving points and distances in 2d, problems resulting from Cauchy triangulations of the polyhedra in 3d as well as bodyandhinge structures in 3d. Moreover, it should be emphasized that while existing applications stop at finding subgraphs representing solvable constraint systems, we are interested in the entire problem of decomposition and recombination, optimizing the size of the largest il v\tf iln to be solved, i.e we are interested in finding an optimal DRplan. Also note that already for the class of generically solvable constraint systems and I DE Figure 27: Original geometric constraint graph G1 and simplified graph G2 corresponding graphs, the DRplanning problem is, in general, difficult (see later Note about NPhardness, after the definition of the optimal DRplan). O Formal definition of DRplans using constraint graphs. Informally, stated in terms of constraint graphs, the DRplanning problem involves finding a sequence of graphs Gi a DRplan such that the original constraint graph G = G1 and every Gi contains a minimal solvable subgraph Si, which is simplified or abstracted into a simpler subgraph T,(S,) and substituted into Gi to give an overall simpler graph GC+I = Ti(Gi). (While Ti(S,) should be simpler than Si, it should also be somehow equivalent to Si, for example by having same density value.) If the original graph G1 is wellconstrained, then the process terminates when G, = S,. (If not, the process terminates with the decomposition of G, into a maximal set of minimal solvable subgraphs). Consider for example Figure 27 which shows one simplification step. On the left is the constraint graph G1, the weight of all vertices is 2, weight of all edges is 1, geometry dependent constant D = 3. Then S1 = {A, B, C} is a solvable subgraph. On the right is the simplified graph TI(G1) = G2, after subgraph S1 is replaced by a vertex {V} = Ti(S1). Since density of the subgraph S1 is 3, the weight of the vertex {V} could be set to 3. A sequence of simplification steps is shown in Figure 28. The top part depicts a geometric constraint graph G, where the weight of each edge is 1, the weight of each vertex is 2, and the dimension dependent constant D is equal to 3 (this S, S3 S5 A B C D E F G HI J K L M N O Figure 28: Geometric constraint graph and a DRplan corresponds to points and distances in 2d). One of the plans for decomposing and recombining G (and the geometric constraint system that G represents) into small solvable subgraphs (representing solvable il1 \ti i4 ), is to decompose G into dense subgraphs St = {A, B, C}, S2 = {D, E, F}, S3 = {G, H, I}, S5 = {J, K, L}, S6 = {M, N, O}, represent their solutions appropriately in a simplified graph so that they can be recombined, one possibility is to represent them as vertices P, Q, R, S, T of weight 3 each; recursively decompose the simplified graph into 4 = {P, Q, R}, S7 = {S, T}; represent and recombine their solutions as vertices U, W of weight 3; and so on until the entire graph is represented and recombined as a single vertex. A corresponding DRplan is shown at the bottom part of Figure 28. Note that there could be more than one DRplan for a given constraint graph. For example, another possible DRplan for a constraint graph described above is shown in Figure 29. An optimal DRplan will minimize the size of the largest solvable subgraph Si found during the process. I.e, it will minimize the maximum fanin of the vertices in the DRtree shown in Figure 28 and Figure 29, where by fanin of a vertex we mean the number of immediate descendants of the vertex. With this description, it should be clear, that DRplans obtained using the weighted, constraint graph model are generically robust with respect to the changes made to the geometric constraints; as long as the number of degrees of freedom attached to the objects and destroyed by the constraints remains the same, the same DRplan will work for the changed constraint system as well. Thus, such DRplans satisfy the initial robustness requirements of the characteristic (viii) of the set C described in Section 2.1.5. Next we formally define a DRplan for constraint graphs, and the various perfor mance measures that capture desirable properties of DRplans and DRplanners. 40 S1 B3 S, /S7 S2G Sg S4 S S S2 S5 \ S6 ABC DE F G H I J K L MN O Figure 29: Another possible DRplan The development is parallel to that in Section 2.1.6, where a DRsolution sequence and various performance measures for these sequences and for DRsolvers were motivated and defined in terms of polynomial systems. Note. Due to the strong analogy of DRplanners to DRsolvers defined in the previous section, the discussion here is more terse. The following are useful generic correspondences to keep in mind after reading the Note at the end of Section 2.1.7, and the paragraphs preceding it: Solvable subgraphs = solvable ill \'t it . DRplans = DRsolution sequences; DRplanner = DRsolver; subgraph simplifier =: ii \ iti simplifier. < Let G be a solvable constraint graph. A DRplan Q for G is a sequence Q of graphs G1, ..., G, such that G1 = G, Gm is a minimal solvable graph, and every Gi is solvable. An algorithm is a general DRplanner if it outputs a DRplan when given a solvable constraint graph as input. The union (resp. intersection) of two ub,,1li~,,!.i A and B is the graph induced by the union (resp. intersection) of sets of vertices of A and B. All subgraphs are understood to be vertex induced. The mapping from the graph Gi to GC+1 is called a o,,1li,,,, simplifier and is denoted by Ti. This mapping should have the following properties. (1) If A is a subgraph of B then TI(A) is a subgraph of Ti(B). (2) T,(A) U T,(B) is the same as the graph T,(A U B). (3) T,(A) n T,(B) is the same as T,(A n B). As in the case of DRsolution sequences, assume that every constraint graph Gi in the DRplan can be written as Si U Ri U Ui, where Si is minimal solvable, Ri is a maximal subgraph such that S, and Ri do not have common vertices, Si, Ri, U, do not have common edges and all vertices of Ui are either vertices of Si of vertices of Ri. Analogous to properties (4) and (5) of the ii1\'f i n simplifier in the previous section, we would like the subgraph simplifier to have the following additional properties. (4) For every A C Ri, T,(A) = A (5) All the preimages of S,, i.e T1 T ...T, 1(S) for all 1 < < i 1, are solvable. A DRplan that satisfies the above rules is called valid. The size of the DRplan Q of G is the maximum of the sizes of Si. The size of an arbitrary subgraph A C Gi is computed as follows. Size(A) = 0 For l B = T_1T,_,...T,(Sj) If AnB 0 then Size(A) = Size(A) + D, A = A \ B end if end for Size(A) = Size(A) + EZeA w(v) In other words, the image of any of the Sj contributes D to the size of A, where D is geometry dependent constant, and the vertices of A that are not in any such image contribute their original weight. The optimal size of the constraint graph G is the minimum size of Q, where the minimum is taken over all possible DRplans of G. An optimal DRplan of G is the DRplan that has size equal to the optimal size of G. The approximation factor of DRplan Q of the graph G is defined as the ratio of the optimal size of G to the size of Q. Note. The problem of finding the optimal DRplan for a constraint graph with unbounded vertex weights is NPhard. This follows from a result in the authors' paper Hoffmann et al. (1997) showing that the problem of finding a minimum dense subgraph is NPhard, by reducing this problem to the CLIQUE. The CLIQUE problem is extremely hard to approximate Hastad (1996), i.e, finding a clique of size within a n'6 factor of the size of the maximum clique cannot be achieved in time polynomial in n, for any constant e (unless P=NP). However our reduction of CLIQUE to the optimal DRplanning problem is not a socalled gappreserving reduction (or Lreduction); thus how well this problem could be approximated is still an open question. The definition of solvability preservation is largely analogous to the case of DR solvers, but is additionally motivated by the following. In the case of DRsolvers, one condition on a solvability preserving simplifier is that it preserves the ex istence of real solutions for certain iil\'f in Here, in the case of DRplans, a natural choice is to correspondingly require that the simplifier does not map wellconstrained subgraphs or overconstrained subgraphs to underconstrained and viceversa. The DRplan Q of G is l,11,.l,litf, preserving if and only if for all A C GC, A is solvable and (A n S = 0 or A C S) > T,(A) is solvable. The DRplan Q of G is strictly ',11,.l,ilitf, preserving if and only if for all A c Gi, A is solvable nontrivial solvable B C S,, B = T,_IT_2...,Tj(Sj) for some j < i 1. Next, we formally define DRplanners and their performance measures. An algorithm is said to be a DRplanner if it outputs a DRplan when given a solvable constraint graph as input. As before, we consider DRplanners to be randomized algorithms. A randomized DRplanner A is said to be valid, Nl.,/dl,l;,f preserving, strictly ,l,.,i;l;ifi, preserving, complete if and only if for every G every DRplan produced by A is valid, solvability preserving, strictly solvability preserving or complete accordingly. The worstchoice approximation factor of a DRplanner A on input graph G is the minimum of the approximation factors of all DRplans Q of G obtained by the DRplanner A over all possible random choices. The bestchoice approximation factor of the algorithm A on input graph G is the maximum of the approximation factors of all the DRplans Q of G obtained by the DRplanner A over all possible random choices. In addition to the above performance measures, we define three others that reflect the ChurchRosser property, the ability to deal with underconstrained ii1 \t' in as well as the ability to incorporate an input, design decomposition provided by the designer. A DRplanner is said to have the CI,,,,I, Rosser property, if the DRplanner terminates with a DRplan irrespective of the order in which the dense subgraphs S, are chosen. A DRplanner A adapts to underconstrained constraint i pi,,/, G if every (partial) DRplan produced by A terminates with a set of solvable subgraphs Qi such that each solvable subgraph Qi has no supergraph that is solvable, and moreover, no subgraph of G that is disjoint from all of the Qi's is solvable. A conceptual design decomposition P is a set of solvable subgraphs P,, which are partially ordered with respect to the subgraph relation. A DRplanner A is said to incorporate a design decomposition P, if for every DRplan Q produced by A, the corresponding sequence of solvable subgraphs Si embeds a topological ordering of P as a subsequence recall that a topological ordering is one that is consistent with the natural partial order given by the subgraph relation on P. When a DRplan incorporates a design decomposition P, the level of a cluster Pi in the partial ordering of P can now be viewed as a priority rating which specifies which component of the design decomposition has most influence over a given geometric object. In other words, a given geometric object K is first fixed/manipulated with respect to the local coordinate system of the lowest level cluster P, E P containing K. Thereafter, the entire cluster P, can be treated as a unit and can be independently fixed/manipulated in the local coordinate system of the next level cluster Pj containing (the simplification of) P,, and so on. Finally, we summarize how the above formal performance measures capture the informally described characteristics in the set C given in the Section 2.1.5. The property of being a general DRplanner refers to whether the method success fully terminates with a DRplan in the general case, and reflects characteristic (i); since we use constraint graphs which yield robust DRplans that can be ob tained efficiently, the property of being a general DRplanner also reflects (iii) and (viii); dealing with underconstrained graphs also reflects (i); incorporating input, design decompositions reflects (v); validity influences the ChurchRosser property and reflects (i) as well as (iv),(v), (vi); solvability preservation, strict solvability preservation influence the ChurchRosser property and reflect (i), (ii), (iv), (v); completeness is based on the criteria (ii) and (ix); worst and best choice approximation factors are based on (ii) and complexity directly reflects (iii). 2.1.8 Two old DRplanners We concentrate on two primary types of prior algorithms for constructing DRplans using constraint graphs and geometric degrees of freedom. Note. Due to reasons discussed in Section 2.1.7, we leave out those graph rigidity based methods for distance constraints in dimensions 3 or greater such as Tay and Whiteley (1985); Hendrickson (1992) as well as methods such as Crippen and Havel (1988); Havel (1991); Hsu (1996) since they are nondeterministic or rely on symbolic computation, or they are randomized or generally exponential and based on exhaustive search. Graph rigidity and matroid based methods for more specific constraint graphs are discussed in Section 2.1.10 under the socalled Maximum Matching based algorithms. Also, for reasons discussed in the introduction, we leave out methods based on decomposing sparse polynomial systems. < The first type of algorithms, which we call SR for constraint S ,,1i' Recognition (e.g.Bouma et al. (1995); Owen (1991, 1993); Bouma et al. (1995), Hoffmann and Vermeer (1994, 1995); Fudos and Hoffmann (1996b, 1997)), concentrates on recognizing specific solvable subgraphs of known shape, most commonly, patterns such as triangles. The second type, which we call MM for generalized Maximum Matching (e.g. AitAoudia et al. (1993); Pabon (1993); Latham and Middleditch (1996); Kramer (1992)), is based on first isolating certain solvable subgraphs by transforming the constraint graph into a bipartite graph and finding a maximum generalized matching, followed by a connectivity analysis to obtain the DRplan. In this section, we give a formal performance analysis of SR, and MM based algorithms choosing a representative algorithm (typically the best performer) in each class using the performance measures defined in the previous section. Informally, one major drawback of the SR and MM algorithms is their inability to perform a generalized degree of freedom analysis. For example, SR would require an infinite repertoire of patterns. In the case of spatial constraints, some elementary patterns have been identified Hoffmann and Vermeer (1994, 1995). In the case of extending the scope of planar constraint solvers, adding freeform curves or conic sections requires additional patterns as well Hoffmann and Peters (1995); Fudos and Hoffmann (1996a). Similarly, a decomposition of underconstrained constraint graphs into wellconstrained components is possible for SR algorithms but only subject to the pattern limitations. In many cases, MM algorithms will output DRplans with larger, nonminimal subgraphs Si that may contain smaller solvable subgraphs. This affects the approximation factors adversely. This inability to find general minimal dense subgraphs also affects their ability to deal with overconstrained subgraphs that arise in assemblies, which is in turn needed to perform constraint reconciliation Hoffmann and JoanArinyo (1998). 2.1.9 Constraint Shape Recognition (SR) Consider the algorithm of Fudos and Hoffmann (1996b, 1997) which relies on a following strong assumption (SR1): all geometric objects in 2 dimensions have 2 degrees of freedom and all constraints between them are binary and destroy exactly one degree of freedom. Thus, in the corresponding constraint graph, the weight of all the edges is 1 and of all the vertices is 2. Because of this assumption, the SR algorithm ignores the degrees of freedom and relies only on the topology of the constraint graph. Description of the algorithm. We give a terse description of the algorithm the reader is referred to Fudos and Hoffmann (1996b, 1997) for details. Our description is meant only to put the algorithm into an appropriate DRplanner framework that is suited for the performance analysis. The algorithm consists of two phases. During Phase One, SR uses the bottom up iterative technique of Itai and Rodeh (1978): in the current graph Gi (where G1 = G), specific solvable graphs (clusters) are found that can be represented as a union of three previously found clusters that pairwise share a common vertex. Such configurations of three clusters are called ti i ,ll, ll The vertices of Gi represent clusters and edges of Gi represent constraints between clusters (initially due to SRI, every vertex and every edge of G is a cluster. More specifically, once a triangle formed by three clusters has been found, the three vertices in Gi corresponding to these three clusters are simplified into one new vertex in the simplified graph Gi+C. The edges of Gi+I are induced by the edges of the three old vertices. This is repeated for k steps until there are no more triangles left. If there is only one cluster left in Gk, then the algorithm terminates. Otherwise Gk serves as an input to Phase Two of the algorithm. Before we describe Phase Two, we note that a socalled cluster pui'i, Ci corresponding to Gi is used as an auxiliary structure for the purpose of finding triangles. Hence the partial DRplan produced during Phase One of the algorithm is of the form: (G1, C1),... (Gk, Ck). The vertices of the cluster graph Ci correspond to vertices of the original graph G1; clustervertices in the graph GC; and edges in G1 which have not been included into one of the clustervertices in the graphs Gi_,... G1. In particular, the first cluster graph C1 contains one vertex for every vertex and every edge of G1. The edges of the cluster graph C, connect the vertices of Gi that represent clusters to the original vertices from G1 that are contained in these clusters. Due to the structure of cluster graphs, triangles in Gi are found by looking for specific 6cycles in the corresponding cluster graph Ci. These 6cycles consist of 3 clustervertices and 3 original vertices. The new cluster graph Cj+I is constructed from Ci by adding a new vertex ci representing the newly found cluster S,, and connecting it by edges to the original vertices from G1 that are in the cluster S,. We also remove the three old clustervertices in C, which together formed the new cluster S,. We note that this is the only way in which cluster vertices are removed from cluster graphs. In particular, situations may arise where two clusters (that share a single vertex) are represented by the same vertex in the graph Gi, but they are represented by distinct vertices in the cluster graph Ci. During Phase Two, SR constructs the remainder of the DRplan (Gk, Ck),..., (Gm, Cm). First SR uses a global topdown technique of Hopcroft and Tarjan (1973) to divide Gk into a collection of triconnected subgraphs. These subgraphs are found by recursively splitting the original graph using separators of size at most 2. Thus the triconnected components can be viewed as the leaves of a binary tree T each of whose internal nodes corresponds to a vertex separator of size at most 2. For every triconnected subgraph S in Gk, a new cluster vertex is created in the cluster graph Ck: similar to Phase One, this vertex replaces all vertices that represent existing clusters contained in S. The next pair (Gk+i, Ck+1) in the DRplan is found as in Phase One by finding a triangle in Gk, or effectively locating a 6cycle in Ck. However, triangles in Gk have already been located in the course of constructing the tree T these triangles were originally split by the vertex separators at the internal vertices. Thus, if the original constraint graph G is solvable, the remainder of the DRplan (Gk+1, Ck+I), ... (Gm, Cm) is formed by repeated simplifications along a bottom up traversal of the tree T. If the original graph was underconstrained, then it is still possible to construct a DRplan of its maximal wellconstrained subgraphs, by introducing additional constraints and making the original graph solvable. I.e, in order to complete the bottom up traversal of the tree T in Phase Two, additional constraints need to be introduced, to make the whole graph solvable. For details, see Fudos and Hoffmann (1996b, 1997). Example. Consider Figure 210. During Phase One, the triangles ADE, ABE, BCE and CEF will be discovered and simplified as P. During Phase Two, the remainder of the graph will be divided into triconnected subgraphs P, PGKILN and OKHMJP, then PGKILN and OKHMJP are simplified and finally the union of P, PGKILN and OKHMJP is simplified. Defining the Simplifier Map. The same simplifier is used throughout Phase One and Two: replace a subgraph Si consisting of a triangle of clusters in Gi (or triconnected subgraphs during Phase Two), by one vertex in Gj+I representing this triangle. The subgraph S, is found as a 6cycle in the cluster graph Ci. The cluster graph C,+i is constructed as described in Phase One. AD A DG D DG G AE G FO F AE G C1 \Fo p 5 o M 0 0\ OM O O DG 0 Figure 2 10: The original, cluster graph and the simplified graphs More formally, recalling the definitions in Section 2.1.7: let G be a constraint graph; the first graph G1 in the DRplan is the original graph G. Let Gi = (V, E) be the current graph and let Si be a cluster found. Let A C G, A = (VA, EA). Then the image of A under the subgraph simplifier T, is T,(A) = A, if the intersection of A and Si is empty; otherwise T(A) = (VT,(A), ET,(A)) where VT,(A) is the set of all vertices of A that are not vertices of Si plus a vertex ci that replaces the cluster S,. The set of edges ET,(A) is a set of all edges of A that are not edges of S,; the edges of EA that have exactly one endpoint in Si will have this endpoint replaced by the vertex c1; and the edges of A that have both endpoints in Si are removed. Since the cluster Si in Gi is located by finding a 6cycle in C1, we need to describe how C+1 is constructed from C1, i.e, the effect that T, has on C, (formally, T, is a map from (Gi, C,) to (Gi+l, C,+I)). To obtain Ci+i, we start with Ci and G2 G3 (Cl C2 Tvv y/ \^^ \0xii )/ ^ ,k ~ ~ ~ ~ ~ \ / C1 AE AD DE EB AB Figure 211: C1 A EB D AB E CB C3 C2 A CB D CE E FC B B B C CE FE S T T2 Action of the simplifier on Gi and Ci during Phase One first add a new vertex ci representing the cluster Si, which is connected by edges to all the original vertices that it contains. Finally, vertices in Ci that represent clusters entirely contained in S, are removed, and edges adjacent to these vertices are also removed. Figures 211 and 212 illustrate the action of the subgraph simplifier T, on both Gi and Ci. A Further Concession for SR. Observe that the SR algorithm is not a general DRplanner when input geometric constraint graphs do not comply with assumption SRI. For example, for the graph shown in Figure 213, during Phase One, SR would not find any triangles and during Phase Two, it would conclude that the graph is underconstrained, even though the graph is wellconstrained. SR implementations may remedy some cases similar to this one. For instance, weight 2 edges to weight 2 vertices often arise from incidence constraints between geometric elements of same type (two coincident points or two coincident lines), and such cases are easily accounted for by working with equivalence classes of such vertices. Moreover, most planners will evaluate the density of a graph before G1 I\^ KT8 TTTT G9 L M C6 C7 C8 P D P A P D DG I Q D DI G KH L K DN K KO K IK L KJF R IL N JF O LN A OF Figure 212: Action of the simplifier during Phase Two 1 22 1 2 21 l2 2 Figure 213: This solvable graph would not be recognized as solvable by SR announcing under or overconstrained situations. Thus, an implementation of the SR algorithms of Fudos and Hoffmann (1996b, 1997) may or may not construct a DRplan for the graph of Figure 213 depending on the original problem statement. It is clear that such heuristics enlarge the class of solvable graphs, but fall short of decomposing all solvable constraint graphs. However, even when input graphs do comply with SRI, and SR checks overall density of a graph, SR could still mistake a graph that is not solvable for solvable. Figure 214 shows an example which the SR algorithm may process incorrectly: since the graph contains no solvable triangles, SR proceeds immediately to Phase Figure 214: Weight of all vertices is 2, weight of all edges is 1 Two. During Phase Two the triconnectivity of the entire graph could be erro neously construed to mean that the graph is solvable. In fact, the graph does have density 3, which superficially seems to support such a conclusion. However, the graph is certainly not wellconstrained: the eight vertices on the right form a subgraph of density 2, that is, an overconstrained subgraph. Moreover, if this is overconstrained subgraph is replaced a subgraph of density 3, the resulting graph has density 4 uncovering that it is not welloverconstrained either, and therefore not solvable. Figure 214 demonstrates that the density calculation heuristics is insufficient to determine the existence of minimal dense subgraphs of triconnected constraint graphs. What is needed is a general algorithm for finding minimal dense subgraphs. In order to give a performance analysis of the SR algorithm for those classes of constraint graphs where it does produce a satisfactory DRplan, we make a strong concession (SR2) that: only "triangular" structures are "acceptable" for the remainder of this section. I.e, we modify the definitions of validity, solvability preserving, strictly solvability preserving and completeness by replacing the words "solvable subgraph" by the following recursive definition: "either a subgraph that can be simplified into a single vertex by a sequence of consecutive simplifications of triangles of solvable subgraphs, (using the simplifier described in Section 2.1.9), or a vertex, edge or triconnected subgraph'. Performance Analysis. In this section, we analyze the SR algorithm with respect to the various performance measures defined in Section 2.1.7. Claim 3 Under the concession SR2, the SR :,li.,' ifll, is valid. Proof We will show that every preimage of the "solvable" cluster Si found at the ith iteration of the SR algorithm is also "solvable," using the stricter SR2 definition of "solvable". It can be easily checked that the other requirements necessary for validity from Section 2.1.7 also clearly hold. Let Si be a cluster that has been found in Gi by the SR algorithm (by locating a 6cycle in C1). Then from the description of the algorithm, and by assertion SR2, there is a sequence of simplifications, say Ti+i, ... Tm whose composition maps S5 to a single vertex. For every preimage A C Gj A = T .... T(S), for j < 1, the composition Tm o... T, o T,_i o ... o Tj will map A to a single vertex, hence A is "solvable". I Claim 4 The SR :,li., ill,, is strictly ,11.,lili'fd, preserving under the concession SR2, and therefore is le.,el ili'fd, preserving as well. Proof Let A be a "solvable" subgraph, i.e there is a sequence of simplifi cations A, ..., Am such that A = A1 and Am consists of only one vertex. If the intersection of A and the currently found cluster Si is empty then Ti(A) = A and it remains "solvable". If this intersection is not empty, then a subgraph B = A n S is simplified into a new cluster vertex c, = T,(S,). We need to show that in this case Ti(A) remains "solvable" as well. Suppose that some subgraph of B is a vertex of a 6cycle in one of the cluster graphs formed during the simplification A, ..., Am. Then clearly the new cluster vertex c, could perform the same function: i.e, it could also be a vertex in that 6cycle of one of the cluster graphs formed during the simplification A, ..., Am. Also if A was triconnected, then so is T,(A). This proves that there is a sequence (essentially a sequence A1,... Am modified by replacing A B Figure 215: Two triconnected subgraphs not composed of triangles Figure 216: Solvable graph consisting of n/3 solvable triangles B by ci) which terminates in a single vertex, thus demonstrating the "density" of T,(A). I Claim 5 Even under concession SR2, SR is not complete. Proof We will show that there are cases when the SR picks large, nonminimal "solvable" subgraphs Si to simplify, ignoring smaller "solvable" subgraphs of Si. Consider Figure 215. If subgraphs A and B are triconnected but not com posed of triangles, then they are "solvable," but since the entire graph is tricon nected neither A nor B will be simplified by SR. However, since the whole graph A U B is triconnected, it will chosen by SR as S1 during Phase Two. I Claim 6 The (worst and) bestchoice approximation factor of SR under concession SR2 is at most 0(1). Proof Consider Figure 216. The entire graph consists of n triangles. During Phase One SR will successfully locate and simplify each one of them. However, during Phase Two SR will not be able to decompose the entire solvable graph into smaller solvable ones (since entire graph is triconnected) so the size of the corresponding DRplan is O(n). On the other hand, the optimal DRplan would simplify neighboring pairs of triangles, one pair at a time, thus the optimal size is a small constant. I Next, we consider three other performance measures discussed in Section 2.1.7. Claim 7 Under the concession SR2, the :ii.,'i Illi, SR adapts to underconstrained Proof Suppose that the graph G is underconstrained. Let A be a "solvable" subgraph that is not contained in any other "solvable" graph. Since Phase Two of the SR algorithm is topdown, either SR will find A and simplify it as one of the S,'s, or A n Si 0 for one of the S,. In either case, SR adapts to G. I Observation 1 Under the concession SR2, the SR lw/ ,i;t it,,. has the CI,,,1, 1, Rosser property, since the new ,in ,1, Gi+I remains ,*,IlI,'1 if Gi is ,',*I, a 1,", i,, i,,lless of the choice of the 'Il,*Il',1," Si that is simplified at the ith stage. Claim 8 Under the concession SR2, the SR .l'i't ill,,in can incorporate design decompositions P if and (,or1,1 if P fulfills the following requirement: ',,, pair of ,u,,hll,.'" .,,,.lit,,al,, Pk and Pt in P satisfy Pk C Pt or Pt C P~ or Pk n Pt contains no edges. Proof For the 'if' part we consider the most natural modification of the original SR algorithm, and find a topological ordering O of the given design decomposition P which is a set of "solvable" subgraphs of the input graph G, partially ordered under the subgraph relation such that O is embedded as a subplan of the final DRplan generated by this modified SR algorithm; i.e, O forms a subsequence of the sequence of "solvable" subgraphs Si, whose (sequential) simplification gives the DRplan. We take any topological ordering O of the given design decomposition P and create a DRplan for the first "solvable" subgraph P1 in P. I.e, while constructing the individual DRplan for P1, we "ignore" the rest of the graph. This individual DRplan induces the first part of the DRplan for the whole graph G. In particular, the last graph in this partial DRplan is obtained by simplifying P1 using the simplifier described in 2.1.9 (and treating P1 exactly as SR would treat a cluster Sj found at some stage j). Let Gi be the last graph in the DRplan for G created thus far. Now, we consider the next subgraph P2 in the ordering 0, and find an individual DRplan for it, treating it not as a subgraph of the original graph G, but as subgraphs of the simplified graph Gi. This individual DRplan is added on as the next part of the DRplan of the whole graph G. The crucial point is that the simplification of any subgraph, say Pk, will not affect any of the unrelated subgraphs Pt, t > k, unless Pk C Pt. This is because, by the requirement on P, Pk and Pt share no edges. Therefore, when the cluster vertex for Pk is created, none of the clusters inside Pt is removed. The process of constructing individual DRplans for subgraphs in the decomposition P and concatenating them to the current partial DRplan is continued until a partial DRplan for the input graph G has been produced, which completely includes topological ordering O of the decomposition P as a subplan. Let G, be the last graph in this partial DRplan. The rest of the DRplan of G is found by running the original SR algorithm on G, and the corresponding cluster graph C,. For the 'only if' part, consider Figure 217. Let P = {Po, P, P2}, where Po = ABD, P1 = BCD, P2 = ABCD. Then SR cannot produce any DRplan that would incorporate P as subplan. I 2.1.10 Generalized Maximum Matching (MM) Consider the algorithms of AitAoudia et al. (1993); Pabon (1993); Kramer (1992); Serrano and Gossard (1986); Serrano (1990) as well as graph rigidity and matroid based methods for distance constraints in 2 dimensions Hendrickson (1992), Gabow and Westermann (1988), Imai (1985) as well as more general constraints Sugihara (1985) all of which more or less use (generalized) maximum C Pc P B D\ AA A B D B C D A B D C Figure 217: Constraint graph, intended and actual decompositions matching (or equivalent maximum network flow) for finding solvable subgraphs in specialized geometric constraint graphs. These methods either assume that the constraint graph has zero density or they reduce the weight of an arbitrarily selected set of vertices in order to turn the graph into one of zero density. In this thesis we will analyze what we consider to be the most general algo rithm of this kind Pabon (1993) (it generalizes the algorithm of AitAoudia et al. (1993), although the latter provides a more complete analysis), supplemented (by us, as I. tI i1 by a reviewer) with a method from Hendrickson (1992). Note that while the algorithm of Pabon (1993) both locates solvable subgraphs and describes how to construct a corresponding DRplan, Sugihara (1985), Hen drickson (1992), Gabow and Westermann (1988) only describe algorithms that allow to verify whether a given graph is solvable, but do not explicitly state how to use these algorithms for successively decomposing into small solvable subgraphs, i.e, for constructing DRplans. While neither of the previously known algorithms analyzed in this thesis perform well according to our previously defined set of criteria, later, we will describe our network flow based Frontier Algorithm that improves the performance in several key areas. Description of the Algorithm. As in the case of SR, we give a terse de scription of the MM algorithm the reader is referred to AitAoudia et al. (1993); c A D A D B B Figure 218: Original graph and it decomposition Pabon (1993) for details. Our description is meant only to put the algorithm into an appropriate DRplanner framework that is suited for the performance analysis. By using maximum flow, the input constraint graph is decomposed into a collection of subgraphs that are strongly connected. The flow information also provides a partial ordering of the strongly connected subgraphs representing the order in which these subgraphs should be simplified. This ordering in turn specifies the DRplan. It is important to note that these strongly connected components represent a sequence of solvable subgraphs of the original constraint graph, only if the input constraint graph is wellconstrained. Consider Figure 218. All the vertices have weight 2, all the edges have weight 1, and the geometry is assumed to be in 2 dimensions (i.e geometry dependent constant D = 3). The output of the MM algorithm is: a set of vertices whose total weight is reduced by 3 units, say weight of vertices A,B and C to be reduced by one unit each, (this corresponds to fixing 3 degrees of freedom the number of degrees of freedom of a rigid body in 2 dimensions); two strongly connected components ABC and D; the DRplan, i.e, the information that the ii \t' il represented by ABC should be simplified/solved first and then its union with D should be simpli fied/solved. AC A AC A AB B1S B AB 1 B BC Ck BC Sink CD 1 CD ( BD (1 BD ( Figure 219: Modified bipartite graph and maximum flow in this graph In order to produce such an output, the MM algorithm first constructs the network X = (VX, EX) corresponding to the original weighted constraint graph G = (V, E) (after the weights of A, B, C were reduced by one unit each). The set of vertices VX is the union of VX1 and VX2 where the vertices in VX1 correspond to the vertices in V, vertices in VX2 correspond to the edges in E. An edge ex E EX would be created between vxl E VX1 and vz2 E VX2 if the vertex in V corresponding to the vxl is an endpoint of an edge in E corresponding to vz2. The edge ex has infinite capacity. All the vertices in VXi are connected to the special vertex called Sink. The capacity of connecting edges is equal to the weight of the corresponding vertices in V. For example, the left half of Figure 219 shows the bipartite graph corresponding to the constraint graph of Figure 218. Next the maximum flow in the network X is found, with vertices in VX2 being source vertices of capacity equal to the weights of the corresponding edges in E. See right half of Figure 219 (thick edges have nonzero flow). The maximum flow found in X induces a partition of the original graph G into a partially ordered set of strongly connected components giving a sequence of solvable subgraphs of G, provided G is wellconstrained as in Figure 218, according to the following rules: if the flow in X from the vertex z E VX2 that is connected to the vertices x, y E VX1 is sent toward x, then in the graph G, the edge corresponding to z (between vertices x and y) becomes an oriented edge directed from y to x. If the flow from z is sent toward both x and y, then the edge C AB B D AD I / BD S2ink 2 BC A DC Figure 220: Constraint graph and network flow with 3 extra flow units at AB is bidirected toward both x and y. (Recall that a strongly connected component S in this directed graph is a subgraph such that for any two vertices a, b E S, there is an oriented path from a to b.) The partial ordering of components is induced as follows. Let K and L be two strongly connected components in the oriented version of G. If all the edges between vertices of K and L are pointing toward L, then L should be simplified after K. Defining the Simplifier Map. We capture the transformations performed by the MM DRplanner described above, by describing its simplifier maps (recall the definitions in Section 2.1.7). Let G = (V, E) be the geometric constraint graph. Denote by G1 = (Vi, 'E = E) the directed graph after weights of some vertices have been reduced as described above and a partial ordering of strongly connected components has been found. First S1 C G1 is located such that S1 is strongly connected. Then S1 is simplified into the vertex vi of weight zero. The other vertices of G1 remain unchanged. Edges of G1 that had both endpoints outside of S1 are unchanged, edges that had both endpoints in S1 are removed, edges that had exactly one endpoint in S1 have this endpoint replaced by vl. In the next step, C2 the next strongly connected component in a topological ordering of the components in G2 = T1(G1) is located. The subgraph S2 is set to be {vl} U C2. Then S2 is simplified into the vertex v2 A E 12 2 C B D 2 2) Figure 221: DRplan depends on the initial choice of weight zero. This process is continued until Gk consists of one vertex. The simplifier maps are formally defined as follows. T(S,) = vi where vi is the vertex in G1+I of weight 0. If B C G, B n Si = 0, then Ti(B) = B. If B C G,, B n S, # 0, then the image of B, T,(B) = {vi} U (B \ S,). Redefining Solvability. Claim 9 The MM ,i/., t ifllr is a not a ./, u ,l DRplanner. Proof While the MM algorithm can correctly classify as solvable and de compose wellconstrained and welloverconstrained graphs and correctly classify underconstrained graphs that have no overconstrained subgraphs as being un solvable, it is unable to correctly classify an underconstrained graph that has an overconstrained subgraph. Consider Figure 221, the weight of all the edges is 1, of the vertices as indicated. Graph ABCDE has density 3, it contains over constrained subgraphs AC, BC, CD, CE, and removal of say edge AC will result in ABCDE becoming nondense, hence ABCDE is not welloverconstrained and not solvable. The MM algorithm may or may not detect this, depending on the initial choice of vertices whose weights are to be reduced. Suppose that the weight of the vertex E was reduced by 1 and the weight of the vertex D by 2. Then the corresponding maximum possible flow f and the corresponding decomposition into strongly components are shown in Figure 222. Note that it is impossible to simplify the strongly connected component A, and thus there can be no DRplan AC A A /. AB B1 BC Sink CED Figure 222: Maximum flow and decomposition given the bad initial choice Figure 223: Decomposition given the good initial choice for this initial choice of vertices for reducing weights. On the other hand, if the weight of A had been reduced by 2 and weight of D by 1 then the maximum flow is larger than f (in fact, no choice of vertices for weight reduction can give a larger flow) and it can be checked that MM would yield a DRplan, see Figure 223 (S1 = A, S2 = AC, S3 = ABC, S4 = ABCD, S5 = ABCDE). I Thus MM runs into problems in the presence of overconstrained subgraphs, unless G happens to be welloverconstrained, which cannot be apriori checked without relying on an algorithm for detecting overconstrained subgraphs and replacing them by wellconstrained ones. Therefore it is necessary and sufficient to locate overconstrained subgraphs and replace them by wellconstrained ones, in order to guarantee that MM will work. The author of Pabon (1993) does not specify how to do this. The following modification similar to that of Hendrickson (1992) could be used, as was I. t Id by a reviewer, and completed here. First a maximum flow in the unmodified network X (i.e where vertex weights are not reduced) is found. After that, for every source vertex v E VX2, except one vertex vm the following two steps are repeated. Three extra units of flow are sent from v, possibly rearranging existing flows in X. These 3 units of flow are removed, without restoring original flows. For vertex v,, 3 units of flow are sent but not removed. For example, consider Figure 220. The constraint graph is shown on the left, weights of all vertices is 2, the weights of all edges is 1. The resulting network flow is shown on the right, assuming that AB was the last vertex v,. The extra 3 units of flow and their destination vertices A and B are marked by asterisks. This particular flow induces a weight reduction of A by 1 unit and of B by 2 units. This modification identifies overconstrained subgraphs since it is impossible to send all 3 extra units from at least one edge of an overconstrained graph. These overconstrained graphs have to be modified by the designer to become wellconstrained, and the flow algorithm is run again. This is important because otherwise the DRalgorithm cannot proceed, since in underconstrained graphs with overconstrained subgraphs, strongly connected components do not necessarily correspond to a sequence of solvable subgraphs. To reflect the modification above, we make the following concession for MM, (MM1): the input constraint graph G has no overconstrained subgraphs in G. A subgraph A C G is "solvable" if it has zero density, after the vertices for weight reduction by D are chosen (these can be chosen arbitrarily, provided there are no overconstrained subgraphs). Performance Analysis. In this section, we analyze the MM algorithm with respect to the various performance measures defined in Section 2.1.7. Note that despite the concession MM1, the MM algorithm has the following drawbacks: the DRplan is uniquely determined, once vertices whose weights are reduced are chosen. For example, in Figure 220 after the weight of A is reduced by 1 and the weight of B by 2 units, solvable subgraphs to be simplified are S1 = {A, B}, S2 = {TI(S), D}, S3 = T2(S2), C}. While the subgraph BCD is also solvable (if say initially weights of vertices B and C were reduced instead of A and B), it cannot be chosen as one of the Si after weights of A and B are reduced. This causes MM to have bad worstchoice and bestchoice approximation factors and to be unable to incorporate general designer decomposition. The following is straightforward from the description of the simplifiers. Claim 10 Under the concession MM1, the MM :ldi./ ilim is a valid DRplanner. Claim 11 Under the concession MM1, the MM :li/.,, ill/,, is strictly 11,.,ldilif, preserving (and therefore ,' 1lift e, preserving). Proof Suppose that a subgraph A of the input graph G is "solvable," i.e d(A) = 0. Let Si be the "solvable" subgraph to be simplified at the current stage. Let B = A n S, C = A \ B. Since we assume that G does not contain any overconstrained subgraphs, d(B) < 0 and d(A U S) < 0 => d(A U S) = d(A) + d(Si) d(B) < 0 = 0 + 0 d(B) < 0 = d(B) = 0. Thus d(TJ(A)) d(T,(C)) + d(T,(B)) = d(C) + 0 = d(A) d(B) = 0, therefore T,(A) is also solvable. I Claim 12 Under the concession MM1, the MM ,l1./,, illcp is complete. Proof Let A be a proper solvable subgraph of the Si, i > 2. Since A is solvable, there cannot be any edges outside of A pointing toward A (this is because there is no room for flows of "outside" edges toward the vertices of A). Recall that Si is the union of Ci U {v,_i}, where Ci is the first strongly connected component 3 3 hn2 3 R 2 Ln/2l1 R n/21 L2 R2 2 2 Figure 2 24: Bad bestchoice approximation in the topological ordering of the components at the stage i, and vi1 is the simplification of S,_1. However, unless A = v_l1, the first strongly connected component at this stage would have been A \ {vil}, not Ci, which contradicts the choice of C, at stage i. I Claim 13 Under the concession MM1, the bestchoice (and worstchoice) approxi mation factor of MM is at most 0(l). Proof To prove the bound on the bestchoice approximation factor consider Figure 2 28. The left and right columns contain n/2 vertices each. The weights of all the vertical edges are 2, the weights of all other edges are 1, the weights of the vertices are as indicated, and the geometry dependent constant D = 3. Note that all solvable subgraphs in Figure 2 28 could be divided into 3 classes. The first class consists of the subgraphs CLL2; CL1L2L3; ... ; CL1L2 ... L /21L /2 The second class consists of the subgraphs CRR2; CR1R2R3; ... ; CR1R2... R /21R,/2 The third class contains the solvable subgraphs that contain both L and R vertices. There is only one element in this class the entire graph CL1L2... L /2R1R2... R,~/2 There is an optimal DRplan of constant size that takes S1 = CL1L2, S2 = S1 U L3,... ,Sn/21 = Sn/22 U Ln/2. After that it takes Sn/2 = CR1R2, S/2+1 = Sn/2 UR3, ... Sn = S_1 U R,/2. Finally it takes S,+I = Sn/21 U S,. However all DRplans found by MM will have size O(n). The reason for this is that MM is unable to simplify solvable subgraphs on the left of the Figure 228 independently from the solvable subgraphs on the right. More formally let S1 be the first subgraph simplified by MM under some DRplan Q. If S1 belongs to the third class of solvable subgraphs then size of Q is O(n). Otherwise, without loss of generality we can assume that S1 belongs to the first class. According to the definition of MM, the simplification of S1 is a vertex vi of weight 0. After this simplification any strongly connected component that contains some Ri should also contain all of the R1... R/2. Hence there is an S, in Q such that RiR2 ... R n/2 C Si. Hence the size of Q is O(n). I Next, we consider three other performance measures discussed in Section 2.1.7. Claim 14 Under the concession MM1, a simple modification of the MM :d,,wi I;fli is able to adapt to underconstrained vi,b,,,l' This modification, however, increases the, ',w,1, pb if,, by a factor of n. Proof Suppose that the graph G is underconstrained. Consider the max imum flow found by MM in the network X corresponding to G, as described in subsection 2.1.10. There are two cases. The first case is when the last vertex vm in X corresponds to an edge of some solvable subgraph A1. Then all vertices vi in X corresponding to vertices of A1 have their capacities completely filled, since A1 is solvable. On the other hand, at least one vertex v of G will not have its capacity filled completely, since G is underconstrained. Let W be the set of such vertices v. The new modification of MM would proceed by removing all vertices of X corresponding to vertices of W and edges adjacent to W, as well as flows originating at such edges. Once this is done, a new set W is recomputed and removed, until all remaining vertices of X that represent vertices of G have their capacities filled completely. These vertices comprise a solvable subgraph A1 such that no supergraph of A1 is solvable. Once the subgraph A1 (and its DRplan Qi) is found, it could be removed from G and the process applied recursively to G\A1 to find a solvable subgraph A2, its DRplan Q2 and so on. The second case is when the last vertex vm in X is not contained in any solv able subgraph. Then constructing and removing sets W as described above will completely exhaust G, without finding any solvable graphs. The new modification of MM would proceed by finding another maximum flow in network X correspond ing to G such that the last vertex v^ is different from vn. Again two cases are considered for vertex vo. If all voE G are not contained in any solvable subgraph, then G does not contain any solvable subgraph and the process terminates. Note that this modification offhand increases the complexity of MM by a factor of n, and there does not seem to be any obvious way to prevent this factor. This modification of MM outputs a DRplan Q = Q1,... Qk for set of solvable subgraphs A1,... Ak such for any i no supergraph of Ai is solvable and there are no solvable subgraphs B C G such that B n Aj = 0, Vj. Thus this modification of MM is able to adapt to underconstrained graphs. I Observation 2 (i) Under the concession MM1, MM has the Cl,i1,, IR .. r property since i;,!,lifi,;i.'i any Si that is solvable at the current stage preserves the .1, ,.si;i of the whole intol, Gi+l (i.e Gi+l is solvable if and (orl,, if Gi is). (ii) Under the concession MM1, MM is able to incorporate a design decomposition P specified by the designer if and ol.1,1 if for every Pk, Pt E P such that Pk n Pt # 0 either Pk C Pt or Pt C Pk . Proof is similar to the corresponding proof for SR algorithm in Claim 8. 2.1.11 Comparison of Performance of SR and MM Next, we give a table comparing the SR and MM DRplanners with respect to the performance measures of Section 3. "Uii. utu refers to the ability to deal with underconstrained graphs, "Design decomp, it i ii refers to the ability to incorporate design decompositions specified by the designer. The superscript '*' refers to a narrow class of DRplans: those that require the solvable il1 i\' iri S, to be based on triangles or a fixed repertoire of pat terns. The superscript 't' refers to results that were not true for the original MM algorithm developed by (AitAoudia et al. (1993); Pabon (1993)) and proved in this thesis through a modification of MM described in Section 2.1.10. The super script < refers to a restricted class of graphs in which there are no overconstrained subgraphs. It also refers to a further modification of MM described in Claim 14, which however, increases the complexity by a factor of n. The superscript 'o' refers to strong restrictions on the design decompositions that can be incorporated into DRplans by SR and MM. 2.1.12 Analysis of Two New DRplanners We present two new DecompositionRecombination (DR) planning algorithms or DRplanners. The new planners follow the overall structural description of a typical DRplanner, based on the DRsolver S given in previous sections. Fur thermore, the new DRplanners adopt and adapt features of older decomposition methods such as SR (shape recognition) and MM (generalized maximum matching) that were analyzed and compared previously. In particular, those methods as well Performance measure SR MM Generality No Yest Underconstr. No(Yes*) Yest, Design decomposition No(Yes*o') No(Yest0) Validity No(Yes*) Yest Solvability No(Yes*) Yest Strict solvability No(Yes*) Yest Complete No(No*) YesT Worst approximation factor 0 (0(Q)*) O(i)t Best approximation factor 0 (0(6)*) O(i) ChurchRosser No(Yes*) Yest Complexity 0((m + n)2) O(n(m + n))t as the new planners are based on degree of freedom analysis of geometric constraint It should be noted that the SR and MM based algorithms Bouma et al. (1995); Owen (1991, 1993); Bouma et al. (1995); Hoffmann and Vermeer (1994), Hoffmann and Vermeer (1995); Latham and Middleditch (1996); Fudos and Hoffmann (1996b, 1997), AitAoudia et al. (1993); Pabon (1993); Kramer (1992); Serrano and Gossard (1986); Serrano (1990), were being developed even as the issue of efficient decomposition of constraint systems for capturing design intent in CAD/CAM was still in the process of crystallization. In contrast, our development of the new DRplanners is systematically guided by the new performance measures, to closely reflect several desirable characteristics C of DRplanners for CAD/CAM applications. An important building block of both the new DRplanners is the routine used to isolate the solvable i l.\'.t' i, S, at each step i. In both new DRplanners, the solvable i1 \ti ili/subgraph Si is isolated using an algorithm developed by the authors based on a subtle modification of incremental network flow: this algorithm, called "Algorithm Dense," first isolates a dense subgraph, and then finds a minimal dense subgraph inside it, which ensures its solvability. The interested reader is referred to earlier papers by the authors: Hoffmann et al. (1997) for a description as well as implementation results, and Hoffmann et al. (1998) for a comparison with prior algorithms for isolating solvable/dense subgraphs. Here, we shall only note several desirable features of Algorithm Dense. (a) A useful property of the dense subgraph G' found by the Algorithm Dense (in time O(n(m + n))) is that the densities of all proper subgraphs are strictly smaller than the density of G'. Therefore, when G' corresponds to a wellconstrained i l.t\i i" then G' is in fact minimal, and hence it is unnecessary to run the additional steps to obtain minimality. Ensuring minimality crucially affects completeness of the new DRplanners. (b) A second advantage of Algorithm Dense is that it is much simpler to implement and faster than standard maxflow algorithms, This was borne out by our C++ implementation of Algorithm Dense both for finding dense and minimal dense subgraphs. By making constantD a parameter of the algorithm, our method can be applied uniformly to planar or spatial geometry constraint graphs. Furthermore, the new algorithm handles not only binary but also ternary and higherorder constraints which can be represented as hyperedges. (c) A third specific advantage of our flowbased algorithm for isolating dense subgraphs (solvable ll \ t' int) is that we can run the algorithm online. That is, the constraint graph and its edges can be input continuously to the algorithm, and for each new vertex or edge the flow can be updated accordingly. This promises a good fit with interactive, geometric constraint solving applications, i.e, the criterion (viii) of C. As will be seen below the main difference between the two new planners, however, lies in their simplifier maps T,, i.e, the way in which they abstract or simplify a solvable subgraph S, once it has been found. Comparison. As a prelude to the ,it.l\ li of the new DRplanners Condense and Frontier we give a table below which extends the comparison between the SR and MM to the new DRplanners Condense and Frontier. The "complexity" entries for the 2 new DRplanners are directly based on the complexity of a building block Algorithm Dense (briefly discussed above) for isolating minimal dense subgraphs Si. "Undero cni refers to the ability to deal with underconstrained systems, "Designdec" refers to the ability to incorporate design decompositions specified by the designer, "Solv." and "Strict solv." refer to (strict) solvability preservation, best choice approximation factor. \\WV t and Best ;I1I1'lc.: refer to the worst and Note. The variable s in the n, plus the number of edges, complexity expressions denotes the number of vertices, m, of the constraint graph. Recall that D refers to the number of degrees of freedom of a rigid object in the input geometry (in practice, this could be treated as a constant). < The superscripts '*' and '+' refer to narrow classes of DRplans: those that require the solvable 1il \' t'i Si to be based on triangles or a fixed repertoire of patterns, or to represent rigid objects that fixed or grounded with respect to a single coordinate system. The superscript 'f' refers to results that were left unproven by the developers of the MM based algorithms (AitAoudia et al. (1993), Pabon (1993)) and proved in this paper through a crucial modification of MM described previously. The modification also results in the improvement of the complexity of the best MM algorithm to O(n(s = n + m)). Perf. meas. SR MM Condense(new) Frontier Generality No Yest Yes Yes Underconst No(Yes*) No Yes Yes Designdec No(Yes*') No No(Yes) Yes Validity No(Yes*) Yes+ Yes Yes Solv. No(Yes*) Yes+ Yes Yes Strict solv. No(Yes*) Yes+ No Yes Complete No(No*) No Yes Yes Worst approx. 0 (O()) 0(1) O(1) O(1) Best approx. 0 (O(Q)*) O()t O(1) 0(1) ChurchRosser No(Yes*) Yest Yes Yes Complexity O(s2) O(nD+1s)t O(n3s) O(n3s) (d (b Figure 225: Sequential extension The superscript 'o' refers to a strong restriction on the design decompositions that can be incorporated into DRplans by SR and the new DRplanner Condense. In fact, the other new DRplanner Frontier also places a (however, much weaker) restriction on the design decompositions that it can incorporate, as will be shown later. 2.1.13 The DRplanner Condense and its Performance This DRplanner was sketched by the authors already in Hoffmann et al. (1998). The authors' flowbased algorithm discussed above Hoffmann et al. (1997) is applied repeatedly to constraint graphs to find minimal dense subgraphs or clusters (which we know to be generically solvable containing more than one vertex. DRplanner Condense consists of two conceptual steps. A minimal dense cluster can be ", ,'ifidllh1 extended under certain circumstances by adding more geometric objects one at a time, which are rigidly fixed with respect to the cluster. After a cluster has been thus extended, it is then simplified into a single geometric object, and the rest of the constraint graph is searched for another minimal dense subgraph. The following example illustrates sequential extension. Consider the constraint graph G of Figure 225. We assume that all vertices have weight 2 and all edges have weight 1. The geometrydependent constant D = 3. The vertex set {a, b} induces a minimal dense subgraph of G which could be chosen by DR planner Condense as the initial minimal dense cluster, which could be extended sequentially by the vertices c, d, e, f, one vertex at a time, until it cannot be 3c' 332Z 2 22 2 Figure 226: Sequence of simplifications from left to right extended any further. The resulting subgraph is called an extended dense ,,1I',I,,,I or cluster. The simplification of an extended cluster is taken to be a single geometric object with D degrees of freedom. This is done as follows: an extended cluster A is replaced by a vertex u of weight D; all edges from vertices in A to a vertex w outside A are combined into one edge (u, w), and the weight of this induced edge is the sum of the weights of the combined edges. After the simplification, another solvable subgraph is found, and the process is continued until the entire graph is simplified into a single vertex. This is illustrated by the sequence of simplifications of Figure 226. Initially all vertices have weight 2, all edges have weight 1. The vertices connected by the heavy edges constitute minimal or sequentially extended clusters. After four simplifications the original graph is replaced by one vertex. Defining Subsystem Simplifiers. We capture the transformations per formed by the DRplanner Condense by describing simplifier maps. Let G be the input constraint graph; the first graph G1 in the DRplan is the original graph G. Let Gi = (V, E) be the current graph and let Si be a cluster found at the current stage. Let A be any subgraph of Gi. Then T,(A) is defined as follows. If A n S, = 0 then T,(A) = A. If A n S 0 then T,(A) = (VTA, ETA) where VTA is the set of all vertices of A that are not vertices of Si plus one vertex c, of weight D which represents the simplification of the cluster Si. The set of edges ETA is formed by removing edges with all endpoints in Si, and combining edges with at least one endpoint outside S,, (as well as their weights) as described earlier in this section. Performance Analysis. In this section, we analyze the DRplanner Condense with respect to the various performance measures that were defined in proceeding sections. Claim 15 Condense is a valid DRplanner with the CI,,,,, lRosser property. In addition, DRplanner Condense finds DRplans for the maximal solvable ol,,1iI,'l, of underconstrained i, ,,,l, Proof If the graph G is not underconstrained, then it will remain so after the replacement of any solvable subgraph by a vertex of weight D, i.e, after a simplification step by DRplanner Condense. Thus, if G = G1 is wellconstrained, it follows that all of the Gi are wellconstrained. Moreover, we know that if the original graph is solvable, then at each step, DRplanner Condense will in fact find a minimal dense cluster S, that consists of more than one vertex, and therefore Gi+1 is strictly smaller than Gi for all i. Thus the process will terminate at stage k when Gk is a single vertex. This is independent of which solvable subgraph Si is chosen to be simplified at the i'h stage, showing that DRplanner Condense has the ChurchRosser property. On the other hand, if G is underconstrained, since the subgraphs Si chosen to be simplified are guaranteed to be dense/solvable, the process will not terminate with one vertex, but rather with a set of vertices representing the simplification of a set of maximal solvable subgraphs (such that no combination of them is solvable). This completes the proof that DRplanner Condense is a DRplanner that can adapt to underconstrained graphs. E E B D B D F Fs A U M M L L Figure 227: Original and simplified graphs The proof of validity follows straightforwardly from the properties of the simplifier map. I Claim 16 DRplanner Condense is ',l,.,li;l;if, preserving. Proof The simplifier maps T, do not affect subgraphs outside of Si. I Claim 17 DRplanner Condense is not strictly .',/,1, il;if, preserving. Proof Consider the constraint graph of Figure 227. The vertex weights are 2, the edge weights are 1, and the geometrydependent constant D = 3. The graphs ABCDNO, EFHGID and NMKLIJ are all dense/solvable. Suppose that first the cluster S1 = ABCDNO was found and simplified into one vertex S of weight 3. Now the graph SEFHGI = T1(EFHGID) is not dense/solvable anymore. I Intuitively, the reason why DRplanner Condense is not strictly solvability preserving is that the removal of the vertices D and N loses valuable information about the structure of the solvable graph. Claim 18 DRplanner Condense is complete. Proof This is because DRplanner Condense finds minimal dense subgraphs at each stage. I Claim 19 Bestchoice (and worstchoice) approximation factor of DRplanner Condense is at most O(1/n). 3 3 2 2 L2n/2 L I \\ / C Figure 2 28: Bad bestchoice approximation Note. This proof mimics the MM approximation factor proof, except that now the subgraph S is not a strongly connected component. Proof To prove the bound on the bestchoice approximation factor consider Figure 2 28. The left and right columns contain n/2 vertices each. The weights of all the vertical edges are 2, the weights of all other edges are 1, the weights of the vertices are as indicated, and the geometry dependent constant D = 3. Note that all solvable subgraphs in Figure 2 28 could be divided into 3 classes. The first class consists of the subgraphs CL1L2; CL1L2L3; ... ;CL1L2 ... L /21 Ln /2 The second class consists of the subgraphs CRiR2; CRIR2R3; ... ; CR1 R2... Rn/21 Rn/2 The third class contains the solvable subgraphs that contain both L and R vertices. There is only one element in this class the entire graph CL1L2... L 2R1R2... R2n/2 There is an optimal DRplan of constant size that takes S1 = CL1L2, S2 = S1 UL3,..., Sn~/21 = Sn/22 U Ln/2. After that it takes Sn/2 = CR1R2,Sn/2+1 Sn/2 U R3,... Sn = Sn1 U Rn/2. Finally it takes S>+ = Sn/21 U Sn. However all DRplans found by DRplanner Condense will have size O(n). The reason for this is that DRplanner Condense is unable to simplify solvable subgraphs on the left of the Figure 2 28 independently from the solvable subgraphs subgraphs on the left of the Figure 228 independently from the solvable subgraphs on the right. More formally let S1 be the first subgraph simplified by DRplanner Condense under some DRplan Q. If S1 belongs to the third class of solvable subgraphs then the size of Q is O(n). Otherwise, without loss of generality we can assume that S1 belongs to the first class. According to the definition of DR planner Condense, Ti(S1) is a single vertex of weight 3 that replaces several vertices including vertex C. Now for any graph A that belongs to the second class, Ti (A) is not solvable anymore (it has density 4). Hence there is an Si in Q such that R1R2 ... R /2 C S,. Hence the size of Q is O(n). I Next, we consider the last performance measure incorporating input decomposi tion. Observation 3 In general, DRplanner Condense cannot incorporate a design decomposition of the input viul, for reasons similar to those given for the SR ,l.i/.. ;ll,, It can incorporate a design decomposition, ow(lj, if every pair A and B of ,,11,i.liii,iN in the decomposition are either ,.,,!,1 t,. /l, disjoint or A C B or B C A. 2.1.14 The DRplanner Frontier and its Performance Intuitively, the reason why DRplanner Condense is not strictly solvability preserving is that the simplification of a minimal or extended dense cluster into a single vertex loses valuable information about the structure of the cluster. The algorithms described in this section preserve this information at least partially by designing a simplifier that keeps the structure of the frontier vertices of the cluster, i.e, those vertices that are connected to vertices outside of the cluster. However, the way in which the minimal dense clusters and their sequential extensions are found is identical to that of DRplanner Condense i.e, by using the authors' Algorithm Dense from Hoffmann et al. (1997). Informally, under DRplanner Frontier, all internal (i.e not frontier) vertices of the solvable subgraph S, found at the ith stage are simplified into one vertex called the core c1. The core vertex is connected to each frontier vertex v by an edge whose 79 D N Figure 229: The simplified graph after three clusters has been replaced by edges weight is equal to that of v. All other edges, except ones between frontier vertices, of S, are removed. This is repeated until the solvable subgraph S, found is the entire remaining graph Gm. If the solvable subgraph Si has only two frontier vertices, then all internal vertices of Si should be removed and no new core vertex created. Instead the two frontier vertices of S, should be connected by an edge whose weight w is chosen so that the sum of the weights of the two frontier vertices less w is equal to the constant D. This ensures that the graphs Gi become steadily smaller as i increases. For instance, Figure 227 is such a special case, where every cluster has only 2 frontier vertices. Hence after three iterations it would be simplified by the DRplanner Frontier into Figure 229. Defining the Subsystem Simplifier. We capture the transformations performed by the Frontier DRplanner by describing simplifier maps. Let Si be the solvable subgraph of Gi found at stage i, SI be the set of inner vertices of Si, FI be the set of frontier vertices of Si, and A be any subgraph of Gi. Then the simplifier map T,(A) is defined as follows T(Si) = ci, where the weight of c, is equal to the geometrydependent constant D. If A n S, = 0, then T,(A) = A. If An S, ~ 0 and A n SI = 0, then the image of A under the map T, is A minus those edges that A shares with S,. If A n SI # 0, then T,(A) = (VTA, ETA), where VTA is the set of all vertices of A that are not vertices of SI, plus the vertex c, representing the simplification of S,. The set of edges ETA is formed as described earlier in this section. Performance Analysis. In this section, we analyze the DRplanner Frontier with respect to the various performance measures defined in previous sections. Claim 20 DRplanner Frontier is a valid DRplanner with the CI,,l lRosser property. In addition, DRplanner Frontier finds DRplans for the maximal solvable s.,,'1ilipl of underconstrained ,ii,,/'l, Proof The proof is identical to the one used for DRplanner Condense. I Before we discuss the solvability preserving property of DRplanner Frontier, we would like to consider the following example shown in Figure 230. All edges have weight 1, vertices as indicated. Initially, the graph BCDEIJK is solvable. The graph ABCDEFGH is also solvable, vertices A and B are its inner vertices, vertices C, D, E, F, G and H are its frontier vertices. After ABCDEFGH has been simplified into the graph MCDEFGH, the new graph MCDEIJK is no longer dense (edges MC, MD, ME, MH and MF have weight 2 now). However, note that according to the definition of the DRplanner Frontier simplifier map, the image of BCDEIJK is not the graph MCDEIJK, but the graph MCDEFGHIJK which is dense. This graph MCDEFGHIJK is welloverconstrained, since it has density 1 and it could be made wellconstrained by say removing constraints FG and FH. Thus the image of ABCDEFGH is also solvable. In general, the following claim holds. Claim 21 Let A and B be solvable No,,I,11,I, such that A n B # 0 and A n B v where v is a single vertex of weight less than geometry dependent constant D, then A U B is solvable. Figure 230: Original graph BCDEIJK is dense, new graph MCDEIJK is not Proof Since A is solvable, the density of A n B, d(A n B) < D (a solvable graph cannot contain an overconstrained subgraph, unless it is a wellover constrained graph in which case it can be replaced by an equivalent wellcon strained graph). Hence the density of A U B, d(A U B) = d(B) + d(A \ B) D + d(A) d(A n B) > D. Equality occurs when d(A n B) = D, otherwise A U B is overconstrained. If A U B is overconstrained it is welloverconstrained, since it could be converted into wellconstrained by reducing weights of some edges of B\Aor A \B. I This property can be used to show that Claim 22 DRplanner Frontier is .,' *,1/l;ifd, preserving as well as strictly solvabil ity preserving. Proof Let B be a solvable graph, and suppose that the solvable graph Si was simplified by DRplanner Frontier. Then B would only be affected by this simplification if B contains at least one internal vertex of Si (recall that frontier vertices of Si remain unchanged). But then, by the definition of the DRplanner Frontier simplifier, T,(B) = T(B U S). Since T1(B U S) is obtained by replacing Si by solvable T((Si), and according to the previous claim, the union of two solvable graphs is solvable, thus T((B) = T,(B U S) is also solvable. I Claim 23 DRplanner Frontier is complete Proof This is because DRplanner Frontier (just as Condense) finds minimal dense subgraphs at each stage. I Claim 24 DRplanner Frontier has worstchoice approximation factor O(1/n). Proof Consider Figure 231 the solvable constraint graph G. Initially DRplanner Frontier will locate the minimal dense subgraph ABC (since this is the only minimal dense subgraph of G). It will not be able to locate any dense subgraphs disjoint from ABC, or including only frontier vertices of ABC. If it attempts to locate a dense subgraph that includes the entire (simplified) cluster ABC, and does so by inspecting the other vertices in the sequence A, B, C, H, I... F, E, (i.e going counterclockwise), then DRplanner Frontier would not encounter any dense subgraphs after ABC, until the last vertex of the sequence E is reached. The minimal dense subgraph found at this stage is the en tire graph G. Thus the size of the DRplan corresponding to this choice of vertices is proportional to n. On other hand, there is a DRplan of constant size. This DRplan would first locate the minimal dense subgraph St = ABC and simplify it. After that it would simplify S2 = ABCE = St U {E}, after that S3 = S2 U {F} etc going clockwise until the vertex H is reached. At every stage i, the size of Si is constant, hence the size of this DRplan is constant. I E C 2 F 5 3 52 B A H 1 2 I Figure 231: 1/n worstchoice approximation factor of DRplanner Frontier Claim 25 The bestchoice approximation factor of DRplanner Frontier is at least 1 2' Proof Let G be the weighted constraint graph. Let P be an optimal DRplan of G, let p be the size of P (i.e the size of every cluster Si simplified under the optimal DRplan is less than p + 1). We will show that there is a DRplan P' that is "close to" P. Complete resemblance (P = P') may not be possible, since the internal vertices of the cluster S found by DRplanner Frontier at the i' stage, are simplified into one core vertex, thereby losing some information about the structure of the graph. However we will show that there is a way of keeping the size of P' within the constant D of the size of P. Suppose that DRplanner Frontier is able to follow the optimal DRplan up to the stage i, i.e Si = Sf. Suppose that there is a cluster Sj in the DRplan P such that i < j and Sj contains some internal vertices of Si. Therefore the simplification of Sj by DRplanner Frontier may be different from simplification of Sj by P. However, since the union of S, and Sj is solvable, DRplanner Frontier could use S' = T1 (Si) U Sj instead of Sj. The size of S. differs from the size of Sj by at most D units, where D is the constant depending on the geometry of the problem. Hence the size of P' is at most p + D, and since p is at least D, the result follows. I Next, we consider the last performance measure ability to incorporate design decomposition. Observation 4 DRplanner Frontier can incorporate a design decomposition of the input inpl,, if and (,oil, if all pairs of u',,1,i,,,.il A and B in the given design decomposition satisfy: the vertices in A n B are not 'i,", ."i the internal vertices of either A or B. Note. This condition on the design decomposition puts no restriction on the sizes of the intersections of the subgraphs in the decomposition, and is far less restrictive than the corresponding conditions for SR and Condense. < Proof The proof is similar to the case of the DRplanner SR. For the 'if' part, we find a topological ordering O of the given design decomposition P which is a set of solvable subgraphs of the input graph G, partially ordered under the subgraph relation such that O is embedded as a subplan of the final DRplan generated by DRplanner Frontier; i.e, O forms a subsequence of the sequence of solvable subgraphs Si, whose (sequential) simplification gives the DRplan. We take any topological ordering of the given design decomposition P and create a DRplan for the first solvable subgraph A in P. I.e, while constructing the individual DRplan for A, we "i ilnl the rest of the graph. This individual DRplan induces the first part of the DRplan for the whole graph G. In particular, the last graph in this partial DRplan is obtained by simplifying A using the simplifier described in Section 2.1.14 (and treating each A exactly as DRplanner Frontier would treat a cluster Sj found at some stage j). Let Gi be the last graph in the DRplan for G created thus far. Next, we consider the next subgraph in the ordering 0, and find an individual DRplan for it, treating it not as a subgraph of the original graph G, but as a subgraph of the simplified graph Gi. This individual DRplan is added on as the next part of the DRplan of the whole graph G. The crucial point is that the simplification of any subgraph, say A, will not affect any of the unrelated subgraphs B in P. This is because by the requirement on the decomposition P, A and B share at most frontier vertices. As a result, by the functioning of the DRplanner Frontier, when the core vertex for A is created, none of the solvable subgraphs inside B are affected. The process of constructing individual DRplans for subgraphs in the decomposition P and concatenating them to the current partial DRplan is continued until a partial DRplan for the input graph G has been produced, which completely includes some topological ordering of the decomposition P as a subplan. Again, let Gk be the last graph in this partial DRplan. The rest of the DRplan of G is found by running the original DRplanner Frontier on Gk. For the 'only if' part, we consider a DRplan Q produced by DRplanner Frontier. We first observe that the sequence of (original) solvable subgraphs whose sequential simplification gives Q can never contain two subgraphs A and B such that A n B contains both internal vertices of A and internal vertices of B. This is because if, for instance, A is simplified before B, then B (on its own) cannot be simplified at a later stage (although A U B could), since an internal vertex of B that is also an internal vertex of A will disappear from the graph (will be replaced by a core vertex representing everything internal to A), the moment A has been simplified. Next, we consider the remaining case where A n B contains some internal vertices of A but only frontier vertices of B. In this case, potentially B could be simplified before A, and A will not be affected, since the frontier vertices of B are unchanged by the simplification. However, since a given design decomposition P could contain an arbitrary number of overlapping subgraphs, we can choose decompositions P such that all topological orderings of P are infeasible i.e, no DR plan can incorporate them as a subsequence. For instance, if there are 3 subgraphs A, B and C in P such that A n B contains only frontier vertices of B but some internal vertices of A; B n C contains only frontier vertices of C, but some internal vertices of B; and C n A contains only frontier vertices of A, but some internal vertices of C. This forces the DRplan to simplify B before A, C before B and A before C, which is impossible. I 2.2 Relating Problems of Chapter 1 to some Measures of Chapter 2 DRplanning problem of geometric constraint solving community directly corresponds to our RDdag problem. Underlying weighted graph G is the same for both problems, number of geometric degrees of freedom D = K, density function d() is the same etc. Stably dense graphs correspond to solvable graphs/systems. Solving optimal RDdag problem is equivalent to finding optimal DR solution sequence. Maximal stably dense subgraphs correspond to the roots of tree in DRplans. Clearly size of the optimal DR solution sequence is greater or equal to the size of the minimum stablyy) dense subgraph of G, and to the size of the minimum stablyy) dense subgraph of T1(G) and and to the size of the minimum stablyy) dense subgraph of T2(G) etc. Hence an efficient solution of minimum dense subgraph problem would be helpful for finding optimal DR solution sequence. Since it desirable that every S, were cluster minimal (see Section 1.1) a minimal dense subgraph problem is also important for obtaining optimal DR solution sequence. CHAPTER 3 MAXIMAL, MAXIMUM AND MINIMAL STABLY DENSE PROBLEMS 3.1 Finding Maximum Dense Subgraph Unbounded case. Claim 26 Problem of finding maximum dense i,,oi1,ili,,/ when weights are allowed to be unbounded is NPComplete Proof By straightforward reduction from CLIQUE. I Bounded case. Suppose that the weight of all vertices is 3, of all edges 1 (it important that weights be bounded, because unbounded maximum dense subgraph problem is NPcomplete). Constant K = 0. Consider a following LP: max Exa s.t EI 3Exi > 0 xi > yij, Vi, j 0 < x, < l, Vi, j Lemma 4 Let S(G) be a solution of the LP above, for a given ,,Ii'l, G. Then vertices vi s.t xi = 1 form the 1,,,i, 1/ dense ub,,inl,,,ii A of G (dimension dependent constant K = 0). (If there are more than 1 dense ,,/,ii,,l, of size JAI then the one that has highest /, 1. ,I;, is formed). Proof Let A be the (densest) maximum dense subgraph. Let B be a sub graph constructed as described above. Suppose that A # B. Consider an xp that has the smallest positive value in B. If xp = 1 then B = A, contradiction. Suppose that 0 < x2 < 1. Consider edges ypj such that 0 < ypj = xp < 1. If there are 3 or more such edges than both xp and ypj could be increased by some positive 6, resulting in a better LP solution than B, contradiction. Therefore there are at most 2 such edges. Remove xp and its adjacent edges from B and set some vertex vi E A \ B equal to xp. This creates another optimal LP solution B'. Consider an x' that has the smallest positive value in B' and repeat. Eventually the value of x' will reach 1 and by construction A \ BI = B \ Al and density of A is equal to the density of B. I Note that since maximum dense subgraph is also maximal, technique above locates maximal dense subgraph as well. 3.2 Finding a Stably Dense Subgraph 3.2.1 Distributing an Edge In Hoffmann et al. (1997) we have described an algorithm Distribute(ei, A, K) that "distributes" weight of an edge ei to its endpoints (v v') (or into graph A), assuming that all other edges in A has already been "distributed". Formally edges of A, {ej} = A are distributed if there is a mapping (distribution) of edgeweights w(e ) into two parts fj, f (corresponding to the endpoints of the edge ej) such that (**) Ve, E A both fp and fj are nonnegative integers and 