code: public static void randomShuffle(ArrayModifiableDBIDs ids, Random random, final int limit) {
      final int end = ids.size();
      for(int i = 1; i < limit; i++) {
        ids.swap(i - 1, i + random.nextInt(end - i));
      }
    }
docs: Produce a random shuffling of the given DBID array.
  
  Only the first {@code limit} elements will be fully randomized, but the
  remaining objects will also be changed.
  
  @param ids Original DBIDs, no duplicates allowed
  @param random Random generator
  @param limit Shuffling limit.