ソースを参照

Fixed TS crash when entire neighborhood is on tabu list

Jan Potocki 5年前
コミット
c10d296d82
1個のファイルの変更3行の追加1行の削除
  1. 3
    1
      Graph.cpp

+ 3
- 1
Graph.cpp ファイルの表示

@@ -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);

読み込み中…
キャンセル
保存