![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
人工智能引论
zao_yu
这个作者很懒,什么都没留下…
展开
-
Python实现AO*算法进行与或图搜索
只适用与结构简单的图搜索以下图为例:其中n3、n5、n7为已解决节点h_list = [0, 3, 4, 5, 6, 3, 5, 9] # 初始化各节点h值class node: def __init__(self, in_num): self.num = in_num self.bro = None self.son = [] self.goodson = None self.father =..原创 2021-12-04 14:12:21 · 2096 阅读 · 0 评论 -
Python实现A*(Astar)算法寻找最短路径
使用for item in M:只可获取副本,无法改变M中值应使用for index, item in enumerate(M):改变item即可改变M中值import matha = 5 # 矩阵长度b = 5 # 矩阵宽度def init(listx): # a=int(input("x of target:")) # b=int(input("y of target:")) for i in range(0, a):原创 2021-11-29 14:48:19 · 3593 阅读 · 2 评论