Academia.eduAcademia.edu

Shortest point-visible paths on polyhedral surfaces

2000

Abstract. In this paper we study the problem of nding the shortest path between two points lying on the surface of a (possibly nonconvex) polyhedron which is constrained so that a given point on the surface of the polyhedron must be seen from some point in the path. Our algorithm runs in time O (n2 log n) for the convex polyhedron and O (n3 log n) for nonconvex case. The method used is based on the subdivision of the inward layout and intersecting it with the visibility map of the point to be seen.

Shortest Point-Visible Paths on Polyhedral Surfaces Ramtin Khosravi, Mohammad Ghodsi, and Mana Taghdiri Department of Computer Engineering Sharif University of Technology 1 fraamtin,ghodsi,[email protected] Abstract. In this paper we study the problem of nding the shortest path between two points lying on the surface of a (possibly nonconvex) polyhedron which is constrained so that a given point on the surface of the polyhedron must be seen from some point in the path. Our algorithm runs in time O(n2 log n) for the convex polyhedron and O(n3 log n) for nonconvex case. The method used is based on the subdivision of the inward layout and intersecting it with the visibility map of the point to be seen. 1 Introduction The problem of nding the shortest path between two points lying on the surface of a 3D polyhedron is a basic problem in computational geometry and has many applications in di erent areas such as motion planning and navigation. Several forms of the problem can be de ned as we change the properties of the polyhedron (e.g. considering faces to have weights, being nonconvex, etc.), or constrain the path with di erent restrictions. An example of the constrained versions is the problem of nding paths which does not go above some given height as studied in [1]. The problem of nding the shortest path between two points on the surface of a polyhedron is well studied in [7], [5], [2], [3]. Especially [2] presents a method for building a subdivision of the surface which can be used for nding the shortest paths from a xed source to a given query point eciently. The subdivision can be built in O(n2 ) time and the shortest path can be determined in O(k) where k is the complexity of the path itself. The best known algorithm for nding shortest paths on polyhedral surfaces is [3] which nds the shortest path in O(n log2 n) using wavefront propagation method. However as it does not build any subdivision of the surface, it cannot help us for the method used in this paper. In this paper we study a variation of the shortest path problem with visibility constraints, which has interesting applications. The problem is to nd the shortest path from a source point to a target such that a given point on the surface can be seen from at least one point of the path. The method used here is to nd a point on the boundary of the visible image of the point to be seen which has minimum total distance from the source and the target. To the best of our knowledge, this is the rst result on this problem. As the complexity of the visible image of a point on a (possibly nonconvex) polyhedron is quadratic in size of the polyhedron and the algorithms for nding the visibility map are superquadratic in general [6], we assume the visible image of the point to be seen is determined through a preprocessing stage and focus on the problem of nding the shortest path touching the visible image. The running time of our algorithm is O(n2 log n) for convex and O(n3 log n) for nonconvex polyhedra. 2 Preliminaries Let P be a closed (possibly nonconvex) polyhedron in 3-space. We denote the surface of P by @P . By interior of P we mean the portion of the space enclosed by @P not containing @P itself. We consider @P to be speci ed by a set of faces, edges and vertices. Without loss of generality we assume that all faces are triangles. We are given three special points on the surface, namely p, s, and t. The problem is to nd the shortest path  between s and t lying on @P , from which the point p is visible. The point p is visible from  if there is at least one point q on  through which p is visible, i.e. the straight line segment joining p and q does not intersect the interior of P . 2.1 Shortest Paths on a Polyhedron We borrow the terminology from [5]. Two faces f and f are said to be edgeadjacent if they share a common edge e. A sequence of edge-adjacent faces is a list of one or more faces F = (f1 ; f2; : : : ; f +1) such that face f is edge-adjacent to face f +1 (sharing common edge e ). We refer to the (possibly empty) list of edges E = (e1 ; e2; : : : ; e ) as an edge sequence and to the vertex of face f1 which is opposite e1 as the root of E . Each face has a two dimensional coordinate system associated with it. If faces f and f are edge-adjacent sharing edge e, we de ne the planar unfolding of face f onto face f as the image of points of f when rotated about the line through e into the plane of f such that the points of f fall on the opposite side of e to points of f . Extending this notation, we say that we unfold an edge sequence E = (e1 ; e2; : : : ; e ) as follows: Rotate f1 around e1 until its plane coincides with that of f2 , rotate f1 and f2 around e2 until their plane coincides with that of f3, continue in this way until all faces (f1 ; f2; : : : ; f ) lie in the plane of f +1 . A path on @P is called geodesic if it is locally optimal and cannot be shortened by small perturbations. We say a path  connects edge sequence E = (e1 ; e2; : : : ; e ) if  consists of segments which join interior points of e1 ; e2; : : : ; e (in that order). Figure 1 shows a shortest path  from s to t unfolded along the edge sequence connected by it (e1 ; e2; : : : ; e ). The following lemmas express some facts about geodesic paths: 0 k i i i k 0 0 0 0 k k k k k k fk f2 f1 s e2 e1 f3 Fig. 1. e3 ek t f k+1 Shortest path from s to t unfolded along its edge sequence Lemma 1 (Mitchell, Mount and Papadimitriou [5]). If  is a geodesic path which connects the edge sequence E , then the planar unfolding of  along E is a straight line segment. Lemma 2 (Sharir and Schorr [7]). If P is a convex polyhedron then the shortest path between any two points on @P cannot pass through a vertex of P except at its end-points. Lemma 3 (Mitchell, Mount and Papadimitriou [5]). The general form of a geodesic path is a path which goes through an alternating sequence of vertices and (possibly empty) edge sequences such that the unfolded image of the path along any edge sequence is a straight line segment and the angle of the path passing through a vertex is greater than or equal to . The general form of an optimal path is the same as that of a geodesic path, except that no edge can appear in more than one edge sequence and each edge sequence must be simple Lemma 4 (Mitchell, Mount and Papadimitriou [5]). If (x) and (y) are optimal paths from s to points x and y, then they can intersect only at vertices of P , and if they do at v, then the subpath of (x) from s to v has the same length as that subpath of (y) from s to v. 2.2 Point-visible Paths The visibility map of a point p, denoted by Rp , is the subset of @P from which p is visible. In the case of convex polyhedra, Rp is a connected region whose boundary consists of O(n) edges of P . In nonconvex case, Rp is a set of O(n) connected regions. The boundary of each region consists of O(n) line segments (not necessarily edges of P ). Thus the total complexity of Rp is O(n2 ) in this case. We de ne Bp to be the boundary of Rp . With the de nitions above we can say a point p is visible from a path  if the intersection of  and Rp is non-empty. This intersection may be at one point or one or more line segments. We say  is p-visible if p is visible from it. Let  be the shortest p-visible path between s and t. The intersection of  and Bp is a non-empty set of points such as Q. At least one point in Q such as q has the property that the two subpaths of  from s to q and from q to t are optimal. For if not, we can replace the two subpaths with the optimal ones, resulting a shorter p-visible path from s to t (Fig. 2). From the property stated above, we conclude that the image of each subpath after unfolding the corresponding edge sequence is a straight line segment. p s q t Fig. 2. Shortest p-visible path between s and t. The shaded area is Rp . 3 Computing Shortest p-Visible paths Consider a maximal set of points on Bp whose shortest paths to a point connect the same edge sequence. As the following lemma states, such a set forms a connected interval on Bp , which we call it a linearity interval with respect to or simply an L-interval with respect to (Fig. 3). Clearly the set of all -intervals with respect to a point is a partition of Bp . x x x L x a b x Fig. 3. Rp. The segment ab is an L-interval with respect to x. The shaded area is part of Lemma 1. A maximal set of points on one edge of Bp whose shortest paths to a point x connect the same edge sequence is a connected interval. Proof. Suppose I be such a set with the edge sequence E = (e1 ; e2 ; : : : ; ek ) and and 2 be two disjoint connected subsets of (Fig. 4). Consider a point between points of 1 and 2. Since is maximal, has a di erent shortest edge sequence than that of 1 and 2 , say E = ( 1 2 p ). Consider the longest I1 I I I I I I I q q 0 0 0 e ; e ; : : :; e 0 common subsequences of E and E from the end of the sequences. As I1 and I2 lie on the same edge of B , so does q, thus the common subsequence mentioned above is non-empty. Let e be the rst edge in this subsequence and f be the face containing e which is visited rst in the face sequence from source to points of I and q. Let e1 and e2 be the edges of f other than e. Since E and E di er in edges prior to e, either e1 2 E and e2 2 E or converse, i.e. shortest paths to I cross one of the two edges and the shortest path to q crosses the other. Since I1 and I2 are on both sides of q, and the unfolded image of shortest paths is a line segment, the shortest path to q must intersect the shortest paths to either I1 or I2 and this contradicts lemma 4. tu 0 p 0 0 I1 q I2 e e1 f e2 s’ s Fig. 4. Proof of the lemma 1. Suppose L and L be the set of L-intervals with respect to points x and . The intervals obtained from overlapping intervals of L and L are called with respect to the pair x and y. We name the set of such intervals (Fig. 5). Clearly L partitions B . x y L-intervals Lx;y y x x;y y p Lemma 2. Let I be an L-interval with respect to the pair x and y. One can nd the point q(I ) on I with minimum total distance to x and y in constant time. Proof. I has the property that the two edge sequences connected by the shortest paths from a point on I to x and y are the same for all points of I . From this property we can nd the point q(I ) on I whose total distance to x and y is minimum in constant time using elementary techniques of analytical geometry. We omit the details of the computation here. tu Based on the preceding lemma, the shortest p-visible path between s and t can be found by performing the following steps: 1. Compute the set of intervals L on B s;t p a c b d y x Fig. 5. cb is an L-interval with respect to the pair x and y. 2. For each interval I 2 L nd the point q(I ) which has the minimum total distance from s and t. 3. Let q be the point with the minimum total distance from s and t among fq(I ) : I 2 L g. 4. The shortest p-visible path between s and t is the shortest path between s and q followed by the shortest path between q and t. In order to compute the set of intervals L in step 1 above, we compute L and L separately, then overlapping the intervals to obtain L is straightforward. s;t s;t s;t t s s;t 3.1 Computing L-intervals For computing the set of L-intervals with respect to a point x on the surface we use a subdivision presented in [2]. Below we review the method for building the subdivision. Given a source point x on @P , one can construct a shortest path tree for a given polyhedron in O(n2 ) time and O(n) space using Chen and Han's algorithm [2]. This structure holds the information about the shortest paths from x to vertices of P in such a way that for any vertex v of P , the edge sequence connected by the shortest path from s to v can be determined in time proportional to the size of the edge sequence. One can cut the surface of P along the shortest paths from x to all of the vertices of P . The resulting surface can be laid out on a common plane. The layout obtained in this manner is called the inward layout of P and is a starshaped polygon. The vertices of this polygon are the vertices of P and images of the source point x under di erent unfoldings and the edges are shortest paths from the source to the vertices of P . A subdivision of the inward layout can be obtained by constructing the Voronoi diagram on the layout with respect to the images of the source point (Fig. 6). This subdivision has the property that The points in the same region are closer to the corresponding image of the source than to other images, and their shortest paths from the source pass the same edge sequence. As the number of images are O(n), the subdivision can be built in O(n log n) using known algorithms for computing Voronoi diagrams. For the nonconvex case, the inward layout may overlap itself. The algorithm for computing Voronoi diagram in this case is slightly di erent and is given in [2]. s s1 s2 s3 s8 s4 s5 s7 s6 Fig. 6. The inward layout of a box. The edges of the subdivision are dashed lines. It is clear that the L-intervals on Bp with respect to point x are the intervals formed by intersection of Bp and the subdivision mentioned above considering x as the source point. 3.2 The Nonconvex Case In the nonconvex case, the shortest path between two points may pass through vertices of the polyhedron. Suppose v be the last vertex on the shortest path  from x to y.  consists of two optimal subpaths: one from x to v and one from v to y, while the latter can be characterized by the edge sequence connected with it. We may view each vertex v as a pseudo-source with an initial distance equal to the length of the shortest path from the source to it. This causes the shortest path tree to di er slightly from the convex case by introducing some vertex nodes in it which correspond to pseudo-sources. However the time and space needed to construct the tree remains the same. In this case the subdivision of the surface is obtained by constructing the Voronoi diagram on the inward layout of the polyhedron with respect to the images of the source and pseudo-sources. For a point in the region corresponding to one pseudo-source, the shortest path is obtained by rst nding the shortest path from source to the vertex associated by the pseudo-source, then following the edge sequence speci ed by the subdivision region. In this case an L-interval on Bp with respect to x has the property that there is a vertex v of the polyhedron which every shortest path from x to a point on the interval passes through v as the last vertex, and the edge sequence from v to points on the interval is the same. As the rst part of the path is xed among the points on interval, given an L-interval I with respect to s and t we can still nd the point q(I) whose total distance from s and t is minimum in constant time provided that during computing intervals we store the distance to pseudo-source associated with the interval. 3.3 Analysis of the Algorithm We consider two stages for the algorithm: computing L-intervals with respect to the pair s and t, and nding the shortest p-visible path. The rst stage is analyzed by the following two lemmas. Lemma 3. The number of L-intervals on Bp with respect to a point is O(n2 C(Bp )) where C(Bp ) is the number of connected components of Bp . Proof. From lemma 1 we know the intersection of any edge sequence corresponding to a shortest path with each edge of Bp is at most one L-interval. From this, we can conclude that the total number of intervals on each edge of Bp is O(n). As in general, each connected component of Bp has O(n) edges, the total number of L-intervals on Bp is O(n2C(Bp )). t u Thus in worst case, there are O(n2) and O(n3) L-intervals on Bp for convex and nonconvex polyhedra respectively. It can be shown that the bound in lemma 3 is tight. As an example, in Fig. 7(b), Rp consists of all faces adjacent to the top vertex p, and the subdivision with respect to x intersects Bp in O(n2) edges if the number of faces added to the diamond polyhedron (Fig. 7(a)) be O(n). p x (a) Fig. 7. (b) (a) A diamond polyhedron which have O(n) sides (b) Diamond polyhedron with a number of faces added to it. Lemma 4. Computing L-intervals on Bp with respect to the pair s and t can be done in O(n2 logn) for convex and O(n3 log n) for nonconvex polyhedra. Proof. Computing the set of L-intervals with respect to a point x requires two steps: 1. Computing the inward layout and building the subdivision 2. Computing the intervals formed by intersecting Bp with the subdivision. The rst step can be done in O(n2) time in both convex and nonconvex cases while the resulting subdivision has O(n) regions [2]. For computing the intervals we consider the two cases separately: Convex case. In this case Bp consists of O(n) segments so O(n2 logn) time is sucient for the computation of L intervals with respect to x using known map overlay algorithms. It can be shown that there are polyhedra for which this time bound is necessary. Nonconvex case. In this case Bp consists of O(n2 ) segments so O(n3 log n) time is needed for computing intervals. Thus the total time required for computing the set of L-intervals with respect to a point x is In O(n2 logn) in convex case and O(n3 logn) in nonconvex case. After computing L-intervals with respect to s and t, we can nd the overlapping intervals proportional to the number of intervals with respect to s and with respect to t. From the lemma 3, overlapping can be done in O(n2 ) for convex case and in O(n3) for nonconvex case. t u Theorem 1. The time required for computing shortest p-visible path between two points s and t is O(n2 log n) for convex and O(n3 log n) for nonconvex polyhedra. Proof. From the lemma 4, one can nd the L-intervals on Bp in O(n2 log n) for convex and O(n3 logn) for nonconvex polyhedra. From lemma 2 we can nd in constant time, the point q(I) on each L-interval I whose total distance from s and t is minimum. As the number of intervals is O(nC(Bp )), nding the point q with minimum total distance from s and t is possible in O(n2 C(Bp )). which is asymptotically less than the time required for nding the intervals in both cases. After nding point q, one can easily construct the shortest p-visible path between s and t in time O(k) where k is the number of edges connected by the path (which is O(n)). Thus the total time required by the algorithm is O(n2 log n) for convex and O(n3 logn) for nonconvex cases. t u 4 Conclusions We proposed an algorithm for nding the shortest path between two points on general polyhedra from which a given point is visible. The running time of our algorithmis O(n2 log n) for convex and O(n3 log n) for nonconvex polyhedra. The algorithm uses the inward layout and the subdivision based on it. Extending the algorithm to the case in which we want to see multiple points from the path is not easy since it introduces multiple regions (neighborhoods) which must be touched by the shortest path. The problem is similar to TSP with neighborhoods which is studied in [4]. Since the problem is NP-hard, nding an approximation algorithm seems to be the most feasible approach for solving it. References 1. M. de Berg and M. van Kreveld, Trekking in the Alps Without Freezing or Getting Tired, Algorithmica, 18:306-323, 1997. 2. J. Chen and Y. Han, Shortest Paths on a Polyhedron, Iternat. J. Comput. Geom. Appl., 6:127-144, 1996. 3. S. Kapoor, Ecient Computation of Geodesic Shortest Paths, In Proc. 32nd Annu. ACM Sympos. Theory Comput., 1999. 4. C. S. Mata and J. S. B. Mitchell, Approximation Algorithms for Geometric Tour and Network Design Problems, In Proc. 11th Annu. Sympos. Comput. Geom., pp. 360-369, 1995. 5. J. S. B. Mitchell, D. M. Mount and C. H. Papadimitriou, The Discrete Geodesic Problem, SIAM J. Comput., 16:647-668, 1987. 6. J. O'Rourke, Visibility, In J. E. Goodman and J. O'Rourke, eds., Handbook of Discrite and Computational Geometry, chapter 25, pp. 467-480, CRC Press LLC, Boca Raton, FL, 1995. 7. M. Sharir and A. Schorr, Shortest Paths in Polyhedral Spaces, SIAM J. Comput., 15:193-215, 1986.