## 4 Solving the Warehouse Delivery Problem
### Task Assignment and Sequencing
#### 4.3.2 Conflict Detection and Resolution
Hence a matching difference constraint regarding the followup vertex of \(v^{\prime\prime}\) in path \(p\) and vertex \(v^{\prime}\) in path \(p^{\prime}\) would also be derived, essentially delaying the robot that is assigned to \(p^{\prime}\) until the whole conflict zone is cleared. Secondly, the corner case where path \(p\) has no move after vertex \(v\), since \(v\) is its target vertex, is covered by the constraints in Lines 17 to 21 of Listing 14. In this case, the conflict resolution has been propagated to path \(p\)'s successor and the appropriate difference constraint is derived. Furthermore, in this case \(p\) is guaranteed to have a successor path, since if \(p\) were a final homing path then the constraint at Line 21 of Listing 14 would have prevented before((\(p\),\(v\)),(\(p^{\prime}\),\(v^{\prime}\))) from being derived. Finally, it is worth noting that there are alternative ways of addressing conflict resolution. Here, we take a conservative approach by tracking the time when a robot arrives at a location outside of the conflict area. This might be too strict if one faces edges with large durations: The robot might already be out of the way before actually arriving at its next location. In such a case, alternative conflict strategies could be considered. For example, one could introduce a safety period after the exit at the conflict vertex to more closely fit real-world conditions. The final aspect of scheduling is to deal with task execution and dependencies. This is handled by the difference constraints at Lines 18 and 19. Line 18 ensures that the assigned robot remains at the target vertex long enough for the task to be executed. That is, for every task \(t\) and \(v=f_{V}(t)\), we require that arrive(\(t\),\(v\)) \(+\)\(\kappa\)\(\leq\) exit(\(t\),\(v\)). This constraint only requires that a path overlaps at least the execution time with its task's target location; it would be a valid assignment to the integer variables if the exit time were larger than necessary. In practice, however, the difference constraint solver generates an assignment that schedules everything as early as possible, meaning that the exit time of a path is equal to the arrival time at the task location plus the execution time. However, this does not force the robot to physically move locations at this time; it simply transitions to the successor path which has its own arrival and exit variables at that same vertex. This may be necessary, for instance, to delay the starting movement of the robot to let another robot pass. It is worth highlighting an important performance consideration of this constraint. Since each task has an identically named path, the arrival and exit times of the path at its target vertex can be simply identified by the static fact task(\(t\),\(v\)). This means that this constraint can be applied unconditionally by the solver. In contrast, scheduling of task execution for the step-based encoding is dependent on the projection of the task over the assigned robot's walk (see Line 18 of Listing 9). This means that its application is conditional on both the task assignment choice as well as the projection choice. Consequently, task execution scheduling for the step-based encoding is a significantly more complicated, and potentially costly, process. Finally, the rule starting at Line 19 addresses task interdependencies. We add a timing constraint whenever the paths associated with dependent tasks are assigned to different robots. More precisely, for two tasks \(t,t^{\prime}\) with \((t,t^{\prime})\in D\) and distinct robots \(r,r^{\prime}\) such that \(t\in f_{T}(r)\) and \(t^{\prime}\in f_{T}(r^{\prime})\), we impose the timing constraint exit(\(t\),\(v\)) \(+\)\(\kappa\)\(\leq\) exit(\(t^{\prime}\),\(v^{\prime}\)) with \(f_{V}(t)=v\) and \(f_{V}(t^{\prime})=v^{\prime}\).