Выбор колеса рулетки в Генетическом алгоритме. Население должно быть отсортировано сначала?

Нет такой вещи как авторизация JWT.

JWT токены - это просто формат для распространения подписанных наборов заявок.

Правильный способ передачи токенов зависит от многих факторов, например, от того, где вы находитесь в потоке oauth, если транспорт зашифрован, если токены содержат личную информацию, и если ваш интерфейс - spa, native и т. Д. [112 ]

8
задан Jon Seigel 17 May 2010 в 03:49
поделиться

3 ответа

No, you don't actually need to sort them. You are exactly correct that it will have no effect if the higher-ranked members are grouped together or not (at least with a good random number generator :) ).

Your intuition is dead on here - statistically, it will have no effect to sort, and as you mention, you don't have to waste a bunch of time and effort sorting things!

3
ответ дан 5 December 2019 в 22:20
поделиться

You do not need to sort the population if you use such a selection.

And you are also correct about the complexity, a sort is n*log(n), making the genetic algorithm significantly slower (but still, the complexity remains polynomial, a critical feature of a genetic algorithms).

Here is how I would do it (and get extra points at school for this):

  1. implement a more generic solution using hooks - before mutation, after selection etc etc.

  2. measure the number of iterations and the speed of the algorithm / each iteration

  3. do your sorting in a hook. measure. now let the hook be empty and measure and so on.

You will get some nice data and experimentally verify what your intuition tells you.

1
ответ дан 5 December 2019 в 22:20
поделиться

Even if you apply elitism, there is no need to sort the population.

Finding the best N individuals only requires a single iteration through the population.

2
ответ дан 5 December 2019 в 22:20
поделиться
Другие вопросы по тегам:

Похожие вопросы: