327 Kragujevac J. Math. 30 (2007) 327–342.
ALGORITHMS FOR INVESTIGATING OPTIMALITY OF CONE TRIANGULATION FOR A POLYHEDRON
Milica Stojanovi´ c and Milica Vuˇ ckovi´ c Faculty of Organizational Sciences, Jove Ili´ca, 11000 Beograd, Serbia (e-mails:
[email protected],
[email protected])
(Received October 25, 2006)
Abstract. The problem of finding minimal triangulation of a given polyhedra (dividing polyhedra into tetrahedra) is very actual now. It is known that cone triangulation for a polyhedron provides the smallest number of tetrahedra, or close to it. In earlier investigations when this triangulation was the optimal one, it was shown that conditions for vertices to be of the order five, six or for separated vertices of order four was only the necessary ones. It was shown that then if it exists the ”separating circle” of order less then six, for two vertices of order six, cone triangulation is not the minimal one. Here, test algorithms will be given, for the case when the given polyhedron has separating circle of order five or less.
1. INTRODUCTION
It is known how to divide any polygon with n − 3 diagonals into n − 2 triangles without gaps and overleaps. Such a division is called triangulation. The generalization of this process to higher dimensions is also called triangulation. It divides polyhedron (polytope) into tetrahedra (simplices). Problem of triangulation in higher dimensions is much more complicated. It is impossible to triangulate
328 some nonconvex polyhedra [7] in three-dimensional space, and it is also proved that triangulations of the same polyhedron may lead to different numbers of tetrahedra [5], [8]. Considering the smallest and the largest number of tetrahedra in triangulation (the minimal and the maximal triangulation, respectively), the authors obtained values, which linearly, resp. squarely depend on the number of vertices. Some characteristics of triangulation in three-dimensional space are given by Chin, Fung, Wang [3], Develin [4] and Stojanovi´c [9, 10, 11]. In this paper we shall consider convex polyhedra in which every 4 vertices are noncoplanar and all faces are triangular. Furthermore, all considered triangulations are face to face. The number of edges from the same vertex will be called the order or degree of the vertex. In Section 2 previous results are summarized while in Section 3 method for finding separating circle with five or less edges is described. Section 4 is about graphs and their applications to this problem. Abstract data type (ADT) of graph is also presented [2, 6], including some elementary properties, and also two main data structures for representing graphs are given. In Sections 6 and 7 we will provide two graph algorithms. These algorithms work on the graphs of polyhedron representations. We would like to thanks to dr Emil Molnr for improving the text and suggesting usage of the term separating circle.
2. PREVIOUS RESULTS
One of the triangulations, which gives a small number of tetrahedra, is the cone triangulation [8] described as follows. One of the vertices is the common apex, which builds a tetrahedron with each triangular face of the polyhedron, except containing the vertex starting with. By Eulers theorem, a polyhedron with n vertices has 2n − 4 faces if all of them are triangular. So, the number of tetrahedra in triangulation is 2n − 10 at most, since, for n ≥ 12, each polyhedron has at least one vertex of order 6 or more. Sleator, Tarjan and Thurston in [8] considered some cases of ”bad” polyhedra, which need a large
329 number of tetrahedra for triangulation. It is proved, using hyperbolic geometry, that the minimal number of triangulating tetrahedra is close to 2n − 10. That value is tight for certain series of polyhedra, which exists for a sufficiently large n. Computer investigation of the equivalent problem of rotatory distance confirms, for 12 ≤ n ≤ 18, that there exist polyhedra, with the smallest necessary number of tetrahedra equal to 2n − 10. This was the reason why the authors gave a hypothesis that the same statement is true for any n ≥ 12. To prove this hypothesis, it would be enough to check those cases where the cone triangulation of polyhedra gives the smallest number of tetrahedra, and to show how to improve that in other cases. With this aim, in [8] the authors gave a polyhedron example which has vertices of great order and for which there exists a triangulation better than the cone one. They also gave advices how to improve the method in this and some similar cases. Anyway, the polyhedra with vertices of great order give less than 2 n−10 tetrahedra in the cone triangulation, so, vertices of small order are considered in [9, 10, 11]. The obtained results are as follows: Theorem 2.1. Let V be one of the vertices of a polyhedron P whose order is maximal. If the polyhedron P has a vertex of order 3 different and not connected with V, or a sequence of at least 2 vertices of order 4 connected with a chain, each of them not connected with V, then the cone triangulation of P with apex V will not give the smallest number of tetrahedra. Remark When V is connected with a vertex at the end of chain the cone triangulation is not the minimal one whenever the chain contains at least 3 vertices. Besides the order of vertices it is also necessary to consider the order of separating circle (now is better then in [11] called it separating ring). Let us define the following: • A circle of p vertices of the polyhedron P is a p-sided closed polygon A1 , A2 , ..., Ap where Ai (i = 1, ... , p) are different vertices of P and Ai Ai+1 (i = 1, ... , p-1), Ap A1 are edges of P. • Let c be a circle on the polyhedron P, moreover M and N two vertices of P
330 different from Ai . If all paths on P with end points M and N pass through some of the vertices Ai then we say that a separating circle c separates M and N. We also say that M and N are on the different sides of c. If the circle c does not separate the vertices M and N, they are on the same side of the circle. Theorem 2.2. If a polyhedron contains a circle of p vertices, which separates vertices A and B of order ν(A) and ν(B), where ν(A) ≥ ν(B) > p, then the cone triangulation with apex A is not the minimal one. From everything mentioned before, it is clear that candidates for the minimal triangulation with 2n − 10 tetrahedra, are polyhedra with all vertices of order 5 or 6, occasionally some of order 4 which are not connected between themselves, and with separating circles of order six or more. Condition for order of circles will be considered here, while conditions for order of vertices are considered in [12].
3. METHOD OF FINDING SEPARATING CIRCLE OF ORDER AT MOST FIVE
The first of all it is necessary to find the series of neighbor circles in the following way: Start with a vertex of the polyhedron and take all its neighbor vertices. They are connected to form a circle - the first one in series. The new neighbor vertices of those in the first circle form the second circle. The third circle is formed of new neighbors of the vertices of the second circle, and so on. The process is finished when unused neighbors of the vertices of the last circle form a chain, not a circle. If in this series of neighbors circles all of them (except may be the first and the last one) are of order six or more, then we are searching for a circle of smaller order. Let p, q, r denote consequitive neighbour circles of order at least six. Let a circle now be inserted with A1 , A2 , ..., Ak (k = 3, 4,5) and edges Ai Ai+1 (i = 1, ... , k-1), Ak A1 . Then there are the following combinatorial possibilities: a) Vertex A1 lies on p, A2 , A3 are on q;
331 b) Vertices A1 , A2 lie on p, A3 , A4 are on q; c) Vertices A1 , A3 lie on p, A2 , A4 are on q; d) Vertex A1 lies on p, A2 , A3 are on q and A4 is on r; e) Vertices A1 , A2 , A3 lie on p, A4 , A5 are on q; f ) Vertices A1 , A3 , A4 lie on p, A2 , A5 are on q; g) Vertex A1 lies on p, A2 , A3 , A4 , A5 are on q; h) Vertex A1 lies on p, A2 , A5 are on q, A3 , A4 are on r. In cases when vertices Ai are positioned on two of neighbor circles p and q, our inserted circle A1 , ..., Ak have to separate other vertices of the circle p from those of circle q. Although these cases have more subcases, if we require vertices to have order not greater then six, then the only possible case is e) when p is circle of order six. For example in case a) vertices A2 and A3 have to be connected with as follows: themselves, each of them with neighbor vertex of q, each with at least one vertex of another neighbor circle, and with all vertices of circle p (of order at least 6) - both with A1 and one more vertex. That means that sum of orders of vertices A2 and A3 is at least 14 so, at least one of them have order greater than 6.
4. GRAPH METHODS
In the present paper, the graph structure is used as a model for polyhedron representation [1]. Graph provides more natural and consistent approach for this class of algorithms. Viewed abstractly, a graph G = (V, E) consists of a set V of vertices and a set E of edges connecting the vertices in V. An edge e = (u, v) is a pair of two vertices u and v. The vertices u and v are called endpoints of the edge (u, v).
332 An abstract data type (ADT) is a mathematical model of a data structure that specifies the type of data stored, the operations supported on them, and the types of parameters of the operations. An ADT specifies what each operation makes, but it does not describe the way. In modern object-oriented program languages, (such as Java and C#) an ADT can be expressed by an interface, which is simply a list of method declarations. An ADT is realized by a concrete data structure, which is modeled in objectoriented program languages by a class. A class defines the data stored and the operations supported by the objects that are instances of the class. Also, unlike interfaces, classes specify how the operations are performed. A Java class is said to implement an interface if its methods give life to all of those of the interface. As an abstract data type, a graph is a positional container whose positions are its vertices and its edges. Hence, the graph ADT stores elements at either its edges or vertices (or both). A position in graph is always defined relatively, that is, in terms of its neighbors. To abstract and unify the ways of storing elements in the various implementations of a graph, we introduce the concept of position in a graph, which formalizes the intuitive notion of ”place” of an element relative to others in the graph. A position itself is an abstract data type that supports a simple element() method, which returns to the element that is stored at this position. We also use specialized iterators for vertices and edges. An iterator is an enumeration whose traversal order can be guaranteed in some way. In order to simplify the presentation, we denote with v a vertex position and with e an edge position. There are admittedly a lot of methods in the graph ADT. Some methods, however, is unavoidable to a certain extent, since graphs are rich structures. We need different methods for accessing and updating some positions in a graph, as well as dealing with the relationships that can exist between these positions. We divide the graph methods into three main categories: general methods, accessor methods and methods for updating and modifying graphs. We do not discuss error conditions that may occur. In addition, we take into consideration only methods for dealing with
333 undirected edges. We begin by describing the fundamental methods for a graph, which ignore the direction of the edges. Each of the following methods returns global information about a graph G: numVertices() Return the number of vertices in G numEdges() Return the number of edges in G vertices() Return an iterator of the vertices of G edges() Return an iterator of the edges of G The following accessor methods take vertex and edge positions as arguments: degree(v) Return the degree of v. adjacentVertices(v) Return an iterator of the vertices adjacent to v. incidentEdges(v) Return an iterator of the edges incident upon v. opposite(v,e) Return the endpoint of edge e distinct from v. areAdjacent(v,w) Return whether vertices v and w are adjacent. We can also allow for update methods that add or delete edges and vertices: insertEdge(v,w)
Insert and return an undirected edge between vertices v and w insertVertex(v) Insert and return a new (isolated) numbering vertex v storing the object o at this position removeVertex(v) Remove vertex v and all its incident edges removeEdge(e) Remove edge e In order to perform graph algorithms in a computer, we have to decide how to store the graph. There are several ways to realize the graph ADT with a concrete data structure. In this section, we discuss two popular approaches, usually referred to as the adjacency list structure and the adjacency matrix, [2, 6]. There is a fundamental difference between the adjacency list and the adjacency matrix. The adjacency list structure only store the edges actually present in the graph, while the adjacency matrix stores a placeholder for every pair of vertices (whether there is an edge between them or not). This difference implies that, for a graph G with n vertices and m edges, an edge list or adjacency list representation uses O(n + m) space, whereas an adjacency matrix representation uses O(n2 ) space.
334 5. ALGORITHM FOR FORMING NEIGHBOR CIRCLES
Input to the algorithm is an undirected graph G with n vertices and the specific starting vertex s ∈ G. This algorithm forms circles C0 , C1 , . . . , Cm and lists L0 , L1 , . . . , Lm−1 . Each Ci represents neighbor circle. Each list Li store the edges whose connect pairs (u,v) of vertices, where u ∈ Ci and v ∈ Ci+1 . 1. We begin with initializing graph (circle) C0 so it contains a specific vertex s 2. At each iteration, the algorithm forms a new graph (circle) Ci+1 and a new list Li . The process is repeated until the graph G becomes empty 3. For each vertex w ∈ Ci we find its incident edges in the graph G. Algorithm for each discovered edge (w,q) i. insert sits endpoint q to graph Ci+1 ii. inserts edge (w,q) to the list Li iii. removes edge (w,q) from the graph G 4. Away, algorithm for each vertex w ∈ Ci+1 finds all vertices in G adjacent to vertex w; for each found vertex v ∈ G adjacent to w we check if v in Ci+1 . If vertex v ∈ Ci+1 then edge (w,v) is inserted in Ci+1 . 5. When Ci+1 is formed then all edges in Ci+1 are removed from G. We give the pseudo-code for this algorithm in Figure 1. Algorithm for forming neighbor circles Input: An undirected graph G with n vertices and a specific starting vertex s∈G Output: Graphs C0 , C1 , . . . , Cm and lists L0 , L1 , . . . , Lm−1 initialize circle graph C0 to contain a specific vertex s; i = 0; while (G is not empty) { create circle graph Ci+1 to initially be empty;
335 initialize new empty list Li ;// list store edges which connect two adjacency graph Ci and Ci+1 for each vertex w in Ci .vertices() { for each edge e in G.incidentEdges(w) { q = G.opposite(w,e);// returns the endpoint of edge e distinct from w Ci+1 .insertVertex (q); // Add vertex q to graph Ci+1 Li .insertLast((w , q)); //edge (w,q) connects two vertices w and q, w ∈ Ci , q ∈ Ci+1 G.removeEdge((w,q)); // remove edge (w,q) from G } } for each w in Ci+1 .vertices() // add edges to graph Ci+1 { for each v in G.adjacentVertices(w) { if (Ci+1 .containsVertex (v )) then Ci+1 .insertEdge((w , v )); } } for each e in Ci+1 .eges() { G.removeEdge(e); // remove edge e from G } i++; } m=i-1; writeLine(”formed neighbor circles”); for ( i = 0; i