<p>I think I have found the answer in the paper and it is indeed not just a replacement of the potentials:</p>

<blockquote>
  <p>Now, if we want to replace p_f and p_r (forward and reverse potential) , all we need to do is change
  the keys of the labeled vertices for the two searches appropriately
  and update the priority queues containing these vertices. This takes
  time proportional to the number of labeled vertices at this point.</p>
</blockquote>

CC BY-SA 3.0
2016-08-06T16:46:47.310Z
2016-08-06T16:46:47.310Z
Karussell
<p>The A* algorithm is some kind of an enhanced Dijkstra. Keep in mind that I want an optimal algorithm here and A* is optimal if the heuristic does not overestimate the distance to the goal. </p>

<p>The bidirectional case of A* is not as simple as the bidirectional Dijkstra as the finish condition is a bit tricky, of course you can manage to <a href="https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/util/ConsistentWeightApproximator.java#L49" rel="nofollow">implement it</a> if you work with "consistent potential functions" (see paper reference below).</p>

<p>Now to my question: when implementing a special distance estimate for A* (landmarks/ALT) this works also in the bidirectional case. In some papers they say one can change the active set of landmarks <strong>while</strong> the search is going on. This makes sense as the estimates will get better and still only a subset is involved for the estimate.</p>

<p><strong>But will changing/improving the distance estimate while the search is going influence the optimality?</strong> </p>

<p>Unintuitive things can follow from this, e.g. a distance update to a node lowers the distance from source to this node but could increase the distance from this node to the goal due to the better distance estimate but I'm unsure if this violates the 'consistent potential' definition and could result in suboptimal paths. (E.g. in my latest trial to implement this I sometimes get suboptimal results but this could be also other bugs.)</p>

<p>The paper "<a href="http://www.siam.org/meetings/alenex05/papers/03agoldberg.pdf" rel="nofollow">Computing Point-to-Point Shortest Paths from External Memory</a>" says I can do so but I'm unsure if I misunderstood something: </p>

<blockquote>
  <p><strong>6.1 Restarting.</strong> As we shall see below, we sometimes need to change the way lower bounds are calculated <strong>in the middle</strong> of an ALT computation,
  e.g., by replacing the current potential functions p f and p r by
  another consistent pair.</p>
</blockquote>

<graph-theory><graph-algorithms>
Bidirectional A*: is an update of the distance estimation feasible while searching?
Karussell
# Bidirectional A*: is an update of the distance estimation feasible while searching?

(Asked by: username_0 on 2016-08-06)

The A\* algorithm is some kind of an enhanced Dijkstra. Keep in mind that I want an optimal algorithm here and A\* is optimal if the heuristic does not overestimate the distance to the goal.

The bidirectional case of A\* is not as simple as the bidirectional Dijkstra as the finish condition is a bit tricky, of course you can manage to [implement it](https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/util/ConsistentWeightApproximator.java#L49) if you work with "consistent potential functions" (see paper reference below).

Now to my question: when implementing a special distance estimate for A\* (landmarks/ALT) this works also in the bidirectional case. In some papers they say one can change the active set of landmarks **while** the search is going on. This makes sense as the estimates will get better and still only a subset is involved for the estimate.

**But will changing/improving the distance estimate while the search is going influence the optimality?**

Unintuitive things can follow from this, e.g. a distance update to a node lowers the distance from source to this node but could increase the distance from this node to the goal due to the better distance estimate but I'm unsure if this violates the 'consistent potential' definition and could result in suboptimal paths. (E.g. in my latest trial to implement this I sometimes get suboptimal results but this could be also other bugs.)

The paper "[Computing Point-to-Point Shortest Paths from External Memory](http://www.siam.org/meetings/alenex05/papers/03agoldberg.pdf)" says I can do so but I'm unsure if I misunderstood something:

> **6.1 Restarting.** As we shall see below, we sometimes need to change the way lower bounds are calculated **in the middle** of an ALT computation,
> e.g., by replacing the current potential functions p f and p r by
> another consistent pair.

**Tags:** graph-theory, graph-algorithms


---

## 1 answers

### Answer by username_0 on 2016-08-06. Score: 1

I think I have found the answer in the paper and it is indeed not just a replacement of the potentials:

> Now, if we want to replace p\_f and p\_r (forward and reverse potential) , all we need to do is change
> the keys of the labeled vertices for the two searches appropriately
> and update the priority queues containing these vertices. This takes
> time proportional to the number of labeled vertices at this point.


---

