A weighted directed graph $G=(V,A,c)$, where $A\subseteq V\times V$ and $c:A\to R$, describes a road network in which an electric car can roam. An arc $uv$ models a road segment connecting the two vertices $u$ and $v$. The cost $c(uv)$ of an arc $uv$ is the amount of energy the car needs to traverse the arc. This amount may be positive, zero or negative. To make the problem realistic, we assume there are no negative cycles. The car has a battery that can store up to $B$ units of energy. It can traverse an arc $uv\in A$ only if it is at $u$ and the charge $b$ in its battery satisfies $b\ge c(uv)$. If it traverses the arc, it reaches $v$ with a charge of $\min(b-c(uv),B)$. Arcs with positive costs deplete the battery, arcs with negative costs charge the battery, but not above its capacity of $B$. Given $s,t\in V$, can the car travel from $s$ to $t$, starting at $s$ with an initial charge $b$, where $0\le b\le B$? If so, what is the maximum charge with which the car can reach $t$? Equivalently, what is the smallest $\delta_{B,b}(s,t)$ such that the car can reach $t$ with a charge of $b-\delta_{B,b}(s,t)$, and which path should the car follow to achieve this? We refer to $\delta_{B,b}(s,t)$ as the energetic cost of traveling from $s$ to $t$. We let $\delta_{B,b}(s,t)=\infty$ if the car cannot travel from $s$ to $t$ starting with an initial charge of $b$. The problem of computing energetic costs is a strict generalization of the standard shortest paths problem. We show that the single-source minimum energetic paths problem can be solved using simple, but subtle, adaptations of the Bellman-Ford and Dijkstra algorithms. To make Dijkstra's algorithm work in the presence of negative arcs, but no negative cycles, we use a variant of the $A^*$ search heuristic. These results are explicit or implicit in some previous papers. We provide a simpler and unified description of these algorithms.
翻译:考虑一个加权有向图 $G=(V,A,c)$,其中 $A\subseteq V\times V$,$c:A\to R$,描述了一辆电动汽车可以行驶的道路网络。弧 $uv$ 表示连接两个顶点 $u$ 和 $v$ 的路段。弧 $uv$ 的成本 $c(uv)$ 是汽车穿过该弧所需的能量量。该值可以是正数、零或负数。为使问题更贴近现实,我们假设图中不存在负环。汽车的电池最多可存储 $B$ 单位能量。只有当汽车位于 $u$ 且电池电量 $b$ 满足 $b\ge c(uv)$ 时,它才能穿过弧 $uv\in A$。若穿过该弧,汽车将以电量为 $\min(b-c(uv),B)$ 的状态到达 $v$。正成本弧会消耗电池,负成本弧则会为电池充电,但充电量不能超过其容量 $B$。给定 $s,t\in V$,汽车能否从 $s$ 出发,以初始电量 $b$(其中 $0\le b\le B$)行驶到 $t$?若可以,汽车到达 $t$ 时的最大电量是多少?等价地,最小的 $\delta_{B,b}(s,t)$ 是多少,使得汽车能以 $b-\delta_{B,b}(s,t)$ 的电量到达 $t$,并且应选择哪条路径来实现这一目标?我们将 $\delta_{B,b}(s,t)$ 称为从 $s$ 到 $t$ 的能量成本。若汽车无法以初始电量 $b$ 从 $s$ 行驶到 $t$,则令 $\delta_{B,b}(s,t)=\infty$。计算能量成本的问题是最短路径问题的严格泛化。我们证明,单源最小能量路径问题可以通过对 Bellman-Ford 和 Dijkstra 算法进行简单但巧妙的改编来解决。为在存在负弧但无负环的情况下使 Dijkstra 算法生效,我们采用了 $A^*$ 搜索启发式算法的变体。这些结果在先前一些论文中已有显式或隐式体现。我们提供了这些算法的更简洁且统一的描述。