Fixed crash when entire neighborhood is on tabu list
This commit is contained in:
@@ -516,7 +516,9 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps,
|
||||
|
||||
while(cheeseSupplied == true)
|
||||
{
|
||||
std::vector<unsigned> nextRoute;
|
||||
std::vector<unsigned> nextRoute = currentRoute;
|
||||
// ...na wszelki wypadek, gdyby cale sasiedztwo bylo na liscie tabu
|
||||
// (zeby algorytm sie nie wywalil)
|
||||
int nextRouteLength = -1;
|
||||
|
||||
std::vector<unsigned> nextTabu(3, 0);
|
||||
@@ -665,7 +667,7 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps,
|
||||
// Intensyfikacja przeszukiwania przez skrócenie kadencji
|
||||
// (jezeli w ostatnim przebiegu znaleziono nowe minimum)
|
||||
currentRoute = optimalRoute;
|
||||
currentTabuSteps = tabuSteps / 4;
|
||||
currentTabuSteps = tabuSteps; /// 4;
|
||||
intensification = false;
|
||||
// PEA 2 Plus
|
||||
// Jan Potocki 2019
|
||||
|
||||
Reference in New Issue
Block a user