Changeset 13 in tspsg-svn for trunk/src/tspsolver.h
- Timestamp:
- Oct 21, 2007, 3:07:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tspsolver.h
r12 r13 29 29 const double infinity = 1.7E+308; 30 30 31 typedef QList<double *> tMatrix; 32 31 33 // Structure represent one step of solving 32 34 // The tree of such elements will represent the solving process 33 35 struct sStep { 34 double *matrix;36 tMatrix matrix; 35 37 double price; 36 38 struct {unsigned int x; unsigned int y;} pos; 37 sStep *p Left, *pRight;38 sStep() { matrix = NULL; price = pos.x = pos.y = 0; pLeft = pRight = NULL;}39 sStep *plNode, *prNode; 40 sStep() { price = pos.x = pos.y = 0; plNode = prNode = NULL; } 39 41 }; 40 42 … … 44 46 public: 45 47 CTSPSolver(); 46 sStep *solve(int, double *); 48 sStep *solve(int, tMatrix); 49 private: 50 int nCities; 51 sStep *root; 52 double findMinInRow(int, tMatrix); 53 double findMinInCol(int, tMatrix); 47 54 }; 48 55
Note: See TracChangeset
for help on using the changeset viewer.