Merge branch 'gtsp-comb'
This commit is contained in:
302
gtsp.in
302
gtsp.in
@@ -1,201 +1,101 @@
|
|||||||
200 50
|
100 60
|
||||||
31.00 90.00 0
|
49.00 95.00 0
|
||||||
53.00 38.00 1
|
26.00 66.00 1
|
||||||
73.00 38.00 2
|
76.00 50.00 2
|
||||||
59.00 41.00 3
|
39.00 65.00 3
|
||||||
4.00 8.00 4
|
20.00 7.00 4
|
||||||
44.00 92.00 5
|
60.00 91.00 5
|
||||||
64.00 54.00 6
|
2.00 26.00 6
|
||||||
43.00 16.00 7
|
67.00 80.00 7
|
||||||
13.00 24.00 8
|
46.00 99.00 8
|
||||||
32.00 39.00 9
|
90.00 42.00 9
|
||||||
28.00 72.00 10
|
70.00 59.00 10
|
||||||
47.00 79.00 11
|
37.00 83.00 11
|
||||||
81.00 29.00 12
|
83.00 7.00 12
|
||||||
11.00 12.00 13
|
91.00 93.00 13
|
||||||
12.00 43.00 14
|
90.00 0.00 14
|
||||||
83.00 43.00 15
|
27.00 40.00 15
|
||||||
34.00 36.00 16
|
47.00 6.00 16
|
||||||
33.00 59.00 17
|
58.00 23.00 17
|
||||||
75.00 93.00 18
|
56.00 49.00 18
|
||||||
1.00 31.00 19
|
88.00 28.00 19
|
||||||
53.00 97.00 20
|
56.00 0.00 20
|
||||||
75.00 18.00 21
|
71.00 10.00 21
|
||||||
3.00 18.00 22
|
27.00 38.00 22
|
||||||
86.00 16.00 23
|
90.00 73.00 23
|
||||||
42.00 19.00 24
|
89.00 80.00 24
|
||||||
55.00 70.00 25
|
15.00 60.00 25
|
||||||
91.00 54.00 26
|
91.00 4.00 26
|
||||||
1.00 25.00 27
|
43.00 75.00 27
|
||||||
35.00 13.00 28
|
12.00 86.00 28
|
||||||
37.00 48.00 29
|
20.00 54.00 29
|
||||||
56.00 20.00 30
|
38.00 99.00 30
|
||||||
43.00 42.00 31
|
94.00 85.00 31
|
||||||
9.00 77.00 32
|
5.00 4.00 32
|
||||||
2.00 36.00 33
|
8.00 13.00 33
|
||||||
22.00 3.00 34
|
53.00 48.00 34
|
||||||
67.00 27.00 35
|
41.00 10.00 35
|
||||||
0.00 42.00 36
|
48.00 12.00 36
|
||||||
45.00 56.00 37
|
72.00 75.00 37
|
||||||
12.00 84.00 38
|
50.00 63.00 38
|
||||||
72.00 54.00 39
|
1.00 92.00 39
|
||||||
55.00 28.00 40
|
95.00 68.00 40
|
||||||
24.00 98.00 41
|
52.00 87.00 41
|
||||||
34.00 26.00 42
|
73.00 47.00 42
|
||||||
23.00 70.00 43
|
62.00 37.00 43
|
||||||
91.00 61.00 44
|
85.00 34.00 44
|
||||||
18.00 99.00 45
|
91.00 23.00 45
|
||||||
33.00 13.00 46
|
33.00 38.00 46
|
||||||
42.00 42.00 47
|
42.00 20.00 47
|
||||||
90.00 44.00 48
|
4.00 48.00 48
|
||||||
78.00 64.00 49
|
68.00 98.00 49
|
||||||
99.00 97.00 18
|
10.00 68.00 50
|
||||||
92.00 51.00 26
|
10.00 82.00 51
|
||||||
91.00 89.00 18
|
96.00 13.00 52
|
||||||
7.00 3.00 4
|
45.00 97.00 53
|
||||||
25.00 80.00 10
|
5.00 41.00 54
|
||||||
57.00 80.00 11
|
65.00 9.00 55
|
||||||
60.00 34.00 3
|
28.00 90.00 56
|
||||||
79.00 46.00 15
|
8.00 42.00 57
|
||||||
12.00 54.00 14
|
79.00 93.00 58
|
||||||
16.00 3.00 34
|
76.00 71.00 59
|
||||||
15.00 86.00 38
|
68.00 61.00 10
|
||||||
54.00 49.00 3
|
61.00 80.00 7
|
||||||
0.00 48.00 36
|
52.00 55.00 18
|
||||||
92.00 22.00 23
|
0.00 9.00 32
|
||||||
59.00 43.00 3
|
3.00 20.00 6
|
||||||
19.00 51.00 14
|
7.00 13.00 33
|
||||||
95.00 11.00 23
|
88.00 17.00 45
|
||||||
92.00 54.00 26
|
96.00 84.00 31
|
||||||
66.00 18.00 21
|
82.00 93.00 58
|
||||||
86.00 24.00 12
|
33.00 39.00 46
|
||||||
50.00 98.00 20
|
34.00 51.00 15
|
||||||
58.00 81.00 11
|
0.00 14.00 33
|
||||||
45.00 70.00 11
|
41.00 8.00 35
|
||||||
36.00 61.00 17
|
56.00 21.00 17
|
||||||
25.00 3.00 34
|
53.00 84.00 41
|
||||||
48.00 31.00 40
|
44.00 73.00 27
|
||||||
4.00 0.00 4
|
98.00 57.00 40
|
||||||
80.00 48.00 15
|
53.00 50.00 34
|
||||||
94.00 24.00 23
|
12.00 53.00 25
|
||||||
70.00 53.00 39
|
59.00 16.00 17
|
||||||
68.00 41.00 2
|
73.00 18.00 21
|
||||||
56.00 15.00 30
|
81.00 14.00 12
|
||||||
4.00 49.00 36
|
36.00 29.00 46
|
||||||
69.00 71.00 49
|
98.00 70.00 40
|
||||||
19.00 8.00 34
|
23.00 84.00 56
|
||||||
47.00 69.00 25
|
62.00 9.00 55
|
||||||
6.00 5.00 4
|
35.00 62.00 3
|
||||||
3.00 51.00 36
|
24.00 28.00 22
|
||||||
27.00 39.00 9
|
71.00 32.00 43
|
||||||
65.00 4.00 21
|
1.00 76.00 51
|
||||||
94.00 65.00 44
|
69.00 45.00 42
|
||||||
35.00 99.00 0
|
50.00 67.00 38
|
||||||
65.00 15.00 21
|
2.00 3.00 32
|
||||||
47.00 59.00 37
|
69.00 67.00 10
|
||||||
40.00 69.00 10
|
9.00 29.00 6
|
||||||
65.00 60.00 6
|
35.00 82.00 11
|
||||||
10.00 21.00 8
|
99.00 16.00 52
|
||||||
27.00 67.00 10
|
48.00 35.00 34
|
||||||
70.00 48.00 39
|
98.00 47.00 9
|
||||||
38.00 41.00 47
|
58.00 21.00 17
|
||||||
56.00 85.00 11
|
|
||||||
63.00 63.00 6
|
|
||||||
42.00 66.00 37
|
|
||||||
66.00 21.00 35
|
|
||||||
57.00 31.00 40
|
|
||||||
25.00 51.00 17
|
|
||||||
96.00 12.00 23
|
|
||||||
2.00 13.00 4
|
|
||||||
28.00 49.00 29
|
|
||||||
25.00 20.00 42
|
|
||||||
18.00 90.00 38
|
|
||||||
32.00 81.00 0
|
|
||||||
11.00 59.00 14
|
|
||||||
48.00 34.00 1
|
|
||||||
7.00 38.00 33
|
|
||||||
27.00 64.00 43
|
|
||||||
75.00 90.00 18
|
|
||||||
79.00 17.00 21
|
|
||||||
8.00 45.00 14
|
|
||||||
90.00 65.00 44
|
|
||||||
29.00 67.00 10
|
|
||||||
69.00 77.00 25
|
|
||||||
79.00 71.00 49
|
|
||||||
91.00 59.00 44
|
|
||||||
73.00 68.00 49
|
|
||||||
79.00 43.00 15
|
|
||||||
10.00 11.00 13
|
|
||||||
24.00 21.00 8
|
|
||||||
70.00 72.00 49
|
|
||||||
7.00 78.00 32
|
|
||||||
62.00 87.00 20
|
|
||||||
94.00 37.00 48
|
|
||||||
77.00 73.00 49
|
|
||||||
6.00 86.00 38
|
|
||||||
70.00 96.00 18
|
|
||||||
3.00 99.00 45
|
|
||||||
63.00 72.00 25
|
|
||||||
29.00 95.00 0
|
|
||||||
96.00 72.00 44
|
|
||||||
54.00 69.00 25
|
|
||||||
40.00 34.00 16
|
|
||||||
12.00 50.00 14
|
|
||||||
97.00 89.00 18
|
|
||||||
23.00 20.00 8
|
|
||||||
13.00 83.00 38
|
|
||||||
50.00 76.00 11
|
|
||||||
70.00 44.00 2
|
|
||||||
13.00 47.00 14
|
|
||||||
17.00 20.00 8
|
|
||||||
85.00 39.00 15
|
|
||||||
91.00 32.00 12
|
|
||||||
65.00 20.00 35
|
|
||||||
27.00 61.00 17
|
|
||||||
92.00 33.00 48
|
|
||||||
82.00 32.00 12
|
|
||||||
67.00 47.00 6
|
|
||||||
34.00 17.00 28
|
|
||||||
36.00 57.00 17
|
|
||||||
37.00 49.00 29
|
|
||||||
40.00 87.00 5
|
|
||||||
25.00 62.00 43
|
|
||||||
31.00 91.00 0
|
|
||||||
10.00 0.00 4
|
|
||||||
11.00 47.00 14
|
|
||||||
91.00 31.00 12
|
|
||||||
88.00 82.00 18
|
|
||||||
63.00 54.00 6
|
|
||||||
2.00 42.00 36
|
|
||||||
67.00 94.00 18
|
|
||||||
76.00 50.00 39
|
|
||||||
78.00 95.00 18
|
|
||||||
97.00 12.00 23
|
|
||||||
64.00 33.00 35
|
|
||||||
70.00 1.00 21
|
|
||||||
34.00 62.00 17
|
|
||||||
40.00 12.00 7
|
|
||||||
25.00 23.00 42
|
|
||||||
3.00 87.00 38
|
|
||||||
23.00 66.00 43
|
|
||||||
86.00 67.00 44
|
|
||||||
97.00 75.00 44
|
|
||||||
49.00 13.00 7
|
|
||||||
81.00 52.00 15
|
|
||||||
7.00 48.00 14
|
|
||||||
46.00 35.00 1
|
|
||||||
50.00 25.00 40
|
|
||||||
31.00 47.00 29
|
|
||||||
89.00 95.00 18
|
|
||||||
32.00 59.00 17
|
|
||||||
49.00 19.00 7
|
|
||||||
74.00 89.00 18
|
|
||||||
31.00 99.00 41
|
|
||||||
13.00 34.00 14
|
|
||||||
38.00 88.00 0
|
|
||||||
52.00 24.00 40
|
|
||||||
55.00 49.00 3
|
|
||||||
51.00 57.00 37
|
|
||||||
14.00 32.00 8
|
|
||||||
9.00 22.00 8
|
|
||||||
33.00 7.00 28
|
|
||||||
|
|||||||
@@ -147,8 +147,6 @@ static int BNC_solve_node(struct BNC *bnc, int depth)
|
|||||||
bnc->best_x = x;
|
bnc->best_x = x;
|
||||||
x = 0;
|
x = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
log_info("Found a better integral solution:\n");
|
log_info("Found a better integral solution:\n");
|
||||||
log_info(" obj val = %.2lf **\n", objval);
|
log_info(" obj val = %.2lf **\n", objval);
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ int GTSP_create_random_problem(
|
|||||||
struct Graph *graph = 0;
|
struct Graph *graph = 0;
|
||||||
|
|
||||||
int edge_count = (node_count * (node_count - 1)) / 2;
|
int edge_count = (node_count * (node_count - 1)) / 2;
|
||||||
http://ns-webapp-b.private.uwaterloo.ca/wifisetup/index.html?cmd=login&switchip=fd74:6b6a:8eca:402::6&mac=44:6d:57:16:be:2a&ip=2620:101:f000:701::5d3c:2c75&essid=uw-wifi-setup-no-encrypt&apname=ENG-AP-E5-5--E&apgroup=E5&url=http%3A%2F%2Fwww%2Egstatic%2Ecom%2Fgenerate_204
|
|
||||||
graph = (struct Graph *) malloc(sizeof(struct Graph));
|
graph = (struct Graph *) malloc(sizeof(struct Graph));
|
||||||
abort_if(!graph, "could not allocate graph\n");
|
abort_if(!graph, "could not allocate graph\n");
|
||||||
|
|
||||||
@@ -619,11 +618,14 @@ int GTSP_main(int argc, char **argv)
|
|||||||
int init_val ;
|
int init_val ;
|
||||||
|
|
||||||
init_val = inital_tour_value(&data);
|
init_val = inital_tour_value(&data);
|
||||||
|
log_info("Writing random instance to file gtsp.in\n");
|
||||||
|
rval = GTSP_write_problem(&data, "gtsp.in");
|
||||||
|
|
||||||
char filename[100];
|
char filename[100];
|
||||||
sprintf(filename, "input/gtsp-m%d-n%d-s%d.in", input_cluster_count,
|
sprintf(filename, "input/gtsp-m%d-n%d-s%d.in", input_cluster_count,
|
||||||
input_node_count, SEED);
|
input_node_count, SEED);
|
||||||
log_info("Writing random instance to file %s\n", filename);
|
log_info("Writing random instance to file %s\n", filename);
|
||||||
|
|
||||||
rval = GTSP_write_problem(&data, filename);
|
rval = GTSP_write_problem(&data, filename);
|
||||||
abort_if(rval, "GTSP_write_problem failed");
|
abort_if(rval, "GTSP_write_problem failed");
|
||||||
|
|
||||||
@@ -883,7 +885,7 @@ int Larg_neighborhood_search(int* tour, struct GTSP *data){
|
|||||||
|
|
||||||
|
|
||||||
//LNS starts
|
//LNS starts
|
||||||
for(int iter = 0; iter < 500; iter++){
|
for(int iter = 0; iter < 1000; iter++){
|
||||||
//Delete a vertex
|
//Delete a vertex
|
||||||
int delete_vertex = rand()%(data->cluster_count - 1) + 1;
|
int delete_vertex = rand()%(data->cluster_count - 1) + 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user