## 4 Solving Methodology  
The solving methodology presents a heuristic-based approach to solve the problem described in Section 3. We consider two relatively simple yet effective and extremely fast heuristics. These heuristics assume we can estimate the expected delay associated with each circuit at any moment in time, being this delay a function of the current system conditions. This is achieved by creating a dynamic matrix of expected delays that uses historical data to estimate the delay associated with a given circuit under a specific configuration of the environmental conditions. In other words, the dynamic matrix provides, for the current time, the updated estimates for the delays associated with each possible circuit. Algorithm 1 presents the pseudo-code for our first heuristic, which is a non-reactive one. ```
1:Data: List of tasks \(T\), and matrix of expected delays \(D\)
2:Result: Permutation of completed tasks \(P\)
3:\(P\leftarrow\emptyset\)
4:\(t_{c}\gets 0\)
5:while\(T\
eq\emptyset\)do
6:\(T\leftarrow\text{estimateDelays}(T,D,t_{c})\)
7:\(T\leftarrow\text{sort}(T)\)
8:\(t\leftarrow\text{selectTask}(T)\)
9:\(P\gets P\cup\{t\}\)
10:\(t_{c}\leftarrow\text{updateSystem}(t_{c},t)\)
11:endwhile
12:return\(P\)
```  
**Algorithm 1** Non-Reactive Heuristic for Dynamic Delays  
The non-reactive heuristic algorithm receives the following input parameters: (i) the list of assigned tasks \(T\) a particular AGV needs to complete; and (ii) the dynamic matrix of expected delays \(D\). More specifically, each task in the list contains a product-workstation pair, along with the time needed by the AGV to complete the associated circuit. The dynamic matrix contains the estimated delays associated with each circuit for each daily time. The non-reactive heuristic works as follows: first, an empty permutation of tasks \(P\) is constructed (line 3). The elements from the list of tasks will be added to this permutation in the order the assigned tasks are completed. In addition, the system conditions track the current time \(t_{c}\), which is initialized to the starting time \(t=0\). Next, the list of tasks to be completed \(T\) is iterated until no more tasks are in the list (lines 5-11). In each iteration, the delays of each circuit are estimated based on the system conditions (line 6). More specifically, the delays for each circuit are extracted from the dynamic matrix of estimated delays using the current time \(t_{c}\). In addition, the estimated delay of each circuit is added to the time each task in the list of tasks needs to complete the particular circuit it needs to traverse. Hence, we compute the estimated total time needed by the AGV to complete each assigned task. The list of tasks is then sorted from the lowest to the highest estimated delay (line 7). The task with the lowest delay \(t\) is extracted from the list (line 8). Thistask is then added to the end of the permutation of completed tasks (line 9). Once the completed task is added to the permutation, the system conditions are updated, which adds the estimated total time needed to complete the assigned task to the system variable that tracks the current time (line 10). Once the list of assigned tasks to be completed is empty, the constructed permutation of completed tasks is returned (line 12). The non-reactive heuristic presented here selects the task with the lowest estimated delay when the circuit is traversed, which constitutes the delays estimated from historical data. However, the delays encountered when the circuit is actually traversed might be different than the estimated ones. The second heuristic, which is described next, solves this issue by employing a reactive approach: taking into account the current system conditions, which are updated at the end of each circuit. Algorithm 2 presents the pseudo-code of our reactive heuristic.