## 3 Problem Formulation
### Modeling
Figure 5 shows the relationship between the number of remaining nodes and the number of unfinished orders. \[\text{min}F_{3}=E\Bigg{(}\sum_{l=1}^{|\mathcal{A}|}\lambda_{l}(a_{l}-a_{l-1}) \Bigg{)} \tag{3}\]  
Constraints (4) and (5) delineate the deduction constraints governing the sequential visitation order of the order nodes. The access sequence \(s_{l}\) of the \(l\)th node is deduced by decision variables \(x_{ij}\). Obviously, \(s_{|\mathcal{A}|}\) is the last access node. \[s_{1}=\sum_{j\in\mathcal{A}}jx_{s_{0}j} \tag{4}\]  
\[s_{l+1}=\sum_{j\in\mathcal{A}^{\prime}}jx_{s_{l}j},\forall l\in\{1,2,\dots,| \mathcal{A}|-1\} \tag{5}\] \begin{table}
\begin{tabular}{l l} \hline \hline
**Sets** & **Description** \\ \hline \(p_{l}^{2}\) & if the \(l\)th node and the next node merge to deliver food, \(p_{l}^{2}\) is equal to 1, otherwise \(p_{l}^{2}\) is equal to 0, \(l\in\{1,\dots,|\mathcal{A}^{\prime}|-1\}\) \\ \(a_{l}\) & time to arrive \(s_{l},l\in\{1,2,\dots,|\mathcal{A}^{\prime}|\}\) \\ \(d_{l}\) & takeout volume carried on arrival at \(s_{l},l\in\{1,2,\dots,|\mathcal{A}^{\prime}|\}\) \\ \(\lambda_{l}\) & the number of unfinished orders before visit \(s_{l},l\in\{1,2,\dots,|\mathcal{A}^{\prime}|\}\) \\ \(g_{n}\) & the completion time of order \(n\), \(n\in N\) \\ \(\omega\) & the timeout rate of the order \\ \hline \hline \end{tabular}
\end{table} 
Table 2: _Cont._  
Figure 5: Changes in the number of orders and nodes to be delivered. Constraints (6) and (7) are constraints on the volume of takeout carried by the AGV. The volume of takeout carried upon arrival cannot exceed the maximum capacity of the AGV. If the AGV passes through the restaurant node \(s_{l}\) (pick-up stage), the takeout volume is increased. The takeout volume \(d_{l+1}\) carried by the AGV upon arrival \(s_{l+1}\) is the sum of \(d_{l}\) and \(v_{\text{arga}(s_{l})}\). If the AGV passes through the customer node \(s_{l}\) (the delivery stage), the takeout volume is reduced. The takeaway volume \(d_{l+1}\) carried by the AGV on arrival \(s_{l+1}\) is the difference between \(d_{l}\) and \(v_{\text{arga}(s_{l})}\). \[d_{0}=\sum\limits_{n\in N_{1}}v_{n}\]  
\[d_{l+1}=\left\{ \begin{array}{rl}&d_{l}+v_{\text{arga}(s_{l})}\quad s_{l}\in I \\ &d_{l}-v_{\text{arg}\beta(s_{l})}\quad s_{l}\in J\end{array} \right.\forall l\in \left\{1,\ldots,|A\prime|-1\right\} \tag{6}\]  
\[d_{l}\leq V,\forall l\in\left\{1,\ldots,|A\prime|-1\right\} \tag{7}\]  
Constraint (8) imposes limitations on the visiting sequence of the order nodes. For the same order, the AGV should visit the restaurant node \(\alpha_{n}\) first, then the customer node \(\beta_{n}\) is visited. It is expressed that the time when the AGV arrives at the restaurant node \(a_{\text{args}(\alpha_{n})}\) should be less than the time when it arrives at the customer node \(a_{\text{args}(\beta_{n})}\). \[a_{\text{args}(\alpha_{n})}<a_{\text{args}(\beta_{n})},\forall n\in N \tag{8}\]  
Constraints (9)-(11) are the AC identification constraints of the order. \[p_{l}^{1}=\left\{ \begin{array}{rl}1,map_{s_{l}}^{1}=map_{s_{l+1}}^{1}\quad s _{l},s_{l+1}\in I,\forall l\in\left\{1,\ldots|A\prime|-1\right\}\\ \\ \end{array} \right. \tag{9}\]  
\[p_{l}^{2}=\left\{ \begin{array}{rl}1,map_{s_{l}}^{2}=map_{s_{l+1}}^{2}\quad s _{l},s_{l+1}\in J,\forall l\in\left\{1,\ldots|A\prime|-1\right\}\\ \\ \end{array} \right. \tag{10}\]  
\[p_{l}^{1}+p_{l}^{2}\leq 1,\forall l\in\left\{1,\ldots|A\prime|-1\right\} \tag{11}\]  
Constraint condition (14) is the constraint of the completion time of the order; \(g_{n}\) is the sum of \(a_{\text{args}(\beta_{n})}\) and \(t_{n}^{s}\). The derivation of \(a_{l}\) is shown in (13). If there is a combination of routings between \(s_{l}\) and \(s_{l-1}\) (merged meal pick-up or delivery), \(a_{l-1}\) is equal to \(a_{l}\). If \(s_{l-1}\) is the restaurant node, which does not produce a merged meal pick-up with the last node, \(a_{l}\) is the sum of \(a_{l-1}\) and \(t_{s_{l-1}s_{l}}^{d}\).