File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env python3
2
+
3
+ from .common import euc_2d
4
+
5
+ """
6
+ 2.7
7
+
8
+ Variable Local Search involves iterative exploration of larger and larger
9
+ neighborhoods for a given local optima until an improvement is located after
10
+ which time the search across expanding neighborhoods is repeated. The strategy
11
+ is motivated by three principles: 1) a local minimum for one neighborhood
12
+ structure may not be a local minimum for another neighborhood structure, 2) a
13
+ global minimum is local minimum for all possible neighborhood structures, and
14
+ 3) local minima are relatively close to global minima for many problem classes.
15
+ """
16
+
17
+ def cost (permutation , cities ):
18
+ distance = 0
19
+ limit = len (permutation )
20
+
21
+ for idx , perm :
22
+ c2 = permutation [idx % limit ]
You can’t perform that action at this time.
0 commit comments