## 2 Methods  
### Problem Formulation  
Solving the PC-TAPF problem in a smart manufacturing environment is defined as determining how to optimally assign tasks with precedence constraints and generate conflict-free paths for each moving robot. In our study, the environment is represented as a grid map consisting of cells with a unit length, and an index incrementally numbered from left to right and top to bottom is used as the position coordinate of each cell. For example, in a \(5\times 10\)-cell grid, the cell in the upper left corner is indexed with 0, while that in the lower right corner is indexed with 49. Thus, in path finding, graph-based search methods such as CA* [27] can be adopted. Let \(M_{i}=\{1,\ldots,m\}\) be a set of optional machining centers for task \(i\) when operating task \(i\). This setting considers a scenario where several machining centers are available for a manufacturing job, and generally, the energy consumed by different machining centers and the distance between these machining centers and mobile robots are different, resulting in various total time and energy consumption. For example, to process task \(t_{1}\), the energy consumption of machining center \(m_{1},m_{2}\) is \(e_{a},e_{b}\), respectively (in most cases \(e_{a}\
eq e_{b}\)). The time taken to travel \(t_{1}\) to the machining center \(m_{1},m_{2}\) is \(t_{c},t_{d}\), respectively (in most cases, \(t_{c}\
eq t_{d}\)). In this way, for task \(t_{1}\), there is coupling between the energy consumed in choosing which machining center to process and the time taken to choose which robot to transport. In fact, the energy consumption is not necessarily smaller when the transportation time is shorter. For example, when \(e_{a}>e_{b}\) and \(t_{c}<t_{d}\), although the energy consumption of machining center \(m_{1}\) is larger than \(m_{2}\), it will take less time to transport \(t_{1}\) to machining center \(m_{1}\) compared to \(m_{2}\). Thus, it is important for a task to choose the proper machining center to save the time and energy. This means that the goal positions of some tasks are unknown before the final task assignment, in which these tasks will eventually be assigned to appropriate machining centers considering both the time and energy efficiency. Let \(T=\{1,\ldots,n\}\) represent a set of tasks in the smart factory in which the cargo (e.g., materials or parts) is transported from starting positions to designated positions. Each task \(i\in T\) has a given tuple with seven attributes, \(\big{(}type_{i},sp_{i},gp_{i},st_{i},gt_{i},parent_{i},M_{i}\big{)}\). \(type_{i}\) is the type of task \(i\), and \(type_{i}=0\) represents that in task \(i\), the cargo will be transported from a storage zone or machining center to another machining center (note here that the goal position of task \(i\) is still unknown), while \(type_{i}=1\) represents that the cargo will be transported from a machining center to a storage zone (note here that the goal position of task \(i\) is known because we assume that the storage location of each part is known and fixed). These constraints are defined in Equations (7)-(9) in the following formulation. Given a grid map with \(g\) cells, \(sp_{i},gp_{i}e\{-1,\ldots,g-1\}\) are the starting and goal positions of task \(i\), respectively, which equals \(-1\) when the starting or goal position is unknown. \(st_{i},gt_{i}e\{-1\}\cup\mathbb{N}\) are the starting and finishing times of task \(i\), respectively, which equals \(-1\) when either one is unknown. \(parent_{i}\) is the parent task of task \(i\), and it must be completed before starting task \(i\). Here, we only consider a basic case where each task has one parent. \(R=\{1,\ldots,a\}\) represents the set of robots for transporting tasks. \(s_{j}\) denotes the starting position for each robot \(j\in R\). The starting positions of all robots are randomly assigned in the docking zone at the beginning. In this study, the robots are assumed to be able to turn around in place; thus, robot heading is not considered in task assignment.