How is the Dijkstra algorithm better than the A * algorithm for finding the shortest path?

How is the Dijkstra algorithm better than the A * algorithm for finding the shortest path?

+3
source share
2 answers

It is not better to find the shortest path. As long as you have a valid heuristic for A *, it will find a shortcut faster than Dijkstra.

And as Mehrad noted in the comments, A * degrades in Dijktras if you give it a heuristic function that returns 0.

A Wikipedia article for A * contains tons of useful information about all of this.

+11
source

node Dijkstra , A *, Dijkstra , . Dijkstra A * - , , node. N A *, N node.

Dijkstra node . ( ), M, , A * - - , Dijkstra , M A *.

: Matthew :

  • Dijkstra , A *. : A *.
  • A *, , node ( node). , node , A * Dijkstra; - *. ( , "A *" ( "Dijkstra" ), ​​ , A *.)
  • , : Dijkstra . A * .
  • , : node, , node. , , node, A * ( ) .
+3

Source: https://habr.com/ru/post/1791789/


All Articles