CTSPSolver Class Reference

This class solves Travelling Salesman Problem task. More...

#include <tspsolver.h>

Collaboration diagram for CTSPSolver:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CTSPSolver ()
 Class constructor.
QString getSortedPath () const
 Returns the sorted optimal path, starting from City 1.
bool isOptimal () const
 Returns whether or not the solution is definitely optimal.
SStepsolve (int numCities, TMatrix task, QWidget *parent=0)
 Solves the given task.

Static Public Member Functions

static QString getVersionId ()
 Returns CTSPSolver's version ID.

Detailed Description

This class solves Travelling Salesman Problem task.

Author:
Copyright © 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
Todo:
TODO: Deletion of solution tree on destroy and cleanup.

Member Function Documentation

QString CTSPSolver::getSortedPath (  )  const

Returns the sorted optimal path, starting from City 1.

Returns:
A string, containing sorted optimal path.

Here is the call graph for this function:

QString CTSPSolver::getVersionId (  )  [static]

Returns CTSPSolver's version ID.

Returns:
A string: $Id: tspsolver.cpp 79 2009-12-18 13:07:48Z laleppa $.
bool CTSPSolver::isOptimal (  )  const

Returns whether or not the solution is definitely optimal.

Returns:
true if solution is definitely optimal, otherwise false.

The solution may need some further interations to determine whether it is optimal. In such cases this function returns false.

SStep * CTSPSolver::solve ( int  numCities,
TMatrix  task,
QWidget parent = 0 
)

Solves the given task.

Parameters:
numCities Number of cities in the task.
task The matrix of city-to-city travel costs.
parent The parent widget for displaying messages and dialogs.
Returns:
Pointer to the root of the solution tree.
Todo:
TODO: Comment the algorithm.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Defines

Generated on Thu Jan 7 18:22:51 2010 for TSPSG: TSP Solver and Generator by  doxygen 1.6.1