Cheapest path algorithm

后端 未结 7 1762
刺人心
刺人心 2020-12-20 03:28

I\'ve learnt a dynamic programming algorithm to find the \"cheapest\" path from A to B. Each sub path has an associated cost.

Each corner is calculated using

7条回答
  •  北海茫月
    2020-12-20 04:04

    Try looking for "shortest path" algorithms, but there is a catch.

    Many shortest-path searches use estimated distance to goal as a heuristic, which often has to satisfy certain conditions. A*, for example, uses a distance-to-goal estimation function, and is guaranteed to find the shortest path if it never underestimates the distance to the goal. Since you're looking for the path with lowest arbitrary cost, you won't have that sort of heuristic easily available. Also, you know the length of the path, so algorithms like iterative deepening aren't going to be useful.

    Any deterministic algorithm, like Dijkstra's algorithm, should work fine.

提交回复
热议问题