Git Product home page Git Product logo

tsp_collection's People

Contributors

kellenf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tsp_collection's Issues

关于数组深拷贝

            best_path = tmp_path.copy(),这里应该这样写,不然返回的路径不是全局想对最优解,是最后一个epoch的

bug

No module named 'matplotlib'

模拟退火bug

随机找一个新解时,实际上不是交换两个元素的位置,切片没有考虑左值小于右值,有可能不进行操作,貌似也不影响

PSO

PSO.py Line 118是不是该返回one2, l2? 但是修改之后的最佳值反而更差?
# 粒子交叉
def cross(self, cur, best):
one = cur.copy()
l = [t for t in range(self.num_city)]
t = np.random.choice(l,2)
x = min(t)
y = max(t)
cross_part = best[x:y]
tmp = []
for t in one:
if t in cross_part:
continue
tmp.append(t)
# 两种交叉方法
one = tmp + cross_part
l1 = self.compute_pathlen(one, self.dis_mat)
one2 = cross_part + tmp
l2 = self.compute_pathlen(one2, self.dis_mat)
if l1<l2:
return one, l1
else:
(Line 118) return one, l2

蚁群算法bug

更新信息素代码部分,a->b的信息素和b->a的信息素都应该更新,代码中只更新了单向

FileNotFoundError

FileNotFoundError: [Errno 2] No such file or directory: 'data/bayg29.tsp'
能够提供一下bayg29.tsp这个文件嘛?

蚁群算法bug

蚁群算法的初始信息素设置有问题,虽然作者写了设置初始信息素的函数,但是代码中,并没有使用,并且设置初始信息素的函数也有bug。
当前情况是,初始信息素全为0,在使用轮盘赌函数的时候注定会出现bug,导致收敛速度变慢,甚至出错

禁忌搜索有误

移动加入禁忌表的时候应当反向后加入,直接禁忌移动的话就相当于减小了后续搜索的广度

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.