algorithm - Tabu Search in TSPTW -
i applied tabu search in tsptw problem, gives me result similar getting best improvement using exchanging pivot rule (exchange between 2 cities ), in papers, stated tabu gives result near optimal 1 (i have best solution of same initial solution 0 constraints violation using algorithm). sure, result normal ?, , here's pseudo code of applying tabu:
running tabu number of iteration tabu tenure=7 list tabulist each solution saved, 2 exchanged cities bestsol=initial solution currsol=initial solution tabufun() { while(i<iteration) { i++; currsol=bestneighbourhood(currsol) if(currsol.fitness < bestsol.fitness) // curr better best bestsol=currsol } return bestsol // result of tabu search } bestneighbourhood(currsol) { solutions=getallexchanepossiblesolution(currsol) // if first time save global min, firsttime global variable set 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 , cityj existing in tabulist if not existing { //update elements in tabulist, element has tabu value=0 remove list //and decrement tabu value of others //add cityi , cityj in tabu list intial tabu value=tabu tenure break; } else { //check aspiration if(sol.fitness<globalmin) { //update tabu list //reinitialize cityi , cityj tabu tenure break; } else conitnue } return bestneigh
}
Comments
Post a Comment