We consider online algorithms for the $k$-server problem on trees of size $n$. Chrobak and Larmore proposed a $k$-competitive algorithm for this problem that has the optimal competitive ratio. However, the existing implementations have $O\left(k^2 + k\cdot \log n\right)$ or $O\left(k(\log n)^2\right)$ time complexity for processing a query, where $n$ is the number of nodes. We propose a new time-efficient implementation of this algorithm that has $O(n)$ time complexity for preprocessing and $O\left(k\log k\right)$ time for processing a query. The new algorithm is faster than both existing algorithms and the time complexity for query processing does not depend on the tree size.
翻译:我们考虑大小为$n$的树上$k$-服务器问题的在线算法。Chrobak和Larmore针对该问题提出了一个具有最优竞争比的$k$-竞争算法。然而,现有实现中每次查询处理的时间复杂度为$O\left(k^2 + k\cdot \log n\right)$或$O\left(k(\log n)^2\right)$,其中$n$为节点数。我们提出了一种新的时间高效实现方案,其预处理时间复杂度为$O(n)$,每次查询处理的时间复杂度为$O\left(k\log k\right)$。该新算法比现有两种算法更快,且查询处理的时间复杂度与树的大小无关。