Tabu在TSPTW中搜索

时间:2013-05-21 05:39:12

标签: algorithm traveling-salesman tabu-search

我在TSPTW问题中应用了Tabu搜索,但是它给我的结果类似于使用交换枢轴规则(两个城市之间的交换)获得最佳改进,但是在一些文章中,表明Tabu在最优的一个附近给出了良好的结果(我有相同初始解决方案的最佳解决方案,使用另一种算法违反0约束)。所以我想确定,这个结果是否正常?,这是我应用Tabu的伪代码:

Running Tabu for number of iteration
Tabu tenure=7
list TabuList
with each solution I saved, the two exchanged cities
bestsol=initial solution
currsol=initial solution
tabufun()
{
   while(i<iteration)
   {
    i++;
    currsol=bestneighbourhood(currsol)
    if(currsol.fitness < bestsol.fitness)  // curr is better than best
      bestsol=currsol
  }
return bestsol // result of tabu search
}

bestneighbourhood(currsol)
{
  solutions=getallexchanepossiblesolution(currsol)
  // if for first time save global min, firsttime is global variable set to true
 for(each sol in solutions)
{
   bestneigh=sol;
   if(firstTime)
  {
      globalmin= sol.fitness
      firsttime=false
  }
if(sol.fitness()<globalmin)
{
   globalmin=sol.fitness()
}
   check if cityi and cityj existing in tabulist
   if not existing
  {
    //update all elements in tabulist, element has tabu value=0 remove it from list
    //and decrement tabu value of others
    //add cityi and cityj in tabu list with intial tabu value=tabu tenure
    break;
  }
  else
 {
   //check for aspiration
   if(sol.fitness<globalmin)
   {
     //update tabu list
     //reinitialize this cityi and cityj with tabu tenure
   break;
 }
else
 conitnue

}
 return bestneigh

}

0 个答案:

没有答案