Research Article
Developing Programming Tools to Handle Traveling Salesman Problem by the Three Object-Oriented Languages
| (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 | | 10 unsigned long long Cost(); //computes and returns cost | | 11 void InitiateRandomly();//forms tour by sequence: 0, 1, …, dimenion − 1 | | 12 Tour Copy(); | | 13 short IsComplete();//if tour is complet, this function returns 1 otherwise 0. | | 14 void reset(); | | 15 }; |
|