AIT*杂谈

本文详细介绍了AIT*(Adaptively Informed Trees)算法,它是BIT*的改进版,通过修改ĥ(x)的定义以实现更快的性能。AIT*采用从终点到采样点的最短路径作为启发式,同时利用最短路径树减少碰撞检测,提高路径规划效率。文章还探讨了A*算法的启发式性质和BIT*的工作原理,并对比了AIT*与BIT*、RRT-Connect等算法的差异。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本文将介绍AIT*(Adaptively Informed Trees)算法[1](不是ABIT*[2],但是后面会提到这篇文章的内容)。

AIT*是对BIT*的改进,论文中给出的图可以看到,AIT*非常快,稳稳跑赢BIT*,而且在许多问题上比RRT-Connect还快。


AIT*性能


那么AIT*做了什么改进呢?——主要是修改了ĥ(x)的定义。

回顾一下BIT*中,存储各顶点的优先队列Qv,其键值定义为g(v)+ĥ(v),这里ĥ(v)是从v到终点的直线距离;


                                                                                                            BIT*中的h(v)
而在AIT*中,ĥ(v)被定义为从终点经过各采样点到v的最短路径距离,即论文中称的adaptive。


                                                                                                     

### 实现路径规划A*算法的源码 以下是基于Python编写的简单版本的A*算法实现,用于二维网格环境中的路径规划: ```python import heapq class Node: def __init__(self, position, g_cost=float('inf'), h_cost=0, parent=None): self.position = position # (row, column) self.g_cost = g_cost # Cost from start to this node self.h_cost = h_cost # Heuristic cost estimate to goal self.f_cost = g_cost + h_cost # Total cost self.parent = parent def __lt__(self, other): return self.f_cost < other.f_cost def heuristic(a, b): """Calculate the Manhattan distance between two points.""" return abs(a[0] - b[0]) + abs(a[1] - b[1]) def astar(start, end, grid): open_list = [] closed_set = set() start_node = Node(position=start, g_cost=0, h_cost=heuristic(start, end)) heapq.heappush(open_list, start_node) while open_list: current_node = heapq.heappop(open_list) if current_node.position == end: path = [] temp = current_node while temp is not None: path.append(temp.position) temp = temp.parent return path[::-1] closed_set.add(current_node.position) neighbors = get_neighbors(grid, current_node.position) for neighbor_pos in neighbors: if neighbor_pos in closed_set: continue tentative_g_score = current_node.g_cost + 1 # Assuming uniform movement costs neighbor_node = next((n for n in open_list if n.position == neighbor_pos), None) if not neighbor_node or tentative_g_score < neighbor_node.g_cost: neighbor_h_score = heuristic(neighbor_pos, end) new_node = Node( position=neighbor_pos, g_cost=tentative_g_score, h_cost=neighbor_h_score, parent=current_node ) if not any(n.position == neighbor_pos for n in open_list): heapq.heappush(open_list, new_node) def get_neighbors(grid, pos): directions = [(0, 1), (1, 0), (-1, 0), (0, -1)] # Right, Down, Up, Left result = [] for d_row, d_col in directions: row, col = pos[0] + d_row, pos[1] + d_col if 0 <= row < len(grid) and 0 <= col < len(grid[row]) and grid[row][col] != 'obstacle': result.append((row, col)) return result ``` 此代码定义了一个基本框架来执行A*搜索算法,在给定起点和终点的情况下找到最优路径[^2]。
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值