Improvement of Escape Time Algorithm by No ... - Journal of Computers

5 downloads 0 Views 361KB Size Report
Abstract—Escape time algorithm is a universal algorithm when to create fractal image. A class of algorithms based on escape time algorithm is ...
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|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. 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) 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)|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 kmax). 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 η

Suggest Documents