Browse Source

Fixed TS crash when entire neighborhood is on tabu list

Jan Potocki 5 years ago
parent
commit
c10d296d82
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      Graph.cpp

+ 3
- 1
Graph.cpp View File

517
 
517
 
518
         while(cheeseSupplied == true)
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
             int nextRouteLength = -1;
523
             int nextRouteLength = -1;
522
 
524
 
523
             std::vector<unsigned> nextTabu(3, 0);
525
             std::vector<unsigned> nextTabu(3, 0);

Loading…
Cancel
Save