← Back to all articles
2 min

Mathematical Models for Collision Avoidance in MAPF

MAPFroboticsalgorithm

Introduction

Multi-Agent Path Finding (MAPF) is the problem of finding collision-free paths for multiple robots to reach their destinations simultaneously.

As the number of warehouse robots increases, the risk of deadlocks and livelocks grows. This article explains the mathematical definitions of collisions in MAPF and the optimization objectives.

Collision Definitions

MAPF considers two types of collisions.

Vertex Conflict

Two agents aia_i and aja_j occupy the same node vv at the same timestep tt:

conflictv(ai,aj,t)    πi(t)=πj(t)=v\text{conflict}_v(a_i, a_j, t) \iff \pi_i(t) = \pi_j(t) = v

where πi(t)\pi_i(t) denotes the position of agent aia_i at timestep tt.

Edge Conflict

Two agents traverse the same edge in opposite directions at the same timestep:

conflicte(ai,aj,t)    πi(t)=πj(t+1)πi(t+1)=πj(t)\text{conflict}_e(a_i, a_j, t) \iff \pi_i(t) = \pi_j(t+1) \land \pi_i(t+1) = \pi_j(t)

Optimization Objectives

MAPF has two common optimization objectives.

Makespan Minimization

Minimize the latest arrival time across all agents:

minmaxi{1,,k}πi\min \max_{i \in \{1, \ldots, k\}} |\pi_i|

Sum-of-Costs Minimization

Minimize the total path cost of all agents:

mini=1kπi\min \sum_{i=1}^{k} |\pi_i|
ObjectiveCharacteristicUse Case
MakespanMinimizes latest arrivalThroughput-focused
Sum-of-CostsMinimizes total movementEnergy efficiency

CBS Algorithm

Conflict-Based Search (CBS) is the foundational MAPF algorithm.

cbs_pseudocode.py
def cbs(agents, graph):
    root = CTNode(constraints=[], solution=find_individual_paths(agents))
    open_list = [root]
    while open_list:
        node = open_list.pop(0)  # lowest cost
        conflict = find_first_conflict(node.solution)
        if conflict is None:
            return node.solution  # conflict-free
        for constraint in resolve(conflict):
            child = CTNode(
                constraints=node.constraints + [constraint],
                solution=replan(node, constraint)
            )
            open_list.append(child)
    return None  # no solution

Inline Math Examples

Given kk agents, V|V| vertices, and E|E| edges, the state space is O(Vk)O(|V|^k). In practice, however, the constraint tree branching is limited, drastically reducing the search space.

Conclusion

MAPF is NP-hard in terms of computational complexity, but CBS-family algorithms make it possible to solve practical-scale problems. Rovnou leverages this research to deliver real-time path optimization for warehouse robots.


This article was written with reference to MAPF research overview.