Fixed crash when entire neighborhood is on tabu list

This commit is contained in:
Jan Potocki
2020-01-20 19:18:13 +01:00
parent babb720caa
commit 4292c63a15
+4 -2
View File
@@ -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