09.09.2014 Views

13th International Conference on Membrane Computing - MTA Sztaki

13th International Conference on Membrane Computing - MTA Sztaki

13th International Conference on Membrane Computing - MTA Sztaki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

H. ElGindy, R. Nicolescu, H. Wu<br />

Pseudocode 5: Discard, adapted for G r−1 = (V, E r−1 )<br />

1 Discard(σ i, G r−1)<br />

2 Input : a cell to discard, σ i ∈ V , and the residual digraph, G r−1<br />

3 i f σ i is permanently visited then return<br />

4 set σ i as permanently visited<br />

5 ioldreach = σ i.reach<br />

6 σ i.reach = ∞<br />

7 foreach arc (σ j, σ i) ∈ E r−1<br />

8 i f (σ j, σ i) is temporarily visited then<br />

9 fork Update(σ j, G r−1, ioldreach, σ i) // see Pseudocode 6<br />

10 endif<br />

11 set (σ j, σ i) as permanently visited<br />

12 endfor<br />

13 foreach temporarily visited arc (σ i, σ k )<br />

14 fork Discard(σ k , G r−1)<br />

15 endfor<br />

Pseudocode 6: Update, adapted for G r−1 = (V, E r−1 )<br />

1 Update(σ j, G r−1, ioldreach, σ i)<br />

2 Input : a cell, σ j ∈ V , the residual digraph, G r−1, a reach-number, ioldreach,<br />

3 and a cell, σ i ∈ V<br />

4 i f σ j.reach = ioldreach then<br />

5 newreach = σ j.depth<br />

6 foreach temporarily visited arc (σ j, σ k ) ∈ E r−1<br />

7 newreach = min(newreach, σ k .reach)<br />

8 endfor<br />

9 i f newreach > σ j.reach then<br />

10 joldreach = σ j.reach<br />

11 σ j.reach = newreach<br />

12 foreach temporarily visited arc (σ k , σ j) ∈ E r−1<br />

fork Update(σ k , G r−1, joldreach, σ j)<br />

endfor<br />

13 endif<br />

14 if σ i.reach > σ j.depth then<br />

fork Discard(σ i, G r−1)<br />

endif<br />

15 endif<br />

Search round #r starts when cell σ s sends the forward token, together with<br />

a depth indicati<strong>on</strong> of <strong>on</strong>e (lines 3.8–11), to unvisited cell σ sr . When an unvisited<br />

cell becomes visited, it becomes the new fr<strong>on</strong>tier cell, it marks itself as temporarily<br />

visited (line 4.6), records its depth and reach-number as the received<br />

depth (line 4.7), sends visited notificati<strong>on</strong> to all its neighbours (line 4.8–10). A<br />

current fr<strong>on</strong>tier cell sends the forward token over an arbitrarily selected unvisited<br />

arc, together with an incremented depth (lines 4.15–17). An unvisited cell<br />

180

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!