Lably
Skip to content

Multi-agent pathfinding

  • 8 min read
  • 4 chapters

Related on Lably

Through Optimization problem, Graph (discrete mathematics) and Mathematical optimization

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 A={1,2,...,k} of k agents;
  • an undirected graph G=(V,E), where V is the node set, and E 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 s:A→V that associates each agent with its starting point;
  • a map t:A→V that associates each agent with its target point.

It is assumed that time is discrete, and that each agent can perform one action at each time step. There are two possible types of actions: the wait action, in which the agent remains in its node, and the move action, that allows the agent to move to an adjacent node. An action is formalized as a function a:V→V, meaning that a(v)=v′ represents the action of moving from v to v′ if v′ is adjacent to v and different than v′, or to stay in node v if v=v′.

The agents perform sequences of actions to go from their starting point to their target location. A sequence of action performed by agent i is denoted by πi=(a1,a2,...,an) and is called a plan. If agent i starts from its location s(i) and arrives to its target location t(i) performing plan πi, then πi is called single-agent plan for agent i. A valid solution for the MAPF problem is a set of k single-agent plans (one for each agent), 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 k agents do not collide one another. Given plan πi, the expression πi[x] denotes the position of agent i after having performed x steps of plan πi. It is possible to distinguish five different types of collisions between two plans πi and πj.

  • Vertex conflict: there is a vertex conflict between plans πi and πj when the two agents occupy the same location at the same time. Formally, a vertex conflict happens when πi[x]=πj[x].
  • Edge conflict: an edge conflict occurs whenever two agents cross the same edge in the same direction at the same time, that is πi[x]=πj[x] and πi[x+1]=πj[x+1]. 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 πi[x+1]=πj[x].
  • Cycle conflict: a cycle conflict happens whenever a set of agents (at least three) 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 πi[x+1]=πj[x] and πj[x+1]=πi[x].

When formalizing a MAPF problem, it is possible to decide which conflicts are allowed and which are forbidden. A unified standard about permitted and denied conflicts does not exist, however vertex and edge conflicts are usually not allowed.

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 ∑i∈A|πi|, where the plans πi,i∈A are single-agent plans without collisions;
  • makespan: the number of time steps necessary so that all the agents complete theirs tasks, defined as maxi∈A|πi|, where πi,i∈A 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.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication