Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/26/10 00:04:24 (14 years ago)
Author:
abeham
Message:

updated permutation moves, fixed 3-opt #889

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/ThreeOpt/TSPThreeOptPathMoveEvaluator.cs

    r3209 r3221  
    5858        edge3target = permutation[move.Index3];
    5959      }
     60      if (move.Index1 == move.Index3
     61        || move.Index2 - move.Index1 >= permutation.Length - 2
     62        || move.Index1 == permutation.Length - 1 && move.Index3 == 0
     63        || move.Index1 == 0 && move.Index3 == permutation.Length - 1) return 0;
    6064      double moveQuality = 0;
    6165      // remove three edges
     
    9195      }
    9296      if (move.Index1 == move.Index3
    93         || move.Index2 - move.Index1 >= permutation.Length - 2) return 0;
     97        || move.Index2 - move.Index1 >= permutation.Length - 2
     98        || move.Index1 == permutation.Length - 1 && move.Index3 == 0
     99        || move.Index1 == 0 && move.Index3 == permutation.Length - 1) return 0;
    94100      double moveQuality = 0;
    95101      // remove three edges
Note: See TracChangeset for help on using the changeset viewer.