Pārlūkot izejas kodu

Fixed TS crash when entire neighborhood is on tabu list

Jan Potocki 5 gadus atpakaļ
vecāks
revīzija
c10d296d82
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3
    1
      Graph.cpp

+ 3
- 1
Graph.cpp Parādīt failu

@@ -517,7 +517,9 @@ void Graph::travellingSalesmanTabuSearchEngine(Graph &graph, unsigned tabuSteps,
517 517
 
518 518
         while(cheeseSupplied == true)
519 519
         {
520
-            std::vector<unsigned> nextRoute;
520
+            std::vector<unsigned> nextRoute = currentRoute;
521
+            // ...na wszelki wypadek, gdyby cale sasiedztwo bylo na liscie tabu
522
+            // (zeby algorytm sie nie wywalil)
521 523
             int nextRouteLength = -1;
522 524
 
523 525
             std::vector<unsigned> nextTabu(3, 0);

Notiek ielāde…
Atcelt
Saglabāt