Building a Nest by an Automaton

Jurek Czyzowicz, Dariusz Dereniowski, Andrzej Pelc · Algorithmica · 2020

Abstract A robot modeled as a deterministic finite automaton has to build a structure from material available to it. The robot navigates in the infinite oriented grid $${\mathbb {Z}} \times {\mathbb {Z}}$$ Z × Z . Some cells of the grid are full (contain a brick) and others are empty. The subgraph of the grid induced by full cells, called the shape , is initially connected. The (Manhattan) distance between the furthest cells of the shape is called its span . The robot starts at a full cell. It can carry at most one brick at a time. At each step it can pick a brick from a full cell, move to an adjacent cell and drop a brick at an empty cell. The aim of the robot is to construct the most compact possible structure composed of all bricks, i.e., a nest . That is, the robot has to move all bricks in such a way that the span of the resulting shape be the smallest. Our main result is the design of a deterministic finite automaton that accomplishes this task and subsequently stops, for every initially connected shape, in time $$O(sn)$$ O ( s n ) , where s is the span of the initial shape and $$n$$ n is the number of bricks. We show that this complexity is optimal.

Read the paper · More papers on PaperTik