Coder Social home page Coder Social logo

caroleliang / ga_tsp Goto Github PK

View Code? Open in Web Editor NEW
27.0 1.0 9.0 8 KB

TSP问题是指假设有一个旅行商人要拜访n个城市,他必须选择所要走的路径,路径的限制是每个城市只能拜访一次,而且最后要回到原来出发的城市。路径的选择目标是要求得的路径路程为所有路径之中的最小值。使用遗传算法解决att48问题,即48个城市的旅行商问题,该问题目前的最优解是10628,受个别参数影响,所设计的算法所得到的最优结果是10648,相对误差为0.18818216%。

MATLAB 100.00%

ga_tsp's Introduction

GA_tsp

TSP问题是指假设有一个旅行商人要拜访n个城市,他必须选择所要走的路径,路径的限制是每个城市只能拜访一次,而且最后要回到原来出发的城市。路径的选择目标是要求得的路径路程为所有路径之中的最小值。使用遗传算法解决att48问题,即48个城市的旅行商问题,该问题目前的最优解是10628,受个别参数影响,所设计的算法所得到的最优结果是10648,相对误差为0.18818216%。

att48.txt ----- 48个城市的坐标

CalDist.m ----- 计算个体的总路径

cro.m --------- 交叉函数

drawTSP.m ----- 根据坐标作图

GA.m ---------- 主函数

mut.m --------- 变异函数

objf.m -------- 适应度函数

pro.m --------- 判断是否需要变异、交叉

sel.m --------- 选择函数

tsp.m --------- 读取att48坐标,并计算每两个城市之间的距离

ga_tsp's People

Contributors

caroleliang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar Endeavor avatar feifeifeibudongle avatar  avatar Forseti avatar  avatar Hanyu Fu avatar Ecoli avatar  avatar LZY avatar  avatar Hao Xu avatar  avatar  avatar  avatar  avatar  avatar  avatar 文森 Wen Sen avatar  avatar  avatar 丁思哲 avatar 無理奈 avatar

Watchers

Forseti avatar

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.