  We investigate algorithmic control of a large swarm of mobile particles (such
as robots, sensors, or building material) that move in a 2D workspace using a
global input signal (such as gravity or a magnetic field). We show that a maze
of obstacles to the environment can be used to create complex systems. We
provide a wide range of results for a wide range of questions. These can be
subdivided into external algorithmic problems, in which particle configurations
serve as input for computations that are performed elsewhere, and internal
logic problems, in which the particle configurations themselves are used for
carrying out computations. For external algorithms, we give both negative and
positive results. If we are given a set of stationary obstacles, we prove that
it is NP-hard to decide whether a given initial configuration of unit-sized
particles can be transformed into a desired target configuration. Moreover, we
show that finding a control sequence of minimum length is PSPACE-complete. We
also work on the inverse problem, providing constructive algorithms to design
workspaces that efficiently implement arbitrary permutations between different
configurations. For internal logic, we investigate how arbitrary computations
can be implemented. We demonstrate how to encode dual-rail logic to build a
universal logic gate that concurrently evaluates and, nand, nor, and or
operations. Using many of these gates and appropriate interconnects, we can
evaluate any logical expression. However, we establish that simulating the full
range of complex interactions present in arbitrary digital circuits encounters
a fundamental difficulty: a fan-out gate cannot be generated. We resolve this
missing component with the help of 2x1 particles, which can create fan-out
gates that produce multiple copies of the inputs. Using these gates we provide
rules for replicating arbitrary digital circuits.
