<p>I'm looking for a version of path planning that is able to find paths in a graph where edge costs depend on the state of the moving entity. In such cases, it is required to also consider trade-offs, i.e. accepting drawbacks on sub-paths if this leads to a better overall rating of the full path from A to Z.</p>

<p>I know a problem is that it is impossible to determine whether a path is the best one or if there are better ones without expanding every single possible path.
But maybe there are algorithms around that can handle such problems.
Ideally one can define a threshold in time or rate of cost improvement for a solution to control runtime and optimality as required. Maybe I need a metaheuristical approach?</p>

<p><strong>Background:</strong></p>

<p>As I started with a much simpler problem, that could be easily solved by A* I will outline my thoughts from there on.
A* is able to find the best path only if every sub-path is optimal itself. But in some circumstances, the best path may contain parts that are not optimal if examined stand-alone. This can be the case if edge costs are dependent on the state of a moving entity.
As a practical example I tried to simplify my application as good as possible. In reality it is much more complex in space and state.</p>

<p>A vehicle travels from A to Z, the cost function depends on the fuel burnt. At some node the following edge has additional costs depending on the weight (say a bridge). The higher the vehicle's mass, the higher the costs. A* will find the path with fewest fuel consumption from start to the node before the bridge.
But it may be better to use a path on which more fuel will be consumed to lower the vehicle's mass and thus the cost to travel over the bridge which will in turn reduce the overall costs.</p>

<p>This little graph visualizes such a problem.</p>

<pre><code>(A) -- 1 -- (B) -- 1 -- (C) -- 1 + c -- (Z)
  \                     /
   \-------- 1 --------/

c = 10 * m
m(t) = max(0, 10 - t)
</code></pre>

<p><code>m</code> represents the mass of the vehicle and <code>t</code> the time, which is 0 at the beginning and increases by 1 after each step.
As one can see, the best path from A to D must contain C. So while A* will find the path <code>A-C-Z</code> with costs of 92 (<code>A -- 1 --&gt; C -- 1 + 10*9 --&gt; Z</code>), a better one would be <code>A-B-C-Z</code> with costs of 83. If loops are allowed it even can be reduced to 20 (<code>A-B-C-B-A-B-C-A-B-C-Z</code>)</p>

CC BY-SA 3.0
2016-06-21T16:51:19.160Z
You will need to specify how the state of the vehicle can vary (what can it depend on? the path followed thus far? its cost? anything else? some random process?) and how exactly cost can depend on that state.
reinierpost
<graph-algorithms><shortest-path>
Path finding on graph with state dependent edge costs
Stanley F.
# Path finding on graph with state dependent edge costs

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

I'm looking for a version of path planning that is able to find paths in a graph where edge costs depend on the state of the moving entity. In such cases, it is required to also consider trade-offs, i.e. accepting drawbacks on sub-paths if this leads to a better overall rating of the full path from A to Z.
I know a problem is that it is impossible to determine whether a path is the best one or if there are better ones without expanding every single possible path.
But maybe there are algorithms around that can handle such problems.
Ideally one can define a threshold in time or rate of cost improvement for a solution to control runtime and optimality as required. Maybe I need a metaheuristical approach?
Background:
As I started with a much simpler problem, that could be easily solved by A* I will outline my thoughts from there on.
A* is able to find the best path only if every sub-path is optimal itself. But in some circumstances, the best path may contain parts that are not optimal if examined stand-alone. This can be the case if edge costs are dependent on the state of a moving entity.
As a practical example I tried to simplify my application as good as possible. In reality it is much more complex in space and state.
A vehicle travels from A to Z, the cost function depends on the fuel burnt. At some node the following edge has additional costs depending on the weight (say a bridge). The higher the vehicle's mass, the higher the costs. A* will find the path with fewest fuel consumption from start to the node before the bridge.
But it may be better to use a path on which more fuel will be consumed to lower the vehicle's mass and thus the cost to travel over the bridge which will in turn reduce the overall costs.
This little graph visualizes such a problem.
(A) -- 1 -- (B) -- 1 -- (C) -- 1 + c -- (Z)
  \                     /
   \-------- 1 --------/

c = 10 * m
m(t) = max(0, 10 - t)

m represents the mass of the vehicle and t the time, which is 0 at the beginning and increases by 1 after each step.
As one can see, the best path from A to D must contain C. So while A* will find the path A-C-Z with costs of 92 (A -- 1 --> C -- 1 + 10*9 --> Z), a better one would be A-B-C-Z with costs of 83. If loops are allowed it even can be reduced to 20 (A-B-C-B-A-B-C-A-B-C-Z)

**Tags:** graph-algorithms, shortest-path

> **Comments:**
> **username_1**: You will need to specify how the state of the vehicle can vary (what can it depend on? the path followed thus far? its cost? anything else? some random process?) and how exactly cost can depend on that state.  

---

## 0 answers

