<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Multi-Agent Pickup and Delivery in Dynamic Environments</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Benedetta Flammini</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Davide Azzalini</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Francesco Amigoni</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Politecnico di Milano</institution>
          ,
          <addr-line>Dipartimento di Elettronica, Informazione e Bioingegneria</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>In a Multi-Agent Pickup and Delivery (MAPD) problem, a group of agents has to accomplish subsequent pickup and delivery tasks while avoiding collisions. Tasks are provided at runtime, making MAPD a combination of Multi-Agent Path Finding (MAPF) and online task assignment. In this paper, we consider a new formulation of MAPD, in which a team of agents has to solve a MAPD problem without interfering or communicating with other agents not belonging to the team that are operating in the same environment. We address the problem from the point of view of the team of agents, and we propose that they build a model of the behavior of the agents external to the team and exploit this information in planning their paths. We consider diferent levels of knowledge that the team of agents can have about the other agents, and propose diferent solutions accordingly. Experimental results show that the inclusion of information about the behavior of external agents in the team's planning phase reduces the number of potential collisions and decreases tasks' completion time for the team.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Multi-Agent Path Finding</kwd>
        <kwd>Multi-Agent Pickup and Delivery</kwd>
        <kwd>Multirobot Systems</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The MAPD problem [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] consists in finding collision-free paths for a team of agents executing
incoming tasks by moving from their starting locations to the delivery locations, passing through
the pickup locations. MAPD problems have a dynamic nature since new tasks can be added
at any time, and agents have to assign and complete them in an online manner. The MAPD
problem is currently very popular within both academia and industry due to its several
realworld applications, especially in logistics [
        <xref ref-type="bibr" rid="ref2 ref3 ref4 ref5">2, 3, 4, 5</xref>
        ]. We consider a new formulation of MAPD,
in which a team of agents has to solve a MAPD problem in an environment in which other
moving agents are present. The team of agents has to accomplish its MAPD tasks without
interfering or communicating with agents not belonging to the team. Possible applications
of this setting can be found in logistics: for example, it can happen in warehouses that some
items fall on the ground, or that some locations need cleaning. So, while the agents of the team
perform their usual pickup and delivery tasks, other agents (which can also be humans) clean
or remove items from the ground.
      </p>
      <p>Since we conservatively assume that the team of agents cannot communicate with external
agents and does not know their plans, collisions between a team agent and an external agent
may happen. Every time there is a potential collision, the team agent has to reactively avoid the
collision and replan its path. Frequent replans can slow down the completion of tasks, implying
that team agents will need more time to solve their MAPD problem. To overcome this issue,
we propose that agents in the team model the behavior of the external agents and use this
information to plan better paths that attempt to avoid collisions.</p>
      <p>To model the behavior of the external agents, we consider diferent levels of knowledge
that can be available to the team, which trigger diferent solutions. The levels of knowledge
considered are: (1) the team of agents knows the current positions of the external agents in
real-time and the tasks they are assigned to; (2) the team of agents knows a set of paths followed
by the external agents in the past; (3) the team of agents knows anything about external agents.</p>
      <p>
        Our work is related to the problem of multi-agent moving obstacles’ avoidance [
        <xref ref-type="bibr" rid="ref6 ref7 ref8">6, 7, 8</xref>
        ],
but difers for the important aspect that in the latter it is not always possible to assume that
obstacles follow a behavior that is worth to model over an extended period.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Background</title>
      <p>
        The MAPD problem [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] involves agents in an environment represented by an undirected
connected graph  = (, ) (as it is common in this field), where vertices in  represent the
locations of the environment, and edges in  the connections between them. Time is assumed
to be discrete, and at each time step each agent performs an action  :  →  . Two types of
actions are allowed: remain in the current vertex or move to an adjacent one. All actions are
assumed to have unitary cost.
      </p>
      <p>A task set  contains all the tasks that have not been assigned and, due to the dynamic
nature of the problem, new tasks can be added at any time. Each task   ∈  is composed of
a pickup location  ∈  and a delivery location  ∈  . Each agent can have a single task
assigned at a time, and a task can be assigned to only one agent. To solve an assigned task, an
agent  has to plan and perform a sequence of actions   = (1, . . . , ) that brings it from its
current location to the pickup location and then to the delivery location of the task. Agents’
paths must not collide, that is: two diferent agents cannot be in the same location at the same
time (vertex conflict ) and they cannot traverse the same edge in opposite directions at the same
time (swapping conflict ). The aim of a MAPD problem is to plan paths that complete all the
tasks in the shortest time.</p>
      <p>
        Token Passing (TP) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] is a decentralized MAPD algorithm in which each agent assigns itself
a task in  and plans its collision-free paths exploiting the global information contained in the
token, a synchronized block of memory shared among the agents that includes the task set  ,
current tasks’ assignments, and current agents’ paths.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Problem Formulation</title>
      <p>Given an environment represented as a graph  = (, ), we define the MAPD problem in
a dynamic environment from the perspective of a team  = {1, ..., } of  agents that has
to perform a MAPD problem while in the same environment there are other external moving
agents ℋ = {ℎ1, ..., ℎ}. Agents ℋ are not necessarily coordinated in performing their tasks.</p>
      <p>We assume the team and the other agents are neither collaborative nor adversarial. We also
make a no-interference assumption, namely, we assume external agents’ decisions to move to be
immutable, irrespective of the presence of the team agents, and hence the team agents are in
charge of implementing proactive and/or reactive behaviors to avoid collisions. To allow the
team agents to implement reactive behaviors for collision avoidance, we assume that each team
agent  ∈  can detect external agents within a field of view   () = {︀  ∈  | ∃ =
(loc(), . . . , ) with | | ≤ 2︀} , which covers all locations  of the environment  that are
reachable from the current location loc() of  with paths  of length 2 or less. We assume
that the team agents know the location and the next move of external agents within their FOVs.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Anticipating Other Agents’ Behavior using Prediction Trees</title>
      <p>We now suppose the team of agents knows the current positions of external agents, the locations
each one of them must reach, and the fact that external agents are coordinated and rational
(i.e., they move along the shortest conflict-free paths). The idea is to simulate all possible paths
external agents may take to complete their tasks so the team can avoid future potential conflicts.</p>
      <sec id="sec-4-1">
        <title>4.1. Proposed Approaches</title>
        <p>
          We store all the possible shortest paths that external agents can follow to complete their tasks in a
Path Prediction Tree (PPT). Although we assume external agents plan their paths in a coordinated
way, we do not make any assumption on the algorithm they use to coordinate themselves or to
plan their paths, nor we make assumptions about whether hierarchies or priorities exist among
them (e.g., team agents know that external agents address a MAPD problem but do not know
the algorithms they employ). As a consequence, when we simulate external agents’ paths in the
PPT, we need to consider all possible priority orders that external agents could have followed
to make their conflict-free plans. This means that, when simulating the future behavior of each
external agent, we have to consider higher-priority agents’ paths as obstacles. Once all the
combinations of possible shortest paths for each possible priority order are found, the PPT is
complete. The tree is not immutable: at the end of each timestep, after all team and external
agents have executed their actions, all the predicted paths in the PPT are checked to see if they
are still valid given the new locations of external agents and are otherwise pruned. Moreover,
when an external agent completes a task and is assigned a new one, the PPT needs to be updated
accordingly. The PPT can be created and updated by any agent of the team and is stored in the
token so that all team agents can access it. As, especially in grid environments, the computation
of all possible combinations of shortest paths is prone to combinatorial explosion and becomes
computationally infeasible even for medium-sized environments, we also develop a windowed
version of the approach based on bounded-horizon planning [
          <xref ref-type="bibr" rid="ref10 ref11 ref12">10, 11, 12</xref>
          ] for the team agents and
on simulating only the next  steps of external agents’ plans. The low-level algorithm used
for planning within PPTs is a modified version of Dijkstra, adapted to navigate a space-time
state space, find all the shortest paths connecting two locations, and exploit bounded-horizon
planning.
        </p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Experimental Results</title>
        <p>We validate our approach on two types of grid environments: warehouses with narrow corridors
and more open environments inspired by city layouts, with 3 external agents and 2 team agents.
The metrics used for evaluation are the number of potential conflicts generated (i.e., team agents’
replans) and the service time, i.e., the average number of time steps needed to finish executing
a task after it has been added to the task set  . Although the non-windowed version allows to
avoid potential conflicts completely, it is computationally unfeasible for environments bigger
than 80 × 80 cells. When adopting the windowed version, a trade-of needs to be made between
the computing time and number of potential conflicts admissible. For example, with a window
size  = 6 we observe an average decrease of around 50% in the number of potential conflicts
without hurting the service time w.r.t. ignoring the presence of other agents.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Learning Behavioral Models using Past Observations</title>
      <p>This section deals with the case in which the team of agents knows a set of paths performed by
the external agents in the past. The idea is to build a model of the external agents using past
observations of their movements.</p>
      <sec id="sec-5-1">
        <title>5.1. Proposed Approaches</title>
        <p>
          The first approach [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] is an extension to TP, called TP with collision avoidance and replanning
+ model (TP-CA-M), in which the team agents implement a proactive behavior at planning time
for minimizing the probability of incurring in potential conflicts, in addition to the reactive
one. The algorithm computes an estimate for the probability of occupancy  for each vertex
 ∈  as the ratio of time steps in which  has been observed in the past to be occupied by
some external agent, over the total number of time steps constituting the observation period.
Then, the solving algorithm redefines the underlying graph as ˆ = (, ˆ) maintaining the
same vertices and edges as in , but assigning a weight to the edges. The weight  of an edge
(,  ) ∈ ˆ represents the cost of moving from  to  , and is defined as a linear combination
of the distance between these vertices and the estimated probability of occupancy for the
destination vertex  .
        </p>
        <p>In the second approach, the focus is to estimate the position of each external agent 
maintaining a belief , that is a probability distribution over all possible vertices  ∈  expressing the
likelihood for agent  to occupy a given vertex at time . The beliefs {} can then be aggregated
into a probability () of occupancy for vertex  (at time ) via the complement rule. To
propagate the belief through time, the movement of an external agent is modeled with a n-th
order Markov chain, where the states correspond to the vertices  ∈  . We can interpret
a belief  as the probability distribution over the states of the Markov chain at time , and
therefore we can obtain the corresponding belief state after  time steps as + =   , where
 is the transition matrix of the Markov chain learned from the set of paths performed by
the external agents in the past using maximum likelihood estimation. This allows the model
to make predictions on the future positions of the agents when it comes to planning, and to
update the belief state in light of the observations collected via field of view at each time step.
The idea of a weighted graph is maintained, however, the weight attributed to an edge is not
1
stationary anymore:  ( ) = (1 −  ) () +  (, ,  ). Since the belief state of an agent
is propagated over time, it now depends on the future time step  at which the transition takes
place. Term (, ,  ) combines the probability of a vertex conflict and of a swapping conflict.</p>
      </sec>
      <sec id="sec-5-2">
        <title>5.2. Experimental Results</title>
        <p>Two types of grid environments are used for testing, both presenting the features of a warehouse
with narrow corridors, using an observation window of 600 time steps, 4 external agents, and 3
team agents. Best results are obtained for  = 0.2: a significant reduction of potential conflicts
(i.e., team agents’ replans) w.r.t. a purely reactive approach is observed both for TP-CA-M
(reduction of 37%) and, especially, Markovian models (79% for the second order). The service
time is similar to the purely reactive approach, with a reduction of 2.5% for TP-CA-M and 4%
for the second-order Markovian model, meaning that planning for paths with a lower number
of potential conflicts results in a small reduction in the speed of completion of the tasks.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Learning Behavioral Models using Real-Time Observations</title>
      <p>It can happen that team agents do not have information regarding the past behavior of external
agents. For this reason, we discuss the case in which team agents have to build the behavioral
model of the external agents relying solely on the information they observe when external agents
enter their field of view. The models presented in Section 5 are preserved, with the diference
that in the probabilistic matrix and the transition matrix of the first and second approach,
respectively, the probability is initially uniformly distributed and is updated according to the
observations made at runtime. In terms of computing efort, learning other agents’ behaviors
in real-time when using the probability occupation matrix or a first-order Markov chain just
requires the update of a matrix, which is feasible to perform online at runtime. For higher-order
Markov chains, it could become computationally unfeasible to do it online.</p>
      <p>The results collected under this scenario, without any initial window of observation, show
that the performance of a trained probabilistic/Markovian model and an untrained one, that
simply hypothesizes a uniform distribution for the probabilistic/transition matrix, are not that
diferent. This highlights the dificulty of our models in learning a distinctive behavior for the
external agents: a possible reason may involve the pattern of motion itself, which may be close
to a random movement for an agent.</p>
    </sec>
    <sec id="sec-7">
      <title>7. Conclusions and Future Directions</title>
      <p>In this paper, we proposed and formalized a new MAPD variant in which a team of agents
has to carry out its MAPD tasks in an environment with other external moving agents. Three
diferent solving approaches have been proposed according to three possible levels of knowledge
that team agents have of external agents. Interesting directions of future work include (i) the
management of deadlocks, e.g., those conflicts that cannot be solved without violating the
no-interference assumption; and (ii) a more in-depth investigation of the real-time approach.
Benedetta Flammini is financially supported by the ABB – Politecnico di Milano Joint Research
Center. This paper is supported by PNRR-PE-AI FAIR project funded by the NextGeneration EU
program.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>H.</given-names>
            <surname>Ma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Kumar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Koenig</surname>
          </string-name>
          ,
          <article-title>Lifelong multi-agent path finding for online pickup and delivery tasks</article-title>
          ,
          <source>in: Proc. AAMAS</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>837</fpage>
          -
          <lpage>845</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>P. R.</given-names>
            <surname>Wurman</surname>
          </string-name>
          ,
          <string-name>
            <surname>R. D'Andrea</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Mountz</surname>
          </string-name>
          , Coordinating hundreds of cooperative, autonomous vehicles in warehouses,
          <source>AI Mag</source>
          .
          <volume>29</volume>
          (
          <year>2008</year>
          )
          <fpage>9</fpage>
          -
          <lpage>20</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>R.</given-names>
            <surname>Morris</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C. S.</given-names>
            <surname>Pasareanu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Luckow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Malik</surname>
          </string-name>
          , H. Ma, T. S. Kumar,
          <string-name>
            <given-names>S.</given-names>
            <surname>Koenig</surname>
          </string-name>
          ,
          <article-title>Planning, scheduling and monitoring for airport surface operations</article-title>
          ,
          <source>in: Proc. AAAI Workshop on Planning for Hybrid Systems</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>608</fpage>
          -
          <lpage>614</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M.</given-names>
            <surname>Veloso</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Biswas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Coltin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Rosenthal</surname>
          </string-name>
          , Cobots:
          <article-title>Robust symbiotic autonomous mobile service robots</article-title>
          ,
          <source>in: Proc. IJCAI</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>4423</fpage>
          -
          <lpage>4429</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.</given-names>
            <surname>Silver</surname>
          </string-name>
          ,
          <article-title>Cooperative pathfinding</article-title>
          ,
          <source>in: Proc. AIIDE</source>
          ,
          <year>2005</year>
          , pp.
          <fpage>117</fpage>
          -
          <lpage>122</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>W.</given-names>
            <surname>Budiharto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Santoso</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Purwanto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Jazidie</surname>
          </string-name>
          ,
          <article-title>Multiple moving obstacles avoidance of service robot using stereo vision</article-title>
          ,
          <source>TELKOMNIKA</source>
          <volume>9</volume>
          (
          <year>2011</year>
          )
          <fpage>433</fpage>
          -
          <lpage>444</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>J.</given-names>
            <surname>Kim</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Do</surname>
          </string-name>
          ,
          <article-title>Moving obstacle avoidance of a mobile robot using a single camera</article-title>
          ,
          <source>Procedia Eng</source>
          .
          <volume>41</volume>
          (
          <year>2012</year>
          )
          <fpage>911</fpage>
          -
          <lpage>916</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>C.</given-names>
            <surname>Fulgenzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Spalanzani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Laugier</surname>
          </string-name>
          ,
          <article-title>Dynamic obstacle avoidance in uncertain environment combining pvos and occupancy grid</article-title>
          ,
          <source>in: Proc. ICRA</source>
          ,
          <year>2007</year>
          , pp.
          <fpage>1610</fpage>
          -
          <lpage>1616</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Liu</surname>
          </string-name>
          , H. Ma,
          <string-name>
            <given-names>J.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Koenig</surname>
          </string-name>
          ,
          <article-title>Task and path planning for multi-agent pickup and delivery</article-title>
          ,
          <source>in: Proc. AAMAS</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>1152</fpage>
          -
          <lpage>1160</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>D.</given-names>
            <surname>Silver</surname>
          </string-name>
          ,
          <article-title>Cooperative pathfinding</article-title>
          ,
          <source>in: Proc. AIIDE</source>
          ,
          <year>2005</year>
          , pp.
          <fpage>117</fpage>
          -
          <lpage>122</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Bnaya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Felner</surname>
          </string-name>
          ,
          <article-title>Conflict-oriented windowed hierarchical cooperative A*</article-title>
          ,
          <source>in: Proc. ICRA</source>
          ,
          <year>2014</year>
          , pp.
          <fpage>3743</fpage>
          -
          <lpage>3748</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Tinka</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kiesel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. W.</given-names>
            <surname>Durham</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. K. S.</given-names>
            <surname>Kumar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Koenig</surname>
          </string-name>
          ,
          <article-title>Lifelong multi-agent path finding in large-scale warehouses</article-title>
          ,
          <source>in: Proc. AAAI</source>
          ,
          <year>2021</year>
          , pp.
          <fpage>11272</fpage>
          -
          <lpage>11281</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>B.</given-names>
            <surname>Flammini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Azzalini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Amigoni</surname>
          </string-name>
          <article-title>, Multi-agent pickup and delivery in presence of another team of robots (extended abstract)</article-title>
          ,
          <source>in: Proc. AAMAS</source>
          ,
          <year>2023</year>
          , pp.
          <fpage>2562</fpage>
          -
          <lpage>2564</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>