Abstract
Molecular robotics is challenging, so it seems best to keep it simple. We consider an abstract molecular robotics model based on simple folding instructions that execute asynchronously. Turning Machines are a simple 1D to 2D folding model, also easily generalisable to 2D to 3D folding. A Turning Machine starts out as a line of connected monomers in the discrete plane, each with an associated turning number. A monomer turns relative to its neighbours, executing a unit-distance translation that drags other monomers along with it, and through collective motion the initial set of monomers eventually folds into a programmed shape. We provide a suite of tools for reasoning about Turning Machines by fully characterising their ability to execute line rotations: executing an almost-full line rotation of radians is possible, yet a full rotation is impossible. Furthermore, line rotations up to are executed efficiently, in expected time in our continuous time Markov chain time model. We then show that such line-rotations represent a fundamental primitive in the model, by using them to efficiently and asynchronously fold shapes. In particular, arbitrarily large zig-zag-rastered squares and zig-zag paths are foldable, as are y-monotone shapes albeit with error (bounded by perimeter length). Finally, we give shapes that despite having paths that traverse all their points, are in fact impossible to fold, as well as techniques for folding certain classes of (scaled) shapes without error. Our approach relies on careful geometric-based analyses of the feats possible and impossible by a very simple robotic system, and pushes conceptional hardness towards mathematical analysis and away from molecular implementation.
Keywords: Model of computation, Algorithmic molecular robotics, Self-assembly, Nubot, Reconfiguration
Introduction
The challenge of building molecular robots has many moving parts, as the saying goes. These include molecular parts that move relative to each other; units needing some sort of memory state; the ability to transition between states; and perhaps even the ability to use computation to drive robotic movements. Here we consider a simple algorithmic model of robotic reconfiguration called Turning Machines.
The main ethos behind our work is the notion of having a reconfigurable structure where component monomers actuate their position relative to their neighbours and governed by simple actuation rules. Volume exclusion applies (two monomers can not occupy the same position in space), almost for free we get massive parallelism and asynchronicity, and the complexity of allowable state changes is small: unit monomers start with a natural number and decrement step-by-step to zero. The Turning Machine model embodies these concepts.
On the one hand, there are a number of senses in which molecular systems are better suited to robotic-style reconfiguration than macro-scale robotic systems: there is no gravity nor friction fighting against components’ actuation, and should we know how to exploit them, randomness, freely diffusing fuel (robots need not carry all their fuel) and large numbers of components are all readily available as resources. On the other hand, building nanoscale components presents a number of challenges including implementing computational controllers at the nanoscale, as well as designing systems that self-assemble and interact in a regime where we can not easily send in human mechanics to diagnose and fix problems (Fig. 1).
Turning machines
Monomers are the atomic components of a Turning Machine and are arranged in a connected chain on the triangular grid , with each monomer along the chain pointing at the next (Fig. 2). In an initial instance, the chain of monomers are sitting on the x-axis all pointing to the east. Each monomer has an initial (input) integer turning number , the monomer’s ultimate goal is to set that number to 0: if s is positive, the monomer tries to simultaneously decrement s and turn anti-clockwise by an angle of (Fig. 2b), if s is negative, it tries to increment and turn clockwise by .1 If the monomer has reached its target orientation and does not turn again (Fig. 2b).
A key point is that although a monomer actuates by rotating the direction in which it points, when it does so it “drags” (translates) all monomers that come after it in the chain in the same way the rotation motion of a human arm (around a shoulder) appears to translate a flag through the air, or the way a cam in a combustion engine converts rotational shaft motion to translational piston motion (Figs. 2c and 3). Sect. 2 gives the precise model definition.
The main challenge: blocking
Programming the model simply requires annotating an east-pointing line of monomers with turning numbers; an incredibly simple programming syntax.
Locally, individual monomers exhibit a small rotation, but globally this effects a large translation, or dragging, of many monomers (Fig. 2c). Thus globally, the main challenge is how to effect global rotations—in other words how to use translation to simulate rotation. In particular, how to do this when lots of monomers are asynchronously moving and bumping into each other, potentially blocking each other from moving.
Blocking is illustrated in Fig. 2d and comes in two forms. Temporary blocking where one monomer is in the way of another, but eventually will get out of the way, and permanent blocking where all monomers block each other in a locked configuration that will never free itself. We say that a target structure is foldable if all possible system trajectories lead to that structure, i.e. permanent blocking does not occur on any trajectory. A foldable structure may exhibit temporary blocking on some trajectories, indeed most of the work for our positive results in this paper comes down to showing that for certain folding tasks, any blockings that happen are merely temporary kinks in the chain that are eventually worked out. We measure the amount of blocking by considering the completion time: a foldable structure where temporarily blocked monomers can quickly become unblocked finishes faster than one where blocking takes a while to sort out. Our model of time assumes that the time to apply a turning rule to a given unblocked monomer is an exponential random variable with rate 1, and the system evolves as a continuous time Markov chain with the discrete events being rules applied asynchronously and in parallel.
Given a shape and a best-guess at an initial (input) state sequence to fold that shape, the main challenge often lies in showing that all trajectories lead to the desired shape, i.e. that permanent blocking never occurs. If we succeed in this, a second challenge is to analyse the time to completion—with speed of completion being a measure of efficiency and parallelism.
Results: line rotations and shape building
After defining the Turning Machines model (Sect. 2), and giving technical lemmas for reasoning about it (Sect. 4), in Sect. 5 we fully characterise the line rotation capabilities of the model, in two senses. First, we show that for each of the angles , and any number of monomers there is a Turning Machine with n monomers that starts on the x-axis and ends rotated by radians. We show this is the best one can do, that is, that rotation of is impossible (for any , there are always some trajectories that are permanently blocked). Second, line rotation is fast: Up to constant factors the speed is optimal, completing in expected time . This shows that despite the fact that line rotations in the range experience large number of blockings along their trajectories, these blockings are all temporary, and do not conspire to slow the system down by more than a constant factor on average.
In Sect. 6, we go on to give results on the shape-building abilities of Turning Machines. To do this, we build on previous technical tools to show that so-called zig-zag paths (paths that wind over and back parallel to the x axis) are foldable, and in merely logarithmic expected time (Theorem 21). We use that result to prove that squares, rastered in a zig-zag fashion, are foldable, and time-efficiently so (Corollary 22). By allowing error in the folding of a shape (the error is the symmetric difference between the set of points of the shape and points in the folding), any shape is trivially foldable, albeit with error up to the area of the shape, by simply folding the entire bounding box of the shape.2 This means that there are shapes, that are not Hamiltonian but are foldable with large error (e.g. a cross with thin arms, Fig. 9 and Theorem 25). What shapes can be folded with small error? We show that any shape from a wide class called y-monotone shapes is foldable in optimal3 expected time , and with error no more than the perimeter of the shape and no more than the perimeter of the folding (Theorem 24). Certain classes of shapes can be folded with zero error: Theorem 33 shows that there are shapes, that we call, y-monotone with a yw-separator, that are are foldable at scale factor 2. Finally, one can ask if every shape that has a Hamiltonian path is foldable. The answer is no: our main negative result (Theorem 38) gives a classes of shapes (thin spirals with a gap between their arms) and proves that they are not foldable.
We would argue that programming in this model is deceptively simple: if a shape has a Hamiltonian path, it is typically straightforward to trace that path while assigning turning numbers to an initial configuration such that there is some trajectory that folds the shape. However, making the step forward to then show that all trajectories fold that shape may involve significant and subtle argumentation, or may be impossible. Programming in the model seems simple, the analysis may not be. This has the benefit of pulling hardness away from the molecular robot design and implementation problem (which is a rather challenging experimental problem) and instead pushing it towards a theoretical geometric analysis problem, exactly where we’d prefer it to be.
Related and future work
Besides finding insights at the interface of computation and geometry, another ultimate aim of this kind of work is to bridge the gap between what we can imagine in theory and what we can engineer in the lab (Ramezani and Dietz 2019). Biological systems actuated at the molecular scale provide inspiration: in the gastrulation phase of embryonic development of the model organism Drosophila melanogaster, large-scale rearrangements of the embryo are effected by thousands of (nanoscale) molecular motors working together to rapidly push and pull the embryo into a target shape (Dawes-Hoang et al. 2005; Martin et al. 2008).
Our Turning Machine model is a restriction of the nubot model (Woods et al. 2013), a molecular robotic model with many features including self-assembly capabilities, random agitation (jiggling) of monomers, the ability to execute cellular automata style rules, and floppy/rigid molecular bonds. The parallel computing capabilities (Chen et al. 2014b), and construction using random agitation and self-assembly (Chen et al. 2014a) have been studied. Dabby and Chen consider related (experimental and theoretical) systems that use an insertion primitive to quickly grow long (possibly floppy) linear structures (Dabby and Chen 2012), later tightly characterised by Hescott et al. (2017); Hescott et al. (2018) in terms of number of monomer types and time. Hou and Chen (2019) show that the nubot model can display exponential growth without needing to exploit state changes. Chin et al. (2018) look at both minimising numbers of state changes and number of ‘2D layers’ to assembly 1D structures. There are a number related autonomous self-folding models, both 1D to 2D (Cheung et al. 2011) and 2D to 3D (Connelly et al. 2010), and reconfigurable robotic/programmable matter systems, e.g. (Aloupis et al. 2009, 2008; Demaine et al. 2018; Geary et al. 2016; Gmyr et al. 2019; Michail et al. 2019).
There are several avenues for future work.
Concretely, it remains to fully characterise the classes of shapes foldable with zero error (Open Problem 26). For example, can our main negative result showing the impossibility of folding spirals be generalised to give impossibility result for wider classes of shapes? Can we find new techniques to increase the class of shapes that are foldable (with zero error), beyond the zig-zag rastering techniques we heavily use in Sects. 6.1–6.3 (to fold squares, and certain other y-monotone shapes including those with a yw-separator at scale factor 2).
Establishing error bounds for various classes of shapes, including trade-offs between notions of shape complexity and error could be another avenue to explore. It seems interesting to consider folding where we permit a small number of trajectories to be permanently blocked.
In this paper, our positive results are mainly for model instances with either positive integer states, which define an anti-clockwise rotation-and-translation motion about the origin, or with negative integer states which define a clockwise motion; our negative results hold for both directions. Does the combination of both anti-clockwise (positive) and clockwise (negative) turning rules strictly increase the expressivity of the model?
Using a variant (Woods et al. 2013; Chen et al. 2014a) of the model with random agitation of monomers would side-step our negative result about the impossibility of reaching a full line rotation, essentially by allowing reversible movement out of blocked configurations (although upon reaching the target configuration, the Turing machine would also immediately reverse out it). We don’t know if adding agitation to the model can help increase the set of foldable shapes, however since it is a somewhat natural physical notion it is worth investigating—either with or without the notion of locking into position when a monomer has completed all of its movements by reaching state 0. Indeed, the analysis of such systems would provide intellectual fruit by mixing probability, geometry and computation.
As indicated in Fig. 1, it is straightforward to generalise the model to (say) 2D trees folding into 3D shapes.
We know that certain kinds of zig-zag paths (e.g. over-and-back parallel to x-axis, while moving monotonically either positive or negative along the y axis, see for example Fig. 8) are efficiently foldable, and under certain conditions mixing of two kinds of of zig-zag paths are foldable (e.g. prooxf of Theorem 33 and Fig. 10).
In all of these cases fully characterising the classes of shapes that can be folded, and characterising the time to fold such classes of structures, provides questions whose answers would expand our understanding of the capabilities of simple reconfigurable robotic systems.
Turning machine model definition
In this section we define the Turning Machine model. Formally speaking, the model is a restriction of the Nubot model (Woods et al. 2013), for simplicity we instead use a custom formalism.
Grid. Positions are pairs in defined on a two-dimensional (2D) triangular grid using x and y axes as shown in Fig. 2. We use the notation to denote points in the positive orthant, or positive sextant, of the 2D triangular grid. For convenience, we define a third axis, w, centred on the origin and running through the point . We let denote the unit vectors along the x, y and w axes.
Monomer, configuration, trajectory. A monomer is a pair ) where is a state and is a position. A configuration, of length , is a tuple of monomers whose positions define a length simple directed path (or non-self-intersecting chain) in (on the grid ) and where .4
A configuration is a tuple of monomers . A final configuration has all monomers in state 0. A pair of configurations is said to be a step if yields via a single rule application (defined below) which we write as . A trajectory, of length k, is a sequence of configurations where, for each the pair is a step . A Turning Machine initial configuration is said to compute the target configuration if all trajectories that start at lead to , and is said to compute its target configuration if it reaches the configuration with all monomers in state 0. A Turning Machine instance is an initial configuration. For a monomer , we let denote its state in the initial configuration, and we let denote the horizontal line through . Given a monomer in configuration c we say that for monomer points in direction if . By convention, monomer does not point in any direction, and whenever we say all monomers point in some direction , we mean all except . A configuration is reachable from configuration c if there is at least one sequence of rule applications from c to (if c is not specified we mean the initial configuration ).
Turning rule: state decrement/increment. Let be the set of states that appear in the initial configuration. Let and , and let be the called the Turning Machine state set. The turning rules of a Turning Machine are defined by a function r such that for all states :
1 |
Let be the set of all configurations. The turning rule is a function and R(c, i) is said to be applicable to monomer in configuration c if and the rule is not blocked (defined below). If the rule is applicable, we write and say that R(c, i) yields the new configuration , and we say that is a step.
Turning rule: blocking. For , we define the head and tail of monomer as and . Consider the following tuple of unit vectors: , and let denote the kth element of that tuple. Let be the direction of monomer , and then if let , or if let . For a vector we write to mean the monomer translated by . Define5If the set of positions of has a non-empty intersection with the set of positions of we say that the rule is blocked, and the rule is not applicable. If the rule is not blocked, it is applicable and the resulting next configuration is ,
A configuration c is said to be permanently blocked if (a) not all states are 0, and (b) none of the monomers in c has an applicable rule. A monomer m within a configuration c is said to be temporarily blocked if (a) m is not in state 0, and (b) there is no rule applicable to m, and (c) there is a trajectory starting at c that reaches a configuration where there is a rule applicable to m.
Time. A Turning Machine evolves as a continuous time Markov process. The rate for each rule application is 1. If there are k applicable transitions for a configuration (i.e. k is the sum of the number of rule applications that can be applied to all monomers in ), then the probability of any given transition being applied is 1/k, and the time until the next transition is applied is an exponential random variable with rate k (i.e. the expected time is 1/k). The probability of a trajectory is then the product of the probabilities of each of the transitions along the trajectory, and the expected time of a trajectory is the sum of the expected times of each transition in the trajectory. Thus, is the expected time for the system to evolve from configuration to configuration , where is the set of all trajectories from to , and is the expected time for trajectory t.
Example. These concepts are illustrated in the proof of Lemma 4 in Appendix A, and in the example in Fig. 3.
Introduction to line rotation turning machines
Every Turning Machine analysed in this paper starts with monomers, sitting on the x-axis, pointing to the east. We define a class of Turning Machines which we call line rotation Turning Machines.
Definition 1
(Line rotation Turning Machine) Let and let be the Turning Machine with initial configuration of n monomers all pointing to the east, positioned on the x-axis (), and for all monomers in the same state and .
Remark 2
The initial monomer state dictates that each monomer wishes to turn (have a rule applied) a total times, i.e. be rotated through an angle of .
Remark 3
(Target configuration) For intuition, if there was no notion of blocking in the Turning Machine model, that is, if the model permitted self-intersecting configurations (which it does not), then the final configuration c of the Turning Machine in Definition 1 is a straight line of monomers sitting along the ray that starts at the origin and is at an angle of , i.e. at positions and all pointing to the west. We call c the desired target configuration of the line rotation Turning Machine . Also, if there was no notion of blocking: expected time to completion would be fast, (by a generalisation of the analysis used in the proof of Lemma 4). However, a model with no blocking would be rather uninteresting.
Figure 3 (left) illustrates Lemma 4 and Appendix A contains its straightforward, yet instructive, proof.
Lemma 4
For each , the line-rotating Turning Machine computes its target configuration, and does so in expected time.
Tools for reasoning about turning machines
The following lemma is illustrated in Fig. 3 (right).
Lemma 5
Let and let be a Turning Machine with initial states for all . For any monomer in a reachable configuration c of , the monomers are positioned on or above , and are positioned on or below , where is a horizontal line passing through .
Proof
The claim follows from the fact that in any configuration of , and for any the angle of the vector (from monomer to ) is either , , , or (and, in particular, is not strictly between and ).
The notion of turn angle of a monomer is crucial to our analysis and is illustrated in Fig. 4.
Definition 6
(Turn angle) Let c be the configuration of an n-monomer Turning Machine and let . The turn angle at monomer is the angle between and , and it is the positive counterclockwise angle if the points make a left turn,6 and the negative clockwise angle otherwise.
For a monomer , the following definition gives a measure, , of how its state has progressed since the initial configuration.
Definition 7
Let c be a reachable configuration of an n-monomer Turning Machine, let be a monomer with state in c and initial state . We define to be the number of rule applications to (or, moves of) the monomer from the initial configuration to c. That is, .
Lemma 8
(Difference of State is ) Let , and let c be any reachable configuration of an n-monomer Turning Machine with all monomers pointing in the same direction in its initial configuration, then
for all .
Proof
Let , for and , denote the monomer in the configuration . Initially, for all monomers , and thus .
Observe, that because otherwise making c a self-intersecting (non-simple) configuration, contradicting its definition.
By Eq. (1), when a rule is applied to one of or the absolute value of its state decreases by 1 and its increases by 1. Then . When a rule is applied to some other monomer with , then . Thus, after each rule application the value of changes by at most 1, and as it cannot be equal to 3, we have that .
We can now prove the following lemma, which gives a relation between the states of any two monomers of a Turning Machine and the geometry of the current configuration.
Lemma 9
Let c be any reachable configuration of an n-monomer Turning Machine , whose initial configuration has all monomers pointing in the same direction, and let and be two monomers of c such that , then
where is the turn angle at monomer .
Proof
For any intermediate configuration, the turn angle between monomers and depends only on the number of moves each monomer has made. Initially, . It increases by each time monomer moves anti-clockwise or monomer moves clockwise, and it decreases by every time monomer moves clockwise or monomer moves anti-clockwise. By Lemma 8, for two consecutive monomers and , in any configuration, . Hence, for a pair of consecutive monomers and , the turn angle is in the range , and thus . Summing over all i gives the lemma conclusion.
The following technical lemma is used extensively for our main results. Intuitively, it tells us that high-state monomers are not blocked.
Lemma 10
Let be a Turning Machine with initial state values for all . In any reachable configuration c of no monomer with is blocked (neither temporarily blocked nor permanently blocked).
Proof
Suppose, for the sake of contradiction, there is a blocked monomer with . Then there exist two monomers and such that , where is the position of in (see Fig. 5).
By definition of head and tail we know that . Consider the closed chain . Since configurations are simple, P defines a simple polygon. The turn angles of a simple polygon sum to if the polygon is traversed anticlockwise (interior of P is on the left-hand side while traversing), or if the polygon is traversed clockwise (interior of P is on the right-hand side). For P, this sum is defined as:
where is the turn angle at monomer , and and are the turn angles of the polygon at vertices and respectively (see Fig. 5). More precisely,
Furthermore, by Lemma 9,
Thus,
Observe that when a monomer moves, its head translates in the direction corresponding to the current direction of rotated by angle . Therefore, the state of can be represented as a function of the state of and the angle , more precisely
(See Fig. 5 for an example.) Therefore, by the previous two equalities
Recall, that the angle , that by the assumption of the lemma, and that . If the polygon defined by P is traversed anti-clockwise, then
which implies that is out of the range of valid states, as must have moved more times as its initial state. Else, if the polygon P is traversed clockwise, then
which again implies that is out of the range of valid states, as must have moved in the wrong direction. In either case we contradict that the state is in the range of valid states, and, therefore, the monomer is not blocked.
Lemma 11
Let be a line-rotating Turning Machine with . Let c be a reachable configuration of where each monomer in c has . Then the line-rotating Turning Machine has a reachable configuration such that for every , and the geometry (chain of positions) of c is equal to that of the rotation of by around the origin.
Proof
Consider the sequence rule applications (moves) that brings the initial configuration of to configuration c. We claim that can be converted into another sequence , of the same length, in which the first moves are by monomers in state s.
First, we claim: for any two consecutive moves, where the second move is applied to a monomer in state s, swapping the two moves results in a valid sequence of moves transforming the Turning Machine into the same configuration. Let the first move be applied to monomer which transitions from state to , and the second move be applied to monomer which transitions from state s to . Suppose for the sake of contradiction that swapping the moves results in at least one of the monomers or being blocked. We begin by attempting to apply the move to monomer , but, by Lemma 10, that move is not blocked. Then we attempt to apply a move to monomer , but that is not blocked either since the coordinates of all monomers before and after swapping the two moves are exactly the same; i.e. the resulting configuration is a valid (non-self-intersecting) configuration in both cases. Hence neither monomer is blocked.
Thus, the original sequence of moves resulting in configuration c, can be converted into another sequence where the first moves are applied to monomers in state s. Then, after the first moves the configuration of is equivalent to the initial configuration of but rotated by and with all monomers in state . Hence equivalent to the initial configuration of rotated by .
Applying the remaining moves to transforms it into configuration .
Line rotation: possible and fast, impossible
Line rotation to
In this section we show that for the line-rotation Turning Machine computes its target configuration of a rotated line (Theorem 12), and does so in expected time (Theorem 13). In addition to those results for any state , in Appendix A we include stand-alone proofs for each of , , and which showcase a variety of geometric techniques for analysing Turning Machine movement, but are not needed to prove our main results. Also, the cases of and are illustrated in Figs. 3 and 6 .
Theorem 12
For each and , the line-rotation Turning Machine computes its target configuration.
Proof
We prove by induction on that any reachable configuration c of is not permanently blocked.
Base case . In any configuration reachable by , monomers have either state or 0. Monomers in state cannot be permanently blocked by Lemma 10. Thus, any non-final configuration is not permanently blocked.
Assume for the claim is true, i.e. it holds for . We will prove that for s it is also true, i.e. it holds for . Suppose, for the sake of contradiction, there is a permanently blocked configuration c of for some and . If there is no monomer in c in state s, then by Lemma 11 there exists a corresponding configuration in with monomers , such that, for any monomer in c with state the corresponding monomer in has the same state . Configurations c and form chains equal up to rotation by angle . Configuration is not blocked by the induction hypothesis, thus configuration c cannot be blocked either.
On the other hand, if there is a monomer in configuration c in state s, then by Lemma 10 it is unblocked, and configuration c, again, is not blocked.
Hence the induction hypothesis holds for s, and does not have a reachable permanently blocked configuration.
Theorem 13
For each and , the line-rotation Turning Machine computes its target configuration in expected time .
Proof
By Theorem 12, computes its target configuration. For the time analysis we use a proof by induction on , in decreasing order.
The induction hypothesis is that for a reachable configuration of with maximum state value u (there may be states in the configuration), the expected time to reach a configuration with maximum state is .
For the base case we let and assume c is such that all monomers are in state u. Hence c is an initial configuration and hence, by definition, is reachable. By Lemma 10, monomers in state s are never blocked and hence we claim that the first configuration with maximum state appears after expected time . To see this claim, note that for each monomer in state the rule application that sends to state occurs at rate 1, independently of the states and positions of the other monomers (by Lemma 10, there is no blocking of a monomer in state ). Since there are n monomers in state u, the expected time for all n to transition to is Graham et al. (1989):
2 |
We assume the inductive hypothesis is true for , and we will prove it holds for u. Thus, there exists a reachable configuration where the maximum state value is , which is reachable from in expected time. Let there be monomers in state u in . By Lemma 11, there is a line-rotating Turning Machine that has a reachable configuration such that for every in , and the positioning of is equal to the rotation of by around the origin. By Lemma 10 monomers in state u in are never blocked, hence monomers in state u in are not blocked either. Setting in Eq. (2), and noting that , proves the inductive hypothesis for u.
Since we need to apply the inductive argument at most times, by linearity of expectation, the expected finishing time for the s processes is their sum, .
Negative result: line rotation to is impossible
Theorem 14
For all , the line-rotating Turning Machine does not compute its target configuration. In other words, there is a permanently blocked reachable configuration.
Proof
Figure 7, looking only at the first 7 (initially blue) monomers, shows a valid trajectory of , then ends in a permanently blocked configuration, hence the lemma holds for .
Let , and in Fig. 7 let the red line segment denote a straight line of monomers co-linear with the red line segment. By inspection, it can be verified that (a) in all 25 configurations the line does not intersect any blue monomer, and moreover (b) the transitions from configurations 1 through 14, configurations 17 through 23, and configuration 24 to 25 are all valid, meaning that the length line does not block the transition. The transitions for configurations 14 through 17 are valid by Theorem 12 (with ) and the fact that the last blue monomer (the origin of ) is strictly above all other blue monomers (hence the rotation of proceeds without permanent blocking by blue monomers). The transition for configuration 23 to 24 is valid by applying Lemma 4 (or Theorem 12, with ) reflected through a horizontal line that runs through the last blue monomer, and the fact that the last blue monomer (the origin of ) is strictly below all other blue monomers (hence the rotation of proceeds without permanent blocking). Thus all transitions are valid and the permanently blocked configuration is reachable, giving the lemma statement.
Folding shapes
In this section we show how to fold certain kinds of shapes with Turning Machines, and we show that other kinds of shapes are impossible to fold, and that others are not foldable but can be approximated.
Definition 15
(Shape) A shape is a set of points in the grid such that its induced graph is connected (using unit length edges on ).
Definition 16
(xy-connected shape) An xy-connected shape S is a set of points in the grid such that if we remove all the edges parallel to the direction from the induced graph of S, it remains connected.
For example squares are a classic benchmark shape in self-assembly:
Definition 17
( square) For the square is the set of points such that .
Typically, we are interested in folding a shape with a Turning Machine, and ideally we’d like each monomer to sit on one point of the shape, but in the non-ideal case there are errors:
Definition 18
(Error of folding a shape) Given a shape S and Turning Machine configuration c, the error of folding of c with respect to S is the size of the symmetric difference of the shape and the positions of c (i.e., the number of positions of c that are not in S, plus the number of positions S not in c).
Folding zig-zag paths and squares
Recall that a path in is simple, connected and directed, and its length is the number of its points. Intuitively, a zig-zag path is a path that winds over and back parallel to the x axis, while heading off in one direction (positive or negative) along the other two axes. For example, Fig. 8 shows a positive zig-zag path that rasters an square (traced out by a Turning Machine configuration).
In this section, we apply our techniques from previous sections to help us prove Theorem 21, which states that zig-zag paths (Definition 19) are foldable by Turning Machines in expected time logarithmic in path length. Since for any , an square can be rastered (traced out) using a zig-zag path, we then get that they too are efficiently foldable by Turning Machines.
Definition 19
(Zig-zag path) A positive zig-zag path, or simply zig-zag path, is a path in composed of unit length line segments that run along directions , and . A negative zig-zag path, has unit length line segments that run along , and .
The previous definition captures the intuition of a path that zig and zags over and back (e.g. Fig. 8) but is much more general since a positive, respectively negative, zig-zag path is any path that is monotone in y (and hence in w), respectively (and hence in ).
The following lemma will find future use in showing that a Turning Machine folds a positive zig-zag path.
Lemma 20
Let c be any configuration reachable by a line-rotating Turning Machine , then there is a Turning Machine that has c as its target configuration. Moreover, runs in expected time .
Proof
We first define as having the initial configuration , of length , where for monomer in has state , where is the state of monomer in c. By hypothesis, c is reachable in , which means there is a trajectory (sequence of rule applications) from the initial configuration of to c, thus applying the same sequence of moves in , starting with , also yields c. We need to show that c is the target of (meaning all trajectories from reach c).
We will define a “suppressed--system” to be a Turning Machine-like system7 that acts like in all ways, except that for each i, after monomer reaches state any rule application to is “suppressed” (not applied).8 By Lemma 10, for any i where , monomer in the suppressed--system is never blocked since to experience blocking a monomer needs be in the process of transitioning from state 1 to 0, which never happens for ). In other words, we only expect blocking to affect monomers for which . Consider such a monomer . By applying Conclusion (i) of Lemma 40 to we note that blocking only occurs if is in state 1 and is adjacent to a monomer in state 3. However, such blocking is temporary, which follows from the claim that that adjacent monomer eventually leaves state 3: to see the claim note that: (a) does not experience permanent blocking (hence does not) and (b) , since otherwise two monomers would occupy the position in c which contradicts the positions of c tracing out a path (i.e. non-self-intersecting). Therefore, since there is no permanent blocking in the suppressed--system it always reaches c.
Both and the restricted--system have the same set of trajectories because (a) suppressed rules in the restricted--system make no change to a configuration, and (b) for any configuration it has the same set of applicable (non-suppressed) rules in the restricted--system and in .
For the time analysis, we analyse the expected time for the restricted--system to reach c. To do that, we consider two processes (two Markov chains): the process where rules are applied/blocked and the process where rules are suppressed. Observe that suppressed rules do not change a configuration and do not change the rate of applications of rules, thus from now on in our analysis, we ignore the latter process. For the restricted--system to reach c, applicable rules are either unblocked (rate 1 per rule application) or temporarily blocked, and the latter case only occurs when a monomer in state 1 is adjacent to a monomer where is in state 3 and is unblocked (as argued above). Since all such are unblocked, the expected time until they are all in a state is , after which there are no blocked monomers in the resulting configuration. The rule application process then completes in expected time , giving an overall expected time of .
Theorem 21
A positive, or negative, zig-zag path P, of length n, is foldable by a Turning Machine in expected time .
Proof
Let P be a positive zig-zag path. We begin by defining a length-n Turning Machine whose target9 configuration c traces out the zig-zag path P. By the definition of P, each monomer in c points in one of the directions and . For any configuration , and , let denote monomer in configuration . In the initial configuration of , for we define monomer to have the state
3 |
and , where , i.e. the direction of as defined in Sect. 2. Thus the initial configuration has all states .
Let denote the initial state of monomer . Consider the line-rotating Turning Machine in its initial configuration and consider the following trajectory. We begin by moving sequentially along the chain of monomers from left to right starting at , and for each monomer with we apply a turning rule to once. After we reach monomer , we move back along the chain and for each monomer such that we apply a turning rule to it. After we get back to , we once again move left to right and for each with we apply a turning rule to it. Once we reach again we are done. At this point each monomer has had turning rules applied and thus we are in a configuration which traces out the path P. Since target configuration c of traces out the path P, c is reachable by . Thus by Lemma 20, folds P in expected time.
For a negative zig-zag path P, we use the same proof but mirror-flipped around the x-axis, and using negative (instead of positive) turning numbers.
An example of an square (Definition 17), with in the example, is traced out by the path in Fig. 8 (left). Since for any n the square is traced out by a positive zig-zag path, by Theorem 21 we immediately get the following corollary:
Corollary 22
For any , the square is foldable with zero error and in expected time .
Folding y-monotone shapes, but with error
If we permit error in a folding, by which we mean that some points of the folding are not in the shape (or vice-versa) then any shape is foldable. In particular, for any shape S there is a (boring) Turning Machine that folds a zig-zag traversal of the bounding rectangle of S. The error will be bounded by the area of S. Can we do any better? In this section, we show that, yes, the class of y-monotone shapes are foldable with error bounded merely by the perimeter of S, and if we allow spatial scaling for y-monotone shapes with the yw-separator property (see Definition 29) we have zero error.
Definition 23
We say that a shape is y-monotone if the points along each of its y-coordinates form a line segment.
The perimeter of a shape is defined as the set of points in the shape that are adjacent (in ) to point(s) not in the shape, and the perimeter length is the number of points in the perimeter. A traversal is a simple path in . A zig-zag traversal is a traversal that traces a positive (or negative) zig-zag path (Definition 19) such as the square shown in Fig. 8 (Left).
Theorem 24
Any y-monotone shape S can be folded with error no more than the perimeter length of S, and no more than the perimeter of the shape induced by the folding. Moreover, S is folded with error in expected time .
Proof
We will give a zig-zag traversal that covers all points of the shape, as well as possibly a number of points outside the shape, but within the stated error bound. We will then show that the traversal is foldable using the techniques from Sect. 6.1.
For each y-coordinate in the shape, i.e. where the shape is of height (or span) H along the y-axis, let denote the set of points along y. The set is a line segment by y-monotonicity of the shape S.
We define a zig-zag traversal that includes all points of S: If i is an even index such that is a y-coordinate of S, then let include all points of , plus any points p to the right of such that there is a point , and any points p to the left of such that there is . Else if i is an odd index such that is a y-coordinate of S, then let include all points of , plus any points p to the left of such that there is a point , and any points p to the right of such that there is .
In either case is a line segment, this follows from the fact that S is connected and y-monotone. For we write to mean the jth point, where for even i we index from the left hand side (from smallest to largest x-coordinate), and for odd i we index from the right hand side (from largest to smallest x-coordinate) of the line segment .
We next claim that the sequence is a path that includes all points of S. Writing point-by-point:
First, includes all points of S because for each i where is a y-coordinate of S, the set of points includes all points at y-coordinate of S (because does and ). Second, we need to show that is a simple path. is composed of non-intersecting line segments therefore is simple. To see that is connected it suffices to observe that for each , . This completes the claim that is a path that includes all of S.
For the error, any point in that is not in S is adjacent to a perimeter point of S, this follows from the definition of , i.e. points in are not in S but are adjacent to points in .
Also, there is no perimeter point p of S such that there are points of adjacent to p (if there were, this would contradict being simple, or S being connected/y-monotone).
Since is a zig-zag path, it is foldable in expected time by Theorem 21.
Theorem 24 states that all y-monotone shapes are foldable, albeit with some error. One might ask: Is it possible to fold y-monotone shapes without error? The answer is no, via a straightforward argument:
Theorem 25
There are y-monotone shapes that require folding error .
Proof
Let S be a cross shape with width-1 line segments for arms, with arm length , as illustrated in Fig. 9.
Since S is y-monotone, by Theorem 24 it is foldable (with error) by a Turning Machine, but since it is not Hamiltonian (does not have a traversal), any folding of it has non-zero error.
Theorem 25 feels unsatisfactory: it is not fair to ask Turning Machines to exactly (zero error) fold shapes that don’t even have an error-free traversal. Later, in Theorem 38, we give a much stronger result: there is a class of shapes that are unfoldable (with zero error), even though each shape in the class has a (zero error) traversal, and moreover that traversal is foldable on at least one Turning Machine trajectory.
We leave the following open problem as future work:
Open Problem 26
Characterise the class of shapes that are foldable with 0 error.
In the next section we make some partial progress.
Folding scaled shapes with 0-error
In this section we present an approach to folding spatially scaled shapes with 0-error. In our setting, factor-2 scaling is sufficient. See an example in Fig. 10.
Definition 27
Given a shape S, we define its scaled version by a factor k in the following way. Each vertex is replaced by a square in shape . That is, for every , shape contains all grid-vertices .
If we blindly attempt to take our approach of folding with error, Theorem 24, and attempt to apply it directly to fold factor-2 scaled shapes, we will fail (for example, consider a factor-2 scaled version of the cross in Fig. 9). However, in this section we introduce a sufficient property of a shape S to have, such that its scaled version is foldable by a Turning Machine (leading to Theorem 33).
Let be a chain of grid-vertices in S. That is, C is a non-self-intersecting sequence of grid-points such that and are neighboring grid vertices, for all i.
Definition 28
We say that chain C is a yw-chain if the y-coordinates of and differ by exactly one.
Note that in this case C is a chain of straight-line segments parallel to one of the or directions.
Now, let S be a y-monotone shape, let be the y-coordinate of its bottom most row, and let be the y-coordinate of its topmost row.
Definition 29
We say that chain is a yw-separator of a y-monotone shape S if (1) C is a yw-chain, (2) for all i, and (3) the y-coordinates of and are and , respectively.
First, we prove that a scaled version of an xy-connected y-monotone shape with a yw-separator can be partitioned into two pieces with “nice” left and right boundary, respectively (see Fig. 10 (right)).
Definition 30
Define the left (right) boundary of a y-monotone shape S to be the set of the leftmost (rightmost) grid-points in every row of S.
Definition 31
Given the yw-separator C of a y-monotone shape S. Define as the set of grid points in that corresponds to C in S, that is, for each , we denote the four points in corresponding to , as , , , and
Consider the yw-separator C of S, where S is a xy-connected y-monotone shape, and consider the grid-points of .
We cut in between the points of in the following way (refer to Fig. 11). Let and be the rightmost boundary of and the leftmost boundary of respectively. Assign the bottommost points to and to .
For two consecutive points and on C, if is parallel to , then assign and to , and and to .
Otherwise, if is parallel to , then one of the following cases holds: either the point belongs to S, or the point belongs to S. Indeed, as S is a xy-connected y-monotone shape, one of the two points must belong to S. Then, in the first case, when belongs to S, we assign one point to , and three points , , and to . In the second case, when belongs to S, we assign three points , , and to , and one point to .
Finally, assign the topmost points to and to .
In the following lemma we prove that the described method indeed partitions into two simply-connected pieces with yw-chains on the right and left boundary.
Lemma 32
Let S be an xy-connected y-monotone shape that has a yw-separator. Then can be partitioned into two simply-connected y-monotone pieces and such that (1) every row of is partitioned into two non-empty subsets, with the left belonging to , and the right to , and (2) the right boundary of and the left boundary of form yw-chains.
Proof
We argue that by splitting between the two chains and constructed above, we indeed obtain such and .
First, observe that and are both yw-chains. Indeed, for each pair of rows in corresponding to a row in S from to both and have grid-points assigned to them (from the points corresponding to either grid-points in or adjacent grid-points in direction or ). Furthermore, by construction, for every two consecutive points (and ) they differ in y-coordinate by exactly 1, and they differ in x-coordinate by 0 or .
Furthermore, observe that and are both yw-separators of , as they span from the bottommost to the topmost row of .
Let consist of and all the grid-points of to the left of , and let consist of and all the grid-points of to the right of . Shapes and are simply-connected, as and are connected, and have yw-chains on the rightmost and the leftmost boundary respectively.
We next define a traversal of . Consider the shapes and constructed as described in the proof of the above lemma. For each pair of rows of corresponding to a row in S, we traverse the bottom of the two rows of from the grid-point on left to the end of the row, and return to the grid-point on along the top one of the two rows (see Fig. 10). As the two leftmost grid-points of the two rows in correspond to the same grid-point of S, the traversal from the first to the second row is valid. Similarly, we traverse the bottom of the two rows of from the grid-point on right to the end of the row, and return to the grid-point on along the top one of the two rows. As and are yw-chains, the traversal between the two pairs of rows in and is valid as well. Finally, we connect the two parts of the traversal across and in the bottommost row of .
Theorem 33
Let S be an xy-connected y-monotone shape that has a yw-separator C, then is foldable by a Turning Machine in expected time .
Proof
We prove that the Turning Machine defined as follows folds the shape , i.e. on all trajectories. Let consist of n monomers , where n is the number of grid-points of , and the first monomer corresponds to the topmost grid-point of (defined above). In the folded state, traverses from top to bottom, and then traverses from bottom to top. Let the initial states of the monomers forming the bottommost row (except for the rightmost one) of be 0. Applying Lemma 9 we derive the initial states of the remaining monomers (refer to Fig. 10). Let monomer correspond to a grid-point . We consider the following cases: is in an odd or even row of ; furthermore, we consider the cases when is the leftmost point, the rightmost point, or an interior point of the row. Let and , where and are the bottom most grid-points, and and are the top most grid-points. Let be in an odd row, then
if and , then if is parallel to , and if is parallel to ,
otherwise, if or , then .
Let be in an even row of , then
if is the leftmost point in its row, then ,
otherwise, .
Similarly, for the monomers whose final positions fall in , we specify the following initial states. Let be in an even row of , then
,
if and , then if is parallel to , and if is parallel to ,
otherwise, if , then .
Let be in an odd row of , then
if is the right point in its row, then ,
otherwise, .
We claim that indeed computes and does not enter a permanently blocked configuration for any sequence of transition rules (trajectory). Assume that there is a configuration c that is reachable from the initial configuration of that is permanently blocked. Let be the monomer corresponding to the bottommost grid-point of , that is, is the last monomer in the traversal that is still in . Let and be Turning Machines consisting of the monomers and correspondingly. Similarly to the proofs of Theorems 21 and 24 , we can argue that and individually compute the shapes and , i.e., they fold without entering in a permanently blocked configuration. Thus, if is blocked, then for every monomer there must be a pair of monomers with and with that are blocking the transition of .
Consider individual folding of the Turning Machine . Without loss of generality, let the monomer be fixed in the origin of the coordinate system, and the remaining monomers move with respect to it. We consider the cut between the shapes and in this global coordinate system, and extend its ends to infinity along the direction (see Fig. 12). We claim that the monomers of always remain to the right of . Consider how the position changes when the transition rules are applied to the monomers of . The monomers of rotate from orientation to , from to , and from to . If a monomer moves, where , the position of does not change. If a monomer moves, where , the position of changes by one unit distance in the directions , , or . Suppose in an intermediate configuration some monomer has a position to the left of the cut . From this moment on, the position of is confined to a with its apex in and the two rays emanating in the directions and . Thus, monomer will never cross the cut to the right side, and thus does not compute .
Similarly, we argue that the monomers of always remain to the left of the cut . This implies that there can never be a blocked pair with and with . Therefore, folds on every trajectory.
For the time analysis, we note that the target configuration of is a negative zig-zag path, and the target configuration of is a positive zig-zag path. By Theorem 21, both and would each individually fold in expected time if they were separate Turning Machines. In the construction in this proof, we show that monomers in don’t block any monomers in (and vice-versa), hence even if both and are joined, they fold independently. Thus, completes in expected time.
Shapes that have a traversal, yet are not foldable: spirals
The goal of this section is to prove Theorem 38, which gives a class of shapes that have a traversal yet are not foldable. Specifically, the following definition of k-turn, 1-gap, spiral, defines a particular kind of spiral that makes k anti-clockwise turns, and has its arms held at unit distance (gap 1) apart, as shown in Fig. 13.
Definition 34
(k-turn 1-gap spiral) For , define the anti-clockwise k-turn 1-gap spiral to be , where is an “almost rectangle” formally defined as follows (see Fig. 13 for a pictorial definition):
Remark 35
For each k, the k-turn 1-gap spiral has two traversals—one starting at the centre, one ending at the centre. It can also be seen that k-turn 1-gap spiral has a Turning Machine that has a trajectory whose final configuration is the spiral— starts as a line with monomer at the centre of the spiral, and with initial states being turning numbers10 for the spiral curve. One can then imagine a trajectory that folds each arm of the spiral one at a time starting at the centre and working its way out (like rolling up a piece of paper). However, despite this, in this section we show that for each , the k-turn 1-gap spiral is not foldable by a Turning Machine (Theorem 38). The proof shows that any Turning Machine that attempts to fold a spiral must fail by either having invalid/illegal states, or else having at least one permanently blocked reachable configuration.
The following technical definition is used in the statement of Lemma 37. The notation , means .
Definition 36
For , let S be a k-turn 1-gap spiral. A sequence of inside-to-outside turning numbers for S is of the form
where is such that and
4 |
A sequence of outside-to-inside turning numbers for S is any sequence of the form
where is such that , and
5 |
Lemma 37
For , the k-turn 1-gap spiral is unfoldable by any Turning Machine M that has initial state sequence that is not one of the turning number sequences or from Definition 36.
Proof
From its definition, has exactly points, which, by a straightforward calculation, is the same as the length of the sequences of canonical turning numbers in Definition 36. If M does not have exactly monomers, does not fold (either it does not cover all points of or covers too many). Assume then that we are given a Turning Machine M with monomers, but that do not have states given by Definition 36.
The spiral has exactly two points, namely (0, 0) and , that have degree 1 (one neighbour in ); we respectively call them the inside and outside start points. If the spiral were foldable, then monomer is positioned on either the inside or outside start point. By Lemma 8, for all .
Suppose is the inside start point. If any of the remaining claims do not hold, then the is unfoldable:
Monomer ’s initial state is , by directionality of in the final configuration of M (if not, we are done because either finishes in state 0 but pointing in the wrong direction and thus places outside of , or else never reaches state 0 meaning is permanently blocked). Also, , for the same reason. But Lemma 8 tell us that for all , hence . (If not, we would get that M is blocked (by violating Lemma 8), or that M does not precisely trace the spiral (if ). Tracing around using the same reasoning for each point along gives that either or else M does not fold , giving the lemma conclusion for this case.
Else, is on the outside start point of . A similar argument (to the inside case) shows that or else M does not fold , giving the lemma conclusion for this case.
Theorem 38
(Shapes with a traversal, but are unfoldable) For all the k-turn 1-gap spiral is not foldable.
Proof
Suppose for the sake of contradiction that there is a Turning Machine M that folds , . By Lemma 37, there are two cases, either, (Case 1) M has initial states and , or (Case 2) and .
Case 1: M has initial states for (intuitively, folding the spiral from inside to outside).
We have (at the “centre” of the spiral), otherwise if M finishes with all monomers in state 0 it would place (many) monomers outside and we get the statement. There are three subcases: (a) all initial states are positive, (b) all initial states are negative, or (c) there are both strictly positive and strictly negative initial states:
Case 1(a): all initial states are positive ( for all ). Here, the idea is to find a reachable configuration of M that is permanently blocked, as illustrated in Fig. 14a. First, the M carries out repeated line rotations by , until reaching a configuration where is in state 0. Then the line of monomers rotates by , which puts in state 0. We next have the line of monomers rotate by , which puts in state 0, and parallel to the x-axis, pointing the direction (Fig. 14a, left). Next we apply a turning rule application to , and then another to (Fig. 14a, middle). Now we repeat the previous three steps, moving backwards along monomer indices, until we reach the configuration shown in Fig. 14a, right: i.e., for each (starting at ) apply one turning rule to , one to and then one more turning rule to , then decrement j and repeat. Eventually we reach a value of j for which no move is possible, yielding the permanently blocked configuration shown in Fig. 14a, right.
Case 1(b): all initial states are negative ( for all ). Here, the intuition is to block M by using the fact that line rotation is impossible (), as shown in Fig. 14b. First, by Definition 36, on . Moreover, for all monomer states to be negative, and by applying Eq. (4), it is case that . By the definition of () and since , there are monomers with initial state . Next we apply the main idea used to prove Theorem 14, and illustrated in Fig. 7 (there we folded in the anticlockwise direction, here it is clockwise). Specifically, we claim that the configuration shown in Fig. 14b, right, is reachable, since the 15 monomers have initial state , hence they are able to reach the configuration shown, and since the other monomers (orange, purple) can be moved as shown to enable the tight inner spiral to form. The configuration in Fig. 14b, right is not (yet) permanently blocked, but the 7 monomers in the inner tight spiral are permanently blocked and thus all trajectories forward lead to permanently blocked configurations.
Case 1(c): there are both strictly positive and strictly negative initial states. We know from the definition of , and the subcase we are in, that . Moreover, we claim that has a contiguous subsequence ; in other words there is an such that the initial state sequence, , contains the state subsequence . To see the claim, first note that by Definition 36, , and by Eq. (4) every 4th term (here, ) has the property that . Second, since and , there is some j such that , giving the claim. Let denote the segment of monomers with initial states (Fig. 14c purple segment). Then, the preceding segment has length and monomers all in initial state , and all monomers preceding that have initial state (by Eq. (4)). Hence the second configuration in Fig. 14c is reachable (decrement each monomer in twice). The succeeding segment has length and monomers all in state 1, and and all monomers succeeding that have initial state (by Eq. (4)). Hence the third configuration in Fig. 14c is reachable (increment each monomer in once, and each monomer in , for , three times). Figure 14c is permanently blocked.
Case 2: M has initial states for (intuitively, folding the spiral from outside to inside).
We have (at the “outside” of the spiral, bottom right corner), otherwise if M finishes with all monomers in state 0 it would place (many) monomers outside and we get the statement. There are three subcases: (a) all initial states are positive, (b) all initial states are negative, or (c) there are both strictly positive and strictly negative initial states:
Case 2(a): all initial states are positive ( for all ). this case is illustrated in Fig. 15a. The proof here is very similar to that of Case 1(b), in particular Fig. 15a is a reflection about the x-axis of Fig. 14b, and the only other difference here is that to reach a permanently blocked configuration we start turning from the monomers that are intended to become the shorter (rather than longer) arms of the spiral.
Case 2(b): all initial states are negative ( for all ). First, by Definition 36, on . Moreover, for all monomer states to be negative, and by applying Eq. (5), it is case that . We begin by applying turning rule applications to all monomers, until the first k monomers (i.e, ) have each reached state 0. Next we apply 2 turning rules to all non-zero monomers such that monomers with initial state turn to state zero (grey in Fig. 15b, left). Next we apply 1 turning rules to the remaining non zero monomers such that the monomers which were initially in state are now in state zero (purple in Fig. 15b, left). Next we apply 2 turning rule applications to monomers with in order to reach the ‘q-shaped’ configuration shown in Fig. 15b, right. We claim that all trajectories forward from this configuration reach a permanently blocked configuration: The first three “spiral arms” (monomers with initial states ) have reached state 0 and thus will not rotate any further. In order for the remaining non-0 state monomers to attempt reach the target configuration of , they can only make clockwise turns which results in them wrapping around the blocked inner region. Eventually all are permanently blocked
Case 2(c): there are both strictly positive and strictly negative initial states. This case is similar to that of Case 1(c). By the definition of (), and the subcase we are in, . Similarly to Case 1(c) we claim that the initial state sequence () = () contains the state sequence for some . To see this we first note that by Definition 36, , and by Eq. (5) every 4th term after the term is congruent to (that is to say such that ). Thus for some j with . We let denote this segment of monomers each with initial state 0. (Fig. 15c dark green segment). Then the preceding segment has length and has initial states 1 and the succeeding segment of length with initial state by Eq. (5). Hence the second configuration in Fig. 15 is reachable. The segment of length has initial state by Eq. (5). Hence the third configuration in Fig. 15c is reachable. Thus Fig. 15c is permanently blocked.
Acknowledgements
We thank Vera Sacristán and Suneeta Ramaswami for insightful ideas and important input. This work began at the 29th Bellairs Winter Workshop on Computational Geometry (March 21–28, 2014 in Holetown, Barbados), we thank Erik Demaine for organising a wonderful workshop and providing valuable feedback, and the rest of the participants for providing a stimulating environment. We also thank Dave Doty and Nicolas Schabanel for helpful comments. This paper expands upon the conference version published in Proceedings of the 26th International Conference on DNA Computing and Molecular Programming. Oxford 2020, Leibniz International Proceedings in Informatics (LIPIcs), with new material appearing in Sects. 6.2–6.4. We thank the anonymous reviewers of this work for insightful comments led to significant improvements of the text.
Appendix
Line rotation by , nd
In this appendix we present proofs that line-rotating Turning Machine for respective angles of , and terminates in expected time . These claims are superseded by the results in the main paper, but we include the proofs as they give a number of techniques to analyse the Turning Machine model.
Line rotation by :
The following proof of line rotation by radians is intended to be a simple example worked out in detail. Let be the Turning Machine defined in Definition 1 with , as illustrated in Fig. 3 (left).
Lemma 39
For each , the line-rotating Turning Machine computes its target configuration, and does so in expected time.
Proof
The initial configuration (Fig. 3, left) of is a line of monomers in state 1 with an additional final monomer in state 0, i.e. at time 0 the n states are . Since monomer states only change by decrementing from 1 to 0, any configuration on any trajectory of has its (composite) state of the form . Consider a configuration c in a trajectory of evolution of , and the corresponding state11. Let denote the ith monomer of in configuration c. For any such that , consider the unique configuration where and (and, by definition of next configuration step, implies ).
We claim that does not share any positions with , in other words, that is a non-self-intersecting configuration. To show this, consider a horizontal line through monomer and observe that in (and in c), the monomers lie on or below (because the path is connected and consists of unit length segments each at an angle of either or clockwise relative to the x-axis), but the monomers lie strictly above (because is strictly higher than , and because the path is connected and consists of unit length segments each at an angle of or to the x-axis). Hence there are no blocked configurations reachable by (neither permanent nor temporary blocking).
At each reachable configuration c, starting from the initial configuration, we can choose i independently from the set of non-zero states. The expected time for the first rule application is since it is the expected time of the minimum of independent exponential random variables each with rate 1. The next is , and so on. By linearity of expectation, the expected value of the total time T is
where the sum is the partial sum of the harmonic series, known to have a bound. Hence completes in expected time.
Line rotation by :
Next, we analyse line rotation of radians.
Lemma 40
Let be a line-rotating Turning machine, then:
-
(i)
only monomers in state 1 adjacent to a monomer in state 3 are blocked, and that blocking is temporary,
-
(ii)
any reachable configuration of has no more than 2n/3 blocked monomers, and
-
(ii)
there exists a configuration of that has exactly 2n/3 blocked monomers.
Proof
Consider any reachable configuration c of , and let monomer be blocked in c. By Lemma 10, monomers in state 2 and 3 are never blocked. By definition, monomers in state 0 are not blocked. Thus if is blocked it is in state 1, i.e. . We claim that in this case either or (or both). Consider the following two cases for :
- If , then by Lemma 5 all monomers of , except its first monomer , lie strictly above , and since lies on or below , we get that does not intersect , except possibly at . Whether intersects depends on the state of :
- If , then all monomers of lie strictly below (except its first monomer which is not at position ), hence cannot intersect . Then cannot be blocked.
- If , then does not intersect : Indeed, . Furthermore, let , , ..., be the longest consecutive subsequence of monomers in state 0 preceding monomer . Then , , ..., are all strictly to the west of . If , the non-zero-state12 monomer enforces that the monomers , , ..., lie strictly below . Thus is not blocked.
If : Both and have monomers on , but we claim the positions of do not intersect those of . If , then all monomers of except lie strictly below , and thus does not intersect (and recall that does not intersect because configurations are simple). If then the monomers lie along (pointing west). Note that a prefix of M is a suffix of and a (disjoint) suffix of M is a prefix of . Hence, in order for to intersect , one or both must depart from , but, by Lemma 5, can only do so by having monomers strictly below , and can only do so by having monomers strictly above . Thus, monomer can only be in state 3.
Therefore, if is blocked, then it is in state 1 and either or is in state 3, and thus is temporarily blocked which yields Conclusion (i) of the lemma. Hence, there cannot be three monomers in a row which are blocked, resulting in Conclusion (ii) of the lemma.
For Conclusion (iii), consider a line-rotating Turning Machine with for some k. The configuration c with state sequence has exactly 2n/3 blocked monomers, as every monomer in state 1 is either blocked by a preceding monomer in state 3, or by a following monomer in state 3.
Theorem 41
(rotate a line by ) For each , the line-rotating Turning Machine computes its target configuration, and does so in expected time .
Proof
By Lemma 40, no configuration has a permanently blocked monomer, hence every trajectory of ends in the target configuration.
At the initial step, the rate of rule applications is (there are monomers in state 3). Over time, for successive configurations along a trajectory, the rate of rule applications may decrease for two reasons: (a) some monomers may be temporary blocked, and (b) after a monomer transitions to state 0 no more rules are applicable to it. We reason about both:
Lemma 40(ii) shows that a configuration with state sequence has 2n/3 blocked monomers, and Lemma 40(ii) states that no configuration has more than 2n/3 blocked monomers for n divisible by 3. Using that fact, and in order to simplify the proof, we shall analyse a new, possibly slower, system where for any configuration c that has monomers in state , we “artificially” block monomers.13 Since this assumption merely serves to slow the system, it is sufficient to give an upper bound on the expected time to finish.
- A second “slowdown” assumption will be applied during the analysis and is justified as follows. Intuitively, the number of monomers transitioning to state 0 increases with time, and since monomers in state 0 have no applicable rules, this causes a decrease in the rate of rule applications. Consider a hypothetical continuous-time Markov system M, with 3n steps with rate decreasing by 1 every third step, that is, with successive rates . By linearity of expectation, the expected value of the finishing time T is the sum of the expected times for each of the individual steps :
where is the partial sum of the harmonic series with (see Graham et al. 1989). Since, in , it requires at least 3 steps to send a monomer from state 3 (the initial state) to state 0, no trajectory sends monomers to state 0 at a faster rate than a (hypothetical) trajectory where a transition to state 0 appears at every third configuration (step). Hence, if there were no blocking whatsoever, then the expected time for would be no larger than (given by Eq. (6)).6
Taking the blocking “slowdown assumption” in (a) into account, if the rate at step i is , then the slowed down rate is giving an expected time of
7 |
Since our two assumptions merely serve to define a new system that is necessarily slower than , we get the claimed expected time upper bound of for .
Line rotation by :
Lemma 42
Let be a blocked monomer in some reachable configuration c of a line rotation Turning Machine with and , and let and be a pair of monomers which block the movement of , then in the subchain of from to the number of unblocked monomers is at least half the number of blocked monomers.
Proof
Similarly to the proof of Lemma 10, consider the closed chain , ..., , . Let denote the x-coordinate of the position of monomer , and denote the y-coordinate of the position of monomer . Note, that for any ,
if , then and ,
if , then and ,
if , then and ,
if , then and ,
if , then and .
Let and , with . The total change in x-coordinate and the total change in y-coordinate, when traversing P, is zero, that is,
8 |
Considering the first part of Eq. (8), and taking into account that the x-coordinate increases only when traversing monomers in state s, and the x-coordinate decreases only when traversing monomers in state or , we get , where denotes the number of monomers with state u in the subchain from to . Observe, by Lemma 10, monomers in states s and cannot be blocked, and since , only the monomers in states or can be blocked. This implies, that within the subchain from to , the number of blocked monomers is at most within an additive factor 1 from the number of unblocked monomers.
Suppose, for a given subchain from to , the number of monomers in state s is strictly positive (that is, ). Then, , that is, in the subchain, the number of unblocked monomers is at least half the number of blocked monomers.
Now suppose that the number of monomers in state s in the subchain is zero (that is, ). As the blocked monomer has state either or , the x-coordinate decreases by 1 when traversing it. The x-coordinate only increases when traversing monomers in state s. Therefore, if there are no monomers in state s, has to be 1, and, besides the blocked monomer , the subchain from to consists only of monomers in states and .
Furthermore, as , we have that (that is, is in state ). We claim that there is at least one monomer in state in the subchain from to . Indeed, consider the second part of Eq. 8. Traversing the edge between monomers and changes the y-coordinate by . Thus there has to be at least one monomer traversing which increases the y-coordinate. This can only be a monomer in state . Thus, in the subchain from to , there is one blocked monomer and at least one unblocked monomer in state , and the total number of unblocked monomers is at least the number of blocked monomers.
Theorem 43
For each and , the line rotation Turning Machine computes its target configuration in steps.
Proof
By Theorem 12 the Turning Machine computes its target configuration. That it computes the target configuration in steps follows from the claim that in any intermediate configuration c, the number of blocked monomers is not greater than 3n/4.
To prove this claim, consider a reachable configuration c of , and consider all blocked monomers .
Let be the edge connecting the positions of two monomers and which block the movement of some monomer (note, that can be blocked by more than one pair of monomers). Let be the set of all such edges for all pairs and which block some monomer in . Observe, that no two edges in E cross each other, as they are unit segments in the triangular graph, and for the same reason no edge in E crosses the chain . Let the chain together with the set of edges E partition the plain into plane subdivision D (refer to Fig. 16). The bounded faces of D are formed of subchains of and edges from E. Now, remove the edges of E from D which are not incident to the outer face, resulting in a plane subdivision . In it, every bounded face is formed by a single subchain of and a single edge from E.
Observe, that all monomers of which are blocked are incident to at least one bounded face. Otherwise, there would be two monomers and blocking the move with the edge not in E, thus contradicting the definition of E.
For each bounded face in , by Lemma 42, we have where denotes the number of unblocked monomers incident to the face , and denotes the number of blocked monomers incident to the face .
Note, that each unblocked monomer can be incident to at most two bounded faces of , and recall that each blocked monomer is incident to at least one bounded face of . Then,
where the sums are over the bounded faces of , and denotes the total number of unblocked monomers in , and denotes the total number of blocked monomers in .
Since there is a constant fraction of unblocked monomers in any configuration, the total expected time it takes to compute its target configuration is .
Funding
Open Access funding provided by the IReL Consortium.
Footnotes
Having the monomer turning angle be confined to the range seems to capture a range of interesting and important blocking behaviours that would otherwise be missed by the model. Having the angle be , and in particular choosing the triangular grid over the square grid, is a somewhat arbitrary choice in the model definition.
Or even just drawing a line through a shape, or even just a single point in the shape, or even zero points in the shape!
We don’t state it as a result, but the folding tasks in this paper have an expected time lower bound of , for a length n Turning Machine instance, since they require they require events to occur.
In the language of Woods et al. (2013), one can imagine that for all , there is a rigid bond between monomer and monomer , and otherwise there are no bonds.
Another way to state this is that when a monomer moves, translates in the direction corresponding to the current direction of rotated by the angle .
The notion of left or right turn along the three points can be formalised by considering the line running through , in the direction , noting that cuts the plane in two, and defining the left- and right-hand side of the plane with respect to the vector along .
We are using a technique here that leverages the statement of Lemma 40 from the appendix. We could alternatively use the same technique as Lemma 40, which more directly reasons about rule applications and blocking, without needing to define the restricted--system.
This notion of “suppression” should not be confused with blocking, for the sake of analysis, we are simply defining a new model where we get to arbitrarily choose which rules are suppressed.
As discussed in Remark 3, a target configuration is one where all states are 0, in other words the intended final configuration of the Turning Machine. Note that we’ve not yet proven that such a target is always reachable—that’s our goal in fact.
Start with some integer (e.g. 0) and traverse the curve writing down an integer at each point, but incrementing the noted value at each turn of anti-clockwise, and decrementing at each turn of clockwise.
In fact any is the state of a reachable configuration, but we don’t need to prove that.
Which must be in state 1 or 2, since 3 would give a self-intersection along the configuration.
The monomers are not necessarily geometrically blocked, we are merely stopping any rule from being applied to them. No configuration in a trajectory of witnesses a larger slowdown due to blocking than the slowdown we have imposed on the configurations of .
This paper expands upon the conference version published in Proceedings of the 26th International Conference on DNA Computing and Molecular Programming. Oxford 2020, Leibniz International Proceedings in Informatics (LIPIcs). Authors C. Wood and D. Woods are supported by European Research Council (ERC) award number 772766 and Science foundation Ireland (SFI) grant 18/ERCS/5746 (this manuscript reflects only the authors’ view and the ERC is not responsible for any use that may be made of the information it contains).
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
References
- Aloupis G, Collette S, Damian M, Demaine ED, Flatland R, Langerman S, O’Rourke J, Ramaswami S, Sacristán V, Wuhrer S (2009) Linear reconfiguration of cube-style modular robots. Comput Geom 42(6–7):652–663 10.1016/j.comgeo.2008.11.003 [DOI] [Google Scholar]
- Aloupis G, Collette S, Demaine ED, Langerman S, Sacristán V, Wuhrer S (2008) Reconfiguration of cube-style modular robots using O(log n) parallel moves. In: International symposium on algorithms and computation, pp 342–353. Springer
- Chen H-L, Doty D, Holden D, Thachuk C, Woods D, Yang C-T (2014a) Fast algorithmic self-assembly of simple shapes using random agitation. In: DNA20: the 20th international conference on DNA computing and molecular programming. LNCS, vol 8727, pp 20–36, Kyoto, Japan, September 2014. Springer. Full version: arXiv:1409.4828
- Chen M, Xin D, Woods D (2014) Parallel computation using active self-assembly. Nat Comput 14(2):225–250 10.1007/s11047-014-9432-y [DOI] [Google Scholar]
- Cheung KC, Demaine ED, Bachrach JR, Griffith S (2011) Programmable assembly with universally foldable strings (moteins). IEEE Trans Robot 27(4):718–729 10.1109/TRO.2011.2132951 [DOI] [Google Scholar]
- Chin Y-R, Tsai J-T, Chen H-L (2018) A minimal requirement for self-assembly of lines in polylogarithmic time. Nat Comput 17(4):743–757 10.1007/s11047-018-9695-9 [DOI] [Google Scholar]
- Connelly R, Demaine ED, Demaine ML, Fekete SP, Langerman S, Mitchell JSB, Ribó A, Rote G (2010) Locked and unlocked chains of planar shapes. Discrete Comput Geometry 44(2):439–462 10.1007/s00454-010-9262-3 [DOI] [Google Scholar]
- Dabby N, Chen H-L (2012) Active self-assembly of simple units using an insertion primitive. In: SODA: the 24th annual ACM-SIAM symposium on discrete algorithms, pp 1526–1536, Jan 2012
- Dawes-Hoang RE, Parmar KM, Christiansen AE, Phelps CB, Brand AH, Wieschaus EF (2005) Folded gastrulation, cell shape change and the control of myosin localization. Development 132(18):4165–4178 10.1242/dev.01938 [DOI] [PubMed] [Google Scholar]
- Demaine ED, Hendricks J, Olsen M, Patitz MJ, Rogers TA, Schabanel N, Seki S, Thomas H (2018) Know when to fold’em: self-assembly of shapes by folding in oritatami. In: DNA: international conference on DNA computing and molecular programming, pp 19–36. Springer
- Geary C, Meunier PÉ, Schabanel N, Seki S (2016) Programming biomolecules that fold greedily during transcription. In: MFCS: the 41st international symposium on mathematical foundations of computer science. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik
- Gmyr R, Hinnenthal K, Kostitsyna I, Kuhn F, Rudolph D, Scheideler C, Strothmann T (2019) Forming tile shapes with simple robots. Nat Comput 19:1–16 [Google Scholar]
- Graham RL, Knuth RL, Patashnik O (1989) Concrete mathematics. Addison-Wesley, Boston [Google Scholar]
- Hescott B, Malchik C, Winslow A (2017) Tight bounds for active self-assembly using an insertion primitive. Algorithmica 77:537–554 10.1007/s00453-015-0085-8 [DOI] [Google Scholar]
- Hescott B, Malchik C, Winslow A (2018) Non-determinism reduces construction time in active self-assembly using an insertion primitive. In: COCOON: the 24th international computing and combinatorics conference, pp 626–637. Springer
- Hou C-Y, Chen H-L (2019) An exponentially growing nubot system without state changes. In: International conference on unconventional computation and natural computation, pp 122–135. Springer
- Martin AC, Kaschube M, Wieschaus EF (2008) Pulsed contractions of an actin–myosin network drive apical constriction. Nature 457(7228):495–499 10.1038/nature07522 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Michail O, Skretas G, Spirakis PG (2019) On the transformation capability of feasible mechanisms for programmable matter. J Comput Syst Sci 102:18–39 10.1016/j.jcss.2018.12.001 [DOI] [Google Scholar]
- Ramezani H, Dietz H (2019) Building machines with DNA molecules. Nat Rev Genet 21:1–22 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Woods D, Chen H-L, Goodfriend S, Dabby N, Winfree E, Yin P (2013) Active self-assembly of algorithmic shapes and patterns in polylogarithmic time. In: ITCS: the 4th conference on innovations in theoretical computer science, pp 353–354. ACM, 2013. Full version: arXiv:1301.2626 [cs.DS]