文章编号:1007—1423(2015)26—0049—03 DOI:10.3969 ̄.issn.1007—1423.2015.26.013 二次分配问题的布谷鸟搜索算法 许秋艳 (盐城工学院信息工程学院,盐城224051) 摘要: 二次分配问题是一种典型的组合优化难题。该问题由于目标函数的非线性而使得问题的求解异常复杂。为求解二次 分配问题。设计基于布谷鸟搜索算法的优化方法。布谷鸟搜索算法是一种新型现代启发式算法,具有结构简单和易于 编程等特点。针对二次分配问题的特点,给出算法的实现流程。实验结果表明该算法的可行性和有效性。 关键词: 二次分配问题:布谷鸟搜索算法:组合优化 1 二次分配问题的数学模型 二次分配问题(Quadratic Assignment Problem,QAP) 最早由Koopmans和Beckmann在1957年提出l11.是一 是一个开放式的问题。布谷鸟搜索算法(Cuckoo Search Algorithm,CSA)是一种新型现代启发式算法,由Yang 和Deb在2009年提出 CSA具有参数少.易于编程实 现和优化性能好等特点.本文将CSA用于对QAP问题 的求解.实验结果证明了本文所给算法的可行性和有 效性 种典型的组合优化难题。QAP通常可以描述为:给定n 个设施和n个地点.各个地点之间的距离矩阵为D= [西 ,各个设施之间的运输量矩阵为 [ ,设施 建在地点k,且设施建在地点f所产生的费用为. . 2 二次分配问题的布谷鸟搜索算法 CSA源于对布谷鸟寄生育雏行为和鸟类的莱维飞 。现要将这n个设施建造在这n个地点上.给每个设施 分配一个位置.使得总费用最低[21: minp i=1 j=l 行行为的模拟,算法的伪代码如图1所示,具体原理请 参考文献『51。在求解连续优化问题时,CSA表现出良好 ・ ( ) 的搜索性能。为充分发挥CSA求解连续优化问题的优 势.在求解QAP时,算法的搜索空间仍定义在连续空 间,且搜索范围在『0,11之间。为将CSA的搜索空 其中,7r是所有分配方案的集合,P( )表示设施i 被分配的地点。QAP的目标是找到一个排列p={P ,p:, …,pn},使得总费用最少。 自提出以来.二次分配问题已经广泛用于许多问 间和QAP的解空间相对应,定义如下的映射 以规模 为5的QAP为例,假设CSA产生的一个解为 [0.8147,0.9058,0.1270,0.9134,0.63241,对解分量进行 题的研究中,例如,工厂位置选址、集成电路布线、作业 调度、打字机键盘设计和接力赛跑排序等翻。目前,用于 求解QAP的传统算法有分支定界法、动态规划法和割 平面法等;现代启发式算法有遗传算法、模拟退火算 排序,每个分量对应的排序号为『3,5,1,2,41,即第1个 设施被分配在第3个地点.第2个设施被分配在第5 个地点,第3个设施被分配在第1个地点.第4个设施 被分配在第2个地点,第5个设施被分配在第4个地 点 法、蚁群算法和粒子群算法等。这些算法为求解QAP 提供了思路.但由于自身搜索机制的.还不能完全 有效求解QAP。当前,如何设计求解QAP的算法仍然 现代计算机 2015.09中④ 布谷鸟搜索算法的伪代码[51: Objective function f(x),x=(x 一,xd)T; Initial a population of n host nests xi(i,1,2,…,n); While(t<MaxGeneration)or(stop criterion) Get a cuckoo(say i)randomly by Levy flight; Evaluate its quality/fitness Fi; F= Choose a nest among n(say j)randomly; If(F。>F ) Replace j by the new solution; End Abandon a fraction(p )of worst nests D= [and build new ones at new locations via evyL lfights]; Keep the best solutions(or nests with quality solutions); Rank the solutions and find the current best; End while Postprocess results and visualization. 利用本文算法计算这两个QAP算例的函数值分 别为2250和1652,对应的排列分别为【2,1,4,3】和 【3,10,1l,2,12,5,6,7,8,1,4,91。经验证,这两个计算 结果已经达到已知的最优解.从而说明本文算法在处 理二次分配问题的优势。 3 数值实验 为测试本文算法的优化性能.采用QAP两个典型 算例进行验证。 1 2 2 3 4 4 5 3 5 6 7 3 4 6 8 5 6 6 5 l 4 6 3 O 6 3 7 9 9 2 2 7{7 算例1 1 O i 1 2 3 3 4 2 4 5 6 4 结语 为求解二次分配问题.本文给出了基于布谷鸟搜 2 1 0 2 1 2 2 3 1 3 4 5 O 9O 10 0 0 78 26 4 6 O 2 6 4 4 4 2 6 3 6 O 6 3 2 O 5 S 3 3 9 4 3 6 9O 0 0 0 2 1 2 O 1 2 2 3 3D= 3 4 5F= i0 0 0 45 0 O 56 18 0 21 56 3 2 1 1 O 1 i 2 2 2 3 4 45 O 8 7 6 5 O 4 3 4 5 7 6 7 18 21 O 索算法的求解方法.并通过实验验证了所提出算法的 可行性和有效性.将算法用于图着色问题是进一步的 研究方向。 4 3 2 2 i 0 2 3 3 i 2 3 5 9 4 5 4 O 8 5 5 S 7 5 算例2 4 3 2 2 1 2 0 i 3 1 2 3 5 4 3 3 2 3 1 0 4 2王2 6 9 4 3 3 8 0 6 8 4 6 7 6 2 4 3 4 5 6 O 1 5 5 3 3 2 1 3 2 3 3 4 O 4 S 6 5 2 2 9 5 5 8 1 O 4 5 2 5 4 3 3 2 1 1 2 4 O 1 2 6 5 4 4 3 2 2 1 5 1 0 1 6 5 5 4 3 3 2 6 2 1 0 l 7 6 4 7 5 4 5 4 0 7 7 4 4 3 3 6 7 6 5 5 7 O 9 6 7 6 6 7 5 7 3 2 7 9 O 参考文献: 【1]Koopmans T C,Beckmann M J.Assignment problems and the location of economic activities[J].Econometrica,1957,25(1):53—76. 【2】马良,朱刚,宁爱兵.蚁群优化算法[M].北京:科学出版社,2010. [3]张惠珍,马良,王洪刚.二次分配问题及其研究进展(I)lJ1.科技通报,2010,26(6):801—805,816. [4]Yang X,Deb S.Cuckoo search via levy lfights[C].World Congress on Nature&Biologically Inspired Computing.Piscataway:IEEE Publications,2009:210—214. [5]Yang X S,Deb S.Engineering optimization by cuckoo search[J].International Journal of Mathematical Modeling and Numerical Opti— mization.2010.1(4):330—343. 作者简介: 许秋艳(1981一),女,讲师,从事领域为算法设计及其应用 收稿日期:2015—06—25 修稿日期:2015—09—10 ④ 现代计算机2015.09中 Cuckoo Search Algorithm for Quadratic Assignment Problem XU Qiu——yan (School ofInformationEngineering,YanchengInstitute ofTechnology,Yancheng 224051) Abstract: Quadratic Assignment Problem(QAP)is a typical hard problem in combinatorial optimization.It is hard to solve QAP because of its non— linear objective function.To solve QAP.proposes a method based on Cuckoo Search Algorithm(CSA).CSA is a novel metaheuristic which is simple and easy to program.According the features of QAP,shows the algorithm procedure.The results demonstrate that the presented method iS feasible and effective. Keywords: Quadratic Assignment Problem;Cuckoo Search Algorithm;Combinatorial Optimization (上接第45页) A Social Network Spread Cost Model Based on User I nfluence YANG Yang ,WANG Yang-yu (1.College of Computer Science and Technology,Nanjing Normal University,Nanjing 210023; 2.College of Teacher Education,Nanjing Normal University,Nanjing 210023) Abstract: In order to assess the cost of the social network spread to blog,proposes a method to assess the cost of a social network communication. Based on PageRank algorithm and analytic hierarchy process,calculates the user influence.Uses greedy algorithm and global algorithm, infers the users releasing quantity rank when all users can see it,and compares the two algorithms.Considering the user influence and the user releasing quantity rank,establishes a social network spread cost model,according to the blog data,assesses the cost of the social network spread. Keywords: PageRank Algorithm;Analytic Hierarchy Process;Greedy Algorithm;Global Algorithm;Social Network Spread Cost Model 现代计算机 2015 f)9申@