\onecolumn

\title{Online Generalized Magician's Problem with Multiple Workers\\(Supplementary Material)}
\maketitle

\appendix

\input{Sections/Appendix/UseCases}

\input{Sections/Appendix/RelatedWork}

\section{Proof of Theorem~\ref{trm:cov}}\label{sec:trm:cov}
(Convex Equivalence) There exists a convex optimization problem $\mathtt{P}'$, such that its optimal solution is also the optimal solution to $\mathtt{P}_1$.
\begin{proof}
    Recall that the optimization problem $\mathtt{P}_1$ is defined as
    \begin{align}
        \mathtt{P}_1\quad\max_{\gamma_l, \forall l}\quad&\min_l\frac{\sum_{l'\in[L]\setminus\{l\}}\gamma_{l'}\underline{u}_{l'}}{\overline{u}_{l}}+\gamma_l\label{eq:cov.1}\\
        \textbf{s.t.}\quad\ \  
            &K\geq\frac{1}{(1- \sum_{l\in[L]}\gamma_{l})(1-\max_{l}\gamma_{l}L)},\label{eq:cov.2}\\
            &\max_{l}\gamma_{l}<\frac{1}{L},\label{eq:cov.3}\\
            &\gamma_l\geq0,\ \forall l.\label{eq:cov.5}
    \end{align}

(i) Note that the objective function in Eq.~(\ref{eq:cov.1}) is equivalent to 
\begin{align}
    \sum_{l'\in[L]} \gamma_{l'}-\sum_{l'\in[L]\setminus l}\gamma_{l'}(1-\frac{\underline{u}_{l'}}{\Bar{u}_l}).\label{(7)}
\end{align}
In addition, by Eq.~(\ref{eq:cov.3}), Eq.~(\ref{eq:cov.2}) is equivalent to
\begin{align}
    \sum_{l\in[L]}\gamma_l\leq1-\frac{1}{K-\max_l\gamma_lKL}.\label{eq:cov.6}
\end{align}
Therefore, $\mathtt{P}_1$ is equivalent to 
\begin{align}
        \mathtt{P}_2\quad\max_{\gamma_l, \forall l}\quad&\min_l\sum_{l'\in[L]} \gamma_{l'}-\sum_{l'\in[L]\setminus l}\gamma_{l'}(1-\frac{\underline{u}_{l'}}{\Bar{u}_l})\label{eq:cov.8}\\
        \textbf{s.t.}\quad\ \  
            &\sum_{l\in[L]}\gamma_l\leq1-\frac{1}{K-\max_l\gamma_lKL},\label{eq:cov.9}\\
            &\max_{l}\gamma_{l}<\frac{1}{L},\label{eq:cov.10}\\
            &\gamma_l\geq0,\ \forall l.\label{eq:cov.11}
    \end{align}

    (ii) There exists an optimal solution that satisfies the equality of Eq.~(\ref{eq:cov.9}). Otherwise, for an optimal solution not satisfying the equality of Eq.~(\ref{eq:cov.9}), we can increase the $\gamma_l$ that is smaller than $1/L$ until the equality of Eq.~(\ref{eq:cov.9}) is satisfied. During this process, Eq.~(\ref{eq:cov.8}) will not decrease.

    (iii) Therefore, an optimal solution of $\mathtt{P}_1$ can be obtained by optimally solving
    \begin{align}
        \mathtt{P}_3\quad\max_{\gamma_l, \forall l}\quad&\min_l1-\frac{1}{K-\max_l\gamma_lKL}-\sum_{l'\in[L]\setminus l}\gamma_{l'}(1-\frac{\underline{u}_{l'}}{\Bar{u}_l})\label{eq:cov.12}\\
        \textbf{s.t.}\quad\ \  
            &\max_{l}\gamma_{l}<\frac{1}{L},\label{eq:cov.13}\\
            &\gamma_l\geq0,\ \forall l.\label{eq:cov.14}
    \end{align}
    
    (iv) We set $w=\max_l\gamma_l$, then $\mathtt{P}_3$ is equivalent to
    \begin{align}
        \mathtt{P}'\quad\max_{w,\{\gamma_l\}_{l\in[L]}}\quad&\min_l1-\frac{1}{K-wKL}-\sum_{l'\in[L]\setminus l}\gamma_{l'}(1-\frac{\underline{u}_{l'}}{\Bar{u}_l})\label{eq:cov.15}\\
        \textbf{s.t.}\quad\ \  
            &0\leq w<\frac{1}{L},\label{eq:cov.16}\\
            &0\leq\gamma_l\leq w,\ \forall l.\label{eq:cov.17}
    \end{align}
    
    (v) In Eq.~(\ref{eq:cov.15}), the second term $1/(K-wKL)$ is convex when $w<1/L$, the last term is linear, so the objective function $1-\frac{1}{K-wKL}-\sum_{l'\in[L]\setminus l}\gamma_{l'}(1-\frac{\underline{u}_{l'}}{\Bar{u}_l})$ is concave, the minimization of this function is concave, and Eq.~(\ref{eq:cov.15}) is convex. With Eq.~(\ref{eq:cov.16}) and Eq.~(\ref{eq:cov.17}), $\mathtt{P}'$ is a convex optimization problem. 

    (vi) Therefore, an optimal solution to the convex optimization problem $\mathtt{P}'$ is also an optimal solution to $\mathtt{P}_1$.
\end{proof}

\section{OWA Algorithm Complexity Analysis}\label{sec:complexity}

\textbf{Complexity of the Pre-Calculation Phase.} Before the first task arrives, we need to solve the optimization problem $\mathtt{P}_1$ to obtain the parameters $\gamma_l^*$. Since, by Theorem~\ref{trm:cov} and its proof (Appendix~\ref{sec:trm:cov}), the optimal solution to $\mathtt{P}_1$ can be obtained by solving the convex optimization problem $\mathtt{P}'$, which is given in Eq.~(\ref{eq:cov.14})--(\ref{eq:cov.16}). We can solve $\mathtt{P}'$ by standard solvers for convex optimization problems, such as the interior-point method (or the barrier method). Specifically, 
if we solve $\mathtt{P}'$ using the \emph{barrier method}~\citep{boyd2004convex} with the starting point as $w=0$ and $\gamma_l=0$ for each $l$, it will take at most $\lceil2\log_2(\frac{5\mathtt{P}_1(\{\gamma_l^*\})}{\epsilon})\rceil(\frac{1}{2p}+c)$ Newton steps (centering steps), where $\epsilon$ is the error tolerance, $\frac{1}{p}=\frac{20-8\alpha}{\alpha\beta(1-2\alpha)^2}$ where $\alpha$ and $\beta$ are the backtracking parameters, and $c=\log_2(\log_2(1/\epsilon))$. Each Newton step has a complexity of $\mathcal{O}(L^3)$. 
Since the pre-calculation phase is performed offline before the online process, this complexity can be well accepted.

\textbf{Complexity of the Worker-Assignment Phase and the Processing Phase.} In the worker-assignment phase, the loops on lines \ref{1-0-7}--\ref{1-0-10} result in a complexity of $\mathcal{O}(1)$. Then we go through the processing phase, where the update of $\Theta_{t+1}$ on lines \ref{1-0-15}--\ref{1-0-23} has $\mathcal{O}(1)$ complexity. Therefore, the total complexity of the worker-assignment phase and the processing phase is $\mathcal{O}(1)$.

\textbf{Complexity of the Baseline-Calibration Phase.}
In the baseline-calibration phase,
we need to calculate the resource utilization function $h_{t+1}$ according to Eq.~(\ref{eq:h2}). A straightforward solution to perform the convolution operation is to calculate its value directly by performing an integral, which can have high computational complexity.  
However, as we will see later in the proof of Theorem~\ref{trm:1}, every $h_{t}(w)$ has a finite length (i.e., $h_{t}(w)=0$ if $w<0$ or $w\geq K$). Therefore, we may use Fast Fourier Transform (FFT) to efficiently compute the convolution in this step. 
Let $D$ be the number of discrete-time samples of each continuous function $\overline{h}_t$ and $\overline{g}_t$.
\textbf{First}, for each task $t$, we update $h_{t+1}$ by Eq.~(\ref{eq:h2}) in Line~\ref{2-0-6}. 
To calculate each $\overline{g}_{t}$ by Eq.~(\ref{eq:barg}), we first calculate each $(1/\sum_l\gamma_l)\gamma_lg_{t,l}(w)$ with $\mathcal{O}(LD)$ complexity, then calculate $\overline{g}_{t}$ with $\mathcal{O}(LD)$ complexity, which leads to $\mathcal{O}(LD)$ total complexity. \textbf{Second}, to update $h_{t+1}$, we calculate $\overline{h}_{t}$ with $\mathcal{O}(D)$ complexity, perform FFT on $\overline{h}_{t}$ and $\overline{g}_{t}$ with a complexity of $\mathcal{O}(D\log(D))$, calculate the multiplication of the FFT results with $\mathcal{O}(D)$ complexity, perform iFFT on the multiplication result with a complexity of $\mathcal{O}(D\log(D))$, and finally add $(h_{t}-\overline{h}_{t})$ with $\mathcal{O}(D)$ complexity. In conclusion, updating $h_{t+1}$ requires a complexity of $\mathcal{O}(D\log(D))$. \textbf{Finally}, in Line~\ref{2-0-7}, we find $\theta_{t}$ by binary search with complexity $\mathcal{O}(\log(D))$ and update $\phi_t$ with complexity $\mathcal{O}(1)$ (since $h_t(w)=0$ when $w<0$). In summary, the complexity of Line~\ref{2-0-6} to update $h_{t+1}$ for each task $t$ is $\mathcal{O}(D\log(D))$, and the complexity of Line~\ref{2-0-7} to update $\theta_{t+1}$ and $\phi_{t+1}$ for each task is $\mathcal{O}(\log(D))$. As a result, the total complexity of the baseline-calibration phase for each task $t$ is $\mathcal{O}(D\log(D))$. 

In conclusion, the complexity of the OWA algorithm for each task during the online process is $\mathcal{O}(D\log(D))$. 
% \end{proof}


\section{Proof of Theorems~\ref{trm:1}--\ref{trm:5} and Corollary~\ref{crly:1}}\label{sec:A.C}

\subsection{Theorem~\ref{trm:1}}\label{sec:trm1}
(Sufficient Resource) With $\gamma_l^*$ from solving $\mathtt{P}_1$ in Eqs.~(\ref{eq:p1start})--(\ref{eq:p1end}), the OWA algorithm satisfies the resource sufficiency condition.
\begin{proof}
    To prove Theorem~\ref{trm:1}, we require several lemmas. For convenience of presentation, we define $\gamma^*=\sum_l\gamma_l^*$. 
    Since PDFs $g_{t,l}(\cdot)$ are continuous, we have $\phi_{t}=\gamma^*$ when $\theta_{t,m}>0$. As a result, it holds that
    \begin{align}
        h_{t+1}(w)=\overline{h}_{t}(w)*\overline{g}_{t}(w)+h_{t}(w)-\overline{h}_{t}(w).
    \end{align}
    Let us define $H_{t}(w)=\int^w_{-\infty}h_{t}(v)dv$, $G_{t,l}(w)=\int^w_{-\infty}g_{t,l}(v)dv$, and $\overline{G}_t(w)=\int^w_{-\infty}\overline{g}_{t}(v)dv$. 
    
    We first show that $H_{t+1}(\theta_{t})\leq H_{t}(\theta_{t})$.

    \begin{lemma}\label{lm:1-1}
        $H_{t+1}(\theta_{t})\leq H_{t}(\theta_{t})$, $\forall t\in[T]$.
    \end{lemma}
    \begin{proof}
    If $\theta_t=0$, according to the update rule of $h_t$ and by the fact that $r_{t,l}>0$, we have $H_{t+1}(0)=(1-\gamma^*\phi_t)H_t(0)<H_{t}(0)$. If $\theta_t>0$,
    by the definition of $H_{t}(w)$, we have
    \begin{align}
        H_{t+1}(\theta_{t})=&\int^{\theta_{t}}_0h_{t+1}(w)dw\\
        =&\int^{\theta_{t}}_0 \left(\overline{h}_{t}(w)*\overline{g}_{t}(w)+h_{t}(w)-\overline{h}_{t}(w)\right)dw.
    \end{align}
    Then by the definition of $\overline{h}_{t}(w)$, we have $h_{t}(w)-\overline{h}_{t}(w)=0$ when $w\leq\theta_{t}$. Hence we have $H_{t+1}(\theta_{t})=\int^{\theta_{t}}_0 \overline{h}_{t}(w)*\overline{g}_{t}(w)dw$. Since $\int^{\theta_{t}}_0 \overline{h}_{t}(w)dw = \int^{\theta_{t}}_0 h_{t}(w)dw=H_t(\theta_t)$, by Fubini's theorem, we have
    \begin{align}
        \int_{-\infty}^{\infty}\overline{h}_{t}(w)*\overline{g}_{t}(w)dw=&\left(\int_{-\infty}^{\infty}\overline{h}_{t}(w)dw\right)\cdot\left(\int_{-\infty}^{\infty}\overline{g}_{t}(w)dw\right)\\=&H_t(\theta_t).
    \end{align}
    It is straightforward that $\overline{h}_{t}(w)\geq0$ and $\overline{g}_{t}(w)\geq0$, so we have
    \begin{align}
        H_{t+1}(\theta_{t})=\int^{\theta_{t}}_0 \overline{h}_{t}(w)*\overline{g}_{t}(w)dw\leq H_t(\theta_t).
    \end{align}
    Thus, Lemma~\ref{lm:1-1} is proved.
    \end{proof}

    Next, we show that $\theta_t\leq\theta_{t+1}$.
    \begin{lemma}\label{lm:1.5}
        $\theta_t\leq\theta_{t+1}$ for every $t\in[T]$
    \end{lemma}
    \begin{proof}
        To prove Lemma~\ref{lm:1.5}, we first show three properties for $H_t$ and $\theta_t$:
        \begin{itemize}
            \item (i) CDF $H_t(w)$ is continuous and non-decreasing for $w>0$. This is because $H_t(w)$ is the integral of $h_t(w)$, where $h_t(w)$ has a limited number of removable discontinuities at $w>0$, and we have $h_1(w)\geq0$ at every $w$.
            \item (ii) We have $\theta_t\geq0$ for every $t$. This is because $h_t(w)=0$ when $w<0$.
        \end{itemize}
        

        Then we prove Lemma~\ref{lm:1.5} by discussing separately the two cases where $\theta_t=0$ and $\theta_t>0$. When $\theta_t=0$, by property (ii) we have $\theta_{t+1}\geq0$, leading to $\theta_{t+1}\geq\theta_t$. When $\theta_t>0$, by Lemma~\ref{lm:1-1} we have $H_{t+1}(\theta_t)\leq H_t(\theta_t)$. Then by property (i), we have $\theta_{t+1}\geq\theta_t$. Thus, Lemma~\ref{lm:1.5} is proved.
        
        
    \end{proof}

    Next, we define $\overline{\Theta}_{t}=\min_{w}\{H_{t}(w)=1\}$ and prove that $\overline{\Theta}_{t+1}\leq\theta_{t}+1$.
    \begin{lemma}\label{lm:1-2}
        $\overline{\Theta}_{t+1}\leq\theta_{t}+1$ for every $t\in[T]$.
    \end{lemma}
    \begin{proof}
        We prove this lemma by induction. We start from the base case at $t=1$. By the fact that $\theta_1=0$, $\phi_1=1$, the update rule of $h_t$ and the convolution property of $\delta(w)$, we have $h_{2}(w)=(1-\gamma^*)\delta(w)+\gamma^* \overline{g}_t(w)$. Since $\overline{G}_t(1)=1$ for every $t$, we have $H_2(1)=1$. As a result, $\overline{\Theta}_{2}\leq1=\theta_1+1$. The base case is proved.

        Suppose that $\overline{\Theta}_{t+1}\leq\theta_{t}+1$ is valid at every $t\in[\tau-1]$. We next prove that $\bar{\Theta}_{\tau+1} \leq \theta_\tau +1$. We first show that there exists $w$ such that $H_{\tau+1}(w)=1$. By Fubini's theorem, when $\theta_\tau=0$, we have
        \begin{align}
            \int_{-\infty}^{\infty} h_{\tau+1}(w)dw=&(1-\gamma^*/\phi_\tau)\int_{-\infty}^{\infty}h_{\tau}(w)dw+(\gamma^*/\phi_\tau)\int_{-\infty}^{\infty}h_{\tau}(w)dw\\
            =&1.\label{eq:n-25}
        \end{align}
        When $\theta_\tau>0$, for $h_{\tau+1}$ we have
        \begin{align}
            \int_{-\infty}^{\infty} h_{\tau+1}(w)dw=&  \int_{-\infty}^{\infty}\left(\overline{h}_{\tau}(w)*\overline{g}_{\tau}(w)+h_{\tau}(w)-\overline{h}_{\tau}(w)\right)dw\label{eq:n-26}\\
            =&\left(\int_{-\infty}^{\infty}\overline{h}_{\tau}(w)dw\right)\cdot\left(\int_{-\infty}^{\infty}\overline{g}_{\tau}(w)dw\right)+\int_{-\infty}^{\infty}h_{\tau}(w)dw-\int_{-\infty}^{\infty}\overline{h}_{\tau}(w)dw\\
            =&\int_{-\infty}^{\infty}h_{\tau}(w)dw\label{eq:n-28}
        \end{align}
        We define $\tau'=\max_{\tau''\in[\tau+1]}\{\theta_{\tau''}=0\}$, and by Lemma~\ref{lm:1.5}, we have $\tau'<\tau$.
        Then by the same derivation of Eqs.~(\ref{eq:n-26})--(\ref{eq:n-28}), we have
        \begin{align}
            \int_{-\infty}^{\infty} h_{\tau+1}(w)dw=&\int_{-\infty}^{\infty}h_{\tau}(w)dw\\
            =&\int_{-\infty}^{\infty}h_{\tau-1}(w)dw\\
            =&\cdots\\
            =&\int_{-\infty}^{\infty} h_{\tau'+1}(w)dw\\
            =&1,
        \end{align}
        where the last equation comes from Eq.~(\ref{eq:n-25}).
        
        Second, we show that when $w\geq\theta_{\tau}+1$, we have $h_{\tau+1}(w)=0$. 
        When $\theta_\tau=0$, by the update rule of $h_t$, we have $h_{\tau+1}(w)=(1-\gamma^*/\phi_\tau)h_{\tau}(w)+(\gamma^*/\phi_\tau)(\phi_\tau\cdot\delta(w)*\overline{g}_{\tau}(w)+h_{\tau}(w)-\overline{h}_{\tau}(w))$, since $\phi_{\tau}=\int_{-\infty}^0h_{\tau}(w)dw=\int_{-\infty}^0\overline{h}_{\tau}(w)dw$. Therefore, by the convolution property of $\delta(w)$, we have $h_{\tau+1}(w)=(1-\gamma^*/\phi_{\tau})h_{\tau}(w)+(\gamma^*/\phi_{\tau})(\phi_\tau\cdot\overline{g}_{\tau}(w)+h_{\tau}(w)-\overline{h}_{\tau}(w)$. Since $h_{\tau}(w)$ and $\overline{g}_\tau(w)$ become $0$ when $w\geq1$, so does $h_{\tau+1}(w)$. When $\theta_\tau>0$, according to the definition of convolution and that fact that $\overline{h}_{\tau}(w)=\overline{g}_{\tau}(w)=0$ at $w<0$, we have
        \begin{align}
            \overline{h}_{\tau}(w)*\overline{g}_{\tau}(w)=\int_0^w\overline{h}_{\tau}(v)\overline{g}_{\tau}(w-v)dv.
        \end{align}
        When $v\leq w-1$, we have $w-v\geq1$ and $\overline{g}_{\tau}(w-v)=0$, so
        \begin{align}
            \overline{h}_{\tau}(w)*\overline{g}_{\tau}(w)=\int_{w-1}^w\overline{h}_{\tau}(v)\overline{g}_{\tau}(w-v)dv.
        \end{align}
       By the definition of $\overline{h}_{\tau}$, when $w\geq\theta_{\tau}+1$, we have $\overline{h}_{\tau}(v)=0$ at $v\in(w-1,w]$, so $\overline{h}_{\tau}(v)\cdot \overline{g}_{\tau}(w-v)=0$. As a result, when $w\geq\theta_{\tau}+1$, we have $h_{\tau+1}(w)=h_{\tau}(w)$ by the update rule of $h_{\tau+1}$.
       
       
       Next, by Lemma~\ref{lm:1-1}, $H_{\tau}(\theta_{\tau-1})\leq H_{\tau-1}(\theta_{\tau-1})$. We note that since $H_{\tau}(w)$ is the integral of $h_{\tau}(w)$, it continuously increases to $1$ on $w>0$. Then, \textcircled{1} since $\theta_{\tau}$ is at least $0$ for every $\tau$, when $\theta_{\tau-1}=0$, we have $\theta_{\tau}\geq\theta_{\tau-1}$; and \textcircled{2} when $\theta_{\tau-1}>0$, we have $H_{\tau-1}(\theta_{\tau-1})=\gamma^*$ and $\theta_{\tau}\geq\theta_{\tau-1}$.
       Then, since by the induction hypothesis, $H_{\tau}(\theta_{\tau-1}+1)=1$, we have $h_{\tau}(w)=0$ when $w\geq\theta_{\tau}+1\geq\theta_{\tau-1}+1$. Therefore, we have $h_{\tau+1}(w)=0$ when $w\geq\theta_{\tau}+1$.
       Since \textcircled{1} there exists $w$ that $H_{\tau+1}(w)=1$, \textcircled{2} $H_{\tau+1}(w)=\int_{-\infty}^wh(v)dv$, \textcircled{3} $\overline{\Theta}_{t}=\min_{w}\{H_{t}(w)=1\}$, and \textcircled{4} $h_{\tau+1}(w)=0$ when $w\geq\theta_{\tau}+1$, we have $\overline{\Theta}_{\tau+1}\leq\theta_{\tau}+1$. Thus, Lemma~\ref{lm:1-2} is proved.
    \end{proof}

    Now we show that $\theta_{t+1}<\theta_{t}+1$.

    \begin{lemma}\label{lm:1-3}
        $\theta_{t+1}<\theta_{t}+1$ for every $t\in[T]$.
    \end{lemma}
    \begin{proof}
        Since \textcircled{1} by Lemma~\ref{lm:1-2} we have $H_{t+1}(\theta_{t}+1)=1$, \textcircled{2} by the definition of $\theta_{t+1}$, we have $H_{t+1}(\theta_{t+1})\in[\gamma^*,1]$, and \textcircled{3} $H_{t+1}(w)$ is non-decreasing in $w$, we have $\theta_{t+1}\leq\theta_{t}+1$. 
        Furthermore, if $\theta_{t+1}=\theta_t=0$, we have $\theta_{t+1}<\theta_t+1=1$. And if $\theta_{t+1}>0$, since $H_{t+1}(w)$ is continuous on $w>0$, we have $H_{t+1}(\theta_{t+1})=\gamma^*<1$. As a result, we also have $\theta_{t+1}<\theta_{t}+1$. Thus, Lemma~\ref{lm:1-3} is proved.
    \end{proof}

    Next, we prove an inequality on $H_{t}$.

    \begin{lemma}\label{lm:1-4}
    For every $t$ we have
    \begin{align}
        H_{t}(w-1)\leq\gamma^* H_{t}(w), \forall w\in(-\infty,\overline{\Theta}_{t}).\label{eq:n-40}
    \end{align}
    \end{lemma}
    \begin{proof}
        First, if $\theta_{t-1}=0$, then $\overline{\Theta}_{t}\leq1$. For $w<\overline{\Theta}_{t}$, we have $w-1<0$ and $H_{t}(w-1)=0$. Therefore, Eq. (\ref{eq:n-40}) holds.
        
        Next, we consider $\theta_{t-1}>0$. We first derive the expression of $H_{t}$ from $h_t$. According to the update rule of $h_t$, we have
        \begin{align}
            H_{t+1}(w)=&\int_0^w\left(\int_0^v\overline{h}_{t}(u)\overline{g}_{t}(v-u)du+h_{t}(v)-\overline{h}_{t}(v)\right)dv\\
            =&\int_0^w\int_0^v\overline{h}_{t}(u)\overline{g}_{t}(v-u)du dv\label{eq:4-44}+H_{t}(w)-\min\{H_{t}(w),H_{t}(\theta_{t})\}.\nonumber
        \end{align}
        We define $\overline{H}_{t}(w)=\min\{H_{t}(w),H_{t}(\theta_{t})\}$, and it is straightforward that $\overline{H}_{t}(w)=\int_0^w\overline{h}_{t}(v)dv$.
        Then from Eq.~(\ref{eq:4-44}) and by the differential property of convolution, we have
        \begin{align}
            H_{t+1}(w)=&\int_0^w\overline{H}_{t}(w-v)\overline{g}_{t}(v)dv+H_{t}(w)-\overline{H}_{t}(w).
        \end{align}
        Now, we prove Eq. (\ref{eq:n-40}) by induction.
        Consider the first $t'$ such that $\theta_{t'}>0$. Since we have proved that Eq. (\ref{eq:n-40}) holds when $\theta_{t-1}=0$, our base case is that Eq.~(\ref{eq:n-40}) holds for all $t \leq t'$. Next, we assume that Eq.~(\ref{eq:n-40}) holds for $H_{t}$ at every $t\in[\tau]$, we prove that it also holds for $t=\tau+1$. 

        When $w\leq\theta_{\tau}$, since $\overline{g}_{\tau}(w-v)=0$ when $v\leq w-1$, and since $H_{\tau}(v)=\overline{H}_{\tau}(v)$ when $v\leq w$, we have
        \begin{align}
            H_{\tau+1}(w)=\int_{w-1}^wH_{\tau}(v)\overline{g}_{\tau}(w-v)dv
        \end{align}
        and
        \begin{align}
            H_{\tau+1}(w-1)=&\int_{w-2}^{w-1}H_{\tau}(v)\overline{g}_{\tau}(w-1-v)dv\\
            =&\int_{w-1}^{w}H_{\tau}(v-1)\overline{g}_{\tau}(w-v)dv\\
            \leq&\gamma^* H_{\tau+1}(w),
        \end{align}
        where the last inequality comes from the induction hypothesis.

        When $w\in(\theta_{\tau},\overline{\Theta}_{\tau})$, by Lemma~\ref{lm:1.5} and Lemma~\ref{lm:1-2} we have $\overline{\Theta}_{\tau}-1\leq\theta_{\tau}$. As a result,
        \begin{align}
            H_{\tau+1}(w)=&\int_{w-1}^{w}\overline{H}_{\tau}(v)\overline{g}_{\tau}(w-v)dv+H_{\tau}(w)-\overline{H}_{\tau}(w)\\
            =&\int_{w-1}^{\theta_{\tau}}H_{\tau}(v)\overline{g}_{\tau}(w-v)dv+\int_{\theta_{\tau}}^wH_{\tau}(\theta_{\tau})\overline{g}_{\tau}(w-v)dv\\
            &+H_{\tau}(w)\int_{w-1}^w\overline{g}_{\tau}(w-x)dx-\int_{w-1}^{w}H_{\tau}(\theta_{\tau})\overline{g}_{\tau}(w-v)dv\\
            =&\int_{w-1}^{\theta_{\tau}}H_{\tau}(v)\overline{g}_{\tau}(w-v)dv+H_{\tau}(w)\int_{w-1}^w\overline{g}_{\tau}(w-x)dx-\int_{w-1}^{\theta_{\tau}}H_{\tau}(\theta_{\tau})\overline{g}_{\tau}(w-v)dv\\
            \geq&\int_{w-1}^{w}H_{\tau}(v)\overline{g}_{\tau}(w-v)dv+\int_{w-1}^{\theta_{\tau}}\left(H_{\tau}(w)-H_{\tau}(\theta_{\tau})\right)\cdot \overline{g}_{\tau}(w-v)dv\\
            \geq&\int_{w-1}^{w}H_{\tau}(v)\overline{g}_{\tau}(w-v)dv
        \end{align}
        and
        \begin{align}
            H_{\tau+1}(w-1)=&\int_{w-2}^{w-1}H_{\tau}(v)\overline{g}_{\tau}(w-1-v)dv\nonumber\\
            =&\int_{w-1}^{w}H_{\tau}(v-1)\overline{g}_{\tau}(w-v)dv\\
            \leq&\gamma^*\int_{w-1}^{w}H_{\tau}(v)\overline{g}_{\tau}(w-v)dv\\
            \leq&\gamma^* H_{\tau+1}(w).
        \end{align}

        When $w\in[\Theta_{\tau},\Theta_{\tau+1})$, we have $w-1\leq\theta_{\tau}$. Therefore,
        \begin{align}
            H_{\tau+1}(w)=&\int_{w-1}^w\overline{H}_{\tau}(v)\overline{g}_{\tau}(w-v)dv+H_{\tau}(w)-\overline{H}_{\tau}(w)\\
            =&\int_{w-1}^{\theta_{\tau}}H_{\tau}(v)\overline{g}_{\tau}(w-v)dv+\int_{\theta_{\tau}}^wH_{\tau}(\theta_{\tau})\overline{g}_{\tau}(w-v)dv+H_{\tau}(w)\\&-\int_{w-1}^w\overline{H}_{\tau}(\theta_{\tau})\overline{g}_{\tau}(w-v)dv\\
            \geq&\int_{w-1}^wH_{\tau}(v)\overline{g}_{\tau}(w-v)dv\\
            =&\int_{w-1}^{\Theta_{\tau}}H_{\tau}(v)\overline{g}_{\tau}(w-v)dv+\int_{\Theta_{\tau}}^wH_{\tau}(v)\overline{g}_{\tau}(w-v)dv\\
            =&\int_{w-1}^{\Theta_{\tau}}H_{\tau}(v)\overline{g}_{\tau}(w-v)dv+\int_{\Theta_{\tau}}^w\overline{g}_{\tau}(w-v)dv.
        \end{align}
        Meanwhile, by the induction hypothesis,
        \begin{align}
            H_{\tau+1}(w-1)=&\int_{w-2}^{w-1}\overline{H}_{\tau}(v)\overline{g}_{\tau}(w-1-v)dv\\
            \leq&\int_{w-1}^{\Theta_{\tau}}\overline{H}_{\tau}(v-1)\overline{g}_{\tau}(w-v)dv+\int_{\Theta_{\tau}}^{w}\overline{H}_{\tau}(v-1)\overline{g}_{\tau}(w-v)dv.
            \end{align}
        Since $\Theta_{\tau}-1\leq\theta_{\tau-1}\leq\theta_{\tau}$, and $\Theta_{\tau+1}-1\leq\theta_{\tau}$,
            \begin{align}
            H_{\tau+1}(w-1)\leq&\gamma^*\int_{w-1}^{\Theta_{\tau}}H_{\tau}(v)\overline{g}_{\tau}(w-v)dv+\gamma^*\int_{\Theta_{\tau}}^{w}\overline{g}_{\tau}(w-v)dv\\
            =&\gamma^* H_{\tau+1}(w).
        \end{align}
    And Lemma~\ref{lm:1-4} is proved.
    \end{proof}

    Now we start to prove Theorem~\ref{trm:1}, i.e., we prove that $K\geq(1- \sum_{l\in[L]}\gamma_{l}^*)^{-1}(1-\max_l\gamma^*_lL)^{-1}$ satisfies the resource sufficiency condition.

    To meet the resource sufficiency condition, we only need to make sure that $\theta_{t}+1\leq K$ for every $t$. At $t=1$, we have $\theta_{1}=0$ and $K\geq1$, so $\theta_{1}+1\leq K$ regardless of $\gamma_l^*$.
    For $t\in[2,T]$, by Lemma~\ref{lm:1-2} we have $H_{t+1}(\theta_{t}+1)=1$. Then we can express $\theta_{t}+1$ by
    \begin{align}
        \theta_{t}+1=&\int_0^{\theta_{t}+1} H_{t+1}(\theta_{t}+1)dw\\
        =&\int_0^{\theta_{t}+1} H_{t+1}(\theta_{t}+1)-H_{t+1}(w)+H_{t+1}(w)dw\\
        =&\int_0^{\theta_{t}+1}H_{t+1}(w)dw+\int_0^{\theta_{t}+1} H_{t+1}(\theta_{t}+1)-H_{t+1}(w)dw.
    \end{align}
    We define $d_{t}=\int_0^{\theta_{t}+1}H_{t+1}(w)dw$ and $d'_{t}=\int_0^{\theta_{t}+1}H_{t+1}(\theta_{t}+1)-H_{t+1}(w)dw$, then we have 
    \begin{align}
        \theta_{t}+1=d_{t}+d'_{t}.\label{eq:0-69}
    \end{align}
    Now we first seek an upper bound on $d_{t}$. By Lemma~\ref{lm:1.5} and Lemma~\ref{lm:1-3}, we have
    \begin{align}
        d_{t}=&\int_0^{\theta_{t}+1}H_{t+1}(w)dw\\
        =&\int_0^{\theta_{t}}H_{t+1}(w)dw+\int_{\theta_{t}}^{\theta_{t+1}}H_{t+1}(w)dw\label{eq:0-70}+\int_{\theta_{t+1}}^{\theta_{t}+1}H_{t+1}(w)dw\\
        \leq&\int_0^{\theta_{t}}H_{t+1}(w)dw+\gamma^*(\theta_{t+1}-\theta_{t})+(\theta_{t}+1-\theta_{t+1})\\
        =&\int_0^{\theta_{t}}H_{t+1}(w)dw+\gamma^*(\theta_{t+1}-\theta_{t})-(\theta_{t+1}-\theta_{t})+1\\
        \leq&\int_0^{\theta_{t}}H_{t+1}(w)dw+1.
    \end{align}
    Then, by Lemma~\ref{lm:1-4} and the fact that $H_{t}(w)$ is continuous and non-decreasing on $w\geq0$, we have
    \begin{align}
        d_{t}\leq&\int_0^{\theta_{t}}H_{t+1}(w)dw+1\\
        =&\sum_{k=0,1\ldots\lfloor\theta_{t}\rfloor}\int_{\theta_{t}-k-1}^{\theta_{t}-k}H_{t+1}(w)dw+1\\
        \leq&\sum_{k=0,1\ldots\lfloor\theta_{t}\rfloor}H_{t+1}(\theta_{t}-k)+1\\
        \leq&\sum_{k=0,1\ldots\lfloor\theta_{t}\rfloor}{(\gamma^*)}^k\cdot\gamma^*+1\\
        =&\frac{\gamma^*(1-{(\gamma^*)}^{\lfloor\theta_{t}\rfloor})}{1-\gamma^*}+1\\
        \leq&\frac{\gamma^*}{1-\gamma^*}+1\\
        =&\frac{1}{1-\gamma^*}.\label{eq:4-103}
    \end{align}

    Meanwhile, for $d'_{t}$, we have
    \begin{align}
        d'_{t}=&\int_0^{\theta_{t}+1}H_{t+1}(\theta_{t}+1)-H_{t+1}(w)dw\\
        =&\int_0^{\theta_{t}+1}\int_w^{\theta_{t}+1}h_{t+1}(x)dxdw\\
        =&\int_0^{\theta_{t}+1}\int_0^vh_{t+1}(v)dwdv\\
        =&\int_0^{\theta_{t}+1}vh_{t+1}(v)dv.
    \end{align}
    When $\theta_t=0$, we can bound $d'_t$ by
    \begin{align}
        d'_t=&\int_0^{\theta_t+1}vh_{t+1}(v)dv\\
        =&\int_0^{1}vh_{t+1}(v)dv\\
        =&\int_0^{1}v\left[(1-\frac{\gamma^*}{\phi_t})h_t(v)+\frac{\gamma^*}{\phi_t}\left(\int_0^v\overline{h}_t(w)\overline{g}_t(v-w)dw+h_t(v)-\overline{h}_t(v)\right)\right]dv\\
        \leq&\int_0^{1}v\left[(1-\frac{\gamma^*}{\phi_t})h_t(v)+\frac{\gamma^*}{\phi_t}\left(\int_0^v\overline{h}_t(w)\overline{g}_t(v-w)dw+h_t(v)\right)\right]dv\\
        =&\int_0^{1}v\left[\frac{\gamma^*}{\phi_t}\left(\int_0^v\overline{h}_t(w)\overline{g}_t(v-w)dw\right)+h_t(v)\right]dv\\
        =&\frac{\gamma^*}{\phi_t}\int_0^{1}v\int_0^v\overline{h}_t(w)\overline{g}_t(v-w)dwdv+\int_0^{1}vh_t(v)dv.
    \end{align}
    Since $\theta_t\leq\theta_{t+1}$ and $\phi_t=\int_{-\infty}^0h_t(w)dw=\int_{-\infty}^0\overline{h}_t(w)dw$, we have $\overline{h}_t(w)=\phi_t\delta(w)$ and we obtain the following recursive form to bound $d'_t$:
    \begin{align}
        d'_t=&\frac{\gamma^*}{\phi_t}\int_0^{1}v\int_0^v\overline{h}_t(w)\overline{g}_t(v-w)dwdv+d'_{t-1}\\
        =&\frac{\gamma^*}{\phi_t}\int_0^{1}v\phi_t\overline{g}_t(v)dv+d'_{t-1}\\
        =&\gamma^*\int_0^{1}v\frac{\sum_{l}\gamma_l^*g_{t,l}(v)}{\gamma^*}dv+d'_{t-1}\\
        \leq&\sum_l(\gamma_l^*\mathbb{E}[r_{t,l}])+d'_{t-1}.\label{eq:5-94}
    \end{align}
    
    When $\theta_t>0$, noting that $\int_0^1vh_1(w)dw=0$, we have
    \begin{align}
        d'_{t}=&\int_0^{\theta_{t}+1}vh_{t+1}(v)dv\label{eq:0-86}\\
        =&\left(\int_0^{\theta_{t}}+\int_{\theta_{t}}^{\theta_{t}+1}\right)vh_{t+1}(v)dv\\
        =&\int_0^{\theta_{t}}v\left[\int_0^vh_{t}(w)\overline{g}_{t}(v-w)dw\right]dv+\int_{\theta_{t}}^{\theta_{t}+1}v\Bigg[\int_0^{\theta_{t}}h_{t}(w)\overline{g}_{t}(v-w)dw+h_{t}(v)\Bigg]dv\\
        =&\int_0^{\theta_{t}}\int_w^{\theta_{t}}vh_{t}(w)\overline{g}_{t}(v-w)dvdw+\int_0^{\theta_{t}}\int_{\theta_{t}}^{\theta_{t}+1}vh_{t}(w)\overline{g}_{t}(v-w)dvdw+\int_{\theta_{t}}^{\theta_{t}+1}vh_{t}(v)dv.
    \end{align}
    By setting $l=v-w$, we can rewrite the above as
    \begin{align}
        d'_{t}=&\int_0^{\theta_{t}}\int_0^{\theta_{t}+1-w}(l+w)h_{t}(w)\overline{g}_{t}(l)dldw+\int_{\theta_{t}}^{\theta_{t}+1}vh_{t}(v)dv.
    \end{align}
    Note that for $w\in[0,\theta_{t}]$, we have $\theta_{t}+1-w\geq1$.
    Furthermore, $\overline{g}_{t}(l)=0$ when $l\geq1$. Therefore, we have
    \begin{align}
        d'_{t}=&\int_0^{\theta_{t}}\int_0^{1}(l+w)h_{t}(w)\overline{g}_{t}(l)dldw+\int_{\theta_{t}}^{\theta_{t}+1}vh_{t}(v)dv\\
        =&\int_0^{\theta_{t}}\int_0^{1}lh_{t}(w)\overline{g}_{t}(l)dldw+\int_0^{\theta_{t}}\int_0^{1}wh_{t}(w)\overline{g}_{t}(l)dldw+\int_{\theta_{t}}^{\theta_{t}+1}vh_{t}(v)dv.
    \end{align}
    By Lemmas~\ref{lm:1.5}--\ref{lm:1-3}, $h_{t}(v)=0$ when $v\geq\theta_{t-1}+1$. Besides, since $\int_0^1\overline{g}_{t}(l)dl=1$, we have:
    \begin{align}
        d'_{t}=&\int_0^{\theta_{t}}h_{t}(w)\frac{\sum_l\gamma_l^*\mathbb{E}[r_{t,l}]}{\gamma^*}dw+\int_0^{\theta_{t}+1}vh_{t}(v)dv\\
        =&\sum_l\gamma_l^*\mathbb{E}[r_{t,l}]+d'_{t-1}.\label{eq:5-103}
    \end{align}
    By Eqs~(\ref{eq:5-94}) and~(\ref{eq:5-103}), we have $d'_t\leq\sum_l\gamma_l^*\sum_{t'\in[T]}\mathbb{E}[r_{t',l}]\leq\max_{l}\gamma^*_lKL$. By Eq.~(\ref{eq:4-103}), we finally have
    \begin{align}
        \theta_t+1=d'_t+d_t\leq\frac{1}{1-\gamma^*}+\max_{l}\gamma^*_lKL.
    \end{align}
    
    In optimization problem $\mathtt{P}_1$, constraint~(\ref{eq:9}) is equivalent to $K\geq\frac{1}{1-\sum_l\gamma_l}+\max_{l}\gamma_lKL$, which leads to $K\geq\theta_t+1$. As a result, the $\gamma_l^*$ solved from $\mathtt{P}_1$ satisfies $K\geq\theta_t+1$ when $\Theta_t\leq\theta_t$, which meets the resource sufficiency condition. Thus, Theorem~\ref{trm:1} is proved.
\end{proof}



\subsection{Theorem~\ref{trm:2}}\label{sec:trm2}
(Worker Assignment Probability Lower Bound) For all $l$, the probability of processing each task $t$ by worker $l$ is no less than $\gamma_l^*$. 
    \begin{proof}
        We use $h'_{t}(w)$ to denote the PDF of $\Theta_{t}$ and use $H'_{t}(w)$ to denote its CDF. We prove Theorem~\ref{trm:2} by proving that $h'_{t}(w)\geq h_{t}(w)$ by induction.

        It is straightforward that $h'_{1}(w)=h_{1}(w)$, so $h'_{1}(w)\geq h_{1}(w)$ and $H'_{t}(w)\geq H_{t}(w)$ is valid for $t=1$. We assume that $h'_{t}(w)\geq h_{t}(w)$ is valid for every $t\in[1,\tau]$, and we show that it is also valid for $t=\tau+1$. 
        
        If $\theta_\tau=0$, we have
        \begin{align}
            h'_{\tau+1}(w)=&(1-\sum_{l\in[L]}\gamma_l^*/\phi_\tau)h'_{\tau}(w)+(\sum_{l\in[L]}\gamma_l^*/\phi_\tau)\left[\int_0^w\overline{h}'_\tau (v)\overline{g}_\tau(w-v)dv+h'_\tau(w) - \overline{h}'_\tau(w)\right]\label{eq:5-107}\\
            \geq&h_{\tau+1}(w),
        \end{align}
        where$$\overline{h}'_{\tau}(w)=\begin{cases}
        h'_{\tau}(w),\ w\leq\theta_{\tau}\\
        0,\ w>\theta_{\tau}.
    \end{cases}$$
    If $\theta_\tau>0$, we have 
    \begin{align}
        h'_{\tau+1}(w)=&\int_0^w\overline{h}'_{\tau}(v)\overline{g}_{\tau}(w-v)dv+h'_{\tau}(w)-\overline{h}'_{\tau}(w)\label{eq:0-120}\\
        \geq&h_{\tau+1}(w).
    \end{align}
    We note that the evolution of $h'_{\tau}$ in Eqs.~(\ref{eq:5-107}) and~(\ref{eq:0-120}) is not simply duplicated from the update rule of $h_{\tau}$, but derived from the operation of OWA. The term $\sum_l\gamma_l^*/\phi_{\tau}$ in Eq.~(\ref{eq:5-107}) is the probability that we accept a task when $\theta_\tau=0$ and $\Theta_\tau\leq\theta_\tau$, and the convolution represents the sum of two random variables. 
    
    Now that we have proved that $h'_{t}(w)\geq h_{t}(w)$, we finally prove Theorem~\ref{trm:2}. When $\theta_t=0$, since $H_t(0)=\phi_t$, the probability of processing task $t$ by worker $l$ is $\frac{\gamma_l^*}{\phi_t}H'_t(0)\geq\frac{\gamma_l^*}{\phi_t}H_t(0)=\gamma_l^*$. When $\theta_t>0$, the probability of processing task $t$ with worker $l$ is $\frac{\gamma_l^*}{\gamma}H'_t(\theta_t)\geq \frac{\gamma_l^*}{\gamma}H_t(\theta_t)\geq\gamma_l^*$. Thus, Theorem~\ref{trm:2} is proved.
    \end{proof}

\subsection{Theorem~\ref{trm:3}}\label{sec:trm:3}
(Competitive Ratio) 
    The competitive ratio achieved by the OWA algorithm is at least
    \begin{align}
        \alpha=\mathtt{P}_1(\{\gamma_l^*\}).
    \end{align}
\begin{proof}
    By Theorem~\ref{trm:2}, the expected total reward of OWA is $\mathbb{E}[\text{ALG}]=\sum_t\sum_l\gamma_l^*u_{t,l}$. The total reward of the offline optimal algorithm is at most $\sum_t\sum_lx_{t,l}^*u_{t,l}$, where $x_{t,l}^*$ is the decision of the offline optimal solution. Therefore, the competitive ratio of OWA is
    \begin{align}
        \frac{\mathbb{E}[\text{ALG}]}{\max \text{OPT}}\geq&\frac{\sum_t\sum_l\gamma_l^*u_{t,l}}{\sum_t\sum_lx_{t,l}^*u_{t,l}}\\
        \geq&\min_t\frac{\sum_l\gamma_l^*u_{t,l}}{\sum_lx_{t,l}^*u_{t,l}}\\
        \geq&\min_t\min_l\frac{\sum_{l'}\gamma_{l'}^*u_{t,l'}}{u_{t,l}}\\
        =&\min_t\min_l\frac{\sum_{l'\in[L]\setminus\{l\}}\gamma_{l'}^*u_{t,l'}}{u_{t,l}}+\gamma_l^*\\
        \geq&\min_t\min_l\frac{\sum_{l'\in[L]\setminus\{l\}}\gamma_{l'}^*\underline{u}_{l'}}{\overline{u}_l}+\gamma_l^*\\
        =&\min_l\frac{\sum_{l'\in[L]\setminus\{l\}}\gamma_{l'}^*\underline{u}_{l'}}{\overline{u}_l}+\gamma_l^*.
    \end{align}
\end{proof}

\subsection{Corollary~\ref{crly:1}}\label{sec:crly1}
 (Closed-Form Lower Bound on the Competitive Ratio) The competitive ratio of OWA is lower bounded by 
        $\alpha'=\max\{{1}/{L},c\}\cdot(1-K^{-\frac{1}{2}})$, where $c=\min_{l\in[L]}\underline{u}_l/\max_{l\in[L]}\overline{u}_l$ is a constant derived from the problem instance.
\begin{proof}
    We find a set of feasible solutions for problem $\mathtt{P}_1$, and show that they achieve a competitive ratio of $\alpha'$ on GMPMW. It is straightforward that the constant solution $\gamma_l=\gamma'=\frac{1-K^{-\frac{1}{2}}}{L}$ for all $l$ satisfies every constraint of $\mathtt{P}_1$. With this feasible solution, the competitive ratio satisfies
    \begin{align}
        \frac{\mathbb{E}[\text{ALG}]}{\max \text{OPT}}\geq&
        \min_l\frac{\sum_{l'\in[L]\setminus\{l\}}\gamma'\underline{u}_{l'}}{\overline{u}_l}+\gamma'\\\geq&\gamma'\\
        =&\frac{1-K^{-\frac{1}{2}}}{L}.\label{eq:bound:old}
    \end{align}
    In addition, denote $\underline{u}_{\min}=\min_{l\in[L]}\underline{u}_l$ and $\overline{u}_{\max}=\max_{l\in[L]}\overline{u}_l$, then the competitive ratio also satisfies
    \begin{align}
        \frac{\mathbb{E}[\text{ALG}]}{\max \text{OPT}}\geq&
        \min_l\frac{\sum_{l'\in[L]\setminus\{l\}}\gamma'\underline{u}_{l'}}{\overline{u}_l}+\gamma'\\\geq&\min_l\frac{\sum_{l'\in[L]\setminus\{l\}}\gamma'\underline{u}_{\min}}{\overline{u}_l}+\gamma'\\
        \geq&\min_l\frac{\sum_{l'\in[L]\setminus\{l\}}\gamma'\underline{u}_{\min}}{\overline{u}_{\max}}+\gamma'\\
        =&\gamma' c(L-1)+\gamma'\\
        \geq&\gamma' cL\\
        =&c\cdot(1-K^{-\frac{1}{2}}).\label{eq:bound:new}
    \end{align}
    By Eqs.~(\ref{eq:bound:old}) and~(\ref{eq:bound:new}), we have $\frac{\mathbb{E}[\text{ALG}]}{\max \text{OPT}}\geq(1-K^{-\frac{1}{2}})\cdot\max\{{1}/{L},c\}=\alpha'$.
    Thus, Corollary~\ref{crly:1} is proved.
\end{proof}

\subsection{Theorem~\ref{trm:5}}\label{sec:trm5}
    (Asymptotic Optimality of $\alpha'$) When the reward lower bound of each worker is $0$, $\alpha'$ is an asymptotically optimal competitive ratio for the OWA algorithm on GMPMW, meaning that $\alpha'$ approaches the maximum possible competitive ratio when budget $K$ approaches infinity.
\begin{proof}
 We only need to show that there exists an adversary for which no online algorithm can achieve a competitive ratio higher than $\alpha^*=\frac{1}{L}$ when $c=0$. 
    We focus on the task sequence where the lower and upper bounds of the reward for each $l$ are $\underline{u}_l=0$ and $\overline{u}_l=u$.
    First, we have that the sum of the average probabilities that an online algorithm $\text{ALG}$ processes a task by each worker $l$ is no more than $1$. If $\text{ALG}$ assigns tasks to some worker $l$ with an average probability greater than $1/L$, then there must exist some worker $l'$ for which the probability that $\text{ALG}$ assigns tasks to it is less than $1/L$. Then the adversary arranges the task sequence as follows: the reward for processing each task by worker $l'$ is set to $u$, and the reward for processing each task by other workers $l\neq l'$ is set to $0$. Then the offline optimal reward is exactly $Tu$, and the expected total reward of $\text{ALG}$ is less than $Tu/L$.

    Next, we consider the case where the average probabilities of $\text{ALG}$ processing a task by each worker are all $1/L$. First, if the probability that each worker $l$ processes each task $t$ is $\frac{1}{L}$ (i.e., Pr$\{x_{t,l}=1\}=\frac{1}{L}$), then the performance ratio of $\text{ALG}$ is exactly $\frac{1}{L}$. Next, for an arbitrary worker $l'$, if for any $t'$, Pr$\{x_{t',l'}=1\}<\frac{1}{L}$, the adversary can arrange the reward by setting $u_{t',l'}=u$ and $u_{t,l}=0$ for every other $t\neq t'$ and $l\neq l'$, so that the competitive ratio achieved by $\text{ALG}$ is exactly Pr$\{x_{t',l'}=1\}<\frac{1}{L}$. On the other hand, if for some $t'$, $\text{ALG}$ has $\{x_{t',l'}=1\}>\frac{1}{L}$, there must exist some other $t''$ where $\{x_{t'',l'}=1\}<\frac{1}{L}$, since the average probabilities of $\text{ALG}$ processing a task by this worker is $1/L$. In this case, the adversary arranges the reward by setting $u_{t'',l'}=u$ and $u_{t,l}=0$ for every other $t\neq t''$ or $l\neq l'$, so that the performance ratio achieved by $\text{ALG}$ is Pr$\{x_{t'',l'}=1\}<\frac{1}{L}$.

    Now we have proved that $\alpha^*=\frac{1}{L}$ is the optimal competitive ratio that any online algorithm $\text{ALG}$ can achieve on GMPMW.
    When $c=0$, since $\lim_{K\rightarrow\infty}\alpha'=\frac{1}{L}$, $\alpha'$ is an asymptotically optimal competitive ratio.
\end{proof}


\section{Numerical Results on Competitive Ratio $\alpha$}\label{sec:crly1:num}

 \begin{figure}
    \centering
    \begin{subfigure}{0.48\linewidth}
        \centering
        \includegraphics[width=\linewidth]{Figures/numerical0_3.pdf}
        \caption{$c=0.25$.}
        \label{mfig:exp:num:a}
    \end{subfigure}\hspace{-2.1mm} 
    \begin{subfigure}{0.48\linewidth}
        \centering
        \includegraphics[width=\linewidth]{Figures/numerical0_1.pdf}
        \caption{$c=0.1$.}
        \label{mfig:exp:num:b}
    \end{subfigure}
    \caption{Numerical result on $\alpha$.}
    \label{mfig:exp:num}
\end{figure}

In this section, we present numerical results on the competitive ratio $\alpha$ in Figure~\ref{mfig:exp:num} and compare them with the lower bound $\alpha'$. Specifically, Figure~\ref{mfig:exp:num} shows the numerical results of our competitive ratio $\mathtt{P}_1(\{\gamma_l^*\})$ (brown lines) alongside two components of the lower bound: the first part, $\frac{1}{L}(1 - K^{-\frac{1}{2}})$ (red lines, labeled as "Lower Bound 1"), and the second part, $c(1 - K^{-\frac{1}{2}})$ (green lines, labeled as "Lower Bound 2"), evaluated under varying values of $c$ and different numbers of workers $L$.


In Figure~\ref{mfig:exp:num}, the reward upper bound $\overline{u}_l$ for each worker is set to $1$. In Figure~\ref{mfig:exp:num:a}, the reward lower bound $\underline{u}_l$ for each worker is $0.25$, so the constant $c$ equals $0.25$. In Figure~\ref{mfig:exp:num:b}, the reward lower bound $\underline{u}_l$ for each worker is $0.1$, so there is $c = 0.1$. As shown in Figure~\ref{mfig:exp:num}, when $L$ is small, the numerical competitive ratio $\alpha$ is well bounded by and stays close to $\frac{1}{L}(1 - K^{-\frac{1}{2}})$ (red line), which corresponds to the first part of the lower bound $\alpha'$. As $L$ increases, the numerical competitive ratio $\alpha$ approaches but remains above $c(1 - K^{-\frac{1}{2}})$ (green line), representing the second part of the lower bound $\alpha'$. Consequently, Figure~\ref{mfig:exp:num} illustrates that the competitive ratio $\alpha$ of the OWA algorithm consistently exceeds its lower bound $\alpha'$, while $\alpha'$ closely approximates $\alpha$ by capturing the dominant factors that influence its value for both small and large numbers of workers.

\section{Experimental Evaluation of the Competitive Ratio}\label{sec:A.D.1}

\begin{figure}[ht]
    \centering
    \begin{subfigure}{0.49\linewidth}
        \centering
        \includegraphics[width=\textwidth]{Figures/Set1-1.pdf}
        \caption{Impact of $K$.}
        \label{fig:exp1a}
    \end{subfigure}\hspace{-2.5mm}%
    \begin{subfigure}{0.49\linewidth}
        \centering
        \includegraphics[width=\textwidth]{Figures/Set1-2.pdf}
        \caption{Impact of $\frac{1}{L}\sum_l\sum_t\mathbb{E}\left[r_{t,l}\right]/K$.}
        \label{fig:exp1b}
    \end{subfigure}
    
    \begin{subfigure}{0.49\linewidth}
        \centering
        \includegraphics[width=\textwidth]{Figures/Set1-3.pdf}
        \caption{Impact of $L$.}
        \label{fig:exp1c}
    \end{subfigure}\hspace{-2.5mm}%
    \begin{subfigure}{0.49\linewidth}
        \centering
        \includegraphics[width=\textwidth]{Figures/Set1-4.pdf}
        \caption{Impact of $T$.}
        \label{fig:exp1d}
    \end{subfigure}

    \caption{Impact of various parameters on the performance of the OWA algorithm.}
    \label{fig:exp1}
\end{figure}



In Figure \ref{fig:exp1} we show the ratio between the performance of the OWA algorithm, i.e., $\mathbb{E}[\text{ALG}]$, and the optimal offline result $\max \text{OPT}$. Recall that $\max \text{OPT}$ is calculated as $\max \text{OPT}=\sum_t\max_lu_{t,l}$. In each simulation round, we generate one task sequence, and can directly obtain $\max \text{OPT}$. In each realization of the task sequence, $\overline{u}_l$ is independently set uniformly randomly in the interval from $0$ to $100$ for each $l\in[L]$ and $\underline{u}_l$ is set to $0$. 
We generate $10$ realizations of the task sequence to estimate $\mathbb{E}[\text{ALG}]$ of the OWA algorithm.  
We plot the ratio $\frac{\mathbb{E}[\text{ALG}]}{\max [\text{OPT}]}$ as one red point in Figure \ref{fig:exp1}. We plot $15$ points for each bar. 

The expectation of the distribution $\mathcal{R}_{t,l}$ are set to $\frac{1}{L}\sum_l\sum_t\mathbb{E}[r_{t,l}]=K$ for the base case, and $\mathcal{R}_{t,l}$ are generated as follows.
For the task sequence of each simulation round, we randomly generate a demand factor $a_{l}$ from $(0,1]$ for each worker, then set the expected overall consumption of each worker to $K_l=\frac{a_lKL}{\sum_la_l}$.
The granularity of each PDF $g_{t,l}$ is set to $0.1$. We generate $\mathbb{E}[r_{t,l}]$, for each $t$ and $l$, uniformly on $(0,1)$. Then we normalize them so that $\sum_t\mathbb{E}[r_{t,l}]= K_l$. Then, if $\mathbb{E}[r_{t,l}]$ is greater than $0.5$, we set $\text{Pr}\{r_{t,l}=1\}=(\mathbb{E}[r_{t,l}]-0.5)/0.5$ and $\text{Pr}\{r_{t,l}=0.5\}=1-\text{Pr}\{r_{t,l}=1\}$; if $\mathbb{E}[r_{t,l}]\in[0.1, 0.5)$, we set $\text{Pr}\{r_{t,l}=0.5\}=(\mathbb{E}[r_{t,l}]-0.1)/0.4$ and $\text{Pr}\{r_{t,l}=0.1\}=1-\text{Pr}\{r_{t,l}=0.5\}$; and if $\mathbb{E}[r_{t,l}]<0.1$, we set $\text{Pr}\{r_{t,l}=0\}=1$. This approach guarantees that the resource consumption follows our assumptions that $\frac{1}{L}\sum_l\sum_t\mathbb{E}[r_{t,l}]\leq K$ and $r_{t,l}\leq1$. 

In Figure~\ref{fig:exp1a}, we investigate the competitive ratio of the OWA algorithm under different resource budgets $K$. We let the resource budget $K$ increase from $300$ to $600$ while setting $T=1000$ and $L=2$. 
We observe that the theoretical competitive ratio and the actual performance increase as $K$ increases.

{ In Figure~\ref{fig:exp1b}, we investigate the competitive ratio of the OWA algorithm under different $\frac{1}{L}\sum_l\sum_t\mathbb{E}[r_{t,l}]/K$, which represents the ratio between the expected resource consumption and the resource budget. } We set $K=400$, $T=1000$, and $L=2$. 
The ratio $\frac{1}{L}\sum_l\sum_t\mathbb{E}[r_{t,l}]/K$ is set to $0.8$, $0.85$, $0.9$, and $0.95$, with the randomly generated total consumption $K_l$ of each worker scaled accordingly.
{ In GMPMW, the ratio $\frac{1}{L}\sum_l\sum_t\mathbb{E}[r_{t,l}]/K$ can be interpreted as the scarcity of the resource budget, and is no larger than $1$ due to the assumption that $\frac{1}{L}\sum_l\sum_t\mathbb{E}[r_{t,l}]\leq K$.} 
{
In this case, a larger ratio of 
$\frac{1}{L}\sum_l\sum_t\mathbb{E}[r_{t,l}]/K$ indicates that, on average, more resource is required to process all tasks.
We observe that the theoretical competitive ratio and the actual performance of OWA are not affected by this ratio, demonstrating that the OWA algorithm is insensitive to fluctuations in resource demand, which is consistent with our theoretical result.}

In Figure~\ref{fig:exp1c}, we investigate the competitive ratio of the OWA algorithm with different numbers of workers $L$. We increase $L$ from $1$ to $4$, while fixing T=1000 and K=600. We observe that the theoretical competitive ratio and the actual performance of OWA decrease as $L$ increases. 

In Figure~\ref{fig:exp1d}, we investigate the competitive ratio of the OWA algorithm with different $T$ values. In this set of experiments, we fix $K=600$ and $L=2$. We increase $T$ from $500$ to $1000$. We observe that the theoretical competitive ratio and the actual performance of OWA are insensitive to the length of the task sequence $T$, which is consistent with the theoretical result. 

In all cases of the above experiments, we further notice that the lowest red dots are usually close to the gray bars while remaining above them. This is consistent with the proven tightness of our theoretical bound. 


\section{Performance of the OWA Algorithm in Case Study}\label{sec:A.D.2}

Besides deriving performance bounds for the OWA algorithm in terms of its competitive ratio, we also study its real-world performance against benchmarks. 
In this section, we evaluate the performance of OWA through a case study, with trace-driven experiments on real-time video analytics with multiple deployed machine learning models.

\subsection{Model Selection for Real-Time Video Analytics}

 The rapid development of machine learning and edge computing has made it possible to deploy real-time video analytics on edge devices. Real-time video analysis requires sophisticated machine learning models, but the edge devices, such as tablets and laptops, are equipped with limited batteries.
{ In many situations, the edge devices are not connected to a persistent power supply, so it is important to efficiently manage the workload on the edge devices. }
 
{ Here we consider a general scenario where an edge computing device, equipped with multiple machine learning models, is used for real-time video analytics, processing a sequence of video chunks in practical applications such as traffic monitoring in smart cities and hazard prevention. Different machine learning models (workers) generate different accuracy values (reward) and consume different amounts of energy (resource).} We need to decide whether to process or discard a video chunk and, if so, which machine learning model to use, in order to maximize the overall accuracy (equivalently, the average accuracy) within the energy constraint.

This application scenario of real-time video analysis with multiple models deployed on the edge device is consistent with the formulation of GMPMW. The video chunks are the incoming tasks, and the multiple machine learning models to process each video chunk are the multiple workers in GMPMW. The probability distribution of the energy consumption of each model $\mathcal{R}_{t,l}$ can be estimated by model profiling and video pre-processing~\citep{hung2018videoedge}, and the upper bound $\overline{u}_{l}$ and lower bound $\underline{u}_l$ can also be obtained by profiling~\citep{zhang2017live}. { The edge device does not know the accuracy and energy consumption of processing each video chunk before that chunk arrives, and only after processing a chunk using a model can it know the corresponding accuracy and energy consumption. The energy budget of the edge device is the limited resource budget.
}

\paragraph{Video Traces}
For the video traces, we use a Xiaomi 12 Pro Android smartphone equipped with a Sony IMX766 photosensor to capture the video content as well as the network traces. The smartphone is mounted on a moving vehicle and positioned to capture a comprehensive view of the traffic on the road. We collect $4$ sets of video traces, labeled as Trace $1$, Trace $2$, Trace $3$, and Trace $4$. The length of Trace $1$ is $1200$ seconds, the length of Trace $2$ is $1800$ seconds, the length of Trace $3$ is $2400$ seconds, and the length of Trace $4$ is $3000$ seconds. 
The video frames are grouped into video chunks, with each video chunk containing the video frames of $3$ seconds. The video chunks are then sent to the edge device for analysis, so each video chunk is a task. 

\paragraph{Model Profiling (Energy Consumption)}
As illustrated in Figure~\ref{fig:expreal}, we deploy $3$ machine learning models on a laptop computer powered by an Intel Core i5-11320H CPU with integrated graphics, to analyze the video chunks. The machine learning models deployed are Faster R-CNN~\citep{ren2015faster}, YOLOv5~\citep{yolov5} with a medium backbone, and YOLOv5 with a large backbone. To obtain the maximum and minimum accuracy and energy consumption of each model, we deploy them on the same laptop as above. 

We profile the energy consumption distribution for the models (edge devices) on a $300$-second video. The video is captured by the same Xiaomi 12 Pro smartphone and streamed to the laptops via the HTTP Live Streaming protocol using the FFmpeg software, simulated using the network traces. 
The resolution of the video varies among \{360p, 540p, 720p\} as a result of the bitrate adaptation under different network conditions. To evaluate power consumption, we use the Python implementation of Intel's Running Average Power Limit (pyRAPL)~\citep{pyrapl}. The pyRAPL library connects Intel's hardware-level power counters, facilitating the measurement of power consumed by CPU cores and DRAM. This integration enables accurate, real-time monitoring of energy consumption throughout our experiments. By regularly sampling energy data, pyRAPL provides valuable insights into the energy efficiency of various computational tasks, allowing us to establish correlations between specific software actions and corresponding energy consumption.

\paragraph{Model Profiling (Accuracy)}\label{sec:MP}

We use the accuracy of processing each video chunk by each model as the reward. To effectively benchmark and compare the performance of different object detection models, it is critical to define a consistent metric for accuracy. Each inference generated by an object detection model yields a set of predicted bounding boxes. In parallel, we construct a set of ground truth objects, each represented by its own bounding box. These ground truth bounding boxes are derived from a highly reliable model, the Faster R-CNN~\citep{ren2015faster}, which uses the Resnet 50~\citep{he2016deep} backbone.

The accuracy of our model is determined by comparing these two sets of bounding boxes, as illustrated in Figure~\ref{fig:expreal}. This evaluation is quantified by the Intersection over Union (IoU) metric. For each object, IoU represents the ratio of the intersection area to the union area. Specifically, the intersection area is defined as the overlap between the predicted bounding box and the ground truth bounding box, while the union area encompasses both bounding boxes in their entirety. Thus, we have 
\begin{equation}
    \text{IoU} = \frac{\text{Area of Intersection}}{\text{Area of Union}}
\end{equation}
for each object.
This metric is a standard and widely accepted method in video analytics~\citep{lin2014microsoft, yolopaper, ren2015faster}, as it provides a clear measure of the accuracy of the bounding boxes proposed by the model.

Let $\text{IoU}_i$ represent the IoU of the $i$-th bounding box. The total number of detected objects is denoted by $\text{Det}$, while $\text{GT}$ (Ground-Truth) represents the number of ground-truth objects. The accuracy of the model is then quantified as the ratio of the sum of all IoUs to the total number of ground-truth objects. This can be expressed as
\begin{equation}
\text{Accuracy} = \frac{\sum_{i=1}^{\text{Det}} \text{IoU}_i}{\text{GT}}.
\end{equation}

The upper and lower bounds of the accuracy of each model are profiled in the same environment as the energy consumption distributions for each model. The accuracy and energy measurements are executed once per second and averaged over each 3-second time slot.
Note that even if a task is discarded, a small amount of accuracy can still be achieved. This is due to the temporal similarity between consecutive video chunks. By utilizing the inference results from the previous chunk, we can still gain some accuracy. For example, if we choose to discard chunk $t+1$, reapplying the results from chunk $t$ can still contribute some accuracy. However, we do not allow the continuous reuse of these results. Should chunk $t+2$ also be discarded, the resulting accuracy would be set to zero.

\paragraph{Trace Parameter}

The results of our model profiling are as follows. The minimum accuracy of each model is $0$. The maximum accuracy of Faster R-CNN is $0.9581$, the maximum accuracy of YOLOv5 with a medium backbone is $0.9716$, and the maximum accuracy of YOLOv5 with a large backbone is $0.9773$. The average energy consumption to process one video chunk for Faster R-CNN, YOLOv5 with medium backbone, and YOLOv5 with large backbone are $6.4$ J, $11.0$ J, and $18.9$ J, respectively.
{ Accordingly, the average energy consumption of these models to process videos of $1200$ s, $1800$ s, $2400$ s, and $3000$ s is estimated as $4$ kJ, $6$ kJ, $8$ kJ, and $10$ kJ, respectively.
}

\begin{figure*}[]
    \centering
    \includegraphics[width=0.6\linewidth]{Figures/202401Fig.drawio.pdf}
\caption{(Reproduced from Figure 1) Illustration of video analytics and IoU calculation. Green boxes are ground-truth results, and red boxes are profiling results.}
    \label{fig:expreal}
\end{figure*}

\begin{figure}[t]
    \centering
    \begin{subfigure}{0.40\linewidth}
        \centering
        \includegraphics[width=\linewidth]{Figures/Set2-1.pdf}
        \caption{Trace $1$ ($1200$s).}
        \label{fig:exp2a}
    \end{subfigure}\hspace{-3.1mm} 
    \begin{subfigure}{0.40\linewidth}
        \centering
        \includegraphics[width=\linewidth]{Figures/Set2-2.pdf}
        \caption{Trace $2$ ($1800$s).}
        \label{fig:exp2b}
    \end{subfigure}
    
    \begin{subfigure}{0.40\linewidth}
        \centering
        \includegraphics[width=\linewidth]{Figures/Set2-3.pdf}
        \caption{Trace $3$ ($2400$s).}
        \label{fig:exp2c}
    \end{subfigure}\hspace{-3.1mm} 
    \begin{subfigure}{0.40\linewidth}
        \centering
        \includegraphics[width=\linewidth]{Figures/Set2-4.pdf}
        \caption{Trace $4$ ($3000$s).}
        \label{fig:exp2d}
    \end{subfigure}
    \caption{(Reproduced from Figure 2) Comparing the OWA algorithm against benchmarks on different traces.}
    \label{fig:exp2}
\end{figure} 

\subsection{Benchmarks}
We consider a wide range of benchmarks to compare with the OWA algorithm in the trace-driven experiments.
\begin{enumerate}
    \item  Random (R): The system decides to process each video chunk using each model $l$ with a probability of $1/(L+1)$, and to discard it also with a probability of $1/(L+1)$.
    \item Adaptive (Ada): If the ratio between the total number of tasks processed and the number of tasks that have arrived is less than $1$ (since the resource budget is on average enough to process every task), the system randomly chooses a model $l$ with a probability of $1/L$ to process the incoming task.
    \item Greedy Online Knapsack (GOK): For each incoming task, the system calculates the average reward of each model as $(\underline{u}_l+\overline{u}_l)/2$, and calculates the average consumption of each model as $\mathbb{E}[{r_{t,l}}]$. The system then processes the incoming task that has the highest efficiency, which is calculated as the average reward divided by the average energy consumption.
    \item Exploration and Exploitation (EAE)~\citep{audibert2009exploration}: The system repeatedly performs exploration and exploitation as follows:
    The system starts from the exploration at $t=1$. In the exploration stage, the system uses each model $l$ to process $5$ tasks and discards $5$ tasks, and memorizes each reward and resource consumption. Each time a task is processed by a model or discarded, the average reward and the average resource consumption of that model (or the discarding of a task) are updated. 
    The average reward (resp. average resource consumption) of a model is calculated as the cumulative reward (resp. total resource consumption) of that model divided by the number of tasks processed by that model. 
    The average reward of discarding a task is calculated as the cumulative reward of discarding a task divided by the number of tasks discarded. The average resource consumption of discarding a task is always $0$.
    In total, the system processes $5(L+1)$ tasks in each exploration stage. After each exploration stage, the system enters the exploitation stage, which also lasts for $5(L+1)$ tasks. In the exploitation stage, for each incoming task, the system selects the model (or discards a task) with the highest efficiency, which is calculated by dividing the average reward by the average resource consumption. The system also updates the average reward and the average resource consumption of each model (or discarding a task) in the exploitation stage.
    \item Upper Confidence Bound Bandit (UCB)~\citep{garivier2011upper}: For the first $L$ chunks, the system processes the $l$-th chunk using model $l$. Then the system discards the ($L+1$)-st chunk. The system records and updates $Q_{t,l}$ as the average reward per task of model $l$, and uses $Q_{t,L+1}$ to record and update the average reward of discarding a task. The system records and updates $N_{t,l}$ as the number of tasks processed by model $l$, and uses $N_{t,L+1}$ to record and update the number of tasks discarded.
    Each time a new task $t$ arrives, the system processes it with the model with the highest upper confidence bound, or discards it if the upper confidence bound for discarding a task is the highest. The upper confidence bound $\text{UCB}_l$ is calculated as $\text{UCB}_l=Q_{t,l}+1.75\left({\ln(t)}/{N_{t,l}}\right)^{1/2}$.
    \item Multi-Worker One-Way Trading (MOT): The MOT algorithm is a multi-worker variant of the algorithm designed for the One-Way Trading Problem (OTP)~\citep{cao2020optimal}. The system estimates the length of the task sequence as $T'$ and operates under two situations: The first situation is $K-\Theta_{t}<T'-t$. In this case, when task $t$ arrives, the system calculates the following threshold for each model $l$ as $\int_{\Theta_{t}/K}^{\Theta_{t}/K+r^{avg}_l/K}\phi(x)dx$, where $\phi(x)=\frac{\overline{u}_{l}K}{2}+(\rho-\frac{\overline{u}_{l}K}{2})e^{\frac{x\rho\overline{u}_{l}K}{2}}$, $r^{avg}_{l}$ is the average resource consumption of model $l$, $\rho=\frac{\overline{u}_{l}K}{2}(W(\frac{1}{e})+1)$, and $W$ is the Lambert-W function. 
    The system compares each $\overline{u}_l$ with this threshold, and chooses the worker with the largest $\overline{u}_l$ that exceeds its threshold to process task $t$. The second situation is $K-\Theta_{t}\geq T'-t$. In this case, the system will process the incoming task with the model that has the highest $\overline{u}_l$.
    \item Model Predictive Control (MPC)~\citep{morari1999model}: The system predicts the reward and resource consumption of processing task $t$ by each model using the history data of tasks $t-30$ to $t-1$. For each model $l$, if the system has processed at least one of the last $30$ tasks with it, the efficiency of model $l$ for task $t$ is predicted as $(\sum_{\tau\in[t-10,t-1]}x_{\tau,l}u_{\tau,l})/\sum_{\tau\in[t-10,t-1]}x_{\tau,l}r_{\tau,l}$. Otherwise, the efficiency of model $l$ for task $t$ is predicted as $\frac{1}{2}(\underline{u}_l+\overline{u}_l)/\mathbb{E}[\mathcal{R}_{t,l}]$. The system will then process task $t$ using the processing level with the highest predicted efficiency. If the current task $t<30$ or the system has not processed any of the past $30$ tasks, it randomly selects a model to process the incoming task.
    \item Single-Worker OWA (S-OWA): The system implements a naive single-worker version of the OWA algorithm, focusing on the model with the largest $\overline{u}_l$. We denote this model by $l^*$. The system initializes $h_1(w)=\delta(w)$, updates $h_{t+1}(w)$ by $h_{t+1}(w)=(1-\gamma'/\phi_t)h_{t}(w)+(\gamma'/\phi_t)[\overline{h}_{t}(w)*g_{t,l^*}(w)+h_{t}(w)-\overline{h}_{t}(w)]$ if $\theta_t=0$, and update by $h_{t+1}(w)=\overline{h}_{t}(w)*g_{t,l^*}(w)+h_{t}(w)-\overline{h}_{t}(w)$ otherwise, where the target $\theta_{t+1}$ is updated by $\theta_{t+1}=\arg\min_{w}\{\int_{-\infty}^wh_{t+1}(v)dv\geq\gamma'\}$ and $\gamma'$ is set to $\gamma'=1-K^{-1/2}$.
    The system processes the task using this model if the resource consumption level $\Theta_t$ falls below the target $\theta_t$, and discards it otherwise.
    \item Average OWA (A-OWA): This is another naive variant of the OWA algorithm. The system keeps a different resource utilization function $h_{t,l}(w)$ and baseline $\theta_{t,l}$ for each model $l$. A-OWA initializes $h_{t,l}$ as $\delta(\cdot)$ and updates it by $h_{t+1,l}(w)=(1-\sum_{l'}\gamma_{l'}^*/\phi_{t,l})h_{t,l}(w)+(\sum_{l'}\gamma_{l'}^*/\phi_{t,l})[\overline{h}_{t,l}(w)*g_{t,l}(w)+h_{t,l}(w)-\overline{h}_{t,l}(w)]$ if $\theta_{t,l}=0$, and $h_{t+1,l}(w)=\overline{h}_{t,l}(w)*g_{t,l}(w)+h_{t,l}(w)-\overline{h}_{t,l}(w)$ otherwise, where $\overline{h}_{t,l}(w)=h_{t,l}(w)$ if $w\leq\theta_{t,l}$ and $\overline{h}_{t,l}(w)=0$ otherwise. Furthermore, $\theta_{t,l}$ is initialized to $0$ and updated as $\theta_{t,l}=\arg\min_w\{\int_{-\infty}^wh_{t,l}(v)dv\geq\sum_{l'}\gamma_{l'}^*\}$, and $\phi_{t,l}$ is initialized to $1$ and updated by $\phi_{t,l}=\int_{-\infty}^0$ $h_{t,l}(w)dw$. When each task arrives, the decision maker chooses model $l$ with probability $\gamma_l^*/\sum_{l'}\gamma_{l'}^*$. If the remaining resource budget of the decision maker falls below $\theta_{t,l}$, model $l$ will process that task. Otherwise, the incoming task will be discarded.
\end{enumerate}
{The accuracy of the R, Ada, MPC, S-OWA, and A-OWA algorithms is averaged over 10 runs, as they are randomized, while a single run is performed for the deterministic algorithms GOK, EAE, UCB, and MOT.} 



\subsection{Performance}

To compare the performance of the OWA algorithm against that of the benchmarks, we apply all algorithms to each video trace with different resource budgets $K$, as shown in Figure~\ref{fig:exp2}. 


In all settings, we observe that the OWA algorithm outperforms all benchmarks under all conditions on our video traces.
We also have some observations on the performance of each of the benchmarks. We will discuss them in three groups: \textcircled{1} Random, Adaptive, and GOK; \textcircled{2} EAE, UCB, MOT, and MPC; and \textcircled{3} S-OWA and A-OWA.

The Random algorithm performs worse than OWA because it does not consider the resource constraints. The adaptive algorithm considers the resource constraint, but simply controls the number of tasks (chunks) processed, rather than the resource consumption, so it performs worse than OWA. The GOK algorithm sticks to the worker (model) with the highest average efficiency, but the most efficient worker may not fully utilize all of the resource (energy), leading to inferior performance.

EAE and UCB perform worse than the OWA algorithm because they are not aware of the resource constraint. MOT performs worse than the OWA algorithm because, in our system, the reward (accuracy) and the resource consumption are not known when a video chunk arrives. However, these are important variables for the decision-making process in the MOT algorithm. When MOT can only use the profiled data to make decisions, its performance suffers. MPC performs worse than the OWA algorithm because the real-world street scenes captured in our video traces are highly fluctuating. As a result, the predictions made by MPC are not accurate.

Finally, we discuss S-OWA and A-OWA, which are different variants of OWA. S-OWA focuses only on the best possible worker (model) according to model profiling. It performs worse than OWA because it does not balance between the reward and resource consumption by utilizing all workers. 
On the other hand, A-OWA first chooses the worker (model) and then makes a decision based on that worker's baseline. This strategy of A-OWA leads to worse performance than OWA because each worker only updates its own baseline, but the different reward and resource consumption levels among different workers are coupled in GMPMW. In contrast, OWA updates the baselines in a joint manner and assigns each task to different workers based on the model profiling result, thus achieving superior performance. 


In conclusion, our experimental results demonstrate the excellent capability of the OWA algorithm to utilize the multiple workers in GMPMW in a variety of realistic system settings, and they show the importance of properly handling the multiple workers in the proposed approach.
