repeated. At every node of the recursion tree, the
only robots that can be used as helpers are only the
ones that have still not been used on the path from
the root of the recursion tree to this node. This
means that every robot will be able to help only once.
To quickly obtain possible subgoals for the target or
helper robots, we use the following data structure.
The Graph of Components. Each layout of the
game can be represented as a directed graph where
nodes correspond to tiles and edges to possible tran-
sitions between two tiles. That is, there is a directed
edge between two nodes if the robot can transition
from the source tile to the target tile in one move.
A natural concept in such a graph is a strongly con-
nected component. It consists of a maximal collec-
tion of nodes so that it is possible to reach every node
within the component from every other node within
the component. The graph of the typical grid will
consist of several such components as depicted in Fig-
ure 2.
As visible in this Figure 2 (graph a)), the compo-
nents could be related by reachability, and therefore
we can construct a new graph of components where
there is an edge from component a to component b,
if it is possible to transition from component a to
component b. This graph, which we call reachability
graph, allows us to efficiently query all the compo-
nents reachable from a given tile. We simply check
the components which contain the tile and then return
them together with all their descendants in this graph.
For a tile x, we denote this set of components by ↓(x).
The same can be done to obtain the set ↑ (x) of all
components from which it is possible to reach the tile
x, with the only difference being that we take all an-
cestors. For small grids, these two mappings from
tiles to components can be cached in a dictionary.
If it is possible to reach tile b from tile a without
any help, then ↓ (a)∩ ↑ (b) 6=
/
0. If there is the possi-
bility to reach the tile b from the tile a with exactly
one help from another robot, then the robot that starts
at the tile a will at some point need to transition from
one of the components of ↓ (a) to one of the compo-
nents of ↑(b). This transition will be done by a move
in which the starting tile is still in ↓ (a) but the end
tile is already in ↑ (b). We call the starting tile a pre-
transition tile and the end tile a transition tile. In this
move, the moving robot needs to be blocked by an-
other helping robot that is adjacent to the transition
tile. We call this tile a supporting tile.
Subgoals for the Helper Robots. Therefore, to
enumerate all subgoals that allow the target robot to
reach a tile b from a tile a, we need to find all tiles
that allow the robot to transition from ↓ (a) to ↑ (b).
For that end, we construct another graph, we call tran-
sition graph for the target robot, with the nodes again
corresponding to components and edges correspond-
ing to possible transitions from one component to the
other. In comparison to the first graph, the edges go
in the opposite direction, and we ignore the edges cor-
responding to transitions that are possible without the
assistance of another robot. For the grid in Figure 2,
there would be an edge that goes from the green com-
ponent to the red component but not the edge that goes
in the opposite direction. If there are multiple tiles
that allow for the transition from one component to
the other, we add edges for all of them as visible in
Figure 2 b).
These edges will represent subgoals that could be
satisfied by the helper robots. For example, if there is
an edge going from ↓(a) to ↑(b) and ↓(a)∩ ↑(b) =
/
0,
we know that there is a pretransition tile in one of
the components of ↓(a) reachable from a and we also
know that there is a transition tile in one of the com-
ponents of ↑ (b) from which it is possible to reach b.
Therefore, the only thing we do not know is whether
some helper robot is able to reach the corresponding
supporting tile, and this creates a candidate for a new
subgoal.
Subgoals for the Target Robot. We also need to
take into consideration subgoals for the target robot
for which we know that some helper robot is able to
reach the supporting tile but do not know whether the
target robot is able to reach the pretransition tile. To
enumerate such subgoals for the target robot, we cre-
ate a third graph, we call transition graph for helper
robots, with edges that go from components contain-
ing the supporting tile to components containing the
transition tile. For the grid in Figure 2, we would add
an edge from the blue to the red component because a
robot in the blue component could help a target robot
to get to the red component. The resulting graph is
visible in Figure 2 c).
With each edge, we also store additional informa-
tion to fully specify the subgoal. These include the
positions of the transition, pretransition, and support-
ing tiles. For every transition tile, there are two possi-
ble pairs of the pretransition and supporting tiles be-
cause the moving robot can approach the transition
tile from one of the two directions and the support-
ing tile must be adjacent to the transition tile on the
opposite side as depicted in Figure 3. In the transi-
tion graph for the target robot, we therefore need to
store these two pairs of tiles for every edge or create
two separate edges, which is what we do in our im-
plementation.
ICAART 2023 - 15th International Conference on Agents and Artificial Intelligence
74