| 查看: 1627 | 回复: 24 | |||
| 本帖产生 2 个 数学EPI ,点击这里进行查看 | |||
oliverxzj木虫 (著名写手)
|
[交流]
【求助】帮忙用MATLAB做一个最优化的题目,能解的话请和我联系,犒劳30金币已有5人参与
|
||
|
空运路线规划 在东南亚有一个国家正在遭受广泛的洪灾。在国际援助下,该国政府决定建立一个空运补给系统。不幸的是,在这个国家只有七条还可以使用的跑道,其中一条在首都。 该国政府决定让飞机从首都起飞,然后访问所有其他六个机场,最后回到首都。下表列出了机场之间的距离。机场A1位于首都。应采取什么顺序一次到达各个机场才能使总行程最短? 表5.1 机场之间的距离(千米) A2 A3 A4 A5 A6 A7 A1 786 549 657 331 559 250 A2 668 979 593 224 905 A3 346 607 472 467 A4 890 769 499 A5 386 559 A6 681 对问题分析的提示:我们知道这类问题被称之为“旅行商问题”。也就是在几个城市中,找到最优的方案是旅行者能获得最大的效率。 要注意的是,对于大规模的TSP,其求解属于NP问题,有一定的困难性。但是该国只有七个能用的机场。于是可知这是一个规模较小的TSP问题,因而可以考虑用优化方法来求解。 [ Last edited by javeey on 2010-6-5 at 14:33 ] |
» 猜你喜欢
请问有评职称,把科研教学业绩算分排序的高校吗
已经有4人回复
孩子确诊有中度注意力缺陷
已经有12人回复
2025冷门绝学什么时候出结果
已经有3人回复
天津工业大学郑柳春团队欢迎化学化工、高分子化学或有机合成方向的博士生和硕士生加入
已经有4人回复
康复大学泰山学者周祺惠团队招收博士研究生
已经有6人回复
AI论文写作工具:是科研加速器还是学术作弊器?
已经有3人回复
2026博士申请-功能高分子,水凝胶方向
已经有6人回复
论文投稿,期刊推荐
已经有4人回复
硕士和导师闹得不愉快
已经有13人回复
请问2026国家基金面上项目会启动申2停1吗
已经有5人回复
» 本主题相关价值贴推荐,对您同样有帮助:
谁做过稀土8-羟基喹啉配合物,,有知道方法的吗
已经有10人回复
请帮忙翻译一段汉译英,谢谢
已经有1人回复
请帮忙翻译一段汉译英,谢谢
已经有1人回复
请问国内微纳机械方面哪个学校做的好?
已经有7人回复
公派+硕博连读or联系外面的老师+硕士答辩,帮我解疑下
已经有3人回复
求助啊......matlab
已经有10人回复
请大家帮忙看看投什么期刊好!
已经有14人回复
求高手用matlab做一个动画
已经有3人回复

oliverxzj
木虫 (著名写手)
- 应助: 1 (幼儿园)
- 金币: 3341.5
- 散金: 753
- 红花: 1
- 帖子: 1152
- 在线: 566.1小时
- 虫号: 336505
- 注册: 2007-04-01
- 性别: GG
- 专业: 药剂学

2楼2010-06-05 14:19:06
sxu2009
至尊木虫 (正式写手)
- 数学EPI: 1
- 应助: 27 (小学生)
- 金币: 10463.7
- 散金: 744
- 红花: 5
- 帖子: 983
- 在线: 537小时
- 虫号: 861529
- 注册: 2009-10-01
- 性别: GG
- 专业: 计算机科学的基础理论
3楼2010-06-05 15:53:49
oliverxzj
木虫 (著名写手)
- 应助: 1 (幼儿园)
- 金币: 3341.5
- 散金: 753
- 红花: 1
- 帖子: 1152
- 在线: 566.1小时
- 虫号: 336505
- 注册: 2007-04-01
- 性别: GG
- 专业: 药剂学

4楼2010-06-05 16:18:48
再见北极雪
木虫 (著名写手)
快乐家族之打酱油的小伙计
- 数学EPI: 1
- 应助: 0 (幼儿园)
- 金币: 3957.8
- 红花: 1
- 帖子: 1155
- 在线: 163小时
- 虫号: 917802
- 注册: 2009-12-01
- 专业: 地震学
5楼2010-06-05 17:44:21
zxczxc0417
木虫 (正式写手)
- 数学EPI: 2
- 应助: 2 (幼儿园)
- 金币: 1989.1
- 散金: 552
- 帖子: 925
- 在线: 544.3小时
- 虫号: 326712
- 注册: 2007-03-18
- 专业: 催化化学
6楼2010-06-06 07:21:48
zxczxc0417
木虫 (正式写手)
- 数学EPI: 2
- 应助: 2 (幼儿园)
- 金币: 1989.1
- 散金: 552
- 帖子: 925
- 在线: 544.3小时
- 虫号: 326712
- 注册: 2007-03-18
- 专业: 催化化学
7楼2010-06-06 07:36:16
zxczxc0417
木虫 (正式写手)
- 数学EPI: 2
- 应助: 2 (幼儿园)
- 金币: 1989.1
- 散金: 552
- 帖子: 925
- 在线: 544.3小时
- 虫号: 326712
- 注册: 2007-03-18
- 专业: 催化化学
8楼2010-06-06 07:38:49
zxczxc0417
木虫 (正式写手)
- 数学EPI: 2
- 应助: 2 (幼儿园)
- 金币: 1989.1
- 散金: 552
- 帖子: 925
- 在线: 544.3小时
- 虫号: 326712
- 注册: 2007-03-18
- 专业: 催化化学
★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
Doctorcbw(金币+2):谢谢参与 2010-06-06 09:19:23
Doctorcbw(金币+15, 数学EPI+1):楼主要求,用其金币奖励15个金币 2010-06-08 21:32:51
Doctorcbw(金币+2):谢谢参与 2010-06-06 09:19:23
Doctorcbw(金币+15, 数学EPI+1):楼主要求,用其金币奖励15个金币 2010-06-08 21:32:51
|
clc; clear; data_f = 'E:\兴趣学习\interesting_pro\空运路线规划\data.txt'; [dis(:,1) dis(:,2) dis(:,3) dis(:,4) dis(:,5) dis(:,6) dis(:,7)] = textread(data_f,'%f %f %f %f %f %f %f '); i = 1; min_d = 1e10; for i1 = 2:7 d1 = dis( i, i1 ); for i2 = 2:7 if i2 == i1 continue else d2 = dis(i1,i2); end for i3 = 2:7 if i3 == i1 || i3 == i2 continue else d3 = dis(i2,i3); end for i4 = 2:7 if i4 == i1 || i4 == i2 || i4 == i3 continue else d4 = dis(i3,i4); end for i5 = 2:7 if i5 == i1 || i5 == i2 || i5 == i3 || i5 == i4 continue else d5 = dis(i4,i5); end for i6 = 2:7 if i6 == i1 || i6 == i2 || i6 == i3 || i6 == i4 || i6 == i5 continue else d6 = dis(i5,i6); end d7 = dis(i6,1); temp_d = d1 + d2 + d3 + d4 + d5 + d6 + d7; if temp_d < min_d min_d = temp_d; min_route = [ i i1 i2 i3 i4 i5 i6 i ]; end end end end end end end min_d min_route |
9楼2010-06-06 07:39:07
sxu2009
至尊木虫 (正式写手)
- 数学EPI: 1
- 应助: 27 (小学生)
- 金币: 10463.7
- 散金: 744
- 红花: 5
- 帖子: 983
- 在线: 537小时
- 虫号: 861529
- 注册: 2009-10-01
- 性别: GG
- 专业: 计算机科学的基础理论
不用改数据结构,这个就行
★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
Doctorcbw(金币+2):谢谢参与 2010-06-06 09:19:17
Doctorcbw(金币+15):楼主要求,用其金币奖励15个金币 2010-06-08 21:31:50
Doctorcbw(数学EPI+1): 2010-06-08 21:33:00
小木虫(金币+0.5):给个红包,谢谢回帖交流
Doctorcbw(金币+2):谢谢参与 2010-06-06 09:19:17
Doctorcbw(金币+15):楼主要求,用其金币奖励15个金币 2010-06-08 21:31:50
Doctorcbw(数学EPI+1): 2010-06-08 21:33:00
|
m=[786 549 657 331 559 250;0 668 979 593 224 905; 0 0 346 607 472 467; 0 0 0 890 769 499; 0 0 0 0 386 559; 0 0 0 0 0 681;] total_min=inf; n=6; n_1=prod(1:n); allorder_K=zeros(1,n-1); tic for allorder_m=1:n_1 allorder_flag=zeros(1,n); allorder_P=zeros(1,n); for allorder_i=1:n-1 position=n-allorder_K(allorder_i); allorder_j=n; while(allorder_j>=position) if (allorder_flag(allorder_j)==1) position=position-1; end allorder_j=allorder_j-1; end allorder_P(position)=n+1-allorder_i; allorder_flag(position)=1; end for allorder_i=1:n if (allorder_flag(allorder_i)==0) allorder_P(allorder_i)=1; break; end end for allorder_i=1:n-1 allorder_K(n-allorder_i)=mod(allorder_K(n-allorder_i)+1,allorder_i+1); if (allorder_K(n-allorder_i)~=0) break; end end total=0; for pos=1:5 if (allorder_P(pos) else total=total+m(allorder_P(pos+1)+1,allorder_P(pos)); end end total=total+m(1,allorder_P(1))+m(1,allorder_P(6)); if (total allorder_Final=allorder_P; end end toc Final_cycle=ones(1,8); Final_cycle(2:7)=allorder_Final+ones(1,6); disp('The shortest Hamiltonian cycle from A1 to A1 is:'); Final_cycle disp('The length is:'); total_min [ Last edited by sxu2009 on 2010-6-6 at 08:02 ] |
10楼2010-06-06 07:55:35














回复此楼