/****************************************************************************** * Name: * NetID: * Precept: * * Partner Name: * Partner NetID: * Partner Precept: * ******************************************************************************/ Which partner is submitting the program files? Programming Assignment 8: Traveling Salesperson Problem Hours to complete assignment (optional): /********************************************************************** * Explain how you implemented the nearest insertion heuristic. * **********************************************************************/ /********************************************************************** * Explain how you implemented the smallest insertion heuristic. * * It's sufficient to list only the differences between this * * heuristic and the nearest insertion heuristic. * **********************************************************************/ /********************************************************************** * Explain why it's better to use a circularly linked list instead * * of an array. * **********************************************************************/ /********************************************************************** * Fill in the lengths computed by your heuristics. * **********************************************************************/ data file nearest neighbor smallest increase ----------------------------------------------------- tsp10.txt 1566.1363 1655.7462 tsp100.txt tsp1000.txt usa13509.txt /********************************************************************** * Do two timing analyses. Estimate the running time (in seconds) * * of each heuristic as a function of n, using expressions of the * * form: a * n^b, where b is an integer. * * * * Explain how you determined each of your answers. * * * * To get your data points, run the two heuristics for n = 1,000, * * and repeatedly double n until the execution time exceeds 60 * * seconds. * * * * You may use TSPTimer to help do this, as per the checklist. * * If you do so, execute it with the -Xint option. This turns off * * various compiler optimizations, which helps normalize and * * stabilize the timing data that you collect. * * * * (If n = 1,000 takes over 60 seconds, your code is too slow. * * See the checklist for a suggestion on how to fix it.) * **********************************************************************/ n nearest time smallest time ------------------------------------------------------------ 1000 2000 ... /********************************************************************** * Did you receive help from classmates, past COS 126 students, or * anyone else? If so, please list their names. ("A Sunday lab TA" * or "Office hours on Thursday" is ok if you don't know their name.) **********************************************************************/ Yes or no? /********************************************************************** * Did you encounter any serious problems? If so, please describe. **********************************************************************/ Yes or no? /********************************************************************** * List any other comments here. **********************************************************************/