1648 JOURNAL OF COMPUTERS, VOL. 6, NO. 8, AUGUST 2011 Improvement of Escape Time Algorithm by NoEscape-Point LIU Shuai, CHE Xiangjiu, WANG Zhengxuan College of Computer Science and Technology Key Laboratory of Symbolic Computation and Knowledge Engineering of Ministry of Education Jilin University, Changchun, China Email: [email protected] Abstract—Escape time algorithm is a universal algorithm when to create fractal image. A class of algorithms based on escape time algorithm is wasting-calculation. In this essay, when combined with the feature of eventually periodic point of functions, we define a kind of points as no-escape point. To analyze the shortcomings of the classic algorithm, we improve the escape time algorithm base on the no-escape points. We analyze the algorithm and put forward the best application scope for it. By create lots of fractal figures, we find the figures created by the two algorithms are consistent with each other except a few escape points. We compare the complexity between the two algorithms and find the iteration times by the improved algorithm are less than escape time algorithm when creating the fractal images. We do several experiments and find the improved algorithm is universal and it reduces the time-consuming. Index Terms—fractal; escape time; compute efficiency; universal algorithm; no escape point I. INTRODUCTION Since Mandelbrot constructed the dynamic system fc(z)=z2+c on the computer, which is called M-set, it has considered to be a representative logo of chaotic dynamics[1] and it has been the subject of intense research in the world of fractal geometry and graphics. The thinking and algorithm based on fractal has been used in many sections of computer science soon. There are two basic general algorithms when we create fractal figures. One is escape time algorithm, the other is iterated function system short for IFS. Since a lot of fractal iteration is uncertain, the escape time algorithm is becomes universal algorithm when we create fractal figures of complex initial functions. Nowadays, escape time algorithm and the derivative algorithm of it are the main algorithms when we create complex fractal figures. The escape time algorithm is such an algorithm that it use escape thresholds and the max iteration number to draw iteration trajectory. Specifically, it colors every point in C-plane with different colors by the difference of the iteration number. We show the escape time algorithm as Algorithm a[2]: Algorithm a (Escape Time Algorithm) Step1. Set N as escape threshold number. Set M as the max iteration number. Set mz=0 as the iteration number of point z. Set Nz=z as fn(z) of point z. Step2. For all points z in complex plane, © 2011 ACADEMY PUBLISHER doi:10.4304/jcp.6.8.1648-1653 While mz≤M and |Nz|<N mz=mz+1. Nz=f(Nz). Step3. Color all points z by mz. As basic of algorithm a, if mz>M, the iterations of z is convergence; else is divergence. We know the algorithm needs lots of iterations to create figures. Especially, when the structure of the initial function is complex, the algorithm often requires lots of computation. In this essay, we find two flaws of escape time algorithm. We call it flaw a and b. Flaw a. The convergence points have to do max iterations. Flaw b. When the iteration is in a calculated region, the algorithm does not use the known results. It is a calculate waste. To consider these two flaws, we put forward a new algorithm to improve it by use no-escape points. At first, we put forward the concept of no-escape point and the thinking of the algorithm. Secondly, we put forward the improved algorithm. We also prove the improved algorithm creates better figures and fewer calculations to the classic one. Finally, by create several fractal figures by use both the improved and classic algorithm, we validate the improvement of the new algorithm. II. NO-ESCAPE POINT AND THE IMPROVED THINKING To consider the definition of Julia set (short for J set since), we know that the J set of function f is the repellers of dynamic system of the function. In another words, the J set divided dynamic system into two parts. They are C1={z|fi(z) → ∞ } and C2={z|fi(z) →/ ∞ }. So C1 is divergence and C2 is convergence. When a point of the iterative array is in C1, the iteration is limit to ∞. On the contrary, the iteration is convergence. So it will avoid the repeat calculate if the iteration can be predicted. In addition, when we use the escape time algorithm to create fractal figures by computer, we actually only create the figures in displayed area. It is generally part of the fractal figure. To considered both the display area and iteration number and to extend the definition of escape point, we create a new kind of point called no-escape point and escape point with i order. JOURNAL OF COMPUTERS, VOL. 6, NO. 8, AUGUST 2011 To set the domain of function f is Z, the max iteration number is I, the set of sequence {z, f(z),…, fi(z)} is Hi(z), we give the definition of no-escape point and escape point with i order by definition a. Definition a. To set Q ⊂ Z and ∃ z∈Q make Hi(z) ⊂ Q. When i≥I, we call z as a non-escape point based on f, Q, I. It is short for non-escape point. We called Hi-I (z) is a non-escape sequence of z based on f, Q, I. It is short for non-escape sequence of z. When fi+1(z) ∉ Q, we called z as an escape point with order i+1 based on f, Q, I. It is short for escape point when i=0. We call Hi(z) as an escape sequence with order i+1 of z when i ≤I. We call Hi(z)-Hi-I+1(z) as an escape sequence with order i+1 of z when i>I. The function f is unchanged in escape time algorithm. So when we set Q as the domain of f in the display area, we can call z as a no-escape point with order i or an escape point with order i+1 for short in definition a. As the same, we call Hi(z) as a no-escape sequence with order i or an escape sequence with order i+1. So we can find the following characters easily. Character a. When all attract domain by an attractor of f(z) is complete in displayed area, all points in attract domain are no-escape points. Character b. When all J-set of f(z) is complete in displayed area, all points in J-set are no-escape points. Character c. No-escape sequences in displayed area are convergence by escape time algorithm. Character d. The escape sequence with order i+1 in displayed area is divergence by escape time algorithm. The iteration numbers of divergence are from i-I to 1. In fact, the non-escape point and non-escape sequence are extension of the definition of eventually periodic point and the eventually periodic sequence[3]. It is an corresponding approximate calculation to the computer algorithm. It enhances the speed of the algorithm. In fact, every Hi(z) of z can be calculated in displayed area. Thus, we can predict all points in Hi(z)are escape or not by the calculation of the last point of Hi(z). Therefore, to compare with the escape time algorithm, the improved thinking is reduce lots of iteration number of the points in Hi(z). We illustrate the superiority of the improved thinking by example a and b. In the examples, we set Q as displayed area and f(z) as iteration function of z. Example a. When the no-escape sequence Hi+I(z) ⊂ Q, we calculate Hi(z) by step a and b. Step a. iterate i+I times of z to calculate Hi+I(z). Step b. We affirm the i+1 points {z, f(z), …, fi(z)} are convergence because fi+I(z) is not divergence. We use i+I times iteration of f. It is easy to know that we need (i+I)·(i+1) times iteration of f by escape time algorithm to calculate the i+1 points {z, f(z), …, fi(z)}. So it is less calculate by the improved thinking. Example b. When the escape sequence Hi(z) ⊂ Q, we calculate Hi-1(z) by case a and b. Case a. i≤I+1. Step a. iterate i times of z to calculate Hi-1(z) and fi(z). Step b. We affirm the i+1 points {z, f(z), …, fi(z)} are divergence. The escape order number of fk(z) is i-k. © 2011 ACADEMY PUBLISHER 1649 We use i times iteration of f. It is easy to know that we need i times iteration of f. When we use escape time algorithm to solve the problem, we need to use 1+2+…+i=i•(i+1)/2 times iteration of f because the escape order number of fk(z) is i-k. So it is less calculate by the improved thinking. Case b. i>I+1. The iteration times of the i points by improved thinking is also i. The iteration times by escape time algorithm is (i-I+1)•I+I•(I+1)/2=I(i-I/2+3/2) because HiI(z) in Hi-1(z) is considered to be convergence in the algorithm. In this case, there will be several points with different color by escape time algorithm and the improve thinking. All these points with I times iteration are less than the threshold number N, but with I+1 to i times iteration are more than N. They are considered as convergence by the escape time algorithm and divergence by the improved thinking. To considered algorithm a, the improved thinking is equal to escape time algorithm with larger I by solved these points. From example a and b, we know the improved thinking reduce the iteration times when at the same case of character a~d. Though there may several points with different color in character 4, we can ignore them as they are same to escape time algorithm with larger I. In fact, when we create fractal figures, the part of figures we attend is always J set hereabout. There exist lots of conditions at the same of character a~d. So the improved thinking can improve the creating speed. III. IMPROVE OF ESCAPE TIME ALGORITHM BY NOESCAPE-POINT In this essay, To set the displayed area m×n, we put forward an improved algorithm by definition a and character a~d. The new algorithm needs O(m×n) space. In the algorithm, we set (x,y) as the point x+yi, Count(x,y) as the iteration times at (x,y), Result(x,y) as the result of the mapping of (x,y) by f to Q, Explore(x,y) as f(x,y), logic variable flag as if there exist points are not iterate to the max iteration time, |z| as the module of z, B as the iteration is more than the threshold. In order to describe simple, we call “neighborhood rectangular of a point z” as the unit pixel rectangle (one pixel × one pixel) in Q that contains z. A The Describe of the Algorithm Procedure No-Escape-Point Input. f as the iteration function, Q=(x1,x2)×(y1,y2) as the displayed area, max as the max iteration time, bailout as the threshold. Output. Count(x,y) as the escape iteration times of every pixel in Q. We use them to color all pixels when we create the figure. Step 1. Set flag=0. For all points (x,y) in Q do. { Set Count(x,y)=1, Explore(x,y)=f(x,y). If f(x,y)=(x,y). 1650 Set Count(x,y)=max+1. Else if |f(x,y)≥bailout. Set Result(x,y)=B. Else. Set Result(x,y)=the nearest pixel of f(x,y). } Goto Step 2. Step 2. If flag=1. Goto Step 3. Else Goto Step 4. Step 3. Set flag=0. For all points (x,y) in Q do. { If Result(x,y)∈Q and Count(x,y)<max+1. Set Result(x,y)=Result(Result(x,y)), Count(x,y)=Count(x,y)+Count(Result(x,y)), flag=1. If Count(x,y)>max. Count(x,y)=max+1. If Result(x,y)=B. Count(x,y)=max. } Goto Step 2. Step 4. For all points (x,y) in Q do. { While Count(x,y)<max and Result(x,y)≠B { Set k=Explore(x,y). While |k|<bailout and Count(x,y)<max { If k∈Q Goto Step 3. Set Count(x,y)=Count(x,y)+1, k=f(k). }. }. }. Goto Step 5。 Step 5. For all points (x,y) in Q do. { Set z1~z4 as the pixels of neighborhood rectangular of Explore(x,y). If Count(zi) is not all equal (i=1~4) { Set k=Explore(x,y). While |k|<bailout and Count(x,y)<max Set Count(x,y)=Count(x,y)+1, k=f(k). }. }. Procedure Finished. B The Correctness of the Algorithm We iterate all points in Q one time by step 1 and find the fixed point and several escape point. We find the iteration result of all approximate noescape sequence and escape sequence with order>max by step 2 and 3. To color these points in next step, we set the © 2011 ACADEMY PUBLISHER JOURNAL OF COMPUTERS, VOL. 6, NO. 8, AUGUST 2011 iteration number max of the points with iteration number>max. We iterate the points which the iteration result is not in Q for times until they sum up to case i~iii. Case i. The iteration number is max. Case ii. The iteration result of the point>threshold. Case iii. The iteration result is in Q. We can easily find whether the point is convergence or divergence by case i and ii. The points by case iii are either summed up to case i and ii or to case iii in cycle by the iteration goes on. Because the iteration number of a point (x,y) is Count(x,y) in Q by step 3, all points are sum up to case i and ii when we iterate max-Count(x,y) times by case iii at most. We use step 5 to dispose J set and asymptote in fractal figures. The definition of asymptote is definition b. It is easy to known that the escape time for a point z is k+1 when the point f(z) is between k-asymptote and k+1asymptote of f. It is no relationship with the precise value of fi(z). Definition b. We call the J set with max iteration times i-k as the k-asymptote of J set with iteration times i. Generally, 0-asymptote is J set. In fact, to consider the error of mapping z to f(z)=z1 by function f, the error is near to an k-asymptote. Though Result(z)≠fmax(z), it does not affect the escape number when the error is between two asymptotes. So we can ignore the errors when we create the fractal figures. In another words, the algorithm is correct. We prove it as theorem 1. Theorem 1. The fractal figures created by escape time algorithm and the improved one are almost the same except several escape points. Proof: i> When z is a fixed point or escape by one iteration, it is easy to know the iteration numbers are same by the two algorithms. Theorem 1 is proved. ii> When the result is in Q by the first m iteration times, we prove theorem 1 by case a~d. To simplify the proof, we set fm(z)=z1 and Count(z1)=n. So when we set Result(z)= Result(z1), the Count(z) is equal to m+n. Case a. When m+n≤max, the result of z is changed by z1. It can sum up to case a~d in cycle. Case b. When m+n>max and |f(z1)|<threshold, z is convergence by iteration times max. So we set Count(z)=max, theorem is proved by this case. Case c. When m+n>max and |f(z1)|≥threshold, We set Count(z)=max. The result is different of the two algorithms. In escape time algorithm, this kind of points is considered to be convergence, but the improved algorithm is opposite. However, to consider escape time with the max iteration number>m+n, we find the result is same with the improved algorithm. So it is still to be considered the same by the two algorithms. Theorem is proved by this case. Case d. When z is between k-asymptote and k+1asymptote, we calculate it with step 5 by improved algorithm. It is same to the escape time algorithm. Theorem is proved by this case. JOURNAL OF COMPUTERS, VOL. 6, NO. 8, AUGUST 2011 Based on i and ii, theorem is proved. We know the figure created by the improved algorithm is same to escape time algorithm except several points. But when we increase the max iteration number of escape time algorithm, these points are same by the two algorithm. In fact, the iteration number should be infinity in dynamic system and fractal. So it should be considered escaped by the points of case c of ii>. C. The Complexity of the Algorithm We compare the improved algorithm with the classic escape time algorithm. A basic operation time is to iterate z one time. We use theorem 2 to compare the basic operation times of the two algorithms. Theorem 2. The operation times of the improved algorithm is not more than the classic escape time algorithm. Proof: a − a1 b −b To set m= 2 and n= 2 1 (Δx and Δy are ∆x ∆y increment of row and line of displayed area), we assume aij is the operation times of the point (a1+i·Δx, b1+j·Δy) by the classic algorithm and bij by the improved one. So the sum operation times is and m n ∑ ∑b ij i =1 m n i =1 j =1 ∑∑a ij of escape time algorithm of improved one. j =1 To consider every z(i,j), we need to iterate max times when z is convergence by the classic algorithm. It is easy to know the iteration number by improved algorithm is not more than the classic one. When z is divergence, we know there exist k<max make |fk(z)|≥threshold. It means aij<max. To consider theorem 1, we can divide the condition to case a~d. Case a. The iteration of z is not in Q by one time. When the iteration of z is always outside Q , z iterate one time in Q and aij-1 times outside Q because the iteration number aij make z escape. So bij=1+aij-1=aij. When the iteration number k make fk(z)=z1 ∈ Q, the iteration time reduce Count(Result(z1)). It is to say that bij is nor more than aij. Case b. The iteration of z is not in Q by times m. The iteration time is one in the first m iteration times by improved algorithm. It is the same with case a when the iteration number>m. So bij is nor more than aij. Case c. The iteration of z is in Q until escape. The iteration time is one by improved algorithm and max by the classic one. So bij is nor more than aij. Case d. The neighborhood rectangular of the iteration time k1 of z is cross with k2-asymptote. (k1, k2≤max) It is easy to know that bij=aij=k1+k2 (k1+k2≤max) or bij=aij=max (k1+k2>max). Based on above, we know bij≤aij for all i and j. So m n m n i =1 j =1 ∑ ∑b ≤ ∑ ∑ a ij i =1 j =1 ij , theorem 2 is proved. To study with case a~d, we find that the improved algorithm is better than the classic one, especially in case © 2011 ACADEMY PUBLISHER 1651 b and c. In fact, when we create the fractal figures, we are always interested in the area of case a~d. So the improved algorithm can reduce creating time. Now we compare the complexity of the two. Because the iterate function is uncertain and the structure of fractal figures are complex, we can not solve the complexity by normal method. So we give a new method to compare the two by the creating figures. We assume the displayed area has S pixels. When the pixels are outside an unit rectangular of divergence domain and crossed by an asymptote, we set the number is S1. When the pixels are outside an unit rectangular of divergence domain and not crossed by an asymptote, we set the number is S2. Others’ number is S3. We set the iteration times is E in S1, F in S2 and G in S3 by the classic algorithm, and E* in S1, F* in S2 and G* in S3 by the improved one. So the ratio of the two algorithm is η= E * + F * +G * E + F +G (1) We set the max iteration number is max and the pixels number is equal with every i-asymptote (i=1~max). So we know that E=S1·max, E*=S1, F=S2·(max+1)/2, F*=S2 and G=G*. To use them in formula (1), we gain formula (2). η= S1 + S 2 + G S1 ⋅ max+ S 2 ⋅ (max+ 1) / 2 + G (2) When we create fractal figures, we are not interested in other i-asymptotes except J set. Moreover, the area of J set is small in displayed area. So η <<2/max generally. It is to say that the reduced multiple is max/2. Because we are concerned about J set, not i-asymptote, we can change “If Count(zi) is not all equal (i=1~4)” to “If Count(zi)=max and Count(zj)=max+1 (i, j=1~4)” in step 5. It will be created the similar figures with great speed. In fact, we find most of the points are not changed with step 5 by lots of experiment. We also find the figures are similar to each other by the two algorithms. We can find it in section 4. IV. EXPERIMENT OF THE TWO ALGORITHMS We compare the two algorithm by table 1 and figure 1~4. We create fractal figures of J set (The function is f(z)=z2-1.25), Newton set (The function is f(z)=(2z3+1)/3z2, sine exponent function (The function is f(z)= 3 sin 2 πz 2 and generalized 3x+1 function (The function πz sin 1 πz is f(z)= ( x3 2 + sin 2 ) ) by both the two algorithms. 2 2 The displayed area, creating time and the number of points with different Count() values are all in table 1. The pixels in displayed area are 640×480. We find the number of different points is small from table 1. It means that it is hardly to find the difference between the two figures created by the two algorithms. Moreover, there are many different points are the points in case iii of theorem 1. It is considered divergence by 2 1652 JOURNAL OF COMPUTERS, VOL. 6, NO. 8, AUGUST 2011 fractal and dynamic system. To find the difference between the two kind figures intuitively, we set variable array Iter(x,y) to memorize the iteration times for every pixel (x,y) and instead of Count(x,y) when creating the figures. Then we know the iteration times by the colors in displayed area. We create the fractal figures as figure 1. The threshold is 10-5 in figure 1-a1and 1-a2. The threshold is 1000 in other figures. The figures are created by escape time algorithm in figure 1-a1, 1-b1, 1-c1 and 1-d1, improved algorithm in figure 1-a2, 1-b2, 1-c2 and 1-d2. The iterate function is f(z)=(2z3+1)/3z2 in figure 1-a1 and 1-a2, f(z)=z2-1.25 in sin 2 (Count() value=max and max+1 ), the improved algorithm has less creating time. The improved algorithm has large advantage when the iteration function is complex and difficult to calculate. For example, the time reduce greatly when the iteration πz πz sin sin 1 πz functions are f(z)= 3 2 and f(z)= ( x3 2 + sin 2 ) . 2 2 We also find the number of different points is reduced. In fact, the derivative is often large when the structure of iteration function is complex. So the points in convergence and divergence domain are less affected by the initial value. Therefore, it does not affect the final escape time though there is error by iteration. We can see the iteration number in a2~d2 is much less than a1~d1 from figure 1. In addition, the convergence with large piece in c1 and d1 are corresponding to the piece with escape time 1 in c2 and d2. We can find similar conclusion in a1 and b1 corresponding to a2 and b2. So the new improved algorithm is advantage when the condition is like case a~c. Case a. There is self-mapping area in displayed area. Case b. There is convergence attracted by attract point. Case c. The structure of the iteration function and the πz 1-b1 and 1-b2, f(z)= 3 2 in 1-c1 and 1-c2, f(z)= πz sin 1 πz ( x3 2 + sin 2 ) in 1-d1 and 1-d2[4-7]. The displayed 2 2 area is (-2,2)×(-2,2). We can see the iteration number of the figures created by improved algorithm is smaller than the classic one. It validate theorem 2. We can see the creating time of improved algorithm is more than the classic of J set and Newton set. The reason is mostly for the simple iteration function. The time of reduced iteration number is smaller than the query time in step 3 and 5. But when we only consider J set in step 5 2 TABLE I. Iterate Function f 2 2 RUNTIME OF THE TWO ALGORITHMS f(z)=z2-1.25 f(z)=(2z3+1)/3z2 Displayed area f(z)= 3 sin 2 πz 2 πz sin 1 πz ( x3 2 + sin 2 ) 2 2 2 f(z)= Re∈(-2,2), Im∈(-2,2) Escape Time Algorithm (s) 0.191 0.416 17. 582 145.677 Improved Algorithm(s) 0.292 0.520 3.243 6.449 Number with Different Count() value 0 0 4 8 Number of Changed Points with Step 5 3 15 2 3 Time by only J Set(s) (Count=max、max+1) 0.183 0.408 1.943 3.747 Number of Different Points 3 11 2 0 Iteration times scale (└lnClassic/New┘) -0.4 0 1.7 3.2 a1 a2 b1 b2 c1 c2 d1 d2 Fig.1 fractal image for Re∈(-2,2),Im∈(-2,2) © 2011 ACADEMY PUBLISHER JOURNAL OF COMPUTERS, VOL. 6, NO. 8, AUGUST 2011 calculation is complex. Generally, The created fractal figures are contains these cases. So it is great application value of the improved algorithm. Meanwhile, this algorithm can used into a series algorithms based on the classic escape time algorithm. V. CONCLUSION AND FUTURE WORK In this essay, we have improved the classic escape time algorithm by no-escape point. We have proved the correctness of the algorithm. We have compared the two algorithms by created some classic fractals and have validated the advantage. We have found that the iteration number is less than the classic algorithm and the creating time is also less. We have solved the iteration number in several conditions. The next step we will do the two researches. One is that we will improve the space complexity of this algorithm. To study with figure 1, we find that the judgment domain is convergence to the attract point when the domain is small enough. So the other one is to find an numerical algorithm to solve the attract periodic points. ACKNOWLEDGMENT The authors wish to thank the anonymous reviewers for their helpful comments in reviewing this paper. This work was supported by National Natural Science Foundation of China (No. 60773098, 60905022). REFERENCES [1] Mandelbrot BB. The Fractal Geometry of Nature[M], San Fransisco, Freeman W H, 1982, pp. 1-122. [2] Falconer J. Fractal Geometry: Mathematical Foundations and Applications 2nd Edition[M], John Wiley. Sons, Inc, New York, 2003, pp. 1-250. [3] Xin-Chu Fu, Zhan-He Chen, Hongjun Gao, Chang-Pin Li, et al. Chaotic sets of continuous and discontinuous maps[J], Nonlinear Analysis: Theory, Methods & Applications, vol 72, No 1, 2010, pp. 399-408. © 2011 ACADEMY PUBLISHER 1653 [4] Dumont JP, Reiter CA. Visualizing generalized 3x+1 function dynamics[J], Computers and Graphics, vol 25, No 5, 2001, pp. 553-595. [5] Liu Shuai, Wang zhengxuan. Fixed Point and Fractal Images for a Generalized Approximate 3x+1 Function[J]. Journal of Computer-Aided Design & Computer Graphics, vol 21, No 12, 2009, pp. 1740-1744. [6] Ning Chen, X.L. Zhu, K.W. Chung. M and J sets from Newton's transformation of the transcendental mapping w F(z)=ez +c with vcps, Computers & Graphics, vol 26, No 2, 2002, pp. 371-383. [7] Wang XY,Liu XD,Zhu WY,etal. Analysis of c-plane fractal images from z←zα+c for (α<0), Fractals, vol 8, No 3, 2000, pp. 307~314. Liu Shuai, male, born in 1982, PhD in College of Computer Science and Technology, Jilin University. His main research interests include computer graphics and fractal. Che Xiangjiu, male, born in 1969, PhD and Professor in College of Computer Science and Technology, Jilin University. Senior membership of China Computer Federation. His main research interests include computer graphics and CAGD. Wang Zhengxuan, male, born in 1945, professor and PhD supervisor in College of Computer Science and Technology, Jilin University.. He is a member of the editorial board of Journal of Computer-Aided Design & Computer Graphics. His research interests include computer graphics, image processing and rendering of fractal, computational geometry etc...
© Copyright 2026 Paperzz