当前位置:网站首页>【TSP问题】基于Hopfield神经网络求解旅行商问题附Matlab代码
【TSP问题】基于Hopfield神经网络求解旅行商问题附Matlab代码
2022-06-25 22:23:00 【Matlab科研工作室】
1 简介
本文给出了一种基于Hopfield神经网络模型求解TSP问题的算法.Hopfield网络是一种网状网络,网络中的每个神经元都可以和其他神经元双向连接.这种连接方式使得网络中每个神经元的输出都能反馈到同一层次的其他神经元,因此,它是一种反馈网络.根据网络节点的状态,Hopfield网络可分为离散的和连续的两种类型.离散的网络,其节点状态仅取 两个值;而连续的网络,其节点状态可以取区间 上任何值.Hopfield神经网络在联想记忆,组合优化和机器人控制等方面有重要的应用.其中Hopfield网络用于优化计算是最常见的.Hopfield网络的能量函数是一个多维神经元状态的标量函数,在网络收敛的稳定点上的能量函数最小.因此,设计网络权值W和输入,将优化问题中的目标函数,约束条件与能量函数联系起来,那么能量函数的极小点也是目标函数满足约束条件的极小点,所以Hopfield网络也可用于求解优化计算问题
2 部分代码
% 路径寻优作图function PlotR(V,citys)figure;citys_origin=citys;citys=[citys;citys(1,:)];[xxx,order]=max(V);New=citys(order,:);New=[New;New(1,:)];subplot(1,2,1)plot(citys(1,1),citys(1,2),'*') % first cityhold onplot(citys(2,1),citys(2,2),'+') % second cityhold onplot(citys(:,1),citys(:,2),'o-')for i=1:length(citys_origin)text(citys_origin(i,1),citys_origin(i,2),[' ' num2str(i)])endxlabel('X axis')ylabel('Y axis')title('Original Route')axis([0 1 0 1])grid onsubplot(1,2,2)plot(New(1,1),New(1,2),'*') % first cityhold onplot(New(2,1),New(2,2),'+') % second cityhold onplot(New(:,1),New(:,2),'o-')for i=1:length(citys_origin)text(citys_origin(i,1),citys_origin(i,2),[' ' num2str(i)])endxlabel('X axis')ylabel('Y axis')title('TSP solution')axis([0 1 0 1])axis ongrid on
3 仿真结果

4 参考文献
[1]于慧, 徐慧. 基于Hopfield神经网络模型求解TSP问题的算法[J]. 2008.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
边栏推荐
- Bit compressor [Blue Bridge Cup training]
- 【超能云终端创领先机】如何在48小时内交付一座方舱医院?
- 每日刷题记录 (四)
- tensorrt pb转uff问题
- Rocket之消息存储
- JS to input the start time and end time, output the number of seasons, and print the corresponding month and year
- 深圳台电:联合国的“沟通”之道
- Why do we need to make panels and edges in PCB production
- Redux workflow + complete code of small examples
- SQL按某字段去重 保留按某个字段排序最大值
猜你喜欢

迅为RK3568开发板使用RKNN-Toolkit-lite2运行测试程序

JS to input the start time and end time, output the number of seasons, and print the corresponding month and year

Explain in detail the three types of local variables, global variables and static variables
![[advanced ROS] Lecture 1 Introduction to common APIs](/img/25/85e8c55605f5cc999a8e85f0a05f93.jpg)
[advanced ROS] Lecture 1 Introduction to common APIs

7. common instructions (Part 2): common operations of v-on, v-bind and V-model

CaMKIIa和GCaMP6f是一样的嘛?

小红书微服务框架及治理等云原生业务架构演进案例

Run the test program using rknn-toolkit-lite2 for rk3568 development board

86. (cesium chapter) cesium overlay surface receiving shadow effect (gltf model)

Apache基金会正式宣布Apache InLong成为顶级项目
随机推荐
Ora-01153: incompatible media recovery activated
Redis之跳跃表
Explain in detail the three types of local variables, global variables and static variables
11.1.1、flink概述_flink概述
(Reprint) visual explanation of processes and threads
The problem of low video memory in yolov5 accelerated multi GPU training
Use Coe_ load_ sql_ profile. SQL fixed execution plan
SMT操作员是做什么的?工作职责?
删库跑路、“投毒”、改协议,开源有哪几大红线千万不能踩?
Mysql5.7.31自定义安装详细说明
Use js to obtain the last quarter based on the current quarter
ORA-01153 :激活了不兼容的介质恢复
oracle RAC 集群无法启动
把控元宇宙产业的发展脉络
【ROS进阶篇】第一讲 常用API介绍
Redis之常见问题
[advanced ROS] Lecture 1 Introduction to common APIs
Servlet response下载文件
ffmpeg 版本切换
Smt贴片加工出现元件立碑的解决方法