Abstract
We consider multi-agent transport task problems where, e.g. in a factory setting, items have to be delivered from a given start to a goal pose while the delivering robots need to avoid collisions with each other on the floor.
Abstract
We introduce a Task Conflict-Based Search (TCBS) Algorithm to solve the combined delivery task allocation and multiagent path planning problem optimally. The problem is known to be NP-hard and the optimal solver cannot scale. However, we introduce it as a baseline to evaluate the sub-optimality of other approaches. We show experimental results that compare our solver with different sub-optimal ones in terms of regret.
I. INTRODUCTION
In Multi-Agent Path Finding (MAPF) the problem specification assigns a fixed start and goal state to each agent and the core challenge is to find collision free paths for all agents. In contrast, both Multi-Agent Task Allocation (MATA) and Multi-Agent Pick-up and Delivery (MAPD) focus on solving the allocation of delivery jobs to the agents, while collisions between agent paths (e.g. in traffic networks) are not considered an issue. This paper considers the joint problem of delivery task allocation and finding collision free paths for all agents jointly. We denote this as the Combined Task Allocation and Path Finding (CTAPF) problem.
I. INTRODUCTION
This problem setting is motivated by dense factory floor transportation systems. Here items have to be transported from their current locations to goal locations by robotic agents that share narrow aisles and routes in the factory floor. More generally, the problem setting captures any multi-agent domain where the tasks are to traverse from one state to another, and spatio-temporal constraints between the agents exist.
I. INTRODUCTION
As our problem setting is a superset of multi-agent path finding, it is NP-hard. In this paper we introduce an explicit optimal solver for such problems, which necessarily cannot scale well with the number of agents. We use the method to evaluate the regret (sub-optimality) of alternative approaches in our experiments.
I. INTRODUCTION
In section III we introduce the CTAPF problem formulation. We then present in section IV an optimal solver. In section V we show simulation experiments using our algorithm.
II. RELATED WORK
The task allocation problem is a well researched challenge in the field of multi-agent systems and operations research. We refer to it as MATA. A centralized approach to solve it is the Hungarian algorithm [1] . Further, there exist auction based approaches allowing to solve the problem decentralized [2] . More recently additional market-based approaches [3] , reactive methods [4] or biologically inspired ones [5] have been introduced. We model the problem in a way such that one agent can only perform one task at the time and every task only requires one agent. In the taxonomy by [6] this is an ST-SR-TA problem (Single-Task Robots, Single-Robot Tasks, Time-Extended Assignment) which is proven to be NP-hard [6] .
II. RELATED WORK
The particular problem of transport task allocation is called Pickup and Delivery Problem (PDP) [7] in operations research. See [8] for a survey article. It is defined by a set of agents and a number of requests of certain amount to be transported from one location to another. The problem is often studied with time windows [9] or to optimize vehicle capacity [10] especially in the Autonomous Guided Vehicle (AGV) domain [11] . Currently we do not consider time windows because they are usually not defined in industrial scenarios. Also, we are concerned with the special case of the PDP where every agent has a capacity of one unit, since this models the scenario best. This may be also referred to as dial-a-ride problem [7] .
II. RELATED WORK
Multi-Agent Path Finding (MAPF) is another intensively studied problem in multi-agent systems [12] . The decision in MAPF concerns how a number of agents will be traveling to their goal poses without colliding, also an NP-hard problem [13] . The colored pebble problem is comparable since the color of the pebble makes them not interchangeable [14] . Solving the problem with collision avoidance at runtime can lead to deadlocks especially in narrow environments as discussed by [15] and more recently by [16] . Available sub-optimal solutions to the problem include Local Repair A* [17] , WHCA* [15] and sampling based approaches like Multi-agent RRT* [18] and ARMO [19] . Optimal solvers are Increasing Cost Tree Search (ICTS) [20] and Conflict-Based Search (CBS) [21] . Our solution is based on the latter, because it can be extended with task-assignment and can then solve the introduced problem optimally. Previously we elaborated CBS with nonuniform costs in an industrial AGV scenario [22] .
II. RELATED WORK
One problem formulation that is more closely related to transport systems is the Combined Target-Assignment and Path-Finding (TAPF) introduced by Ma and Koenig [23] . It first solves the assignment problem and MAPF problem but not concurrently, so the costs used for task allocation are not the true costs. Instead of single goals we consider the whole transport task allocation.
II. RELATED WORK
A different type of problem is studied in vehicle routing with capacities [24] , which focuses on the deliveries from one central depot based on certain demands. This is a different problem in the sense that it considers only one origin and additionally considers capacity constraints.
II. RELATED WORK
The joint solution of MATA and MAPF, that we are proposing, was previously studied in [25] , where the problem is considered as Mixed Integer Linear Programming (MILP) but due to collisions on the single-agent path level we think it should be considered a Mixed Integer Non-Linear Programming (MINLP) Problem. Therefore, the solver proposed by Koes et al. [25] can not solve the problem optimally since it ignores agent-agent collisions.
II. RELATED WORK
A similar problem, by taking uncertainties into account, aims at applications in highly dynamic environments [26] . The solution is also sub-optimal because agent-agent collisions are not considered at planning time.
II. RELATED WORK
Similar problems have recently also been formulated by Farinelli et al. [27] , Ma et al. [28] and Nguyen et al. [29] for domains that do not involve transport tasks as we consider them. Both find interesting sub-optimal solutions for Token Passing with Task Swaps (TPTS) [28] , based on Distributed Constraint Optimization Problems (DCOPs) [27] and using answer set programming (ASP) [29] . All of these approaches may solve the sub-problems optimally but they do not solve the combined problem optimally. This would require taking the implications that the task assignment makes into the path finding problem and vice versa. The field of combined task and motion planning [30] is also combining two planning domains but for mobile manipulators. Our algorithm borrows the concept of hierarchical planners and the reaction to planning errors i.e. when no path is found.
II. RELATED WORK
In the literature we can find many approaches that go towards solving the problems of MATA and MAPF in interesting settings. Little research is done in combining both which is the core aspect addressed in this paper. To our knowledge it is the first to solve the combined MATA and MAPF problem optimally.
III. PROBLEM FORMULATION
As discussed above, MAPF and MATA have been researched intensively. We now propose a combined problem formulation.
III. PROBLEM FORMULATION
We consider a configuration space X , and n agents with joint configuration state x = (x 1 , .., x n ) ∈ X n .
III. PROBLEM FORMULATION
We have a set t = {t 1 ,t 2 , ...,t m } of m tasks, each one consists of a start x s i and a goal x g i configuration, t i = (x s i , x g i ) ∈ X 2 . Once an agent visits a task's start pose, it is automatically assigned to the task, and we say the task is running. It is fixed to this task and can not be reassigned to another task before reaching its goal.
III. PROBLEM FORMULATION
The problem is to find a minimum duration T ∈ N and paths P j of length T for each agent j such that every task is fulfilled. In the following we more formally define the constraints on the path (that they follow a roadmap and do not collide), and when tasks are fulfilled.
III. PROBLEM FORMULATION
Each path P j = (P 0 j , .., P T j ) is a sequence of T + 1 configurations, where P 0 j ∈ X is constrained to be the start configuration of agent j, and P t+1 j ∈ ∂ (P t j ) ⊆ X is adjacent to the agents previous configuration P t j . Adjacency is defined by a roadmap ∂ (•) which, for each x ∈ X defines its neighborhood ∂ (x) ⊆ X .
III. PROBLEM FORMULATION
Given the set of paths {P 1 , .., P n } we require them to be non-colliding, meaning that t, j, k : P t j = P t k . In addition, we also require agent movements to be non-colliding, that is, they must not swap places on the roadmap, t, j, k : P t+1 j = P t k ∧ P t j = P t+1 k . Given a path P j of an agent j, we can compute the implicit assignment τ T j ∈ {1, .., m} of agent j to a task i ∈ {1, .., m} at time step T . The mapping from P j to τ j is unique given the rule that a task becomes automatically active if the agent visits its start configuration and ends only when it reaches the task goal. Based on this it is also uniquely defined whether a task i is fulfilled by a path P j . Therefore, given all agent paths P j we can evaluate whether all tasks are fulfilled.
III. PROBLEM FORMULATION
In summary, the input to the problem are the agent's initial configurations {P 0 1 , .., P 0 n }, the roadmap defined by ∂ (•), and the set of tasks t. The output is the total time T per task and all agent paths {P 1 , .., P n }, subject to the path constraints and fulfillment of all tasks. The objective is to minimize ∑ i∈(0,..m) T i , the sum of duration per tasks until it is fulfilled.
III. PROBLEM FORMULATION
In the evaluation, we use a grid-map as roadmap graph. The approach can work on any roadmap graph that fulfills the property that none of the poses in the graphs vertices are in collision with any other.
III. PROBLEM FORMULATION
Optimality is only guarantied with respect to the chosen roadmap. I. e. the best solution duration is measured based on the number of roadmap edges traveled in that given roadmap. Therefore, the duration in actual time units depends on the length of the edges and speeds of the agents.
IV. OPTIMAL SOLVER

A. Concept
Our Task Conflict-Based Search (TCBS) searches on the level of task assignments for all agents. Given a configuration of task assignments and neglecting collision constraints, we can use standard single-agent path finding to compute the corresponding optimal paths that connect the agents configurations to the start and the start to the goal configurations of all assigned tasks. To also account for the path collision constraints we follow the approach of conflict-based search. This introduces additional decision variables in the search tree that represent the "decision" to put an explicit avoid constraint on an agent path. That is, we not only search for task assignments but also avoid configurations that would contain a collision. We will discuss below that this approach does not compromise optimality of the method.
A. Concept
To give a first intuition on how the search tree is built, we describe it briefly before giving the technical description afterwards: If there are no currently running tasks, we start with an empty assignment in the root node. Therefore, at the beginning all tasks and all agents are unassigned. At every node we perform one of the two following types of expansion: a) Iff no collision between agents exists: Add children for all possible combinations of one still unassigned tasks to one agent. This means that the task will be added at the end of the agents task list. b) else (i.e. iff a collision between agents is detected): The expansion adds nodes where the configuration in the roadmap (or the motion between two configurations) is avoided at the time of the collision, one for each colliding agent. See also Figure 1 .
B. Decision variables
The discrete decision variables define node s of the search tree, where s.τ defines the tasks assigned to agents and s.β contains avoided configurations (or the motion between two configurations).
B. Decision variables
For each agent j, one assignment list τ j , j ∈ {1, ..., n} exists. Each assignment list τ j = (t j0 ,t j1 , ...) defines the sequence of tasks that the agent j has to fulfill in order. Where each list element t jk ∈ {1, ..., m}, k ∈ N references a task.
B. Decision variables
To establish collision avoidance we define configurations or motions between configurations that an agent avoids at a given time. For each agent j, one avoid list β , j ∈ {1, ..., n} is defined. Each list can contain multiple avoided configurations: β j = (β j0 , β j1 , ...). And one avoided configuration is defined by either β jk = (x β , T β ), k ∈ N, where x β is the configuration to be avoided at time T β . Or β j0 = (x β 0 , x β 1 , T β ), where the motion between x β 0 and x β 1 is avoided at time T β .
C. Search Algorithm
Given the specific problem formulation in section III we can now describe an optimal solver as A* tree search over assignments of these decision variables. We perform this search by using • Algorithm 1 to expand nodes, • Algorithm 2 the goal test, • Algorithm 3 to decide which nodes to expand first and • Algorithm 4 to determine the cost-so-far function for a node
D. Expand
In the tree search we use algorithm 1 to expand a node. Figure 1 shows how a search tree after multiple expansions may look like. It is especially visible how the two different types of expansion shape the tree. The blue nodes are added by an assignment expansion while the red ones are added to resolve a collision. Fig. 1 . Example of a TCBS tree for n = 2, m = 3. The second level shows the big branching factor which is in this case 6. The leftmost node has for example a configuration, where the first agent executes task 0. In the third displayed level, the assignments are extended further so that the leftmost node indicates a configuration where the first agent would execute task 1 and then 0. In the rightmost node occurs a collision which is solved through avoiding the configuration (here cell 5, 3 at time 6) in the fourth level (red nodes). The last unassigned task 0 is assigned to the first agent which leads to a solution in the left leaf node of the final level. for j do 12 children ← children + (s.τ j + t) 13 return children E. Goal Test algorithm 2 shows the algorithm to do the goal test that is performed on any evaluated node. It requires the node to have no collisions and all tasks to be assigned.
F. Heuristic
The heuristic function (h() function of A*) is presented in algorithm 3. It evaluates the cost of the best-possible assignment. This sums for each unsigned task the distance to the closest agent which might be either its starting position or the goal pose of a previously executed task.
G. Cost-so-far
The cost function (g() function of A*) in algorithm 4 evaluates the cost of the node. A sum of all arrival times is used as cost. This method is also used to evaluate if collisions are present in a node by computing the singleagent paths. If a collision is detected, we still calculate costs. It allows for the freedom to solve collision by changing the task assignment which is a benefit of the CTAPF problem formulation.
H. Path Function
Our approach requires a function to compute a set of paths for all agents for any given node. This plans single agent paths according to the assigned tasks and the configurations (or motions between two configurations) to be avoided. We also use A* here, but on the environments roadmap. Additionally we cache previously calculated paths to use it multiple times. Both of the presented algorithms (Alg. 3 and Alg. 4) use the notion of Distance(a, b) which is a method that returns the Manhattan Distance between two points or, if present in the previously mentioned cache, returns the actual distance of the shortest path.
I. Optimality
An A* search algorithm is considered optimal if the heuristic function is admissible [31] :
I. Optimality
Where h(s) is the heuristic of node s while h * (s) is the optimal cost. The heuristic (algorithm 3) is optimistic since it considers the distance of the closest agent to the tasks goal. This is never greater than the actual path distance:
I. Optimality
Distance(closest agent, start(task)) ≤ Path(assigned agent, start(task)).T f inal (2) Where T f inal indicates the time at the end of the path assuming constant motion speed. And for the length of a transport task, the optimality criterion is the same as for single-agent path finding: Distance(start(task), goal(task)) ≤ Path(start(task), goal(task)).T f inal
I. Optimality
The methods Distance(a, b) and Path(a, b) are described in subsection IV-H in more detail. The consistency of the heuristic would be required, if we were searching on a general graph with no tree structure [32] . Since algorithm 1 only expands nodes by adding information, the search graph has tree structure and consistency is no required criterion.
I. Optimality
That is, our approach adds avoided configurations does not compromise the optimality. The proof is available in the original publication of CBS [21] .
V. EVALUATION
The source code of our implementation in Python is available online 3 . Figure 2 shows an example of one problem configuration and the resulting path set after solving the problem. We can compare the two solutions by TCBS (middle) and MINLP [25] (right). The algorithms received a set of agent positions and tasks (section III) as input and returned a set of paths for the agents. From the paths in the pictures follow the task execution times displayed in Table I per task. We compare the total time for all tasks T , as discussed in section III.
A. Example Problem and Solution
Algorithm Task 1 Task 2 Total  TCBS  6  15  21  MINLP  6  20  26   TABLE I  EXECUTION TIMES FOR THE TASKS IN THE EXAMPLE. It is visible that TCBS produces a solution quality superior to MINLP while it does only utilize one agent. The task allocation step of MINLP assigns each agent to the closest task. When the tasks are executed, the two agents in MINLP block each other. In this sense the TCBS algorithm successfully finds a solution that takes the transport task execution into account. This shows how special cases require to jointly solve the MATA and the MAPF problems which is the main claim of this paper.
B. Algorithms for Comparison
To give further insight into the different sub-optimal solvers we are introducing them in the following before evaluating them afterwards.
B. Algorithms for Comparison
• TCBS The optimal planner described in this paper. • TCBS-NN2 (TCBS for 2 nearest neighbors) A version of our algorithm which uses a sub-optimal nearestneighbor search [33] to only consider the n (here n = 2) closest of all possible assignments. Additionally, it uses sub-optimal heuristics to resolve collision faster. It is still not scalable but can find solutions for much bigger problems than TCBS • Greedy A simple local search algorithm that incrementally assigns tasks to agents using a sub-optimal nearest neighbor search. It finds the currently closest pair of unassigned agents and tasks or tasks and tasks for consecutive execution. See algorithm 5 for details. Then we solve MAPF by the CBS algorithm. • MINLP The separate solution of assignment and path finding problem proposed by [25] has been implemented using the Bonmin solver [34] for the assignment problem and CBS for path finding. • TPTS The original goal of this approach is the lifelong version of MAPF. The task assignment is solved in advanced but optimized by swapping of tasks [28] . The implementation was provided by the authors of the paper and is available online 4 . 
Algorithm 5: Greedy Assignment
Input: agents, tasks 1 free agents = agents.copy() 2 free tasks = tasks.copy() 3 consecutive = dict() 4 agent task = dict() 5 while len(free tasks) > 0 do 6 if len(free tasks) > len(free agents) then 7 poses = free agents ∪ task ends 
C. Solution Regret
While the previous example was designed to explicitly show the potential shortcomings of the separate solution of MATA and MAPF problem, we want to focus on a wider comparison of regret for the available approaches now. To allow a more general evaluation, we use now randomized scenarios for this comparison.
C. Solution Regret
This uses a 8x8 map filled with 20% random obstacles each scenario receives 2, 3 or 4 random tasks. Per configuration 30 trials of different random configurations were tested. An example of one randomly generate scenario is shown in Figure 3 . Figure 4 shows the mean value of regret for different solvers. This is, how much more duration per task was required in the respective solution in comparison to the optimal solution. It can be seen from the figure that most planners have a low mean value, meaning they found the optimal solution most of the time. But different planners show different distributions of outliers in the data. No deviation is visible for TCBS-NN2 which is the only algorithm in this comparison that solves MATA and MAPF in combination. It shows that the joint problem solving delivers good overall solution quality (i.e. small regret).
C. Solution Regret
The greedy algorithm shows also a very small regret, demonstrating that also simple approaches can lead to small regret.
C. Solution Regret
Both MINLP and TPTS show the ability to find the optimal solution in the mean case as well but especially TPTS has a significant amount of data with higher regret. This demonstrate that traditional separate solving of MATA and MAPF can lead to a considerable regret.
D. Planning Time
To compare the algorithms towards their practical usability, we evaluate their planning duration. We used the same random scenarios as introduced before and for this experiment we also differentiate between problem size to elaborate scaling effects in the duration. Problem size is defined as the number of tasks that are introduced. Figure 5 shows the planning time for the approaches. Compared are all the planners mentioned in subsection V-B It is clearly visible that our TCBS algorithm does not scale well with the problem size. This is due to the problem being NPhard. The results for TCBS-NN2 show similar scaling effect but also indicate a tendency towards faster computations times for larger problem sizes. This is due to the algorithms pruning of the search tree by nearest neighbor search.
D. Planning Time
The greedy algorithm shows no visible scaling and fastest mean performance in this comparison. It is very efficient because it always assigns the closest agent.
D. Planning Time
The MINLP algorithm has a better overall performance than TCBS and TCBS-NN2 but shows exponential scaling as well. This is due to the optimization problems complexity also being NP-hard.
D. Planning Time
Results for TPTS show good performance and also scales well. The method of task swaps lead to this results because it is independent of the problem size.
D. Planning Time
Both TPTS and the greedy algorithm could therefore be taken into consideration for practical use although they lack solution quality as seen in the previous experiment.
VI. CONCLUSION Combined Task Allocation and Path Finding (CTAPF)
is a practically highly relevant problem and has, to our knowledge, not been solved optimally previously. We provided a detailed formalization of the problem. The problem can be solved optimally by the proposed Task Conflict-Based Search (TCBS) algorithm based on a dynamically built search-tree. This search-tree incrementally assigns tasks to agents and resolves collisions between agents as they occur. In comparison to other approaches is demonstrated how the combined solving of task allocation and path finding improves the solution quality over solutions that solve them separately. Our optimal algorithm is intended to support the development of sub-optimal planners by evaluating their regret. In addition, we proposed an approximate version of the solver with improved scaling which demonstrates smaller regret than the competing methods.

{'paper_id': '198229599', 'title': 'An Optimal Algorithm to Solve the Combined Task Allocation and Path Finding Problem', 's2_url': 'https://api.semanticscholar.org/CorpusID:198229599', 'source': 'S2ORC'}