路径规划算法_路径规划金典算法汇总

本文介绍了路径规划中的三种经典算法:Dijkstra算法、A*算法和JPS(Jump Point Search)算法。Dijkstra算法找到的路径最优,但计算量大;A*算法在Dijkstra的基础上引入启发式搜索,提高效率,但仍有优化空间;JPS算法通过跳点搜索减少了无效节点的搜索,进一步提升了效率。
摘要由CSDN通过智能技术生成

Path Planning

第1节 基于图搜索的路径规划算法 

Dijkstra算法、A*算法、JPS(Jump Point Search)算法

1、 基本的图遍历算法---BFS and DFS 

18f0ac4647aae8bcd8c11d16d14c1533.png

1.DFS------remove or expand the deepest node in the container.(因为它维护的是一个堆栈,所以对于图中的节点来说是后进先出)

8254b29986ac250f69e93944223fd781.png

2.BFS------remove or expand the shallowest node in the container.(因为它维护的是一个队列,所以对于图中的节点来说是先进先出)

ab6902155026edcd67932e45be802102.png

https://cs.stanford.edu/people/abisee/tutorial/bfsdfs.html

通过上面我们可以发现广度优先搜索找到的路径一定是最优的,而对于深度优先搜索算法来说它所表现出来的并不符合我们对路径搜索的需求。它确实可以找到一条路径,但是这条路径不是最优的。

3.Heuristic search:A heuristic is a guess of how close you are to the target.

①启发式搜索是一个对目标点goal的一个正确引导。它可以帮助算法朝着目标点而去。

②启发式搜索应该是容易计算的。(欧式距离、曼哈顿距离等)

                  e06184d798a6fefaf2d4e811229ec9a0.png

那么带有启发式的搜索算法就一定能帮助我们更快的更优的路径吗?

https://cs.stanford.edu/people/abisee/tutorial/greedy.html

有障碍物时陷入局部最优!!!由这里我们可以看到,贪心算法可能不是我们想要的,但是它有许多我们借鉴的性质。后面在A*算法里面我们会说。

在前面我们提到的BFS和DFS虽然他们都能找到起始点到目标点的一条路径,但是前提图里面的每条边的weight是均匀的。但是对于广义的机器人路径搜索问题来说,它的每条边的weight是不一样的。所以我必须用别的方法来解决从起始点到目标点的代价最小的路径这个问题。

二、Dijkstra算法

Strategy:

*g(n):The current best estimates of the accumulated cost from the start to the node “n”.

*Update the accumulated costs g(m) for all unexpanded neighbors “m” of node “n”;

*A node that has been expanded/visited is guaranteed to have the smallest cost from the start state. 

fd5f8c0ab2d52e14a8d4525cc177cbba.png

Dijkstra算法的伪代码:

✱Maintain a priority queue to store all the nodes to be expended.

✱The priority queue is initialized with the start state Xs.

✱Assign g(Xs)=0,and g(n)=infinite for all other nodes in the graph.   

✱Loop

✱if the queue is empty,return false;break.

✱Remove the node “n”with the lowest g(n) from the priority queue.

✱Mark node “n”as expended.

✱If the node “n”is the goal state,return true;break.

✱For all unexpanded neighbors “m”of node “n”

✱if g(m)=infinite

✱g(m)=g(n)+Cnm

✱p

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值