This class solves Travelling Salesman Problem task. More...
#include <tspsolver.h>
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. | |
SStep * | solve (int numCities, TMatrix task, QWidget *parent=0) |
Solves the given task. | |
Static Public Member Functions | |
static QString | getVersionId () |
Returns CTSPSolver's version ID. |
This class solves Travelling Salesman Problem task.
QString CTSPSolver::getSortedPath | ( | ) | const |
Returns the sorted optimal path, starting from City 1.
QString CTSPSolver::getVersionId | ( | ) | [static] |
Returns CTSPSolver's version ID.
bool CTSPSolver::isOptimal | ( | ) | const |
Returns whether or not the solution is definitely optimal.
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
.
Solves the given task.
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. |