-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTraveling Salesman Error.txt
153 lines (147 loc) · 2.67 KB
/
Traveling Salesman Error.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
80.0
[('84', '24'), ('84', '29')]
5.0
[('84', '24'), ('84', '34')]
10.0
[('84', '24'), ('84', '38')]
14.0
[('84', '24'), ('84', '6')]
18.0
[('84', '24'), ('107', '27')]
23.0
14
Next Step
[('84', '29'), ('0', '13')]
86.0
[('84', '29'), ('0', '26')]
84.0
[('84', '29'), ('0', '27')]
84.0
[('84', '29'), ('2', '0')]
87.0
[('84', '29'), ('5', '13')]
81.0
[('84', '29'), ('5', '19')]
80.0
[('84', '29'), ('5', '25')]
79.0
[('84', '29'), ('5', '31')]
79.0
[('84', '29'), ('8', '0')]
81.0
[('84', '29'), ('84', '34')]
5.0
[('84', '29'), ('84', '38')]
9.0
[('84', '29'), ('84', '6')]
23.0
[('84', '29'), ('107', '27')]
23.0
13
Next Step
[('84', '34'), ('0', '13')]
87.0
[('84', '34'), ('0', '26')]
84.0
[('84', '34'), ('0', '27')]
84.0
[('84', '34'), ('2', '0')]
89.0
[('84', '34'), ('5', '13')]
82.0
[('84', '34'), ('5', '19')]
80.0
[('84', '34'), ('5', '25')]
80.0
[('84', '34'), ('5', '31')]
79.0
[('84', '34'), ('8', '0')]
83.0
[('84', '34'), ('84', '38')]
4.0
[('84', '34'), ('84', '6')]
28.0
[('84', '34'), ('107', '27')]
24.0
12
Next Step
[('84', '38'), ('0', '13')]
88.0
[('84', '38'), ('0', '26')]
85.0
[('84', '38'), ('0', '27')]
85.0
[('84', '38'), ('2', '0')]
90.0
[('84', '38'), ('5', '13')]
83.0
[('84', '38'), ('5', '19')]
81.0
[('84', '38'), ('5', '25')]
80.0
[('84', '38'), ('5', '31')]
79.0
[('84', '38'), ('8', '0')]
85.0
[('84', '38'), ('84', '6')]
32.0
[('84', '38'), ('107', '27')]
25.0
11
Next Step
[('84', '6'), ('0', '13')]
84.0
[('84', '6'), ('0', '26')]
86.0
[('84', '6'), ('0', '27')]
87.0
[('84', '6'), ('2', '0')]
82.0
[('84', '6'), ('5', '13')]
79.0
[('84', '6'), ('5', '19')]
80.0
[('84', '6'), ('5', '25')]
81.0
[('84', '6'), ('5', '31')]
83.0
[('84', '6'), ('8', '0')]
76.0
[('84', '6'), ('107', '27')]
31.0
10
Next Step
[('107', '27'), ('0', '13')]
108.0
[('107', '27'), ('0', '26')]
107.0
[('107', '27'), ('0', '27')]
107.0
[('107', '27'), ('2', '0')]
108.0
[('107', '27'), ('5', '13')]
103.0
[('107', '27'), ('5', '19')]
102.0
[('107', '27'), ('5', '25')]
102.0
[('107', '27'), ('5', '31')]
102.0
[('107', '27'), ('8', '0')]
103.0
9
Next Step
WHY DOES THIS FAIL WITH 9 CITIES LEFT
[(), ('0', '13')]
Traceback (most recent call last):
File "traveling_salesman_PA.py", line 160, in <module>
algorithm_choice()
File "traveling_salesman_PA.py", line 25, in algorithm_choice
Path = nearest_neighbor()
File "traveling_salesman_PA.py", line 103, in nearest_neighbor
print neighbor_measure(d)
File "traveling_salesman_PA.py", line 124, in neighbor_measure
distance += round(( (float(Path_Tuples[0][0]) - float(Path_Tuples[1][0]))**2 + (float(Path_Tuple
s[0][1]) - float(Path_Tuples[1][1]))**2 )**.5)
IndexError: tuple index out of range
C:\Users\patwater\Documents\GitHub\PA_GA_DS_Work>