Research Article

Developing Programming Tools to Handle Traveling Salesman Problem by the Three Object-Oriented Languages

Algorithm 3

Tour ADT.
(1)  class Tour
2  {
3  public:
4  Tour(Graph    graph);//tour constructor gives a gaph object pointer as argument
5  ~Tour();
6  int Add_Right(int node); //exends uncomlete tour from right
7  int Add_Left(int node); //exends uncomlete tour from left
8  int Right(int node); // return right neighbour of node in complete tour
9  int Left(int node); //return left neighbour of node in complete tour
10unsigned long long Cost(); //computes and returns cost
11void InitiateRandomly();//forms tour by sequence: 0,  1,  …,  dimenion    1
12Tour    Copy();
13short IsComplete();//if tour is complet, this function returns 1 otherwise 0.
14void reset();
15};