English

Building a Nest by an Automaton

Data Structures and Algorithms 2024-01-26 v1

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 Z×Z\mathbb{Z} \times \mathbb{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 field, is initially connected. The (Manhattan) distance between the farthest cells of the field 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 field 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 field, in time O(sz)O(sz), where ss is the span of the initial field and zz is the number of bricks. We show that this complexity is optimal.

Keywords

Cite

@article{arxiv.1904.10850,
  title  = {Building a Nest by an Automaton},
  author = {Jurek Czyzowicz and Dariusz Dereniowski and Andrzej Pelc},
  journal= {arXiv preprint arXiv:1904.10850},
  year   = {2024}
}
R2 v1 2026-06-23T08:48:24.689Z