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, tMatrix, 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.
QString CTSPSolver::getVersionId (  )  [static]

Returns CTSPSolver's version ID.

Returns:
A string: $Id: tspsolver.cpp 66 2009-10-21 12:48:49Z 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.

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

Generated on Sat Oct 24 16:33:19 2009 for TSPSG: TSP Solver and Generator by  doxygen 1.6.1