From 4292c63a156d718b7bd886b2781475cdb0c1066b Mon Sep 17 00:00:00 2001 From: Jan Potocki Date: Mon, 20 Jan 2020 19:18:13 +0100 Subject: [PATCH] Fixed crash when entire neighborhood is on tabu list --- Graph.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Graph.cpp b/Graph.cpp index 211e9ab..f397008 100755 --- a/Graph.cpp +++ b/Graph.cpp @@ -516,7 +516,9 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps, while(cheeseSupplied == true) { - std::vector nextRoute; + std::vector nextRoute = currentRoute; + // ...na wszelki wypadek, gdyby cale sasiedztwo bylo na liscie tabu + // (zeby algorytm sie nie wywalil) int nextRouteLength = -1; std::vector 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