From c10d296d82c2ce9cef8cf57e437119036b8c2a89 Mon Sep 17 00:00:00 2001 From: Jan Potocki Date: Mon, 20 Jan 2020 19:23:47 +0100 Subject: [PATCH] Fixed TS crash when entire neighborhood is on tabu list --- Graph.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Graph.cpp b/Graph.cpp index 370fee5..f8c1def 100755 --- a/Graph.cpp +++ b/Graph.cpp @@ -517,7 +517,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);