13.12.2012 Views

Theoretical and Experimental DNA Computation (Natural ...

Theoretical and Experimental DNA Computation (Natural ...

Theoretical and Experimental DNA Computation (Natural ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

74 4 Complexity Issues<br />

The weak parallel filtering model<br />

Here we recall the basic legal operations on sets (or tubes) [65] within what we<br />

now refer to as the weak model. The operation set described here is constrained<br />

by biological feasibility, but all operations are currently realisable with current<br />

technology. The biological implementation of this operation set is described<br />

in detail in Chap. 5.<br />

• remove(U, {Si}). This operation removes from the tube U, in parallel, any<br />

string which contains at least one occurrence of any of the substrings Si.<br />

• union({Ui},U). This operation, in parallel, creates the tube U, whichis<br />

the set union of the tubes Ui.<br />

• copy(U, {Ui}). In parallel, this operation produces a number of copies, Ui,<br />

of the tube U.<br />

• select(U). This operation selects an element of U uniformly at r<strong>and</strong>om, if<br />

U is the empty set then empty is returned.<br />

We now describe an example algorithm within the model. The problem solved<br />

is that of generating the set of all permutations of the integers 1 to n. The<br />

initial set <strong>and</strong> the filtering out of strings which are not permutations were<br />

described earlier. The only non-self-evident notation employed below is ¬i to<br />

mean (in this context) any integer in the range which is not equal to i.<br />

Problem: Permutations<br />

Generate the set Pn of all permutations of the integers {1, 2,...,n}.<br />

Solution:<br />

• Input: The input set U consists of all strings of the form p1i1p2i2 ...pnin<br />

where, for all j, pj uniquely encodes “position j” <strong>and</strong> each ij is in<br />

{1, 2,...,n}. Thus each string consists of n integers with (possibly) many<br />

occurrences of the same integer.<br />

• Algorithm:<br />

for j =1ton − 1 do<br />

begin<br />

copy(U, {U1,U2,...,Un})<br />

for i =1,2,... , n <strong>and</strong> all k>j<br />

in parallel do remove(Ui, {pj¬i, pki})<br />

union({U1,U2,...,Un},U)<br />

end<br />

Pn ← U<br />

• Complexity: O(n) parallel-time.

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

Saved successfully!

Ooh no, something went wrong!