Changeset caef58b531 in tspsg for src/tspsolver.h
- Timestamp:
- Oct 20, 2009, 9:38:01 PM (15 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 85ad815b0b
- Parents:
- bc1b8837b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tspsolver.h
rbc1b8837b6 rcaef58b531 1 /* 2 * TSPSG: TSP Solver and Generator 3 * Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 1 /*! 2 * \class CTSPSolver 3 * \author Copyright © 2007-2009 Lёppa <contacts[at]oleksii[dot]name> 4 * \brief This class solves Travelling Salesman Problem task. 4 5 * 5 6 * $Id$ 6 7 * $URL$ 8 * 9 * <b>TSPSG: TSP Solver and Generator</b> 7 10 * 8 11 * This file is part of TSPSG. … … 20 23 * You should have received a copy of the GNU General Public License 21 24 * along with TSPSG. If not, see <http://www.gnu.org/licenses/>. 25 * 26 * \todo TODO: Deletion of solution tree on destroy and cleanup. 22 27 */ 23 28 … … 29 34 #include "tspmodel.h" 30 35 36 //! A matrix of city-to-city travel costs. 31 37 typedef QList<QList<double> > tMatrix; 32 38 33 // This structure represents one step of solving 34 // The tree of such elements will represent the solving process 39 /*! 40 * \brief This structure represents one step of solving. 41 * 42 * A tree of such elements will represent the solving process. 43 */ 44 //! \todo TODO: List alternative candidates. 35 45 struct sStep { 36 tMatrix matrix; // Steps's matrix 37 double price; // Price of travel to this step 38 struct {int nRow; int nCol;} candidate; // Candiadate for branching in current matrix 39 bool alts; // This matrix has alternative candidates 40 sStep *plNode, *prNode; // Pointers to left and right branch steps 41 sStep() { price = candidate.nRow = candidate.nCol = -1; alts = false; plNode = prNode = NULL; } // Default values 46 tMatrix matrix; //!< This step's matrix 47 double price; //!< The price of travel to this step 48 struct { 49 int nRow; //!< A zero-based row number of the candidate 50 int nCol; //!< A zero-based column number of the candidate 51 } candidate; //!< A candiadate for branching in the current matrix 52 bool alts; //!< Indicates whether or not matrix has alternative candidates 53 sStep *plNode; //!< Pointer to the left branch step 54 sStep *prNode; //!< Pointer to the right branch step 55 56 //! Assigns default values 57 sStep() { 58 price = candidate.nRow = candidate.nCol = -1; 59 alts = false; 60 plNode = prNode = NULL; 61 } 42 62 }; 43 63 44 // TSP Solver class45 64 class CTSPSolver 46 65 {
Note: See TracChangeset
for help on using the changeset viewer.