A* search algorithm浅谈

A* search algorithm浅谈

最近跟着老师做了一个稍简单的关于AGV小车的项目,其中小车寻路部分用的是A*算法,用Matlab实现。整个流程下来,学到了挺多的东西,写这篇文章既是为了给广大朋友分享点学习心得,又是给自己一个交代,对前期的学习做一个阶段性的总结 ^_^

Contents:

- History

- Description

- Searching process

- Code in Matlab


History

From Wikipedia:
In 1968, AI researcher Nils Nilsson was trying to improve the path planning done by Shakey the Robot, a prototype robot that could navigate through a room containing obstacles. This path-finding algorithm, that Nilsson called A1, was a faster version of the then best known method, Dijkstra’s algorithm, for finding shortest paths in graphs. Bertram Raphael suggested some significant improvements upon this algorithm, calling the revised version A2. Then Peter E. Hart introduced an argument that established A2, with only minor changes, to be the best possible algorithm for finding shortest paths. Hart, Nilsson and Raphael then jointly developed a proof that the revised A2 algorithm was optimal for finding shortest paths under certain well-defined conditions.

  大概意思是在遥远的1968年,一位名为Nilsson的人工智能探索者尝试着改进基于[Shakey the Robot]的路径规划算法,其中Shakey the Robot是一种能在设有障碍的房间内寻迹的原型机器人。这个被Nilsson称为A1的算法比广为人知的Dijkstra算法在图路径规划中拥有更快的运行速度。之后,Bertram Raphael对A1算法做了一些重要的改进并更新为A2算法,而在这个算法被公开发表前Peter E.Hart又做了微小的改进终于使它成为了接近最优的寻路算法。这一说法后来被Nilsson和Raphael两位好基友证实——确实在特定的条件下,A2是最理想的寻路算法。

  确实。。。好基友是成双成对的,有一个理想的队友是一件多么令人幸福的事情啊 (☆_☆)


Description

原文(英)链接

首先请允许我隆重地介绍一个基本计算公式:

F=G+H

  • 其中G代表着从原格到目标格的行驶代价,H代表目标格到终点的代价,F代表总代价(务必分清楚是哪个格)

  • 从原格到目标格移动,每次只能移动一格,上、下、左、右、左上、左下、右上、右下(在最后给出的代码中可能是出于简化的目的,只考虑了上、下、左、右四种情况)

  • H(Heuristic,启发代价)的算法有很多种,本文主要介绍的是Manhattan法,据说曼哈顿的的街区都是横纵分布的,只有上下左右(不能斜着走),而本

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值