Alterna · учебный материал

Dakestra and A* (shortest route)

Dakestra's algorithm, A* with euristics.

Что в этом материале

Содержание и основные понятия

Back to the table of contents
Alterna · Chapter 18 · page 18.3
Dakestra and A* (shortest route)
Dakestra's algorithm and A* with hisristics, strolling visualization.
Dakestra is the shortest route algorithm from one top to the rest of the world.
GEF
PIF
EGE No. 1
01
Dakestra algorithm
All vertebrates shall be assigned dist[v] = , except start: dist[start] = 0.
Place the chart in line with priority (on list).
Remove the vertex u with the minimum dist. Mark as processed.
For each neighbour v: if dist[u] + w(u,v) <dist[v], update dist [v] and prev[v][u].
Repeat 3-4 until the line is empty.
Complexity:
O((V+E)·log V) priority.
02
A* - Dakestra + Heuristics
A* uses evaluation
f(v) = g(v) + h(v)
where g(v) is the real cost of the route from start-up to v, h(v), is the heuristic value of distance from v to target.
Popular Heuristics:
Manhattan
is the sum of the coordinates (for grid).
Euclidova
- distance in a straight line.
Fuck you!
- max differences.
If h(v) is allowed (never overestimates), A* finds the best way.
03
Dakestra Visualizer
Run it, you'll see the algorithm goes through the graph.
📍
Dakester's a step-by-step.

Structural map of textbooks