• No se han encontrado resultados

We start by defining the shortest path problem on a graph:

• A graph G is defined by a set of nodes (vertices) X = {x1, x2, . . . , xM+1 = t} and a

set of directed arcs between these nodes.

• Along each arc we prescribe a transition time penalty C(xi, xj) = Ci j > 0, and

assume Ci j = +∞ if there is no transition from xito xj.

• The sets of in-neighbors and out-neighbors of a node xj are respectively defined

by N−j = N−(xj) , n xi | Ci j < +∞o , N+j = N+(xj) , n xk | Cjk< +∞o .

• Assume the graph is sparsely connected, i.e. |N±(x

i)| ≤ κ  M ∀ xi ∈ X for some

fixed κ ∈ N.

• The goal is to find the “value function” U : X → [0,+∞), defined as Ui = U(xi) , the minimum total time to travel from xi to t= xM+1.

Naturally, UM+1 = 0. On the rest of the graph, Bellman’s Optimality Principle [6]

yields a coupled system of M nonlinear equations:

Ui = min xj∈Ni+

n

Uj + Ci jo , ∀ i= 1, 2, . . . , M. (2.2)

Once the value function is known, an optimal path from any node to the target xM+1

can be quickly recovered by recursively transitioning to the minimizing neighbor. A straight-forward iterative method for solving the system (2.2) would result in O(M2)

computational cost. Fortunately, this system is monotone causal: Ui cannot depend on

which recovers the value function on the entire graph in O(M log M) operations [22]. In Dijkstra’s method, all nodes are split into three classes: far (no value yet assigned),

considered(assigned a tentative value), oraccepted(assigned a permanent value).

Algorithm 1: Dijkstra’s Algorithm

Initialization:

1 Ui ←+∞ and mark xiasfarfor i = 1, 2, . . . , M 2 U(t) ← 0 and mark t asaccepted.

3 For all xi ∈ N−(t), mark asconsideredand Ui ← C(xi, t)

Algorithm :

4 while ∃ aconsiderednode do

5 Find theconsiderednode xjwith minimal U-value and mark asaccepted 6 for xi ∈ N−j such that Ui > Uj and xi isfarorconsidereddo

7 U ← U˜ j+ Ci j 8 if ˜U < Ui then

9 Ui ← ˜U

10 Mark xi asconsidered

Figure 2.1: Dijkstra’s algorithm.

Efficient implementations usually maintain the considerednodes as a binary heap,

resulting in the log M term in the computational complexity.

2.2.1

Estimates for “single-source

/ single-target" problems.

If we are only interested in an optimal path from a single starting location s ∈ X, Dijk- stra’s method can be terminated as soon s becomesaccepted. (This changes the stopping

criterion on line 4 of the pseudocode.) Other modifications of the algorithm can be in- troduced to further reduce the computational cost on this narrower problem. Consider a function

Any node xi lying on an optimal path from s to t must satisfy Ui+ Vi = U(s) = V(t).

This provides an obvious relevance criterion, since for any xi that is not on an optimal

path, Ui+Vi > U(s). But since V is generally unknown, all techniques for focusing com-

putations on a neighborhood of this optimal path must instead rely on some “heuristic underestimate”

ϕi = ϕ(xi) ≤ Vi. (2.3)

A stronger “consistency” requirement is often imposed instead:

ϕj ≤ Ci j+ ϕi; ∀ i, j. (2.4)

(Note that ϕ ≡ V is the maximum among all consistent heuristics that also satisfy ϕ(s)= 0.)

Such consistent underestimates are readily available for geometrically embedded graphs. Suppose X ⊂ Rn and di j =

xi−xj

2. If the “maximum speed" F2 > 0 is such that Ci j ≥ di j/F2 for all i and j, then ϕi = kxi−sk2/F2 ≤ Vi. On a Cartesian

grid-type graph, the Manhattan distance provides a better (tighter) underestimate ϕi =

kxi−sk1/F2. For more general embedded graphs, a much better underestimate ϕ can

be produced by “Landmark sampling” [28], but this requires additional precomputation and increases the memory footprint of the algorithm.

Some algorithms for this problem also rely on “heuristic overestimates"

ψi = ψ(xi) ≥ Vi.

An overestimate can be obtained as a total cost of any path from xi to s or can also be

found using landmark precomputations [28]. For structured geometrically embedded graphs, an analytic expression might also be available. E.g., on a Cartesian grid, if the “minimum speed" F1 > 0 is such that Ci j ≤ di j/F1, we can use ψi = kxi−sk1/F1.

2.2.2

A* Restriction Techniques

A* techniques restrict computations to potentially relevant nodes by limiting the number of nodes that becomeconsidered. A more accurate ϕ restricts a larger number of nodes

from becomingconsidered, and if ϕ = V then only those nodes actually on the s → t

optimal path are everaccepted.

Standard A* (SA*). This version of A* is the one most often described in the liter- ature [32]. Unlike in Dijkstra’s algorithm, theconsiderednodes are sorted andaccepted

based on (Ui + ϕi) values. This change affects line 6 in our pseudocode. The resulting

algorithm typicallyaccepts far fewer nodes before terminating: irrelevant nodes with

large ϕ values might still becomeconsidered(if their neighbors are accepted) but will

have lower priority and most of them will never becomeaccepted themselves. More-

over, the consistency of ϕ ensures thatacceptednodes receive exactly the same values

as would have been produced by the original Dijkstra’s method. If xi actually depends

on xj ∈ Ni+, then

Ui = Ci j + Uj =⇒ Ui ≥ ϕj−ϕi



+ Uj ⇐⇒ Ui + ϕi ≥ Uj + ϕj,

guaranteeing that under SA* xiwill not beacceptedbefore xj.

Alternative A* (AA*). A less common variant of A* is described in [8]. Instead of favoring nodes with small ϕ, AA* simply ignores nodes that are clearly irrelevant. AA* relies on an underestimate ϕ (no longer required to satisfy (2.4)) and an additional upper boundΨ ≥ U(s). (If an analytic or precomputed ψ is available, we can take Ψ = ψ(t). But it is also possible to use the total cost of any feasible path from s to t.)

During Dijkstra’s algorithm, a node xiwith Ui+ϕi > Ψ (hence Ui+Vi > Ψ) is surely

not a part of the optimal path. Thus, to speed up Dijkstra’s algorithm, in AA* we still

Ui + ϕi ≤ Ψ. Since the order of acceptance is the same, it is clear that AA* produces

the same values as Dijkstra’s, but the efficiency of this technique is clearly influenced by the quality ofΨ (the smaller it is, the smaller is the number ofconsiderednodes). This

reliance onΨ is a downside (since SA* only needs ϕ), but has the advantage of making AA* also applicable to the label-correcting methods [8]. In section §2.3 we argue that AA* is also more suitable for continuous optimal control problems, in which anΨ is often readily available.

AA* with Branch & Bound (B&B). In AA* Ψ remains static throughout the al- gorithm. The idea of Branch& Bound (B&B) is to dynamically decrease Ψ as we gain more information about the graph, making use of an overestimate function ψ. When

acceptinga node xi, we can also set

Ψ ← min {Ψ, Ui+ ψi}.

Exact estimates. Using “exact estimates" with A* would result in the maximal domain restriction. For both A* techniques, if ϕ ≡ V andΨ ≡ U(s), the algorithm would only

acceptthe nodes lying on an optimal path.