yisuzhou / tsp Goto Github PK
View Code? Open in Web Editor NEW遗传算法、禁忌搜索、模拟退火、蚁群算法
License: MIT License
遗传算法、禁忌搜索、模拟退火、蚁群算法
License: MIT License
请问数据的格式是怎样的呢?是城市坐标的对称矩阵吗?
I notice that you open data in you code, please show the data
具体算法是这段:
这里应该是从n个原始解集中随机(不同概率)选择k个不重复的copy,但是这里的写法会导致parent会被重复选取。还请修改!
def choose_fromlast(dis_adp,answer_source):
mid_adp=[]
mid_adp_each=0
for i in range(num_total):
mid_adp_each=dis_adp[i]+mid_adp_each
mid_adp.append(mid_adp_each)
# print(mid_adp)
#产生0-mid_adp[num_total-1]之间的随机数
#选择n-1<随机数<n的那个n的解,保留
copy_ans=[]
for p in range(copy_num):
rand=random.uniform(0,mid_adp[num_total-1])#产生随机数
# print(rand)
# print(p)
for j in range(num_total):
if (rand<mid_adp[j]):#查找位置
copy_ans.append(answer_source[j])
break
else:
continue
return copy_ans
源码里面没有city_location.txt文件,我把城市坐标copy到新建的city_location.txt,但运行后一直显示“哎呀没找到,我再找找~”
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.