Algorithm 860: SimpleS—An Extension of Freudenthal's ... - CiteSeerX

0 downloads 0 Views 268KB Size Report
The proposed simplex subdivision algorithm is motivated by a problem in the field ... Edelsbrunner and Grayson [2000] that is related to the construction used by.
Algorithm 860: SimpleS—An Extension of Freudenthal’s Simplex Subdivision EDUARDO N. GONÇALVES Federal Center of Technological Education of Minas Gerais and REINALDO M. PALHARES, RICARDO H. C. TAKAHASHI, and RENATO C. MESQUITA Federal University of Minas Gerais

This article presents a simple efficient algorithm for the subdivision of a d -dimensional simplex in k d simplices, where k is any positive integer number. The algorithm is an extension of Freudenthal’s subdivision method. The proposed algorithm deals with the more general case of k d subdivision, and is considerably simpler than the RedRefinementND algorithm for implementation of Freudenthal’s strategy. The proposed simplex subdivision algorithm is motivated by a problem in the field of robust control theory: the computation of a tight upper bound of a dynamical system performance index by means of a branch-and-bound algorithm. Categories and Subject Descriptors: I.3.5 [Computer Graphics]: Computational Geometry and Object Modeling—Geometric algorithms, languages, and systems General Terms: Algorithms Additional Key Words and Phrases: Simplex subdivision, mesh generation

1. INTRODUCTION AND PROBLEM STATEMENT This work presents a simple algorithm for the subdivision of a d -dimensional simplex in k d simplices, inspired in the color scheme concept introduced by Edelsbrunner and Grayson [2000] that is related to the construction used by Goodman and Peters [1995]. In Edelsbrunner and Grayson [2000], an abacus This work has been supported in part by the Brazilian agencies CNPq, and FAPEMIG. Authors’ addresses: E. N. GonÇalves, Department of Electrical Engineering, Federal Center of Technological Education of Minas Gerais, Av. Amazonas 7675, 31510-470, Belo Horizonte, MG, Brazil; R. M. Palhares (corresponding author), Department of Electronics Engineering, Federal University of Minas Gerais, Av. Antˆonio Carlos 6627-31270-010, Belo Horizonte, MG, Brazil; email: [email protected]; R. H. C. Takahashi, Department of Mathematics, R. C. Mesquita, Department of Electrical Engineering, Federal University of Minas Gerais, Av. Antˆonio Carlos 6627-31270010, Belo Horizonte, MG, Brazil. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or direct commercial advantage and that copies show this notice on the first page or initial screen of a display along with the full citation. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, to redistribute to lists, or to use any component of this work in other works requires prior specific permission and/or a fee. Permissions may be requested from Publications Dept., ACM, Inc., 2 Penn Plaza, Suite 701, New York, NY 10121-0701 USA, fax +1 (212) 869-0481, or [email protected].  C 2006 ACM 0098-3500/06/1200-0609 $5.00 ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006, Pages 609–621.

610



E. N. GonÇalves et al.

model of a simplex, denoted the color scheme, is proposed to subdivide a d simplex into k d d -simplices of the same volume and shape characteristics. This article presents a ready-to-implement algorithm for automatic generation of color schemes for the general k d case. In the case of 2d subdivision, the proposed algorithm provides the same results as the refinement strategy proposed in 1942 by H. Freudenthal that is refereed in Bey [2000] as regular (or red) refinement. The proposed algorithm, even when dealing with the more general case of k d subdivision, is considerably simpler than the RedRefinementND algorithm for implementation of Freudenthal’s strategy presented in Bey [2000]. In this work, the motivation for the development of a simplex subdivision comes from a problem in the field of control theory. Considering the d dimensional space of the uncertain parameters of a dynamical system, this article deals with the problem of splitting a polytope type region of such space into smaller polytopes (d -simplices) such that an upper bound of a certain system performance index (calculated using all the polytope vertices simultaneously) and a lower bound for this performance index (calculated for each polytope vertex) become closer as the size of the simplices becomes smaller. This is the basis for a branch-and-bound algorithm for finding the value of such an index, up to a predefined -precision. A large class of such indices can be defined on the basis of some linear matrix inequality formulations, including system H2 and H∞ norms. In this article, the focus is kept on the problem of polytope subdivision. However, this kind of strategy also seems to be of some interest for numerical cubature of a vector of functions over a collection of n-dimensional simplices, as in Genz and Cools [2003]. As the parameter initial polytope can have an arbitrary shape, a Delaunay triangulation is applied first for the generation of the mesh of simplices, which is the input for the simplex subdivision algorithm that performs the subsequent refinement process. The only requirement for the mesh, imposed by the specific application of interest, is the property of “stability,” which means that the simplices should not degenerate (interior angles are bounded uniformly away from zero) during the refinement process [Bey 2000]. We can refer to Bey [2000] for a detailed discussion about subdivision techniques. The technique treated in this work has the following characteristics that are suitable for the considered application [Edelsbrunner and Grayson 2000]: (1) all generated simplices have the same d -dimensional volume; (2) all generated simplices fall into, at most, d2! congruence classes, which is an optimal value according to Bey [2000]; (3) the faces of the simplex are subdivided the same way; (4) repeated subdivision has the same effect as increasing k; (5) the points generated by the color scheme are affinely independent; and (6) the technique can be applied to any given triangulation. Theorems, with proofs, related to some of the aforementioned characteristics are found in Edelsbrunner and Grayson [2000]. ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.

Algorithm 860: SimpleS



611

2. SUBDIVISION OF A SIMPLEX A closed subset T ⊂ Rd is called a m-simplex, 0 ≤ m ≤ d , if T is the convex hull of m + 1 vertices p0 , . . . , pm ⊂ Rd [Bey 2000]:  T = { p0 , . . . , pm } 

  m   p= λ j pj  λ = 1; λ j ∈ [0, 1], 0 ≤ j ≤ m ,  j =0 j j =0 m 

(1)

If m = d , the set T is simply called simplex of Rd . The 2- and 3-simplices correspond to triangles and tetrahedra, respectively. The algorithm proposed here to implement a subdivision of a d -dimensional simplex in k d simplices is based on the color scheme presented in Edelsbrunner and Grayson [2000], which is a new formulation to the construction presented in Goodman and Peters [1995]. Consider a d -simplex T , defined as a sequence of d + 1 points p0 , p1 , . . . , pd that are affinely independent in Rd . Define the notation pχ1 χ2 ...χk  ( pχ1 + pχ2 + · · · + pχk )/k.

(2)

The points that define each new simplex will be obtained from a matrix +1) M ∈ Zk×(d , called the color scheme, whose entries are integer numbers + in the range [0, d ], denoted colors, that represent the indices of the points p0 , p1 , . . . , pd [Edelsbrunner and Grayson 2000]. The i-th column of M will define the point pχ0,i χ1,i ...χk−1,i of the new simplex. In this work, the indices of the rows of M start from 0 instead of 1, as presented in Edelsbrunner and Grayson [2000]. The main characteristics of the color scheme are that its entries are in nondecreasing order when read like text [Edelsbrunner and Grayson 2000] varying from 0 to d [Goodman and Peters 1995]: χ0,0 = 0 ≤ χ0,1 ≤ · · · ≤ χ0,d = χ1,0, ≤ χ1,1 ≤ · · · ≤ χk−1,d = d and the columns are pairwise different in such a way that from the column i − 1 to the column i, only one color is always increased by one. The problem here is how to obtain the k d color schemes to achieve the subdivision. The main contribution of this work is a simple algorithm to obtain all the color schemes. Each color scheme will be created row-by-row starting from χ0,0 = 0. To find out if the next entry will be kept or increased by one, it is necessary to represent the index of the new simplex, n = 0, 1, . . . , k d − 1, in the numerical system with base k: n10 = xd −1 × k d −1 + xd −2 × k d −2 + · · · + x1 × k + x0 × k 0 ≡ xk ,

(3)

where n10 means that n is represented in the decimal base and xk means that x is represented in the base k. The values of the digits xd −i , i = 1, 2, . . . , d , will determine which row of column i − 1 will be increased by one to generate the column i, and are related to the map U → FU considered in Goodman and Peters [1995]. The following row starts with the last color in the preceding row, ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.

612



E. N. GonÇalves et al.

Fig. 1. Partition of a triangle by means of an edgewise subdivision.

that is, χi,0 = χi−1,d . This idea is implemented by the following algorithm: Algorithm SIMPLES for n = 0, 1, . . . , k d − 1 do xd −1 · · · x0 ← convert n to base k; color ← 0; for i = 0, 1, . . . , k − 1 do n χi,0 ← col or; for j = 1, . . . , d do if xd − j = i then color ← color + 1; end n χi,j ← color; end end end end algorithm

In the case of 2d subdivision, the proposed algorithm provides the same results of the refinement strategy proposed in 1942 by H. Freudenthal that is refereed in Bey [2000] as regular (or red) refinement. The proposed algorithm, even dealing with the more general case of k d subdivision, is considerably simpler than the RedRefinementND algorithm for implementation of Freudenthal’s strategy presented in Bey [2000]. The edgewise subdivision k d = 22 of a triangle is shown in Figure 1. This simple subdivision is presented for the purpose of illustrating how the algorithm works. In this case, the color schemes M n ∈ Z2×3 + , n = 0, . . . , 3 are:  n = 0 ⇒ 010 ≡ 002 ⇒ M 0 =  n = 1 ⇒ 110 ≡ 012 ⇒ M 1 =  n = 2 ⇒ 210 ≡ 102 ⇒ M 2 =

0 1 2 2 2 2 0 1 1 1 1 2 0 0 1 1 2 2

ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.



 

Algorithm 860: SimpleS



613

Fig. 2. Partition of a tetrahedron by means of a 23 edgewise subdivision.

 n = 3 ⇒ 310 ≡ 112 ⇒ M 3 =

 0 0 0 . 0 1 2

Remember that the digit of the representation of the index n, in base 2, informs in which row the change in color occurs. Considering each column in the preceding color schemes, the four subtriangles can be derived as { p02 , p12 , p22 }, { p01 , p11 , p12 }, { p01 , p02 , p12 }, and { p00 , p01 , p02 }, as presented in Figure 1, where according to Eq. (2), pij = ( pi + p j )/2 and pii = pi . Consider now the subdivision of a tetrahedron in k d = 23 subtetrahedra. The color schema is formatted as   χ0,0 χ0,1 χ0,2 χ0,3 M = . χ1,0 χ1,1 χ1,2 χ1,3 As mentioned before, in this case the proposed algorithm generates the same eight subtetrahedra listed in the RedRefinement3D presented in Bey [2000], obeying the same vertex order, which is necessary to guarantee the stability of the refinement algorithm [Bey 2000]. For example, to compute the subtetrahedron with n = 6, the change of colors will be specified by 6 in the base 2, that is, x = 1102 , which means that the first two changes occur in row 1, and the third occurs in row 0:   0 0 0 1 6 M = . 1 2 3 3 This color scheme shows that the subtetrahedron is defined by the set { p01 , p02 , p03 , p13 }, as shown in Figure 2. Consider now the subdivision of a triangle into k d = 32 subtriangles, with n = 0, 1, . . . , 8. For n = 8, represented in base 3 as x = 223 = 2 × 31 + 2 × 30 , the subtriangle will be specified by the color scheme: ⎡ ⎤ 0 0 0 0 0⎦ M8 = ⎣ 0 0 1 2 that corresponds to { p000 = p0 , p001 , p002 }. ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.

614



E. N. GonÇalves et al.

Fig. 3. Partition of a tetrahedron into 33 subdivisions.

As another example of 3d subdivision, consider the Figure 3, which shows two subtetrahedra, in k d = 33 subdivision, generated by the color schemes: ⎡ ⎤ 0 1 1 1 1 2 3⎦ 410 = 0 × 32 + 1 × 31 + 1 × 30 = 0113 ⇒ M 4 = ⎣ 1 3 3 3 3 ⎡ ⎤ 0 0 0 0 1 1 ⎦. 1710 = 1 × 32 + 2 × 31 + 2 × 30 = 1223 ⇒ M 17 = ⎣ 0  1 1 1 2 3 As a final demonstration, the abacus presented in Figure 3 in Edelsbrunner and Grayson [2000], dealing with a 37 subdivision, can be generated by the proposed algorithm: 137110 = 1 × 36 + 2 × 35 + 1 × 34 + 2 × 33 + 2 × 32 + 1 × 31 + 0 × 30 ≡ 12122103 ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.

Algorithm 860: SimpleS



615



12122103 ⇒ M 1371

⎤ 0 0 0 0 0 0 0 1 2 3 3 3 4 4 ⎦. =⎣1 2 4 4 5 5 6 7 7 7

3. EXAMPLE IMPLEMENTATION OF THE PROPOSED ALGORITHM The edgewise subdivision algorithm implementation in MATLAB is presented now: function T = simples(k,d) % T = simples(k,d) generates the k^d color schemes to % be used in the d_dimensional simplex subdivision % T is a cell array where each cell contains a matrix with % the colors of the color scheme. for n = 1:(k^d) x = dec2base(n-1,k,d); cor=0; for i = 1:k CS(i,1)=cor; for j = 1:d if x(d+1-j) == (i-1) cor = cor+1; end CS(i,j+1) = cor; end end T{n} = CS; end %-----------------------------------------function y = dec2base(x,b,n) % y = dec2base(x,b,n) converts the decimal number x to % y in base b with n digits: % y(1)+y(2)*b+y(3)*b^2+...+y(n)*b^(n-1) = x for i = 1:n d = fix(x/b); y(i) = x-d*b; x = d; end The function fix(X) rounds the elements of X to the nearest integers towards zero. In this implementation, the indices of the color scheme rows and columns start with 1, instead of 0, due to a MATLAB constraint. The following function in MATLAB can be used to draw the simplex subdivision in the case of 2 or 3 dimensions: function draw_simplices(S,T) % draw_simplices(S,T) draws the simplex subdvision % in 2 or 3 dimension % S: each column corresponds to the vertex ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.

616



E. N. GonÇalves et al.

% coordinates of the simplex % T: Cell array with the k^d color schemes, % generated by the function color_schemes(), % defining the vertices of each the new simplices d = size(S,1); k = size(T{1},1); figure, hold on for i=1:max(size(T)) chi = T{i}; P = zeros(d,d+1); for j = 1:d+1 for m = 1:k P(:,j)=P(:,j)+S(:,chi(m,j)+1)/k; end end draw_splx(P,chi) end hold off %-----------------------------------function draw_splx(P,X) % Draw lines connecting the vertices [d,k]=size(P); for i=1:k-1 for j=i+1:k if d == 2 plot(P(1,[i j]),P(2,[i j])) else plot3(P(1,[i j]),P(2,[i j]),P(3,[i j])) end end end The following commands in MATLAB generate a 102 subdivision of a 2-simplex with the vertices {(x, y)} = {(0, 0), (1, 0.2), (0.6, 1)}. The resulting graphic is shown in Figure 4. S2 = [0 1.0 0.6 0 0.2 1.0] T=simples(10,2); draw_simplices(S2,T) The following commands in MATLAB generate a 63 subdivision of a 3-simplex with the vertices {(x, y, z)} = {(0, 1, 0), (0.5, 0, 0), (1, 1, 0), (0.5, 0.5, 1)}. The resulting graphic is shown in Figure 5. S3 = [0.0 1.0 0.0

0.5 0.0 0.0

1.0 1.0 0.0

0.5 0.5 1.0]

ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.

Algorithm 860: SimpleS



617

Fig. 4. Partition of a triangle into 102 subtriangles.

Fig. 5. Partition of a tetrahedron into 63 subtetrahedra.

ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.

618



E. N. GonÇalves et al.

T=simples(6,3); draw_simplices(S3,T) view(-15,15)

4. THE BRANCH-AND-BOUND ALGORITHM This section presents an example application of the proposed algorithm inside a branch-and-bound (BnB) algorithm that performs a dynamical system analysis. It is not the purpose of this work to explain in detail the BnB algorithm. We can refer to Balakrishnan et al. [1991] for a complete description of BnB principia. The BnB algorithm can be used to find the global maximum of a function f ( p) : Rd → R, where p ∈ Pinit and Pinit is a polytope (convex hull of a finite number of vertices). For a region P ⊆ Pinit , we can define max (P)  max f ( p). p∈P

(4)

The BnB algorithm computes max (Pinit ) based on two functions, lb (P) and ub (P), defined over {P : P ⊆ Pinit }. These two functions must satisfy the following conditions: lb (P) ≤ max (P) ≤ ub (P)

(5)

∀  > 0, ∃ δ > 0 such that ∀ P ⊆ Pinit , size(P) ≤ δ ⇒ ub (P) − lb (P) ≤ 

(6)

and

Condition (6) establishes that as the maximum half-length of the sides of P, denoted by size(P), goes to zero, the difference between the upper and lower bounds converges to zero. In this way, it is necessary to subdivide region Pinit into smaller regions article that Pinit = P1 ∪P2 ∪. . .∪P S , and to compute lb (Pi ) and ub (Pi ), i = 1, . . . , S. Then, max lb (Pi ) ≤ max (Pinit ) ≤ max ub (Pi )

1≤i≤S

1≤i≤S

provides new bounds on max (Pinit ). If the difference between the new bounds is less than or equal to , the algorithm terminates. Otherwise, the partition of Pinit is further refined and the bounds updated. To improve the BnB algorithm, only the region Pi where ub (Pi ) = max1≤i≤S ub (Pi ) is subdivided. The BnB algorithm is presented now [Balakrishnan et al. 1991]: Algorithm k ← 0; L0 ← {Pinit }; L0 ← lb (Pinit ); U0 ← ub (Pinit ); while Uk − Lk >  do ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.

Algorithm 860: SimpleS



619

Fig. 6. Evolution of lb (P) and ub (P).

pick P ∈ Lk such that ub (P) = Uk ; split P into P1 , . . . , P S Lk+1 ← (Lk − {P}) ∪ {P1 , . . . , P S }; Lk+1 ← maxP∈Lk+1 lb (P); Uk+1 ← maxP∈Lk+1 ub (P); exclude all P ∈ Lk+1 such that ub (P) < Lk+1 ; k ← k + 1; end end

The partition of Pinit in the BnB algorithm can be accomplished in several different ways. In this work, the well-known Delaunay triangulation is used to split the initial space Pinit into triangles in 2-dimensions (tetrahedra in 3dimensions or simplices in d -dimensions). There is a close relationship between the Delaunay triangulation of a point set S and the convex hull of the “lifting transformation” [de Berg et al. 1998] of these points in one higher dimension. Therefore, algorithms to compute the convex hull in d + 1 dimensions can be used to compute the Delaunay triangulation in d dimensions. This is performed in the MATLAB function delaunayn, which is based on the Quickhull algorithm [Barber 1996]. After the triangulation of Pinit , the adaptive refinements are performed by the edgewise subdivision technique [Edelsbrunner and Grayson 2000] implemented by the proposed algorithm. Figure 6 shows an example of the evolution of the lower and upper bound functions, with partition of the parameter space, in the computation of a ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.

620



E. N. GonÇalves et al.

Fig. 7. Partition of Pinit after 58 iterations.

guaranteed cost in a robust controller design. Figure 7 presents the corresponding partition of the polytope in the 2-dimensional parameter space, p = [ p1 p2 ]T ∈ Pinit . The initial polytope is the convex hull of the set {[0 0]T , [0.733 0]T , [1 0.333]T , [1 0.733]T , [0.333 1]T , [0 1]T }. In the first partition, the Delaunay triangulation decomposes the polytope with 6 vertices in 4 triangles (thick lines). After this, in each iteration, the triangle with the worst-case upper bound is subdivided by the proposed algorithm with k = 2. The maximum value is found for p = [0.3688 0.3672]T , where more refinements of the simplicial mesh are necessary. This analysis approach had been applied in a control design problem, as presented in GonÇalves et al. [2005]. 5. CONCLUSIONS We have presented a ready-to-implement algorithm for simplex subdivision that allows the split of a d -dimensional simplex into k d simplices, where all the generated simplices have the same d-dimensional volume. This subdivision technique can be used as a stable refinement strategy. A complete implementation of the algorithm, with test functions, is listed to allow the reader to follow the results presented here. We also presented an example application of a branch-and-bound algorithm that exploits the efficiency of the proposed simplex subdivision algorithm. This application has been used with success by the authors in the analysis and design of robust control systems with different parameter space dimensions. ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.

Algorithm 860: SimpleS



621

REFERENCES BALAKRISHNAN, V., BOYD, S., AND BALEMI, S. 1991. Computing the minimum stability degree of parameter-dependent linear systems. In Control of Uncertain Dynamic Systems, S. P. Bhattacharyya and L. H. Keel, Eds. CRC Press, Boca Raton, FL, 359–378. BARBER, C. B. 1996. The quickhull algorithm for convex hulls. ACM Trans. Math. Softw. 22, 4, 469–483. BEY, J. 2000. Simplicial grid refinement: On freudenthal’s algorithm and the optimal number of congruence classes. Numer. Math. 85, 1, 1–29. DE BERG, M., KREVELD, M. V., OVERMAS, M., AND SCHWARZKOPT, O. 1998. Computational Geometry: Algorithms and Applications. Springer Verlag, Berlin. EDELSBRUNNER, H. AND GRAYSON, D. R. 2000. Edgewise subdivision of a simplex. Discrete Comput. Geom. 24, 707–719. GENZ, A. AND COOLS, E. 2003. An adaptive numerical cubature algorithm for simplices. ACM Trans. Math. Softw. 29, 3, 297–308. GONÇALVES, E. N., PALHARES, R. M., AND TAKAHASHI, R. H. C. 2005. Improved optimisation approach to robust H2 /H∞ control problem for linear systems. IEE Proceedings Control Theory Applications 152, 2, 171–176. GOODMAN, T. N. T. AND PETERS, J. 1995. B´ezier nets, convexity and subdivision on higher dimensional simplices. Comput. Aided Geom. Des. 12, 53–65. Received May 2004; revised December 2005; accepted January 2006

ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.