(1).问题描述:旅行商问题
某售货员要到若干城市去推销商品,已知各城市之间的路程(或旅费)。他要
选定一条从驻地出发,经过每个城市一遍,最后回到驻地的路线,使总的路程(
或旅费)最小。
(2).程序设计要求:
a. 设计一个动态规划算法
b. 任给一个输入实例,能输出最短路程及其路线
c. 能用图形演示旅行商的推销路线
输入要测试的文件名,如TSP6.txt,程序将利用动态规划求解该问题,给出最佳线
路,并用图形演示。
SHOW FULL COLUMNS FROM `jrk_downrecords` [ RunTime:0.001086s ]
SELECT `a`.`aid`,`a`.`title`,`a`.`create_time`,`m`.`username` FROM `jrk_downrecords` `a` INNER JOIN `jrk_member` `m` ON `a`.`uid`=`m`.`id` WHERE `a`.`status` = 1 GROUP BY `a`.`aid` ORDER BY `a`.`create_time` DESC LIMIT 10 [ RunTime:0.062653s ]
SHOW FULL COLUMNS FROM `jrk_tagrecords` [ RunTime:0.001035s ]
SELECT * FROM `jrk_tagrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 20 [ RunTime:0.001251s ]
SHOW FULL COLUMNS FROM `jrk_member` [ RunTime:0.000966s ]
SELECT `id`,`username`,`userhead`,`usertime` FROM `jrk_member` WHERE `status` = 1 ORDER BY `usertime` DESC LIMIT 10 [ RunTime:0.003159s ]
SHOW FULL COLUMNS FROM `jrk_searchrecords` [ RunTime:0.000978s ]
SELECT * FROM `jrk_searchrecords` WHERE `status` = 1 ORDER BY `num` DESC LIMIT 5 [ RunTime:0.003636s ]
SELECT aid,title,count(aid) as c FROM `jrk_downrecords` GROUP BY `aid` ORDER BY `c` DESC LIMIT 10 [ RunTime:0.015140s ]
SHOW FULL COLUMNS FROM `jrk_articles` [ RunTime:0.001352s ]
UPDATE `jrk_articles` SET `hits` = 2 WHERE `id` = 528919 [ RunTime:0.029217s ]