42
Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Embed Size (px)

Citation preview

Page 1: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Notes on assembly verification in the aTAM

Days 22, 24 and 25 of Comp Sci 480

Page 2: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Introduction

• We are going to study algorithms that verify tile sets

• E.g., write an algorithm that determines if a particular is uniquely produced by a tile set

• Critical resource: running time

• Important problems: design of self-assembly simulators

Page 3: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Warm up

• Problem 0 (Assembly verification = AV)– Input: A temperature τ and an assembly A

• Tile set inferred from the assembly A

– Output: Yes if A is producible, and No otherwise

• Design an algorithm that solves problem 0 as efficiently as possible

• Is every assembly producible?– If yes, then running time would be O(1)– Not every assembly is producible

Page 4: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

The algorithmAlgorithm Greedy-Grow (A, τ)

1. Start with A' = A(0,0) // (0,0) always has the seed

2. While there is a site (x,y) with A(x,y) = t and A'(x,y) = empty such that t can be added to A' at (x,y), add it.

3. If A ≠ A', then output "A is not producible"

4. Else output "A is producible"

• Running time: ???

• O(|A|2)– For each tile addition, the perimeter of A' is searched

• O(|A|)– Don’t search the perimeter over and over again– Maintain a list of all sites at which a tile could be placed immediately

• |A| tile additions

• O(1) amount of work per tile addition

Page 5: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Easy and hard problems

• Some problems are “easy”, some are “hard”

• We’ll classify problems as “easy” if one can exhibit an algorithm that solves it with running time O(n4), where n is the size of the input

• A “hard” problem is such that, no matter how clever the programmer, any algorithm that solves it has running time Ω(2n)

Page 6: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Easy problem example

• Input: a list of numbers x0, x1, …, xn-1 and a number x

• Output: Yes if x = xi for some i = 0, …, n-1 and No otherwise

• Algorithm: linear search

• Running time O(n) (worst, best and average case)

Page 7: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Another easy problem

• Input: a temperature τ and an assembly A– Tile set inferred from the assembly A

• Output: Yes if A is producible and No otherwise

• Algorithm: use the Greedy-Grow algorithm– Running time is O(n), where n = |A| (size of

input)

Page 8: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Hard problem example• Notation:

– x V y = “x or y” // x || y– x Λ y = “x and y” // x && y– ¬x = “not x” // !x

• Input: – n boolean variables x0, …, xn-1, – m clauses Cj

• Disjunction (“or”) of three boolean literals– Boolean literal = a boolean variable, OR its negation

• That is, Cj = (lp V lq V lr), where 0 ≤ p < q < r ≤ n-1 and lp = xp or ¬xp, lq = xq or ¬xq, lr = xr or ¬xr

– A formula φ = C0 Λ C1 Λ ∙∙∙ Λ Cm-1

• Conjunction (“and”) of the clauses• Output: Yes if there is a way to assign boolean values to the variables

x0, … xn-1 so as to make φ true and No otherwise• Example: φ = (x0 V ¬x1 V ¬x2) Λ (x0 V x1 V x3)

– Output: Yes (setting x0 to TRUE satisfies the formula)• This problem is probably very hard

– Not proven!

Page 9: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

3SAT

• The previous problem is usually called “3SAT”• Like I said, it is probably a very difficult problem

for a computer program to solve• Most likely: any algorithm you write that solves

3SAT (finds a satisfying assignment, or reports that one doesn’t exist) will run in time Ω(cn), where c > 1– Try it!

Page 10: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

3SAT – What not to do

• This doesn’t work…

• For a given 3SAT formula φ…– Enumerate all possible True / False

assignments for the n variables. – If one True / False assignment satisfies φ,

then output Yes, otherwise output No

• This algorithm has running time…– ? – O(2n)

Page 11: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

3SAT is useful

• We will use 3SAT to prove that certain problems in self-assembly are hard

Page 12: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Hw5

• Problem 1: self-assembly of “Pacman” shapes• What defines a thin Nxk Pacman shape?

– N must be odd– k < log N / (log log N - log log log N)– Row 0 is 2k points wide– Row N/2 is k points wide– Row N-1 is 2k points wide– For 0 < i ≤ N/2, row i can be no wider than row i-1– For N/2 < i ≤ N-1 , row i-1 can be no wider than row i

Page 13: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Pacman example

Nxk Pacman shape, where N = 19, and k = 5 (not thin, but oh well)

Must be 5 tiles wide

Must be 10 tiles wide

Must be 10 tiles wide

Seed tile, placed at the origin

If T uniquely produces some Nxk thin Pacman shape, then |T| ≥ ???

Note: for particular N,k values, there are many thin Pacman shapes.

Page 14: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

3SAT warm up

• Is the following formula “satisfiable”? – I.e., can you set the variables so that the

formula is true?

φ = (x0 V ¬x2 V ¬x4) Λ (¬x1 V x3 V x5) Λ (x2 V ¬x3 V x5) Λ (¬x4 V ¬x5 V x7) Λ (¬x2 V ¬x5 V ¬x6) Λ (¬x0 V x3 V ¬x7)

Page 15: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Two problems

• Problem 1 (Unique assembly verification = UAV)– Input: A temperature τ and an assembly A

• Tile set inferred from the assembly A

– Output: YES if is A uniquely produced and NO otherwise

• Problem 2 (Unique shape verification = USV)– Input: a tile set T, a temperature τ and a shape X– Output: YES if X is uniquely produced by T and NO otherwise

• Design algorithms to solve these problems (one algorithm per problem)

• What are the running time complexities?• Which one is easy? Which one is hard?

Page 16: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Algorithm for UAV

Algorithm Unique-Assembly (A, T, τ) // Adleman, et. al., 2002

1. Let A' = Greedy-Grow(A, τ)If A ≠ A', then A is not produced.

2. For all non-empty sites (x,y), test whether any tile t can be added at an adjacent site.If YES, then A is not terminal.

3. For all non-empty sites (x,y), let A/(x,y) be the assembly A with the tile at (x,y) removed.Let A'' = Greedy-Grow(A/(x,y), τ).If a tile t ≠ A(x,y) can be added to A'' at (x,y), then A is not uniquely produced.

4. If A does not fail any of the above three tests, then A is uniquely produced and terminal.

Page 17: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Algorithm Unique-Assembly (A, T, τ) // Adleman, et. al., 2002

1. Let A' = Greedy-Grow(A, τ)If A ≠ A', then A is not produced.

2. For all non-empty sites (x,y), test whether any tile t can be added at an adjacent site.If YES, then A is not terminal.

3. For all non-empty sites (x,y), let A/(x,y) be the assembly A with the tile at (x,y) removed.Let A'' = Greedy-Grow(A/(x,y), τ).If a tile t ≠ A(x,y) can be added to A'' at (x,y), then A is not uniquely produced.

4. If A does not fail any of the above three tests, then A is uniquely produced and terminal.

Is this step necessary?

YES!

Stable, but not producible at temperature 2…

Algorithm for UAV

1 2

3

456

0

7

Page 18: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Running time complexity

• What is the running time for the Unique-Assembly algorithm?

• Step 1 (is producible?): O(|A|)

• Step 2 (is terminal?): O(|A|*|T|)

• Step 3 (checking locations): O(|A|2)– |A| calls to Greedy-Grow

• Running time: O(|A|*|T| + |A|2)

Page 19: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

A special case

• If the temperature is 1, then we can do much better than O(|A|*|T| + |A|2)

• Doty gives a special algorithm for verifying unique production at temperature 1– Running time: O(|A|*log |T|)– Proven in ~2012– Details omitted

• See: http://www.dna.caltech.edu/~ddoty/papers/phsa.pdf

Page 20: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

An observation

• The unique assembly verification algorithms also work in 3D

• We’ll be reminded of this later…

Page 21: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

A really difficult problem

• How do we design an algorithm for USV?

• The problem:– In USV, a tile set may produce exponentially

many assemblies that all have the same shape

• Can’t do a brute-force verification over all possible assemblies

Page 22: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

A different approach

• Don’t try to solve USV directly by designing an algorithm that can determine if a tile set uniquely produces a shape

• Use the USV problem to solve another (probably) hard problem…

• 3SAT!

Page 23: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Solve 3SAT with self-assembly

• Let φ be a 3SAT formula with n variables and m clauses• Let’s design a tile set Tφ that “solves” the 3SAT formula

φ• Basic idea (two phases):

– Tφ will generate all possible True/False assignments to the n variables

– For each True/False assignment of the n variables, Tφ will determine whether or not that assignment solves φ (the assembly in which this happens should be rectangular)

– If φ is NOT solved by some True/False assignment, don’t place a tile in the corner (the resulting shape is NOT a rectangle)

Page 24: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Something from last time

• Can we prove the following “easily”?:log log N < log N / (log log N – log log log N)

• Easy, once you realize this:log(a / b) = log a - log b

• log N / (log log N – log log log N) = log N / log (log N / log log N) >

log N / (log N / log log N) =log N * log log N / log N =

log log N

Page 25: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

More efficient algorithm for UAV?

Algorithm Unique-Assembly (A, T, τ) // Adleman, et. al., 2002

1. Let A' = Greedy-Grow(A, τ)If A ≠ A', then A is not produced.

2. For all non-empty sites (x,y), test whether any tile t can be added at an adjacent site.If YES, then A is not terminal.

3. Let A' be an empty assembly. While there is a site (x,y) with A(x,y) = t and A'(x,y) = empty such that t can be added to A' at (x,y), add it. If at any point in this process, two tile types could be placed at (x,y), then A is not uniquely produced.

4. If A does not fail any of the above three tests, then A is uniquely produced and terminal.

Page 26: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

More efficient algorithm for UAV?Algorithm Unique-Assembly (A, T, τ) // Adleman, et. al., 2002

1. Let A' = Greedy-Grow(A, τ)If A ≠ A', then A is not produced.

2. For all non-empty sites (x,y), test whether any tile t can be added at an adjacent site.If YES, then A is not terminal.

3. Let A' be an empty assembly. While there is a site (x,y) with A(x,y) = t and A'(x,y) = empty such that t can be added to A' at (x,y), add it. If at any point in this process, two tile types could be placed at (x,y), then A is not uniquely produced.

4. If A does not fail any of the above three tests, then A is uniquely produced and terminal.

Running time: ?

Page 27: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

More efficient algorithm for UAV?Algorithm Unique-Assembly (A, T, τ) // Adleman, et. al., 2002

1. Let A' = Greedy-Grow(A, τ)If A ≠ A', then A is not produced.

2. For all non-empty sites (x,y), test whether any tile t can be added at an adjacent site.If YES, then A is not terminal.

3. Let A' be an empty assembly. While there is a site (x,y) with A(x,y) = t and A'(x,y) = empty such that t can be added to A' at (x,y), add it. If at any point in this process, two tile types could be placed at (x,y), then A is not uniquely produced.

4. If A does not fail any of the above three tests, then A is uniquely produced and terminal.

Running time: O(|A|) + O(|A|*|T|) + O(|A|) = O(|A|*|T|)

Does it work?

Page 28: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

NO!

S 1 2

3

4

5

u

v w

S 1 2

3u

v w x y

Counter-example…

Suppose we have a tile set that can produce two assemblies like this…

The previously shown (efficient) algorithm for UAV would sometimes say that either of these assemblies is uniquely produced

Page 29: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

The coolest tile set in the world…

Page 30: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

x0

x0

x0

*

x0

BL

x1

xn-1

Xn-1

xn-1

TL

*

TL

TL

Variable tiles – one for each of the n variables

*

* C0BL C0 C1C0

C0

Cm-1 BRCm-1

Cm-1

*BR

*

SATT*

*

TL T T

OK

T T FT F FF F F

OK

F F

0

*

*

xi

*

0xi

1

*

*

xi 1xi

OK

Cj

0xi 0xi

If xi = 0 Cj true

OK

OK

Cj

1xi 1xi

If xi = 1 Cj true

OK

Cj

Cj

1xi 1xi

Otherwise

Cj

Cj

Cj

0xi 0xi

Otherwise

Cj

OK

OK

0xi 0xi

OK

OK

OK

1xi 1xi

OK

Cj Cj

1xi

0xi

Page 31: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

x0

x0

x0

*

x0

BL

x1

xn-1

Xn-1

xn-1

TL

*

TL

TL

* C0BL C0 C1C0

C0

Cm-1 BRCm-1

Cm-1

*BR

SATT*

*

TL T T

OK

T T FT F FF F F

OK

F F

0

*

*

xi

*

0xi

1

*

*

xi 1xi

OK

Cj

0xi 0xi

If xi = 0 Cj true

OK

OK

Cj

1xi 1xi

If xi = 1 Cj true

OK

Cj

Cj

1xi 1xi

Otherwise

Cj

Cj

Cj

0xi 0xi

Otherwise

Cj

OK

OK

0xi 0xi

OK

OK

OK

1xi 1xi

OK

Cj Cj

Clause tiles – one for each of the m clauses

*

*1xi

0xi

Page 32: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

x0

x0

x0

*

x0

BL

x1

xn-1

Xn-1

xn-1

TL

*

TL

TL

* C0BL C0 C1C0

C0

Cm-1 BRCm-1

Cm-1

*BR

SATT*

*

TL T T

OK

T T FT F FF F F

OK

F F

0

*

*

xi

*

0xi

1

*

*

xi 1xi

OK

Cj

0xi 0xi

If xi = 0 Cj true

OK

OK

Cj

1xi 1xi

If xi = 1 Cj true

OK

Cj

Cj

1xi 1xi

Otherwise

Cj

Cj

Cj

0xi 0xi

Otherwise

Cj

OK

OK

0xi 0xi

OK

OK

OK

1xi 1xi

OK

Cj Cj

Assignment tiles – these tiles attach non-deterministically to “guess” a true/false assignment for the n variables (2n possible assemblies)

*

*1xi

0xi

Page 33: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

x0

x0

x0

*

x0

BL

x1

xn-1

Xn-1

xn-1

TL

*

TL

TL

* C0BL C0 C1C0

C0

Cm-1 BRCm-1

Cm-1

*BR

SATT*

*

TL T T

OK

T T FT F FF F F

OK

F F

0

*

*

xi

*

0xi

1

*

*

xi 1xi

OK

Cj

0xi 0xi

If xi = 0 Cj true

OK

OK

Cj

1xi 1xi

If xi = 1 Cj true

OK

Cj

Cj

1xi 1xi

Otherwise

Cj

Cj

Cj

0xi 0xi

Otherwise

Cj

OK

OK

0xi 0xi

OK

OK

OK

1xi 1xi

OK

Cj Cj

Computation tiles – these tiles initially bind via south and west. Only one of the tile types per row is created

*

*1xi

0xi

Page 34: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

x0

x0

x0

*

x0

BL

x1

xn-1

Xn-1

xn-1

TL

*

TL

TL

* C0BL C0 C1C0

C0

Cm-1 BRCm-1

Cm-1

*BR

SATT*

*

TL T T

OK

T T FT F FF F F

OK

F F

0

*

*

xi

*

0xi

1

*

*

xi 1xi

OK

Cj

0xi 0xi

If xi = 0 Cj true

OK

OK

Cj

1xi 1xi

If xi = 1 Cj true

OK

Cj

Cj

1xi 1xi

Otherwise

Cj

Cj

Cj

0xi 0xi

Otherwise

Cj

OK

OK

0xi 0xi

OK

OK

OK

1xi 1xi

OK

Cj Cj

Propagation tiles – once a clause is satisfied (made to be true), then we propagate the OK signal to the top of the assembly

*

*1xi

0xi

Page 35: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

x0

x0

x0

*

x0

BL

x1

xn-1

Xn-1

xn-1

TL

*

TL

TL

* C0BL C0 C1C0

C0

Cm-1 BRCm-1

Cm-1

*BR

SATT*

*

TL T T

OK

T T FT F FF F F

OK

F F

0

*

*

xi

*

0xi

1

*

*

xi 1xi

OK

Cj

0xi 0xi

If xi = 0 Cj true

OK

OK

Cj

1xi 1xi

If xi = 1 Cj true

OK

Cj

Cj

1xi 1xi

Otherwise

Cj

Cj

Cj

0xi 0xi

Otherwise

Cj

OK

OK

0xi 0xi

OK

OK

OK

1xi 1xi

OK

Cj Cj

Status tiles –track the status of the whole formula being satisfied. Once a false clause is found, the formula cannot be made true after that.

*

*1xi

0xi

Page 36: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

An example

• Here’s an example formula: φ = (x0 V x1 V ¬x2) Λ (x0 V ¬x1 V x2) Λ (¬x0 V x1 V ¬x2)

• Can φ be solved? – Can you assign values to the 3 variables that make all the clauses of φ

true?

• Sure!

• x0 = true, x1 = true and x2 = false

• Not every true/false assignment works, e.g., x0 = true, x1 = false and x2 = true

• We can convert φ into a tile set Tφ and use the tile assembly model to solve φ

Page 37: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

*

x0

x1

*

T T

* C0 C1 C2 *

*

*

SAT

φ = (x0 V x1 V ¬x2) Λ (x0 V ¬x1 V x2) Λ (¬x0 V x1 V ¬x2)

All possible true/false assignments tested…

Each true/false assignment represented by a different terminal assembly

T T

1

1

x2

OK

OK

C1

OK

*0 C0 C1 OK

OK

OK

T T

*

*

F F

1

0

*

x0

x1

*

* C0 C1 C2 *

x2

OK

OK

C1

*0 C0 C1 OK

OK

OK

T

0

0

0

*

x0

x1

*

* C0 C1 C2 *

x2

C1

T

*

*

*

SATT T

C0

OK

C1

OK

OK

OK

OK

C0 OK

T

1

0

0

*

x0

x1

*

* C0 C1 C2 *

x2

T

*

*

*

SATT T

OK OK OK

OKOK

OK OK C2

C2

T

1

0

1

*

x0

x1

*

* C0 C1 C2 *

x2

T

1

1

0

*

x0

x1

*

* C0 C1 C2 *

x2

T

*

*

*

OK

OK

OK

OK

OK OK

OK

OK

C2

T T SATT

0

1

*

x0

x1

*

* C0 C1 C2 *

x2

0

*

*OK

*C0 C1 OK

OK

OK

C0 OK

C0

F F F

T

*

*

*OK OK

OK

C2

C2

OK

OK

OK

OK

SATT T

T T

*

*

*

SATT T

1

1

1

*

x0

x1

*

* C0 C1 C2 *

x2

OK

OK OK

OK

OK

OK

OK

OK C2

Page 38: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Tile complexity

• If φ is a 3SAT formula with n variables and m clauses, then what is |Tφ| ??

• |Tφ| = O(m + n)

• Time complexity to create Tφ: O(m + n)

Page 39: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

What does this mean?

• For each 3SAT formula φ, we can create a tile set Tφ that “solves” φ in a special way

– I.e., either placing (or NOT placing) the upper-right corner tile depending on whether φ is solved by a particular True/False assignment

• If Tφ does not uniquely produce a shape, then we can conclude that φ CAN be solved

Page 40: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Just pretend

• Now pretend that there is an algorithm, say Unique-Shape, that solves USV in time O(|X|)– Input: a tile set T, a temperature τ and a shape X– Output: Yes if T uniquely produces a shape (also

output the points in the shape in this case) and No otherwise (no output)

• How do we use Unique-Shape in an algorithm, say Solve-3SAT, that can solve 3SAT with running time “O(n)”?

Page 41: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Solve 3SAT using USVAlgorithm Solve-3SAT(φ) // φ is a 3SAT formula with n variables

// and m clauses1. Create a tile set Tφ as previously discussed.2. If Unique-Shape(Tφ) outputs No then output Yes.3. If Unique-Shape(Tφ) outputs Yes then output Yes if the shape is a

rectangle, and No if the shape is a rectangle with the top-right corner missing.

Running time of Solve-3SAT: O(m + n) + “O(|X|)” + “O(|X|)” + “O(1)” = O(m + n) + “O(1)”

= O(m + n) + O(1) = O(n)

But this means 3SAT is an “easy” problem, because we have an algorithm that computes it in time O(n)

In other words, assuming USV is easy, so too is 3SAT.Contradiction!

Thus, USV is probably not easy (so an efficient Unique-Shape probably doesn’t exist).

Page 42: Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480

Summary

• Assembly verification (2D/3D)– Easy

• Unique assembly verification (2D/3D)– Easy

• Unique shape verification (2D/3D)– Difficult