用分枝定界算法求解旅行商问题的插件开发Development of plugin to solve travelling salesman problem with branch and bound algorithm
李玲玉,张昆
摘要(Abstract):
针对GIS软件中采用启发式算法求解旅行商问题(TSP),还不具备求解TSP精确解的问题,以Python为开发语言,在PyQT5和QGIS Python API环境下,采用分枝定界算法开发了名为TSP Branch and Bound Solver的QGIS插件。插件基于广度优先与优先级队列技术实现分枝定界算法,同时采用最近邻居算法先求得一条回路作为初始解,加快了剪枝的进程。该插件在5 min内能解决的TSP规模为16个节点,优势在于能够获得TSP的精确解。对于规模不大的TSP问题,该插件具有实用价值,例如用于外卖配送,使快递员的配送路径最优。同时,由于QGIS是一款开源GIS软件,开发的插件也避开了版权问题的困扰,用户可以免费下载和使用该插件。
关键词(KeyWords): 旅行商问题;分枝定界算法;QGIS插件;精确解
基金项目(Foundation): 上海市自然科学基金项目(19ZR1459700)
作者(Author): 李玲玉,张昆
DOI: 10.16251/j.cnki.1009-2307.2020.11.026
参考文献(References):
- [1] 中国报告网.2019年中国快递行业分析报告-市场运营态势与发展前景研究[EB/OL].(2019-01-26)[2019-06-01].http://baogao.chinabaogao.com/wuliu/396090396090.html.(China Bao Gao Website.2019 China express industry analysis report-market operation situation and development prospects[EB/OL].(2019-01-26)[2019-06-01].http://baogao.chinabaogao.com/wuliu/396090396090.html.)
- [2] 中商产业研究院.2018年中国在线外卖市场规模及分析[EB/OL].(2018-10-30)[2019-06-01].http://www.askci.com/news/chanye/20181030/1632321135484.shtml.(China Businesss Industry Research Institute.The scale and analysis of China’s online take-away market in 2018[EB/OL].(2018-10-30)[2019-06-01].http://www.askci.com/news/chanye/20181030/1632321135484.shtml.)
- [3] 第一财经商业数据中心联合苏宁易购.2018年快递员群体洞察报告[EB/OL].(2018-08-07)[2019-06-01].https://www.cbndata.com/report/983/detail?isReading=report&page=1.(CBNData and Suning.2018 Courier group in sights report[EB/OL].(2018-08-07)[2019-06-01].https://www.cbndata.com/report/983/detail?isReading=report&page=1.)
- [4] 上海交警微发布.2017年本市快递外卖行业道路交通事故情况[EB/OL].(2018-02-12)[2019-06-01].http://shzw.eastday.com/shzw/n1102226/n1109686/u1ai11218837.html.(Shanghai Traffic Police Micro Release.Road traffic accidents in express takeaway industry in Shanghai in 2017[EB/OL].(2018-02-12)[2019-06-01].http://shzw.eastday.com/shzw/n1102226/n1109686/u1ai11218837.html.)
- [5] 刘弘.无爪图的Hamilton连通性及其应用[D].大连:大连理工大学,2007:1-49.(LIU Hong.The Hamilton-connectedness of claw-free graphs and its application[D].Dalian:Dalian University of Technology,2007:1-49.)
- [6] 刘锦.混合遗传算法和模拟退火算法在TSP中的应用研究[D].广州:华南理工大学,2014:1-52.(LIU Jin.Applied research of hybrid genetic algorithm and simulated annealing algorithm in traveling salesman problem[D].Guangzhou:South China University of Technology,2014:1-52.)
- [7] 邱儒琼,何保国.基于QGIS的地名搜索插件开发[J].测绘通报,2013,2:76-78.(QIU Ruqiong,HE Baoguo.Customizing QGIS with python plugin of geographic names search[J].Bulletin of Surveying and Mapping,2013,2:76-78.)
- [8] MILTON I N,UGUR A.Application of open source coding technologies in the production of land surface temperature (LST) maps from landsat:a PyQGIS plugin[J].Remote Sensing,2016,8(5):413.
- [9] LAND A H,DOIG A G.An automatic method of solving discrete programming problems[J].Econometrica,1960,28(3):497-520.
- [10] RADOSLAW G,SZYMON J.Fast branch and bound algorithm for the travelling salesman problem[J].CISIM,2016,9842:206-217.
- [11] SAAD S,WANN W J,JAMIL S J.Solving standard traveling salesman problem and multiple traveling salesman problem by using branch-and-bound[J].AIP Conference Proceedings,2013,1522:1406-1411.
- [12] 付志英,吕梦鸽,王谷青,等.优先队列分支限界法解多货车多货箱装载问题[J].现代计算机,2019,4:23-27.(FU Zhiying,LYU Mengge,WANG Guqing,et al.The priority queue branch and bound method for multi-truck multi-container loading problem[J].Modern Computer,2019,4:23-27.)
- [13] 陈涛,张思发.分支限界法求解实际TSP问题[J].计算机工程与设计,2009,30(10):2431-2434.(CHEN Tao,ZHANG Sifa.Using a branch and bound method to solve realistic TSP[J].Computer Engineering and Design,2009,30(10):2431-2434.)
- [14] QGIS Python API.Class:QgsDistanceArea[EB/OL].(2019-08-28)[2019-08-29].https://qgis.org/pyqgis/master/core/QgsDistanceArea.html?highlight=qgsdistancearea.
- [15] JOHN D C,KATTA G,DURA W.An algorithm for the travelling salesman problem[M].Sloan School of Management:Cambridge MIT,1963:7-63.