mirror of
https://github.com/mfocko/blog.git
synced 2024-11-24 14:01:55 +01:00
algorithms(bf-to-astar): fix small typos
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
7f6671999d
commit
701e18ea36
1 changed files with 3 additions and 3 deletions
|
@ -93,7 +93,7 @@ auto bf(const graph& g, const vertex_t& source, const vertex_t& destination)
|
||||||
:::info Relaxation
|
:::info Relaxation
|
||||||
|
|
||||||
I have made a brief mention of the relaxation in the comment in the code. You've
|
I have made a brief mention of the relaxation in the comment in the code. You've
|
||||||
been probably thought that **relaxation of an edge** means that you found
|
been probably taught that **relaxation of an edge** means that you found
|
||||||
a better solution to the problem.
|
a better solution to the problem.
|
||||||
|
|
||||||
In general it is an approximation technique that _reduces_ the problem of
|
In general it is an approximation technique that _reduces_ the problem of
|
||||||
|
@ -129,9 +129,9 @@ Cost: 22
|
||||||
If you have a better look at the map, you will realize that the cost `22` is the
|
If you have a better look at the map, you will realize that the cost `22` is the
|
||||||
one path skipping the `*` cells, since they cost more than going around.
|
one path skipping the `*` cells, since they cost more than going around.
|
||||||
|
|
||||||
We can play around a bit with it. The `*` cells can be even vortices that pull
|
We can play around a bit with it. The `*` cells can even be vortices that pull
|
||||||
you in with a negative price and let you _propel_ yourself out :wink: Let's
|
you in with a negative price and let you _propel_ yourself out :wink: Let's
|
||||||
change their cost to `-1` then. Let's check what's the fastest path to the cell.
|
change their cost to `-1` then and see what's the fastest path to our goal.
|
||||||
|
|
||||||
```
|
```
|
||||||
Normal cost: 1
|
Normal cost: 1
|
||||||
|
|
Loading…
Reference in a new issue