TSPTW問題にタブーサーチを適用したところ、交換ピボットルール(2都市間の交換)を使用して最良の改善を得るのと同様の結果が得られましたが、いくつかの論文では、タブーは最適なものに近い良い結果を与えると述べられています(私は持っています別のアルゴリズムを使用して、制約違反が 0 の同じ初期ソリューションの最適なソリューション)。だから私は確信したい、この結果は正常ですか?そして、ここにタブーを適用する私の擬似コードがあります:
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
}