A "Piano Movers" Problem Reformulated
David Wilson, James H. Davenport, Matthew England, Russell Bradford
AA “Piano Movers” Problem Reformulated
David Wilson, James H. Davenport, Matthew England & Russell BradfordDepartment of Computer Science, University of Bath, Bath, BA2 7AY, UKE-mail: { D.J.Wilson, J.H.Davenport, M.England, R.J.Bradford } @bath.ac.uk Abstract —It has long been known that cylindrical algebraicdecompositions (CADs) can in theory be used for robot motionplanning. However, in practice even the simplest examples can betoo complicated to tackle. We consider in detail a “Piano Mover’sProblem” which considers moving an infinitesimally thin piano(or ladder) through a right-angled corridor.Producing a CAD for the original formulation of this problemis still infeasible after 25 years of improvements in both CADtheory and computer hardware. We review some alternativeformulations in the literature which use differing levels ofgeometric analysis before input to a CAD algorithm. Simplerformulations allow CAD to easily address the question of theexistence of a path. We provide a new formulation for whichboth a CAD can be constructed and from which an actual pathcould be determined if one exists, and analyse the CADs producedusing this approach for variations of the problem.This emphasises the importance of the precise formulation ofsuch problems for CAD. We analyse the formulations and theirCADs considering a variety of heuristics and general criteria,leading to conclusions about tackling other problems of this form.
I. I
NTRODUCTION
A. A “Piano Movers” problem
In [24] the authors describe a “Piano Movers” Problem as follows: “given a body B and a region bounded by acollection of walls, either find a continuous motion connectingtwo given positions and orientations of B during which B avoids collisions with the walls, or else establish that no suchmotion exists.” Such problems commonly arise in robotics.A simple example from [14] is the problem of moving aladder of length 3 through a right-angled corridor of width 1(moving from position 1 to position 2 in Figure 1). A simpleanalysis shows there is no solution to this particular problem,and that it would only be possible to traverse the corridorwith a ladder of length less than √ . We are interested inhow this and similar piano movers problems may be decidedautomatically, with paths calculated when a solution exists.1 2 Fig. 1. The piano movers problem considered in [14]
In [25] the authors proposed a generic approach to pianomovers problems in which the problem is described using polynomial algebra and then solved using the cylindricalalgebraic decomposition (CAD) algorithm. However, for evenvery simple examples this approach can be computationallyinfeasible. In [14] the author applied the approach of [25] tothe simple problem of the ladder just described, demonstratingthe scale of the computations that would be required. Despite25 years of improvements in both CAD theory and computerhardware, producing a CAD for the algebraic formulationgiven in [14] is still infeasible.In Section II we provide a new formulation for whicha CAD has been produced and from which path could bededuced. First we complete the introduction with a reminderof the theory of CAD, details of the original formulation and asummary of other formulations found in the literature. Some ofthese can solve the existential question of whether a path existsvery quickly, but they cannot then give the actual path thatwould be required by a robot, which the formulation presentedin Section II can. In Section III we consider generalisations ofthe problem and how the some of the formulations could beadapted while in Section IV we consider further adaptations toCAD technology for use with piano movers problems. Finallywe give our conclusions in Section V.
B. Cylindrical algebraic decomposition
A cylindrical algebraic decomposition (CAD) is a partitionof R n into cells, constructed with respect to an input, usuallyeither polynomials or formulae, in n ordered variables. Eachcell is described by a semi-algebraic set (a finite sequenceof polynomial equations and inequalities) and the cells arecylindrically arranged (meaning the projection of any two cellson the first k coordinates is either equal or disjoint).A CAD is sign-invariant if the input polynomials haveconstant sign on each cell. Such a CAD allows for thesolution of many problems defined by the polynomials. Collinsprovided the definition and first algorithm [1], motivated asa tool for quantifier elimination in real closed fields. Otherapplications range from robot motion planning to algebraicsimplification technology [5], [15].Collins’ algorithm has two phases. The first, projection ,applies a projection operator repeatedly to a set of polyno-mials, each time producing another set in one fewer variables.Together these contain the projection polynomials . The secondphase, lifting , then builds the CAD incrementally from thesepolynomials. First R is decomposed into cells which are pointsand intervals corresponding to the real roots of the univariatepolynomials. Then R is decomposed by repeating the processover each cell using the bivariate polynomials at a sample pointof the cell. The output for each cell consists of sections ofpolynomials (where a polynomial vanishes) and sectors (theregions between these). Together these form the stack over the a r X i v : . [ c s . C G ] A p r ell, and taking the union of these stacks gives the CAD of R . This process is repeated until a CAD of R n is produced.The projection operator must be chosen in order to concludethat the CAD of R n produced in this way is sign-invariant.We note that CADs can depend heavily on the ordering ofthe variables. In [10] a problem was described which led to acell count doubly exponential in the number of variables forone ordering, but constant in another. Heuristics to help pickthe variable ordering are developed in [16], [7].Since Collins published the original algorithm there hasbeen much research into improvements with a summary of de-velopments over the first twenty years given by [12]. Importantadvances include: the definition of finer projection operators touse in the first phase [20]; the introduction of Partial CAD tomake use of the quantified structure of a formula when lifting[13]; the use of equational constraints to reduce the number ofprojection polynomials required [23]; the use of truth-table-invariant CADs (TTICADs) to apply equational constrainttechniques more widely [6]; and an alternative approach toprojection and lifting where the problem is solved in complexspace and then refined to a CAD of real space [11]. C. Original formulation of the problem
In [14] Davenport considered building a CAD to solve theproblem of moving a ladder of length 3 through a right-angledcorridor of width 1 (as in Figure 1). Denoting the endpoints ofthe ladder as ( x, y ) and ( w, z ) and assuming the outer cornerof the corridor is the origin, the formulation provided was (cid:2) ( x − w ) + ( y − z ) − (cid:3) ∧ (cid:2) [ yz ≥ ∨ [ x ( y − z ) + y ( w − x )( y − z ) ≥ (cid:3) ∧ (cid:2) [( y − z − ≥ ∨ [( x + 1)( y − z ) + ( y − w − x )( y − z ) ≥ (cid:3) ∧ (cid:2) [ xw ≥ ∨ [ y ( x − w ) + x ( z − y )( x − w ) ≥ (cid:3) ∧ (cid:2) [( x + 1)( w + 1) ≥ ∨ [( y − x − w ) + ( x + 1)( z − y )( x − w ) ≥ (cid:3) . (1)The first equation in (1) describes the length of the ladder,and the remaining inequalities describe the valid positions,ensuring the ladder does not intersect any of the four walls.In [14] the author completed the projection phase ofCollin’s CAD algorithm, finding over 250 distinct univariateprojection factors with total degree as high as 26. The technol-ogy available for the paper did not allow for the simultaneousroot isolation of these. With current hardware and softwareincorporating the latest CAD theory (Q EPCAD -B 1.69 [8]and M
APLE
16 [11]) it still remains outside the realm ofcomputation to complete the construction of the CAD.
D. Other approaches
In robotics, piano mover’s problems would typically betackled using numerical methods to produce paths efficientlyat the expense of the possibility of rounding errors. We areconcerned with the development of symbolic approach and sodo not examine numerical methods in this paper. Experiments in this paper were run on a Linux desktop with a 3.1GhzIntel processor and 8.0Gb total memory
In [24] the authors of [25] proposed a separate approachfor the piano movers problems restricted to the plane, whichdid not make use of CAD. This algorithm will typically runmore efficiently than the CAD based approach but does notgeneralise to higher dimensional problems.Tackling the problem with CAD has been revisited severaltimes in the literature. In [19], the author discussed theproblem suggesting the question of traversing the corridor wasequivalent to the question as to whether there is a position ofthe ladder for which both extremities are in the two branchesof the corridor. The verbal description of this reformulationseems misleading since a ladder could be positioned as suchwhile still being unable to turn the corner as in Figure 2.
Fig. 2. A configuration of a ladder in which the endpoints are in oppositebranches of the corridor.
Later in [19] the author reports on another reformulationusing only one endpoint and the tangent of the half-anglebetween the x -axis and the ladder, reporting that a CAD canbe produced for this using Collins’ algorithm sufficient toconclude that the problem has no solution. Since no detailsof the algebraic formulation were provided we are unable toverify this or analyse this formulation further.(b,0) (0,a)(d,1) (-1,c) Fig. 3. A configuration of a ladder in which all four walls are intersected.
In [28], Wang uses “simple reasoning” to deduce that theladder cannot traverse the corridor if and only if it intersectsall four walls simultaneously. From this deduction the problemcan be reformulated as follows: Let a, b, c, d be coordinatesdefining the intersection points as in Figure 3 and r be thelength of the ladder). Then there is no solution if ( ∃ a )( ∃ b )( ∃ c )( ∃ d )[ a + b = r ∧ r > ∧ a ≥ ∧ b < ∧ c ≥ ∧ d < − ∧ c − (1 + b )( c − a ) = 0 ∧ d − (1 − a )( d − b ) = 0] . (2)Due to its simplicity and the small number of free variables(only r is unquantified) Q EPCAD can almost instantly deducethat the maximal length of the ladder is √ , using a CAD of 19cells. When considering the same problem in [27] Wang notedthat if the ladder intersected the outer walls and one of the innerwalls then it must also intersect the other. Hence equation (2)could be simplified further by removing the final conditionsn lines 2 and 3. This further topological reasoning actuallymakes no difference here (Q EPCAD ’s timings and cell countsare unchanged) but could be powerful for other problems.In [22] McCallum approaches path-finding by consideringtransformations of objects by a translation ( x, y ) and a rotation θ . This produces a formulation of the ladder problem involving21 equations and inequalities in a comparatively complicatedboolean formula. Appealing to equational constraints and par-tial CAD techniques McCallum constructs a four-dimensionalCAD of 16,138 cells in 429 seconds.In [31] Yang and Zeng considered the problem in the caseof a rectangular piano instead of a ladder and used geometricanalysis to achieve a simple condition for the problem to havea solution. They parametrize the problem according to theposition of a corner and the angle the rectangle makes withthe horizontal axis. Through some highly non-trivial analysisthey obtain a condition on a polynomial which, if true, impliesthe existence of a valid route. Applying their techniques to thecase of the ladder of length L we see that the existence of avalid route is equivalent to the truth of ( ∀ x ) 4 x − L − x − L − x − L − x +1 > . (3)It takes Q EPCAD just 1.936 seconds (mostly initialization time)and 5 cells to return: L − < ∨ L < . The approaches of [28] and [31] are highly efficient butlimited. They require, not insignificant, geometric deductionsbefore presentation to CAD, and inform you only whetherthe ladder can or cannot pass through the corridor, revealingno information about possible paths. It would make senseto therefore use these sort of approaches as an initial testfor a problem before constructing an inevitably far more-complicated CAD sufficient for planning routes.Also, these reformulations give descriptions in the realspace , meaning they describe the geometry of the plane inwhich the ladder exists. This is opposed to [25], [14] and thenew formulation in Section II which describe the geometry in afour-dimensional configuration space , specifically coordinatesof the endpoints that fix the ladder within the plane. Thisdistinction is important since the former allows us to analysewhether a ladder can move through the corridor, but cannotprovide the explicit path for it to do so. It can be said that[22] also works within a configuration space, however a non-trivial one where positions are encoded by transformations.By not considering the whole configuration space in theirformulations, Wang and Yang–Zeng also cannot considerwhether the ladder is able to rotate within the corridor toexit in the opposite orientation (an important point for thegeneralisations of the problem discussed in Section III-B).II. N
EW FORMULATION OF THE PROBLEM
We consider the problem in configuration space, but froma different perspective than [14]. First we give a formuladescribing all possible invalid regions, then take its negationas a description of the valid regions. As in (1) we denote theendpoints of the ladder by ( x, y ) and ( w, z ) . A. Describing the invalid regions
We describe four canonical invalid configurations for theladder. Each is identified with an equivalent Tarski formulaand examples of each are given in Figure 4.A x < − ∧ y > or w < − ∧ z > : this describesany collision with the ‘inside’ walls along with theladder being on the other side of these.B x > or w > : this describes any collision withthe rightmost wall along with the ladder being onthe other side.C y < or z < : this describes any collision withthe bottommost wall along with the ladder beingon the other side.D ( ∃ t )[0 < t ∧ t < ∧ x + t ( w − x ) < − ∧ y + t ( z − y ) > : this ensures no inner point of theladder lies in the invalid top-left region.A BC D Fig. 4. Four canonical invalid positions of the ladder. Note from the algebraicdescriptions that for positions A–C only one end need be outside the corridor.
We can hence characterise the invalid regions with: [ x < − ∧ y > ∨ [ w < − ∧ z > ∨ [ x > ∨ [ w > ∨ [ y < ∨ [ z < ∨ ( ∃ t ) (cid:2) < t ∧ t < ∧ x + t ( w − x ) < − ∧ y + t ( z − y ) > (cid:3) . (4)This formula contains the “new” variable t used to representany point on the ladder. We can use Q EPCAD to eliminate t from (4) in just over 2 seconds, constructing 681 cells andreturning the equivalent quantifier-free formula: [ y < ∨ [ w > ∨ [ x > ∨ [ z < ∨ [ x + 1 < ∧ y − > ∨ [ w + 1 < ∧ z − > ∨ [ w + 1 < ∧ yw − w + y + x ≥ ∧ xz + z − yw + w − y − x > ∨ [ yw − w + y + x < ∧ z − > ∧ xz + z − yw + w − y − x < ∨ [ y − > ∧ yw − w + y + x < . (5) B. New formulation for CAD
We now have a description of the invalid regions, (5), sowe can describe the valid regions by taking its negation: [ w ≤ ∧ [ x ≤ ∧ [ y ≥ ∧ [ z ≥ ∧ [ x ≥ − ∨ y ≤ ∧ [ w ≥ − ∨ z ≤ ∧ (cid:2) wy − w + x + y < ∨ w + 1 ≥ ∨ xz + z − yw + w − y − x ≤ (cid:3) ∧ (cid:2) yw − w + y + x ≥ ∨ (cid:2) [ z − ≤ ∨ xz + z − yw + w − y − x ≥ ∧ y − ≤ (cid:3)(cid:3) . (6)lthough (6) describes the valid regions in terms of theendpoints it is missing any description of the relationshipbetween these (fixing the length of the ladder). Hence our newformulation of the problem for CAD is [( x − w ) + ( y − z ) = 9] ∧ (6) . (7) C. Applying CAD
The formula (7) was given to Q
EPCAD (with initialisationparameters +N500000000 +L200000 ) under the variableordering x ≺ y ≺ w ≺ z . After a little under 5 hours(16,933.701 seconds) of computation time a CAD of R was constructed with 285,419 cells. The following equivalentformula to (7) was given: x ≤ ∧ y ≥ ∧ w ≤ ∧ z ≥ ∧ ( y − z ) + ( x − w ) = 9 ∧ (cid:104) [ x + 1 ≥ ∧ w + 1 ≥ ∨ (cid:2) y − ≤ ∧ w + 1 ≥ ∧ y w − yw + x w + 2 xw + 2 w − xy w + 4 xyw − x w − x w − xw + x y − x y + x + 2 x − x − x − ≥ (cid:3) ∨ (cid:2) x + 1 ≥ ∧ yw − w + y + x ≥ ∧ w − xw + y − y + x − > ∧ z − ≤ (cid:3) ∨ (cid:2) x + 1 ≥ ∧ yw − w + y + x ≥ ∧ y w − yw + x w + 2 xw + 2 w − xy w + 4 xyw − x w − x w − xw + x y − x y + x + 2 x − x − x − ≤ ∧ z − ≤ (cid:3) ∨ [ y − ≤ ∧ z − ≤ (cid:105) . (8)The first line gives the conditions of the problem whichare in conjunction with any valid configuration. The remain-ing lines give a large disjunction of clauses describing suchconfigurations. The first clause is characterizing the positionswhere the ladder is entirely in the vertical corridor and the lastclause where the ladder is entirely in the horizontal corridor.There are then three more clauses characterising positions inbetween. Any analysis of the decomposition of these equationsrequires knowledge of the adjacency of the four-dimensionalCAD: this is highly non-trivial and discussed in Section II-D.Q EPCAD uses, amongst other theory, partial CAD tech-niques [13] to simplify its calculations and output. These canbe suppressed by issuing the full-cad command. We notethat doing so greatly increases the difficulty of the problem.Calculating a full-cad of (7) resulted in the constructionof 1,691,473 cells taking just over a day of computation time(88,238.442 seconds). The quantifier-free formula returned isalmost identical to the partial CAD version (8) (with a coupleof cases split slightly differently).We can attempt to speed up the construction by introducingquantifiers on one endpoint leading to a CAD of valid positionsfor one endpoint of the ladder, by prefixing (7) with ( ∃ w )( ∃ z ) .Using Q EPCAD this took just over 50 minutes (3052.753seconds) and produced only 5453 cells. The sharp reductionis a result of partial CAD techniques as described in [13]. Theresulting quantifier-free formula is simply, x ≤ ∧ y ≥ ∧ [ x + 1 ≥ ∨ y − ≤ , (9) which is the definition of the original corridor. The quantifiedversion of (7) is simply asking for those points where it ispossible to place an end of the ladder and have it in a validposition and so this formula is as expected. We note thatthe CAD used to construct the formula contains far moreinformation than is needed — a CAD with only 17 cells issufficient to describe the corridor.The existential CAD is not sufficient to solve the pathfinding problem, and for our example the output (9) gives littleuseful information. However, providing quantified variableshas drastically reduced the complexity of the problem andso can be a useful test for the feasibility of the problem (aCAD for the original formulation (1) remains infeasible underquantification). It can also be used in some cases (when thevalid region for the endpoint is not the entire corridor) to showa ladder traversal is impossible: for example, if an invalidregion were to ’block’ the corridor.Q EPCAD can produce a visualisation of two-dimensionalCADs through the p-2d-cad command. Figure 5 shows theoutput for the problem in the preceding paragraphs (so it refersto the existential CAD; the diagram for the non-quantifiedformulation is similar, but omits all cell boundaries within thecorridor). The diagram is for x in the range [ − , and y inthe range [ − , with a step of . (therefore if stacks arewithin . (with respect to x ) or intra-stack cells are within . (with respect to y ) they will not be distinguishable).Figure 5 makes clear just how complicated the problem iswhen being tackled by CAD. There are certainly boundariesto cells that seem to be related to ‘boundary cases’ of theproblem: when the ladder is ‘stuck’ trying to get aroundthe corner. However, there are many boundaries with littlesignificance for the real problem and so further developmentof the CAD technology to remove these would be beneficial. D. Adjacency
The four-dimensional CADs of configuration space wehave produced from (7) could be used to both determine theexistence of a solution and then construct a path. However,to do the latter we need to first analyse the adjacency andconnectedness of cells in the four-dimensional CAD. This isnot currently possible with any existing technology and is cer-tainly non-trivial. The process is described in two dimensionsby [2] (which has been implemented in Q
EPCAD ) while [3]generalises the approach to three dimensions. Further general-isations are not trivial however [4], with adjacency algorithmslikely to work (without a change of coordinates) only for well-behaved input. We also note that in [25] the authors consideradjacencies between n and ( n − -dimensional cells, but sincewe have an equational constraint, we are actually interested inadjacencies between ( n − and ( n − -dimensional cells. E. Choosing a formulation
An important question is why (7) is a better formulationfor CAD than (1), and whether we could have predicted this.On first glance, we see that the new formulation involvespolynomials of lesser degree. One measure of CAD complexityis sotd (introduced in [16] as the sum of total degree of eachmonomial in each polynomial). Using this measure applied ig. 5. A two-dimensional CAD of the ( x, y ) configuration space constructedfrom (7). to the input polynomials as a heuristic certainly favours thenew formulation: (1) has sotd
100 compared to (7) withan sotd of 33. The benefit is less obvious when taking an sotd of the full projection factor sets. The new formulationis still lower, but there is a smaller relative difference: 2006is reduced to 1693. There are over 100 univariate polynomialsin the projection sets of both formulations. Calculating ndrr (introduced in [7] as the number of distinct real roots ofthe univariate projection polynomials) also favours the newformulation, but again, not by an amount that indicates thechanges in feasibility: 367 reduces to 301.For comparison, we note that the approach by Wang leadsto an sotd of 19 for the the top level projection polynomials,98 for the full projection factor set and an ndrr of 17.McCallum’s formulation has sotd ’s of 68 and 32 (lower dueto repeated factors) and an ndrr of 5. Yang-Zeng’s approachgives sotd ’s of 35 and 39, and an ndrr of 2. Hence full sotd and ndrr correctly predict that the CADs related tothese approaches will be smaller than our reformulation.These heuristics do not take into account the number ofquantifiers which can be hugely influential in the complexityof a problem. The fact that Wang’s formulation contained onlya single unquantified variable is hugely instrumental in such anefficient construction. The effect of these quantifiers suggeststhe creation of more sophisticated heuristics. For example:sum of weighted total degrees. This would weight variablesaccording to two properties: the overall variable ordering andwhich variables are quantified.Let the CAD be created with respect to variables x ≺ x ≺ · · · ≺ x n where x decomposes R , { x , x } decom-poses R and so forth. Then assign a weight of i to variable x i so that the polynomial x − x would have sowtd sotd of 4. In addition to this, if a variable is quantified then reflect this by halving its effect on sowtd .For the above polynomial, if x was quantified then the sowtd would become 8.5. Applying these to the various formulationswe get the following: • Davenport (unquantified): sowtd = 148 . • Davenport (quantified): sowtd = 92 . • New formulation (unquantified): sowtd = 72 . • McCallum’s formulation: sowtd = 70 . • New formulation (quantified): sowtd = 46 . • Wang’s formulation: sowtd = 27 . • Yang–Zeng’s formulation: sowtd = 23 .The sowtd measure gives an ordering matching the differencein cell counts, and has plausible-looking differences.III. G
ENERALISING THE PROBLEM
A. Ladders of different length
The reformulation described in Section II was for a ladderof length . We know already that the maximum length of aladder able to traverse the corner is √ and similar geometricreasoning shows that the maximum length of a ladder able toreverse its orientation is √ . We compare the CAD for (7) (inwhich the ladder can not traverse the corridor) to the equivalentformulations with a ladder of shorter length. We consider fourcanonical cases which exhaust the possible scenarios:Length 3: Ladder cannot traverse the corridor.Length 2: Ladder can traverse the corridor but is unableto reverse its orientation.Length : Ladder can traverse the corridor and is ableto reverse its orientation, but only within the‘corner’.Length : Ladder can traverse the corridor and reverse itsorientation at any point within the corridor.All the results are summarized in Table I. We compareboth non-quantified and quantified versions (where the inputformula was preceded by ( ∃ w )( ∃ z ) as indicated by ∃ ). Notethe length of the ladder is an explicit equational constraint andso Q EPCAD automatically applies the theory of [23].
TABLE I. CAD
S OF (7)
MODIFIED BY VARYING LADDER LENGTH . EC-CAD ∃ EC-CADLength Cells Time (s) Cells Time (s)3 285419 16286.431 5453 2941.0242 314541 9863.950 5353 1922.8375/4 404449 33042.101 5589 7312.3473/4 446787 13146.195 4347 69.6903 full-cad
B. Angled corridors
We consider how the problem may be generalised to anon-right angled corridor. There are two canonical cases: thatwhere the angle is obtuse as in Figure 6 and that where theangle is acute as in Figure 7.For a general obtuse angled corridor the right hand corridorwalls have equations y = tan( θ ) x and y = tan( θ ) x + 1 . Thisresults in the following formulation of the invalid positions: x < ∧ y > ∨ [ y < ∨ [ x > ∧ y > tan( θ ) x + 1] ∨ [ y < tan( θ ) x ] ∨ [ w < ∧ z > ∨ [ z < ∨ [ w > ∧ z > tan( θ ) w + 1] ∨ [ z < tan( θ ) w ] ∨ ( ∃ t )[0 < t ∧ t < ∧ (cid:104) [ x + t ( w − x ) < ∧ y + t ( z − y ) > ∨ [ y + t ( z − y ) < ∨ [ x + t ( w − x ) > ∧ y + t ( z − y ) > tan( θ )( x + t ( w − x )) + 1] ∨ [ y + t ( z − y ) < tan( θ )( x + t ( w − x ))] (cid:105) . (10)For a general acute angled corridor the right hand corridorwalls have equations y = − tan( ψ ) x and y = − tan( ψ )( x +1) . This results in the following formulation of the invalidpositions: [ y < ∨ [ y > − tan( ψ ) x ] ∨ (cid:20) x < − (cid:18) tan( ψ ) + 1tan( ψ ) (cid:19) ∧ y > ∧ y < − tan( ψ )( x + 1) (cid:21) ∨ [ z < ∨ [ z > − tan( ψ ) w ] ∨ (cid:20) w < − (cid:18) tan( ψ ) + 1tan( ψ ) (cid:19) ∧ z > ∧ z < − tan( ψ )( w + 1) (cid:21) ∨ ( ∃ t )[0 < t ∧ t < ∧ (cid:104) x + t ( w − x ) < − (cid:18) tan( ψ ) + 1tan( ψ ) (cid:19) ∧ y + t ( z − y ) > ∧ y + t ( z − y ) < − tan( ψ )( x + t ( w − x ) + 1) (cid:105) . (11)If tan of the angle in question is an algebraic number(for example if the angle is a rational multiple of π ) then wecan compute an exact solution to these problems using CAD.However for other cases we would either need to approximatethe value of tan( θ ) or treat it as an additional variable inconfiguration space. θθ Fig. 6. Generic obtuse angled corridor ψψ Fig. 7. Generic acute angled corridor
As with the formulation for the right angled corridor wethen eliminate the extra parameter t , take the negation ofthe quantifier free formula, conjunct the equational constraintdescribing the length of the ladder, and construct a CADaccording to this new formula. Hence the new formulationin Section II may be generalised easily, although constructingthe CAD may be more computationally difficult. GeneralisingWang and Yang–Zeng’s methods is not always straightforwarddue to them being so reliant on geometrical reasoning, asdemonstrated in the examples below. It should be possible toadapt [22] for angled corridors, although care may need to betaken that certain trigonometric identities hold.
1) Obtuse π/ -angled corridor: Let the walls of the rightangled corridor make an angle of π/ with the horizontal.We can generalise Wang’s idea and consider when theladder intersects all four walls at once. As with the right-angledcorridor, this provides us with the maximal length of the ladder.This approach would work for all obtusely angled corridors(under the same constraint of tan( θ ) being algebraic).Q EPCAD can answer this question with 27 cells in 5.717seconds to return r = 0 ∨ r − r − r − ≥ . The appropriate solution is (cid:115) (cid:113) √
159 + (2539 / (cid:112) √
159 + 312 which is approximately 6.6786.Tackling this problem with our method, we first we elim-inate t from the invalid regions. This takes 170,597 cellsand 230.881 seconds. After forming the complete formulation,Q EPCAD fails to construct the relevant CAD after constructing50,000,000 cells (the self-imposed limit of the +N50000000 parameter when calling Q
EPCAD ). The extra complexity isbecause the diagonal corridor is not aligned with the directionsof projection.
2) Acute π/ -angled corridor: Let the walls of the rightangled corridor make an angle of π/ with the horizontal toform an acutely angled corridor with angle π/ .We can na¨ıvely apply Wang’s method to the acutely angledcorridor. Q EPCAD uses 39 cells in 4.520 seconds to return r = 0 ∨ r + 9 r − r − ≥ . The appropriate solution is (cid:115) (cid:113) √
249 + 612 (cid:112) √ − which is approximately 1.8443.Unfortunately this does not give a complete answer to theproblem. It is possible to fit a rod of length √ (greater thanthe above value) by placing it within the corner. This disparityis because na¨ıvely applying Wang’s idea does not take intoaccount the possibility of reversing the orientation of the laddernecessary for ladders of larger lengths. To adapt Wang’s idea toinclude this reverse orientation would require some non-trivialgeometric reasoning.s our formulation is based within configuration space, itacknowledges the extra condition of orientation, but with addedcomplexity expense. If we try our formulation with r = 2 (as . < < √ ) we first eliminate t from the invalidregions. This takes 91,583 cells and 86.647 seconds. If we thentry to solve the problem by constructing the relevant CAD wefail after constructing 50,000,000 cells (the self-imposed limitof the +N50000000 parameter when calling Q EPCAD ).IV. A
DAPTING
CAD
TECHNOLOGY FOR FUTURE W ORK Q EPCAD makes use of the theory of equational constraintsto reduce the number of projection polynomials (and hencethe number of cells in the CAD) along with partial CADtechniques. However, we note that there are further savingsthat could be made given the presence of the equation and wediscuss these ideas and their potential in this section.
A. Extending Equational Constraints
First, as pointed out in [18], the theory of [23] allows usto only lift with respect to the equational constraint for thethe final lift. However, Q
EPCAD appears to lift with respect toall projection polynomials (including the non-equational con-straints). Considerable savings can be made by implementingthis idea. If more than one equational constraint is present ina problem (for example if there were multiple ladders) thenthe full power of TTICAD (as described in [6]) can be usedto simplify the resulting CAD further.
B. Building a layered CAD for the problem
As mentioned earlier we are concerned with the adjacenciesand connectedness of our CAD of configuration space. Forthis problem we are mainly concerned with those cells inthe CAD of full-dimension as these describe regions wherethe configuration of the ladder is free to move. We note thatthe key adjacencies for these cells are those through two-dimensional cells: an adjacency of two three-dimensional cellsthrough a one- or zero-dimensional cell would correspond toan infeasible situation in the real physical space for all butboundary cases (i.e. the ladder having to “tightrope walk” aone-dimensional subspace of R ).The idea of building CADs containing only cells of full-dimension has been investigated previously in [21], [26], [9].We have generalised the idea to produce CADs with cells ofspecified dimension and higher, which we call layered CADs .Algorithms to produce these are presented in [30] along with adiscussion of their topological properties, possible applicationsand an implementation in M APLE built over the authors’
ProjectionCAD package, [17], [18]. Work on these objectsand their properties is ongoing.
C. Lifting to a manifold
In the configuration space, all valid cells must lie on thethree-dimensional manifold described by the equation ( x − w ) + ( y − z ) = 9 so we are only concerned with cells wherethe equation is satisfied (and the ladder has the desired length).We can therefore construct an order-invariant CAD of three-dimensional space using the projection polynomials for inputwith an equational constraint [23], and when lifting over this with respect to the equation, discard all sectors. This leavesjust the sections: precisely the cells on the manifold. We haveimplemented this approach using our M APLE package [18].Within the manifold, the most important cells are thoseof full-dimension (with respect to the manifold) as cells of alower dimension relate to physically infeasible situations (i.e.one-dimensional subspaces of R ). We can restrict our CADto produce only these cells through a smarter lifting stage.Any full-dimensional cell on the three-dimensional mani-fold must project onto a three-dimensional cell in the inducedCAD of R (as it is a section of the equational constraint).We start by constructing the projection set with respect to theequational constraint, producing 11 polynomials in y, w, z . Wethen build just the full-dimensional CAD cells in R : 64,764cells in 16,991.400 seconds.We can now lift over these cells with respect to themanifold (an equational constraint). We construct a stack overeach cell and extract any sections (those cells lying on themanifold). This process is relatively quick, produces 101,924cells in 1020.860 seconds. The total time to construct thethree-dimensional decomposition of the manifold is therefore18,012.3 seconds, producing 101,924 cells.It is not yet feasible to construct all cells on the manifold(or indeed the three-dimensional CAD to lift over) usingM APLE , partly as our implementation does not yet takeadvantage of partial CAD techniques. We expect that withfurther improvements a CAD of the manifold sufficient forconstructing valid paths (one with two and three-dimensionalcells) could be built. V. C
ONCLUSIONS
We considered a classic example of a piano mover’sproblem, how a ladder can traverse a corridor, and the solutionvia CAD. Despite years of improvements to CAD theory andcomputer hardware, building a CAD for the original formu-lation in [14] remains infeasible. However, by reformulatingthe problem CADs can be produced in a matter of seconds,demonstrating how problem formulation is essential to thefeasibility of a CAD problem. Further evidence of this waspresented in [7].We presented a new formulation of the problem for whicha CAD can be produced. There are other solutions in theliterature [28], [22], [31] but these differ in important ways.In [28], [31] the authors relied heavily upon mathematicaldeduction performed by hand before input to CAD. Whilethis is the most powerful reformulation tool available it is nottrivial to automate or generalise. In [22] the author describedconfigurations in a non-trivial manner involving translationsand rotations which may complicate subsequent analysis ofthe space. Our reformulation in Section II uses only a simplenegation of the problem, a technique that could be performedalgorithmically by CAD technology, using heuristics to decidethe appropriate formulation to use.Another distinction is that the approaches in [28], [31] arefirmly rooted within the two-dimensional space of the corridorwhile the new formulation presented here deals with theconfiguration space of the ladder: a three-dimensional manifoldwithin four-dimensional space. This means that whilst thepproaches in [28], [31] are able to answer the question “Canthe ladder get through the corridor?” they cannot answer thequestion “How can the ladder get through the corridor?”. Theapproach of [22] would be able to answer the latter question,but only after some non-intuitive analysis of the trigonometricspace described by the formulation.These distinctions may seem trivial for the problem at hand,but they would become far more important in generalisation.Indeed, even for a ladder in an acute-angled corridor it may bethat the only feasibility path involves rotating the ladder in thecorner (reversing its orientation). This would not be providedby a simple affirmation that a path existed and in the case ofWang’s formulation the possibility would not be consideredsince this formulation requires the orientation to be fixed. It ishard to think of a mathematical argument that takes this intoaccount without needing the full configuration space.Finally, we have also introduced the idea of restrictinglifting in CAD, to cells of full dimension lying on the givenmanifold. This is much more efficient than producing a fullCAD, returning just over a third of the cells for our example.These techniques could be applied to any problem with anequational constraint (lifting to appropriate manifold, or indeedhypersurface) and have now been investigated in generality andformalised in [29].Although a generic symbolic solution to robot motionplanning was provided in theory by [25], in general it remainsinfeasible to the present day, with numerical methods providingthe only practical approach. The ideas presented in this papershow that progress is still possible, but that it will likely followfrom more appropriate formulations of problems just as muchas advances in theory and technology.A
CKNOWLEDGEMENTS
This work was supported by EPSRC grant: EP/J003247/1.R
EFERENCES[1] D. Arnon, G.E. Collins, and S. McCallum. Cylindrical algebraicdecomposition I: The basic algorithm.
SIAM J, Comput. , 13:865–877,1984.[2] D. Arnon, G.E. Collins, and S. McCallum. Cylindrical algebraicdecomposition II: An adjacency algorithm for the plane.
SIAM J,Comput. , 13:878–889, 1984.[3] D.S. Arnon, G.E. Collins, and S. McCallum. An adjacency algorithmfor cylindrical algebraic decompositions of three-dimensional space.
J.Symb. Comput. , 5(1/2):163–187, 1988.[4] S. Basu, A. Gabrielov, and N. Vorobjov. Semi-monotone sets.
J. Eur.Math. Soc. , 15:635–657, 2013.[5] R. Bradford and J.H. Davenport. Towards better simplification ofelementary functions. In
Proc. ISSAC ’02 , pages 16–22. ACM, 2002.[6] R. Bradford, J.H. Davenport, M. England, S. McCallum, and D. Wilson.Cylindrical algebraic decompositions for boolean combinations. In
Proc. ISSAC ’13 , pages 125–132. ACM, 2013.[7] R. Bradford, M. England, J.H. Davenport, and D. Wilson. Optimisingproblem formulations for cylindrical algebraic decomposition. InJ. Carette, D. Aspinall, C. Lange, P. Sojka and W. Windsteiger, editors,
Intelligent Computer Mathematics , volume 7961 of
Lecture Notes inComputer Science , pages 19–34, Springer Berlin, 2013.[8] C.W. Brown. QEPCAD B: A program for computing with semi-algebraic sets using CADs.
ACM SIGSAM Bulletin , 37(4):97–108, 2003.[9] C.W. Brown. Constructing a single open cell in a cylindrical algebraicdecomposition. In
Proc. ISSAC ’13 , pages 133–140. ACM, 2013. [10] C.W. Brown and J.H. Davenport. The complexity of quantifier elim-ination and cylindrical algebraic decomposition. In
Proc. ISSAC ’07 ,pages 54–60, ACM, 2007.[11] C. Chen, M. Moreno Maza, B. Xia, and L. Yang. Computing cylindricalalgebraic decomposition via triangular decomposition. In
Proc. ISSAC’09 , pages 95–102. ACM, 2009.[12] G.E. Collins. Quantifier elimination by cylindrical algebraic decompo-sition – 20 years of progress. In B. Caviness and J. Johnson, editors,
Quantifier Elimination and Cylindrical Algebraic Decomposition , Texts& Monographs in Symbolic Computation, pages 8–23. Springer-Verlag,1998.[13] G.E. Collins and H. Hong. Partial cylindrical algebraic decompositionfor quantifier elimination.
J. Symb. Comput. , 12:299–328, 1991.[14] J.H. Davenport. A “Piano-Movers” Problem.
SIGSAM Bull. , 20(1-2):15–17, 1986.[15] J.H. Davenport, R. Bradford, M. England, and D. Wilson. Programverification in the presence of complex numbers, functions with branchcuts etc. In , SYNASC 2012, pages 83–88.IEEE, 2012.[16] A. Dolzmann, A. Seidl, and T. Sturm. Efficient projection orders forCAD. In
Proc. ISSAC ’04 , pages 111–118. ACM, 2004.[17] M. England. An implementation of CAD in Maple utilisingMcCallum projection. Department of Computer Science Tech-nical Report series 2013-02, University of Bath. Available at http://opus.bath.ac.uk/33180/ , 2013.[18] M. England. An implementation of CAD in Maple utilising problemformulation, equational constraints and truth-table invariance. Depart-ment of Computer Science Technical Report series 2013-04, Universityof Bath. Available at http://opus.bath.ac.uk/35636/ , 2013.[19] J. Marchand. The algorithm by Schwartz, Sharir and Collins on thepiano mover’s problem. In J.-D. Boissonnat and J.-P. Laumond, editors,
Geometry and Robotics , volume 391 of
Lecture Notes in ComputerScience , pages 49–66. Springer, 1989.[20] S. McCallum. An improved projection operation for cylindrical al-gebraic decomposition of three-dimensional space.
J. Symb. Comput. ,5(1-2):141–161, 1988.[21] S. McCallum. Solving polynomial strict inequalities using cylindricalalgebraic decomposition.
The Computer Journal , 36(5):432–438, 1993.[22] S. McCallum. A computer algebra approach to path finding in theplane. In J. Harland, editor,
Proc. Computing: The Australasian TheorySymposium (CATS) , pages 44–50, 1997.[23] S. McCallum. On projection in CAD-based quantifier elimination withequational constraint. In
Proc. ISSAC ’99 , pages 145–149. ACM, 1999.[24] J.T. Schwartz and M. Sharir. On the “Piano-Movers” Problem: I.The case of a two-dimensional rigid polygonal body moving amidstpolygonal barriers.
Communications on Pure and Applied Mathematics ,36(3):345–398, 1983.[25] J.T. Schwartz and M. Sharir. On the “Piano-Movers” Problem: II. Gen-eral techniques for computing topological properties of real algebraicmanifolds.
Adv. Appl. Math. , 4:298–351, 1983.[26] A. Strzebo´nski. Solving systems of strict polynomial inequalities.
J.Symb. Comput. , 29(3):471–480, 2000.[27] D. Wang. Reasoning about geometric problems algebraic methods.DOC Technical Report, Imperial College, Univ. of London, 1991.[28] D. Wang. Geometry machines: From AI to SMC. In J. Calmet, J.A.Campbell, and J. Pfalzgraf, editors,
Artificial Intelligence and SymbolicMathematical Computation (AISMC) , volume 1138 of
Lecture Notes inComputer Science , pages 213–239. Springer, 1996.[29] D. Wilson, R. Bradford, J.H. Davenport and M. England. Cylindricalalgebraic sub-decompositions.
Submitted for publication , exp. 2014.[30] D. Wilson and M. England. Layered cylindrical algebraicdecomposition. Department of Computer Science TechnicalReport series 2013-05, University of Bath. Available at http://opus.bath.ac.uk/36712/ , 2013.[31] L. Yang and Z. Zeng. Symbolic solution of a piano movers’ problemwith four parameters. In H. Hong and D. Wang, editors,
AutomatedDeduction in Geometry , volume 3763 of