Multi-agent pathfinding
The problem of Multi-Agent Pathfinding is an instance of multi-agent planning and consists in the computation of collision-free paths for a group of agents from their location to an assigned target. It is an optimization problem, since the aim is to find those paths that optimize a given objective function, usually defined as the number of time steps until all agents reach their goal cells. MAPF is the multi-agent generalization of the pathfinding problem, and it is closely related to the shortest path problem in the context of graph theory.
Several algorithms have been proposed to solve the MAPF problem. Due to its complexity, it happens that optimal approaches are infeasible on big environments and with a high number of agents. However, given the applications in which MAPF is involved such as automated warehouses and airport management, it is important to reach a trade-off between the efficiency of the solution and its effectiveness.
Problem Formalization
The elements of a classical MAPF problem are the following:- a set of agents;
- an undirected graph, where is the node set, and is the edge set. The nodes represent the possible locations of the agents, while the arcs are the possible connections between such positions;
- a map that associates each agent with its starting point;
- a map that associates each agent with its target point.
The agents perform sequences of actions to go from their starting point to their target location. A sequence of action performed by agent is denoted by and is called a plan. If agent starts from its location and arrives to its target location performing plan, then is called single-agent plan for agent. A valid solution for the MAPF problem is a set of single-agent plans, such that the plans do not collide one another. Once an agent has reached its target, it can either remain in the target location or disappear.
Types of Collisions
In order to have a valid solution for a MAPF problem, it is necessary that the single-agent plans of the agents do not collide one another. Given plan, the expression denotes the position of agent after having performed steps of plan. It is possible to distinguish five different types of collisions between two plans and.- Vertex conflict: there is a vertex conflict between plans and when the two agents occupy the same location at the same time. Formally, a vertex conflict happens when.
- Edge conflict: an edge conflict occurs whenever two agents cross the same edge in the same direction at the same time, that is and. If vertex conflicts are not allowed, then edge conflicts cannot exist.
- Following conflict: a following conflict happens when at a certain time step an agent occupies a location that was occupied by another agent in the previous time step. Mathematically, a following conflict is described as.
- Cycle conflict: a cycle conflict happens whenever a set of agents move as if they are spinning in a cycle. It means that each agent takes the position that was previously occupied by the other agent one step-ahead in the cycle. If following conflicts are forbidden, then cycle conflicts cannot happen.
- Swapping conflict: a swapping conflict is the case in which two agents exchange their position, passing on the same edge at the same time in two different directions. It is expressed as and.
Objective Functions
When computing single-agent plans, the aim is to maximize a user-defined objective function. There is not a standard objective function to adopt, however the most common are:- flowtime: this measure is obtained by summing the time steps employed by each agent to reach their target location. Formally, it is equal to, where the plans are single-agent plans without collisions;
- makespan: the number of time steps necessary so that all the agents complete theirs tasks, defined as, where are part of a valid solution;
- maximization of reached targets given a deadline: the aim is to find a valid solution that maximizes the number of agents that reach their target given a time deadline.
Algorithms
Prioritized Planning
One possible approach to face the computational complexity is prioritized planning. It consists in decoupling the MAPF problem into single-agent pathfinding problems.The first step is to assign to each agent a unique number that corresponds to the priority given to the agent. Then, following the priority order, for each agent a plan is computed to reach the target location. When planning, agents have to avoid collisions with paths of other agents with a higher priority that have already computed their plans.
Finding a solution for the MAPF problem in such setting corresponds to the shortest path problem in a time-expansion graph. A time-expansion graph is a graph that takes into account the passing of time. Each node is composed by two entries, where is the node name and is the time step. Each node is linked to the nodes such that is adjacent to and is not occupied at time step.
The drawback of prioritized planning is that, even if it is a sound approach, it is neither optimal nor complete. This means that it is not assured that the algorithm will return a solution and, even in that case, the solution may not be optimal.
Optimal MAPF Solvers
It is possible to distinguish four different categories of optimal MAPF solvers:- Extensions of A*: algorithms in this category employ modified versions of the A* approach.
- Increasing Cost Tree Search: a novel formalization of the MAPF problem is proposed, that comprehends an increasing search tree and the corresponding algorithm. The algorithm is composed by two levels and relies on the assumption that a valid solution for the MAPF problem is composed by a set of solutions for the single agents.
- Conflict-Based Search: this algorithm computes paths as when solving single-agent pathfinding problems, and then it adds constraints in an incremental way in order to avoid collisions.
- Constraints programming: with this kind of approach, MAPF problems are transformed into a set of constraints and then solved using specific constraint solvers such as SAT and Mixed Integer Programming solvers.
Bounded Suboptimal MAPF Solvers