Simulated annealing: Difference between revisions
Content deleted Content added
J: bugfix (city ids are values in s not indexes into s) |
|||
Line 214:
for_k. 1+i.x do.
T=. kT*1-k%x
u=. ({~ ?@#
v=. ({~ ?@#)I.u{neighbors
sk=. (<
dk=. pathcost sk
dE=. dk-d
Line 243:
<lang J> 1e6 satsp dist
100000 0.9
200000 0.8
300000 0.7
400000 0.6
500000 0.5
600000 0.4
700000 0.3
800000 0.2
900000 0.1
1e6 0
0 10 11 21 20 30 31 32 33 34 35 45 55 65 66 67 77 87 88 78 68 59 69 79 89 99 98 97 96 86 76 75 85 95 94 84 83 93 92 91 90 80 70 71 81 82 72 62 52 51 61 60 50 40 41 42 43 53 63 73 74 64 54 44 46 36 37 27 16 6 7 8 9 19 29 39 49 58 57 56 47 48 38 28 18 17 26 25 15 5 4 14 24 23 22 12 13 3 2 1 0</lang>
|