  We study the TAPF (combined target-assignment and path-finding) problem for
teams of agents in known terrain, which generalizes both the anonymous and
non-anonymous multi-agent path-finding problems. Each of the teams is given the
same number of targets as there are agents in the team. Each agent has to move
to exactly one target given to its team such that all targets are visited. The
TAPF problem is to first assign agents to targets and then plan collision-free
paths for the agents to their targets in a way such that the makespan is
minimized. We present the CBM (Conflict-Based Min-Cost-Flow) algorithm, a
hierarchical algorithm that solves TAPF instances optimally by combining ideas
from anonymous and non-anonymous multi-agent path-finding algorithms. On the
low level, CBM uses a min-cost max-flow algorithm on a time-expanded network to
assign all agents in a single team to targets and plan their paths. On the high
level, CBM uses conflict-based search to resolve collisions among agents in
different teams. Theoretically, we prove that CBM is correct, complete and
optimal. Experimentally, we show the scalability of CBM to TAPF instances with
dozens of teams and hundreds of agents and adapt it to a simulated warehouse
system.
