Changeset aaf2113307 in tspsg for src/tspsolver.cpp
- Timestamp:
- Aug 3, 2009, 5:15:46 PM (15 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- f44855d99e
- Parents:
- e96fad3079
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tspsolver.cpp
re96fad3079 raaf2113307 97 97 for (int r = 0; r < nCities; r++) 98 98 for (int c = 0; c < nCities; c++) 99 if ((matrix[r][c] == 0) && !forbidden.values(r).contains(c)) { 99 // if ((matrix[r][c] == 0) && !forbidden.values(r).contains(c)) { 100 if (matrix[r][c] == 0) { 100 101 sum = findMinInRow(r,matrix,c) + findMinInCol(c,matrix,r); 101 102 if (sum > h) { … … 154 155 int nRow, nCol; 155 156 while (route.size() < nCities) { 156 forbidden.clear();157 // forbidden.clear(); 157 158 step->alts = findCandidate(step->matrix,nRow,nCol,s); 158 159 while (hasSubCycles(nRow,nCol)) { 159 forbidden[nRow] = nCol;160 // forbidden[nRow] = nCol; 160 161 step->matrix[nRow][nCol] = INFINITY; 161 162 step->price += align(step->matrix); … … 204 205 } 205 206 206 pd.reset(); 207 if (!root && !pd.wasCanceled()) { 208 pd.reset(); 209 QMessageBox(QMessageBox::Warning,trUtf8("Solution Result"),trUtf8("Unable to find solution.\nMaybe, this task has no solutions."),QMessageBox::Ok,parent).exec(); 210 } 211 207 212 qApp->processEvents(); 208 213 209 if (!root && !pd.wasCanceled()) {210 QMessageBox(QMessageBox::Warning,trUtf8("Solution Result"),trUtf8("This task has no solution."),QMessageBox::Ok,parent).exec();211 }212 213 214 return root; 214 215 }
Note: See TracChangeset
for help on using the changeset viewer.