package tsp.solutionAlgorithms.simha; import edu.gwu.champAlg.*; import tsp.*; import java.util.*; public class NearestNeighbor implements SolutionAlgorithm { Pointd[] points; public String getName () { return "Simha-TSP-NearestNeighbor"; } public String toString () { return "SimhaTSPNN"; } public void setPropertyExtractor (int algID, PropertyExtractor prop) { } public Solution solve (Problem problem) { TSPProblem tProblem = (TSPProblem) problem; this.points = tProblem.points; int[] tour = new int [points.length]; // INSERT YOUR CODE HERE TSPSolution tSolution = new TSPSolution (); tSolution.tour = tour; return tSolution; } double cost (int[] tour) { double c = 0; for (int i=0; i