Fixed TS crash when entire neighborhood is on tabu list

This commit is contained in:
Jan Potocki
2020-01-20 19:23:47 +01:00
parent 5d78916930
commit c10d296d82
+3 -1
View File
@@ -517,7 +517,9 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps,
while(cheeseSupplied == true) 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; int nextRouteLength = -1;
std::vector<unsigned> nextTabu(3, 0); std::vector<unsigned> nextTabu(3, 0);