Question: Develop an approximate solution method to TSP according to the Nearest Neighbour algorithm. Implement the algorithm by adding the following method to the TSP.java class:

Develop an approximate solution method to TSP according to the Nearest Neighbour algorithm. Implement the algorithm by adding the following method to the TSP.java class: public int] computeNNTour(int startingcity) f. . .) After construction, calling this method will return the solution tour as an array of city numbers, where the N input cities are numbered in sequence 0,1, ..., N - 1. The startingCity parameter specifies the first/last city on the solution tour. Implement your code as efficiently as possible. Consider using an ArrayList to manage the list of city numbers the algorithm is processing. Note: it is possible to implement the method in less than 25 lines of code. Add any additional code for calling your method to obtain a solution to the main() method in TSP.java For your project report: (a) Apply your solution to the set of cities listed in Table 1 below. Find the solution for each city as the starting point (8 different solutions) and complete the table below in your report. Find the optimal solution results by running the computeOptimalTour) method provided in (b) Include drawings of the optimal and the shortest Nearest Neighbour solutions in your report. (c) Describe clearly how your method operates, in bullet point or pseudocode form, in no more (d) Upload your final TSP.java file to Loop. The results produced by your Java file, when run by TSP.java Call the drawTour(...) method, provided in Drawing.java, to do this. than half a page of text. Develop an approximate solution method to TSP according to the Nearest Neighbour algorithm. Implement the algorithm by adding the following method to the TSP.java class: public int] computeNNTour(int startingcity) f. . .) After construction, calling this method will return the solution tour as an array of city numbers, where the N input cities are numbered in sequence 0,1, ..., N - 1. The startingCity parameter specifies the first/last city on the solution tour. Implement your code as efficiently as possible. Consider using an ArrayList to manage the list of city numbers the algorithm is processing. Note: it is possible to implement the method in less than 25 lines of code. Add any additional code for calling your method to obtain a solution to the main() method in TSP.java For your project report: (a) Apply your solution to the set of cities listed in Table 1 below. Find the solution for each city as the starting point (8 different solutions) and complete the table below in your report. Find the optimal solution results by running the computeOptimalTour) method provided in (b) Include drawings of the optimal and the shortest Nearest Neighbour solutions in your report. (c) Describe clearly how your method operates, in bullet point or pseudocode form, in no more (d) Upload your final TSP.java file to Loop. The results produced by your Java file, when run by TSP.java Call the drawTour(...) method, provided in Drawing.java, to do this. than half a page of text
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
