We consider online algorithms for the $k$-server problem on trees. Chrobak and Larmore proposed a $k$-competitive algorithm for this problem that has the optimal competitive ratio. However, a naive implementation of their algorithm has $O(n)$ time complexity for processing each query, where $n$ is the number of nodes in the tree. We propose a new time-efficient implementation of this algorithm that has $O(n\log n)$ time complexity for preprocessing and $O\left(k^2 + k\cdot \log n\right)$ time for processing a query. We also propose a quantum algorithm for the case where the nodes of the tree are presented using string paths. In this case, no preprocessing is needed, and the time complexity for each query is $O(k^2\sqrt{n}\log n)$. When the number of queries is $o\left(\frac{\sqrt{n}}{k^2\log n}\right)$, we obtain a quantum speed-up on the total runtime compared to our classical algorithm. We also give a simple quantum algorithm to find the first marked element in a collection of $m$ objects, that works even in the presence of two-sided bounded errors on the input oracle. It has worst-case complexity $O(\sqrt{m})$. In the particular case of one-sided errors on the input, it has expected time complexity $O(\sqrt{x})$ where $x$ is the position of the first marked element. Compare with previous work, our algorithm can handle errors in the input oracle.
翻译:我们考虑在树上设置 $k$- server 问题的在线算法。 Chrobak 和 Larmore 提议在这个问题上设置 $k$- 竞争性的算法, 并且具有最佳的竞争比率。 但是, 天真地地实施他们的算法, 处理每个查询的时间复杂度为$( n) 美元, 其中美元是树上节点的数量。 我们提议在时间上高效地实施这个算法, 其预处理的时间复杂度为$( n) 美元, 左处理时间复杂度( k% 2 + k\ cdot\ right) 。 我们还提议在使用字符串路径显示树节点的案例中设置量算法 。 在此情况下, 不需要预处理, 每个查询的时间复杂度为$( k% 2) 。 当询问次数为$left (\ fraftc $( sqrick{ n\\\\\\\\\\\\\\\\\\\ rrrright) 用于处理查询。 我们第一次在运行期间找到一个数量加速的量速度, 与最坏的计算法中, 我们也使用一个简单的算法中的一种简单的输入。