Changeset 9443 for trunk/sources
- Timestamp:
- 05/06/13 09:59:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs
r9413 r9443 73 73 74 74 private static double CalculateRelativeDirected(Permutation left, Permutation right) { 75 int[] edges = new int[right.Length]; 76 for (int i = 0; i < right.Length; i++) 77 edges[right[i]] = right[(i + 1) % right.Length]; 75 int[] edgesR = CalculateEdgesVector(right); 76 int[] edgesL = CalculateEdgesVector(left); 78 77 79 78 double similarity = 0.0; 80 for (int i = 0; i < left.Length; i++) 81 if (left[(i + 1) % left.Length] == edges[left[i]]) similarity++; 79 for (int i = 0; i < left.Length; i++) { 80 if (edgesL[i] == edgesR[i]) similarity++; 81 } 82 82 83 83 return similarity / left.Length;
Note: See TracChangeset
for help on using the changeset viewer.