![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
TSP
识堂干饭BOSS高
这个作者很懒,什么都没留下…
展开
-
python实现跳点搜索算法JPS
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys # sys.path.append("..") import json import math # 地图数据;0:能通过;1:障碍,不能通过 map_test = [[0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0], [0, 0, 0,原创 2021-03-22 21:47:15 · 1588 阅读 · 3 评论 -
强化学习Q-learning解决TSP
以下为原创代码,这段代码解决的是TSP问题,采用的思路是强化学习的Q-learning方法 // An highlighted block import numpy as np epsilon = 0.5 gamma = 0.98 lr = 0.1 distance =np.array([[0,7,6,1,3],[7,0,3,7,8],[6,3,0,12,11],[1,7,12,0,2],[3,8,11,2,0]]) R_table = 11-distance space = [0,1,2,3,4] Q_t原创 2021-03-22 21:17:31 · 2437 阅读 · 5 评论