Index: branches/GP-MoveOperators/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/ExhaustiveInsertionMoveGenerator.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/ExhaustiveInsertionMoveGenerator.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/ExhaustiveInsertionMoveGenerator.cs	(revision 8660)
@@ -21,4 +21,6 @@
 
 using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -39,33 +41,31 @@
     }
 
-    public static TranslocationMove[] Apply(Permutation permutation) {
+    public static IEnumerable<TranslocationMove> Generate(Permutation permutation) {
       int length = permutation.Length;
       if (length == 1) throw new ArgumentException("ExhaustiveInsertionMoveGenerator: There cannot be an insertion move given a permutation of length 1.", "permutation");
-      TranslocationMove[] moves = null;
-      int count = 0;
+
       if (permutation.PermutationType == PermutationTypes.Absolute) {
-        moves = new TranslocationMove[length * (length - 1)];
         for (int i = 0; i < length; i++) {
           for (int j = 1; j <= length - 1; j++) {
-            moves[count++] = new TranslocationMove(i, i, (i + j) % length);
+            yield return new TranslocationMove(i, i, (i + j) % length);
           }
         }
       } else {
         if (length > 2) {
-          moves = new TranslocationMove[length * (length - 1) - 2];
           for (int i = 0; i < length; i++) {
             for (int j = 1; j <= length - 1; j++) {
               if (i == 0 && j == length - 1
                 || i == length - 1 && j == 1) continue;
-              moves[count++] = new TranslocationMove(i, i, (i + j) % length);
+              yield return new TranslocationMove(i, i, (i + j) % length);
             }
           }
         } else { // doesn't make sense, but just create a dummy move to not crash the algorithms
-          moves = new TranslocationMove[1];
-          moves[0] = new TranslocationMove(0, 0, 1);
+          yield return new TranslocationMove(0, 0, 1);
         }
       }
-      System.Diagnostics.Debug.Assert(count == moves.Length);
-      return moves;
+    }
+
+    public static TranslocationMove[] Apply(Permutation permutation) {
+      return Generate(permutation).ToArray();
     }
 
Index: branches/GP-MoveOperators/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/ExhaustiveInversionMoveGenerator.cs
===================================================================
--- branches/GP-MoveOperators/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/ExhaustiveInversionMoveGenerator.cs	(revision 7801)
+++ branches/GP-MoveOperators/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/ExhaustiveInversionMoveGenerator.cs	(revision 8660)
@@ -21,4 +21,6 @@
 
 using System;
+using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -40,32 +42,30 @@
 
     public static InversionMove[] Apply(Permutation permutation) {
+      return Generate(permutation).ToArray();
+    }
+
+    public static IEnumerable<InversionMove> Generate(Permutation permutation) {
       int length = permutation.Length;
       if (length == 1) throw new ArgumentException("ExhaustiveInversionMoveGenerator: There cannot be an inversion move given a permutation of length 1.", "permutation");
       int totalMoves = (length) * (length - 1) / 2;
-      InversionMove[] moves = null;
-      int count = 0;
 
       if (permutation.PermutationType == PermutationTypes.RelativeUndirected) {
         if (totalMoves - 3 > 0) {
-          moves = new InversionMove[totalMoves - 3];
           for (int i = 0; i < length - 1; i++) {
             for (int j = i + 1; j < length; j++) {
               // doesn't make sense to inverse the whole permutation or the whole but one in case of relative undirected permutations
               if (j - i >= length - 2) continue;
-              moves[count++] = new InversionMove(i, j);
+              yield return new InversionMove(i, j);
             }
           }
         } else { // when length is 3 or less, there's actually no difference, but for the sake of not crashing the algorithm create a dummy move
-          moves = new InversionMove[1];
-          moves[0] = new InversionMove(0, 1);
+          yield return new InversionMove(0, 1);
         }
       } else {
-        moves = new InversionMove[totalMoves];
         for (int i = 0; i < length - 1; i++)
           for (int j = i + 1; j < length; j++) {
-            moves[count++] = new InversionMove(i, j);
+            yield return new InversionMove(i, j);
           }
       }
-      return moves;
     }
 
