# include # include using namespace std; # include "tsp_att48.hpp" //****************************************************************************80 int *tsp_att48_order ( ) //****************************************************************************80 // // Purpose: // // tsp_att48_order() returns the location data for the AT&T 48 city TSP challenge. // // Licensing: // // This code is distributed under the MIT license. // // Modified: // // 17 June 2026 // // Author: // // John Burkardt // // Output: // // int tsp_att48_order[48]: the 0-based optimal tour order. // { int *att48_order; static int att48_order_save[48] = { 1, 8, 38, 31, 44, 18, 7, 28, 6, 37, 19, 27, 17, 43, 30, 36, 46, 33, 20, 47, 21, 32, 39, 48, 5, 42, 24, 10, 45, 35, 4, 26, 2, 29, 34, 41, 16, 22, 3, 23, 14, 25, 13, 11, 12, 15, 40, 9 }; int i; int n = 48; att48_order = new int[n]; for ( i = 0; i < n; i++ ) { att48_order[i] = att48_order_save[i] - 1; } return att48_order; } //****************************************************************************80 double *tsp_att48_xy ( ) //****************************************************************************80 // // Purpose: // // tsp_att48_xy() returns the location data for the AT&T 48 city TSP challenge. // // Licensing: // // This code is distributed under the MIT license. // // Modified: // // 17 June 2026 // // Author: // // John Burkardt // // Output: // // double tsp_att48_xy[48*2]: the x and y coordinates of the cities. // { double *att48_xy; static int att48_xy_save[48*2] = { 6734, 1453, 2233, 10, 5530, 1424, 401, 841, 3082, 1644, 7608, 4458, 7573, 3716, 7265, 1268, 6898, 1885, 1112, 2049, 5468, 2606, 5989, 2873, 4706, 2674, 4612, 2035, 6347, 2683, 6107, 669, 7611, 5184, 7462, 3590, 7732, 4723, 5900, 3561, 4483, 3369, 6101, 1110, 5199, 2182, 1633, 2809, 4307, 2322, 675, 1006, 7555, 4819, 7541, 3981, 3177, 756, 7352, 4506, 7545, 2801, 3245, 3305, 6426, 3173, 4608, 1198, 23, 2216, 7248, 3779, 7762, 4595, 7392, 2244, 3484, 2829, 6271, 2135, 4985, 140, 1916, 1569, 7280, 4899, 7509, 3239, 10, 2676, 6807, 2993, 5185, 3258, 3023, 1942 }; int i; int n = 48; att48_xy = new double[n * 2]; for ( i = 0; i < n; i++ ) { att48_xy[2*i] = ( double ) att48_xy_save[2*i]; att48_xy[2*i+1] = ( double ) att48_xy_save[2*i+1]; } return att48_xy; }