Changeset 13 in tspsg-svn for trunk/src/tspsolver.h


Ignore:
Timestamp:
Oct 21, 2007, 3:07:21 PM (17 years ago)
Author:
laleppa
Message:

Writing solving algorithm...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tspsolver.h

    r12 r13  
    2929const double infinity = 1.7E+308;
    3030
     31typedef QList<double *> tMatrix;
     32
    3133// Structure represent one step of solving
    3234// The tree of such elements will represent the solving process
    3335struct sStep {
    34         double *matrix;
     36        tMatrix matrix;
    3537        double price;
    3638        struct {unsigned int x; unsigned int y;} pos;
    37         sStep *pLeft, *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; }
    3941};
    4042
     
    4446public:
    4547        CTSPSolver();
    46         sStep *solve(int, double *);
     48        sStep *solve(int, tMatrix);
     49private:
     50        int nCities;
     51        sStep *root;
     52        double findMinInRow(int, tMatrix);
     53        double findMinInCol(int, tMatrix);
    4754};
    4855
Note: See TracChangeset for help on using the changeset viewer.