We introduce the algorithmic problem of finding a locally rainbow path of length $\ell$ connecting two distinguished vertices $s$ and $t$ in a vertex-colored directed graph. Herein, a path is locally rainbow if between any two visits of equally colored vertices, the path traverses consecutively at least $r$ differently colored vertices. This problem generalizes the well-known problem of finding a rainbow path. It finds natural applications whenever there are different types of resources that must be protected from overuse, such as crop sequence optimization or production process scheduling. We show that the problem is computationally intractable even if $r=2$ or if one looks for a locally rainbow among the shortest paths. On the positive side, if one looks for a path that takes only a short detour (i.e., it is slightly longer than the shortest path) and if $r$ is small, the problem can be solved efficiently. Indeed, the running time of the respective algorithm is near-optimal unless the ETH fails.
翻译:我们提出了在一个顶点着色有向图中寻找连接两个特定顶点 $s$ 和 $t$、长度为 $\ell$ 的局部彩虹路径的算法问题。此处,一条路径被称为局部彩虹路径,如果在其任意两次访问同色顶点之间,路径至少连续经过 $r$ 个不同颜色的顶点。该问题推广了经典的彩虹路径问题。它在需要保护多种不同类型资源免遭过度使用的场景中具有自然应用,例如作物轮作优化或生产流程调度。我们证明,即使当 $r=2$ 或仅在最短路径中寻找局部彩虹路径时,该问题在计算上也是难解的。从积极方面来看,如果寻找的路径仅需少量绕路(即比最短路径稍长),且 $r$ 值较小,则该问题可被高效求解。事实上,除非指数时间假设(ETH)失效,相应算法的运行时间近乎最优。