The solution of OneMax problem by genetic algorithm

# preparation

```
import random
import copy
```

```
# パラメータ
LIST_SIZE = 10       # 0/1のリスト長（遺伝子長）

POPULATION_SIZE = 10 # 集団の個体数
GENERATION = 25      # 世代数
MUTATE = 0.1         # 突然変異の確率
SELECT_RATE = 0.5    # 選択割合
```

# function

```
# 適応度を計算する
def calc_fitness(individual):
  return sum(individual)  # リスト要素の合計
```

```
# 集団を適応度順にソートする
def sort_fitness(population):
  # 適応度と個体をタプルにしてリストへ格納する
  fp = []
  for individual in population:
    fitness = calc_fitness(individual)
    fp.append((fitness, individual))
  fp.sort(reverse=True)  # 適用度でソート(降順)

  # ソートした個体を格納する集団
  sorted_population = []  
  
  # 個体を取り出し、集団に格納する
  for fitness, individual in fp:
    sorted_population.append(individual)
  return sorted_population
```

```
# （2）選択
# 適応度の高い個体を残す
def selection(population):
  sorted_population = sort_fitness(population)
  # 残す個体数。このプログラム
  # のパラメータでは、nは常に5
  n = int(POPULATION_SIZE * SELECT_RATE)  
  return sorted_population[0:n]
```

```
# （3）交叉
# まず、ind1をコピーして新しい個体indを作る
# その後、ランダムに決めたr1～r2の範囲を
# ind2の遺伝子に置き換える
def crossover(ind1, ind2):
  r1 = random.randint(0, LIST_SIZE - 1)
  r2 = random.randint(r1 + 1, LIST_SIZE)
  ind = copy.deepcopy(ind1)
  ind[r1:r2] = ind2[r1:r2]
  return ind
```

```
# （4）突然変異
# 突然変異確率(MUTATE)に従って突然変異させる
def mutation(ind1):
  ind2 = copy.deepcopy(ind1)
  for i in range(LIST_SIZE):
    if random.random() < MUTATE:
      ind2[i] = random.randint(0, 1)
  return ind2
```

# main

```
# メイン処理

# （1）初期集団を生成
population = []  # 集団
for i in range(POPULATION_SIZE):
  individual = []    # 個体
  for j in range(LIST_SIZE):
    # 0/1を乱数で追加
    individual.append(random.randint(0, 1))  
  population.append(individual)

print('----------\n初期集団 population')
for individual in population:
    print(individual,calc_fitness(individual))

for generation in range(GENERATION):
  print('\n----------\n'+str(generation + 1) + u"世代")
  
  # （2）選択
  print('\n選択 selection(population)')
  population = selection(population)
  for individual in population:
    print(individual,calc_fitness(individual))
    
  # 交叉と突然変異を繰り返す
  # 交叉と突然変異で増やす個体数
  # このプログラムのパラメータでは、nは常に5
  n = POPULATION_SIZE - len(population)  
  for i in range(n):
    # 集団から2個体をランダムに選び、
    # 交叉した個体を生成する
    r1 = random.randint(0, len(population) - 1)
    r2 = random.randint(0, len(population) - 1)
    # （3）交叉
    individual = \
      crossover(population[r1], population[r2])
    
    print('\n交叉 crossover(population[r1='+str(r1)+'], population[r2='+str(r2)+'])')
    print('\n  crossover(population[r1='+str(r1)+']')
    print('  ',population[r1],calc_fitness(population[r1]))
    print('\n  crossover(population[r2='+str(r2)+']')
    print('  ',population[r2],calc_fitness(population[r2]))
    print('\n  crossover(population[r1='+str(r1)+'], population[r2='+str(r2)+'])')
    print('  ',individual,calc_fitness(individual))
    
    # （4）突然変異
    individual = mutation(individual)  
    print('\n突然変異 mutation(individual)')
    print(individual,calc_fitness(individual))

    # 集団に追加する
    population.append(individual)  
    print('\n暫定結果 population')
    for individual in population:
        print(individual,calc_fitness(individual))
  
  print('\n最終結果 population')
  for individual in population:
    print(individual,calc_fitness(individual))
```

# result

```
----------
初期集団 population
[0, 0, 1, 1, 1, 1, 0, 0, 0, 1] 5
[0, 0, 1, 0, 1, 0, 1, 1, 1, 1] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 0, 0, 1, 0, 1, 0, 1, 0, 0] 3
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 0, 1, 0, 0, 0, 1, 0] 3
[0, 0, 1, 1, 1, 0, 1, 0, 1, 1] 6
[1, 0, 1, 1, 0, 0, 0, 1, 1, 0] 5
[0, 1, 0, 0, 1, 1, 0, 1, 0, 0] 4
[0, 1, 0, 0, 0, 1, 0, 1, 1, 0] 4

----------
1世代

選択 selection(population)
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 0, 1, 1, 1, 0, 1, 0, 1, 1] 6
[0, 0, 1, 0, 1, 0, 1, 1, 1, 1] 6
[1, 0, 1, 1, 0, 0, 0, 1, 1, 0] 5

交叉 crossover(population[r1=1], population[r2=3])

  crossover(population[r1=1]
   [1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6

  crossover(population[r2=3]
   [0, 0, 1, 0, 1, 0, 1, 1, 1, 1] 6

  crossover(population[r1=1], population[r2=3])
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 0, 1, 1, 1, 0, 1, 0, 1, 1] 6
[0, 0, 1, 0, 1, 0, 1, 1, 1, 1] 6
[1, 0, 1, 1, 0, 0, 0, 1, 1, 0] 5
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

交叉 crossover(population[r1=5], population[r2=0])

  crossover(population[r1=5]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r2=0]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r1=5], population[r2=0])
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 0] 7

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 0, 1, 1, 1, 0, 1, 0, 1, 1] 6
[0, 0, 1, 0, 1, 0, 1, 1, 1, 1] 6
[1, 0, 1, 1, 0, 0, 0, 1, 1, 0] 5
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

交叉 crossover(population[r1=4], population[r2=5])

  crossover(population[r1=4]
   [1, 0, 1, 1, 0, 0, 0, 1, 1, 0] 5

  crossover(population[r2=5]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r1=4], population[r2=5])
   [1, 0, 1, 1, 0, 0, 0, 1, 0, 0] 4

突然変異 mutation(individual)
[1, 0, 1, 1, 0, 0, 0, 1, 0, 0] 4

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 0, 1, 1, 1, 0, 1, 0, 1, 1] 6
[0, 0, 1, 0, 1, 0, 1, 1, 1, 1] 6
[1, 0, 1, 1, 0, 0, 0, 1, 1, 0] 5
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 0, 1, 1, 0, 0, 0, 1, 0, 0] 4

交叉 crossover(population[r1=7], population[r2=6])

  crossover(population[r1=7]
   [1, 0, 1, 1, 0, 0, 0, 1, 0, 0] 4

  crossover(population[r2=6]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r1=7], population[r2=6])
   [1, 0, 1, 1, 1, 0, 0, 1, 0, 0] 5

突然変異 mutation(individual)
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 0, 1, 1, 1, 0, 1, 0, 1, 1] 6
[0, 0, 1, 0, 1, 0, 1, 1, 1, 1] 6
[1, 0, 1, 1, 0, 0, 0, 1, 1, 0] 5
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 0, 1, 1, 0, 0, 0, 1, 0, 0] 4
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6

交叉 crossover(population[r1=1], population[r2=5])

  crossover(population[r1=1]
   [1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6

  crossover(population[r2=5]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r1=1], population[r2=5])
   [1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6

突然変異 mutation(individual)
[1, 1, 0, 1, 0, 1, 0, 1, 0, 0] 5

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 0, 1, 1, 1, 0, 1, 0, 1, 1] 6
[0, 0, 1, 0, 1, 0, 1, 1, 1, 1] 6
[1, 0, 1, 1, 0, 0, 0, 1, 1, 0] 5
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 0, 1, 1, 0, 0, 0, 1, 0, 0] 4
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 0, 1, 0, 0] 5

最終結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 0, 1, 1, 1, 0, 1, 0, 1, 1] 6
[0, 0, 1, 0, 1, 0, 1, 1, 1, 1] 6
[1, 0, 1, 1, 0, 0, 0, 1, 1, 0] 5
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 0, 1, 1, 0, 0, 0, 1, 0, 0] 4
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 0, 1, 0, 0] 5

----------
2世代

選択 selection(population)
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6

交叉 crossover(population[r1=3], population[r2=2])

  crossover(population[r1=3]
   [1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6

  crossover(population[r2=2]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r1=3], population[r2=2])
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 0, 1, 1, 0, 0] 5

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6
[0, 1, 0, 1, 1, 0, 1, 1, 0, 0] 5

交叉 crossover(population[r1=5], population[r2=3])

  crossover(population[r1=5]
   [0, 1, 0, 1, 1, 0, 1, 1, 0, 0] 5

  crossover(population[r2=3]
   [1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6

  crossover(population[r1=5], population[r2=3])
   [0, 1, 0, 1, 0, 1, 1, 1, 0, 0] 5

突然変異 mutation(individual)
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6
[0, 1, 0, 1, 1, 0, 1, 1, 0, 0] 5
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6

交叉 crossover(population[r1=0], population[r2=4])

  crossover(population[r1=0]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r2=4]
   [1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6

  crossover(population[r1=0], population[r2=4])
   [0, 1, 0, 1, 1, 1, 1, 0, 0, 0] 5

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 1, 1, 0, 0, 0] 5

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6
[0, 1, 0, 1, 1, 0, 1, 1, 0, 0] 5
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 1, 0, 1, 1, 1, 1, 0, 0, 0] 5

交叉 crossover(population[r1=4], population[r2=1])

  crossover(population[r1=4]
   [1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6

  crossover(population[r2=1]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r1=4], population[r2=1])
   [1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6

突然変異 mutation(individual)
[1, 0, 1, 1, 0, 1, 0, 1, 0, 0] 5

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6
[0, 1, 0, 1, 1, 0, 1, 1, 0, 0] 5
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 1, 0, 1, 1, 1, 1, 0, 0, 0] 5
[1, 0, 1, 1, 0, 1, 0, 1, 0, 0] 5

交叉 crossover(population[r1=6], population[r2=0])

  crossover(population[r1=6]
   [1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6

  crossover(population[r2=0]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r1=6], population[r2=0])
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 0] 7

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6
[0, 1, 0, 1, 1, 0, 1, 1, 0, 0] 5
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 1, 0, 1, 1, 1, 1, 0, 0, 0] 5
[1, 0, 1, 1, 0, 1, 0, 1, 0, 0] 5
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

最終結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 0, 1, 1, 1, 1, 0, 1, 0, 0] 6
[0, 1, 0, 1, 1, 0, 1, 1, 0, 0] 5
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[0, 1, 0, 1, 1, 1, 1, 0, 0, 0] 5
[1, 0, 1, 1, 0, 1, 0, 1, 0, 0] 5
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

----------
3世代

選択 selection(population)
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6

交叉 crossover(population[r1=3], population[r2=0])

  crossover(population[r1=3]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r2=0]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r1=3], population[r2=0])
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

交叉 crossover(population[r1=4], population[r2=1])

  crossover(population[r1=4]
   [1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6

  crossover(population[r2=1]
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

  crossover(population[r1=4], population[r2=1])
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

交叉 crossover(population[r1=2], population[r2=6])

  crossover(population[r1=2]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r2=6]
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

  crossover(population[r1=2], population[r2=6])
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

交叉 crossover(population[r1=0], population[r2=0])

  crossover(population[r1=0]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r2=0]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r1=0], population[r2=0])
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

交叉 crossover(population[r1=5], population[r2=5])

  crossover(population[r1=5]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r2=5]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r1=5], population[r2=5])
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

最終結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 0, 1, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

----------
4世代

選択 selection(population)
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

交叉 crossover(population[r1=3], population[r2=4])

  crossover(population[r1=3]
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

  crossover(population[r2=4]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r1=3], population[r2=4])
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

交叉 crossover(population[r1=5], population[r2=5])

  crossover(population[r1=5]
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

  crossover(population[r2=5]
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

  crossover(population[r1=5], population[r2=5])
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7

交叉 crossover(population[r1=1], population[r2=0])

  crossover(population[r1=1]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r2=0]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r1=1], population[r2=0])
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 0, 0, 0, 1, 1] 5

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 0, 0, 0, 1, 1] 5

交叉 crossover(population[r1=0], population[r2=4])

  crossover(population[r1=0]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r2=4]
   [1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6

  crossover(population[r1=0], population[r2=4])
   [0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 0, 0, 0, 1, 1] 5
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7

交叉 crossover(population[r1=3], population[r2=7])

  crossover(population[r1=3]
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

  crossover(population[r2=7]
   [0, 1, 0, 1, 1, 0, 0, 0, 1, 1] 5

  crossover(population[r1=3], population[r2=7])
   [1, 1, 0, 1, 1, 0, 0, 0, 0, 0] 4

突然変異 mutation(individual)
[1, 0, 0, 1, 1, 0, 0, 0, 1, 0] 4

暫定結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 0, 0, 0, 1, 1] 5
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7
[1, 0, 0, 1, 1, 0, 0, 0, 1, 0] 4

最終結果 population
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 0, 1, 1, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 0, 0, 0, 1, 1] 5
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7
[1, 0, 0, 1, 1, 0, 0, 0, 1, 0] 4

----------
5世代

選択 selection(population)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

交叉 crossover(population[r1=4], population[r2=4])

  crossover(population[r1=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

  crossover(population[r2=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

  crossover(population[r1=4], population[r2=4])
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

交叉 crossover(population[r1=1], population[r2=1])

  crossover(population[r1=1]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r2=1]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r1=1], population[r2=1])
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

交叉 crossover(population[r1=2], population[r2=2])

  crossover(population[r1=2]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r2=2]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r1=2], population[r2=2])
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6

交叉 crossover(population[r1=1], population[r2=0])

  crossover(population[r1=1]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r2=0]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7

  crossover(population[r1=1], population[r2=0])
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

交叉 crossover(population[r1=7], population[r2=5])

  crossover(population[r1=7]
   [0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6

  crossover(population[r2=5]
   [1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6

  crossover(population[r1=7], population[r2=5])
   [1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

最終結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 1, 1, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 0, 0] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

----------
6世代

選択 selection(population)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

交叉 crossover(population[r1=0], population[r2=0])

  crossover(population[r1=0]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=0]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=0], population[r2=0])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6

交叉 crossover(population[r1=3], population[r2=2])

  crossover(population[r1=3]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r2=2]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7

  crossover(population[r1=3], population[r2=2])
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

交叉 crossover(population[r1=6], population[r2=4])

  crossover(population[r1=6]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r2=4]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r1=6], population[r2=4])
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6

交叉 crossover(population[r1=0], population[r2=2])

  crossover(population[r1=0]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=2]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7

  crossover(population[r1=0], population[r2=2])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

交叉 crossover(population[r1=5], population[r2=5])

  crossover(population[r1=5]
   [1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6

  crossover(population[r2=5]
   [1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6

  crossover(population[r1=5], population[r2=5])
   [1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6

突然変異 mutation(individual)
[1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6

最終結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 0, 1, 1, 1, 0, 0, 1] 6

----------
7世代

選択 selection(population)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

交叉 crossover(population[r1=1], population[r2=0])

  crossover(population[r1=1]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=0]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=1], population[r2=0])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

交叉 crossover(population[r1=5], population[r2=5])

  crossover(population[r1=5]
   [1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

  crossover(population[r2=5]
   [1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

  crossover(population[r1=5], population[r2=5])
   [1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

交叉 crossover(population[r1=4], population[r2=4])

  crossover(population[r1=4]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r2=4]
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

  crossover(population[r1=4], population[r2=4])
   [0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7

交叉 crossover(population[r1=5], population[r2=2])

  crossover(population[r1=5]
   [1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

  crossover(population[r2=2]
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

  crossover(population[r1=5], population[r2=2])
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

交叉 crossover(population[r1=0], population[r2=8])

  crossover(population[r1=0]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=8]
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

  crossover(population[r1=0], population[r2=8])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6

最終結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[0, 1, 0, 1, 1, 1, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6

----------
8世代

選択 selection(population)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7

交叉 crossover(population[r1=2], population[r2=0])

  crossover(population[r1=2]
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

  crossover(population[r2=0]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=2], population[r2=0])
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

交叉 crossover(population[r1=1], population[r2=5])

  crossover(population[r1=1]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=5]
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

  crossover(population[r1=1], population[r2=5])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

交叉 crossover(population[r1=6], population[r2=5])

  crossover(population[r1=6]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=5]
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

  crossover(population[r1=6], population[r2=5])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6

交叉 crossover(population[r1=0], population[r2=0])

  crossover(population[r1=0]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=0]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=0], population[r2=0])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

交叉 crossover(population[r1=2], population[r2=8])

  crossover(population[r1=2]
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

  crossover(population[r2=8]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=2], population[r2=8])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 0, 1, 1, 0, 1, 1] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 0, 1, 1, 0, 1, 1] 7

最終結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 0, 1, 1] 6
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 0, 1, 1, 0, 1, 1] 7

----------
9世代

選択 selection(population)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

交叉 crossover(population[r1=1], population[r2=4])

  crossover(population[r1=1]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=4]
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

  crossover(population[r1=1], population[r2=4])
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6

交叉 crossover(population[r1=2], population[r2=1])

  crossover(population[r1=2]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=1]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=2], population[r2=1])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=5], population[r2=5])

  crossover(population[r1=5]
   [0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6

  crossover(population[r2=5]
   [0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6

  crossover(population[r1=5], population[r2=5])
   [0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6

突然変異 mutation(individual)
[0, 1, 0, 1, 1, 0, 0, 1, 0, 1] 5

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[0, 1, 0, 1, 1, 0, 0, 1, 0, 1] 5

交叉 crossover(population[r1=6], population[r2=2])

  crossover(population[r1=6]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r2=2]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=6], population[r2=2])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[0, 1, 0, 1, 1, 0, 0, 1, 0, 1] 5
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

交叉 crossover(population[r1=6], population[r2=5])

  crossover(population[r1=6]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r2=5]
   [0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6

  crossover(population[r1=6], population[r2=5])
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[0, 1, 0, 1, 1, 0, 0, 1, 0, 1] 5
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

最終結果 population
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[0, 1, 0, 1, 1, 0, 1, 1, 0, 1] 6
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[0, 1, 0, 1, 1, 0, 0, 1, 0, 1] 5
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

----------
10世代

選択 selection(population)
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

交叉 crossover(population[r1=1], population[r2=4])

  crossover(population[r1=1]
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

  crossover(population[r2=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=1], population[r2=4])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7

交叉 crossover(population[r1=4], population[r2=0])

  crossover(population[r1=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=0]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r1=4], population[r2=0])
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

交叉 crossover(population[r1=4], population[r2=4])

  crossover(population[r1=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=4], population[r2=4])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8

交叉 crossover(population[r1=7], population[r2=5])

  crossover(population[r1=7]
   [1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8

  crossover(population[r2=5]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7

  crossover(population[r1=7], population[r2=5])
   [1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

交叉 crossover(population[r1=8], population[r2=4])

  crossover(population[r1=8]
   [1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

  crossover(population[r2=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=8], population[r2=4])
   [1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

最終結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 0] 7
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7
[1, 1, 0, 1, 1, 0, 1, 0, 1, 1] 7

----------
11世代

選択 selection(population)
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

交叉 crossover(population[r1=2], population[r2=4])

  crossover(population[r1=2]
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

  crossover(population[r2=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=2], population[r2=4])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

交叉 crossover(population[r1=4], population[r2=2])

  crossover(population[r1=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=2]
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

  crossover(population[r1=4], population[r2=2])
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 0, 1, 1, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 0, 1, 1, 1, 1, 1, 1] 8

交叉 crossover(population[r1=0], population[r2=2])

  crossover(population[r1=0]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r2=2]
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

  crossover(population[r1=0], population[r2=2])
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 0, 1, 1, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=2], population[r2=0])

  crossover(population[r1=2]
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

  crossover(population[r2=0]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r1=2], population[r2=0])
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 0, 1, 1, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7

交叉 crossover(population[r1=1], population[r2=4])

  crossover(population[r1=1]
   [1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8

  crossover(population[r2=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r1=1], population[r2=4])
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 0, 1, 1, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

最終結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 0, 1, 1, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

----------
12世代

選択 selection(population)
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

交叉 crossover(population[r1=1], population[r2=3])

  crossover(population[r1=1]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r2=3]
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

  crossover(population[r1=1], population[r2=3])
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=2], population[r2=0])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8

  crossover(population[r2=0]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r1=2], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=4], population[r2=3])

  crossover(population[r1=4]
   [1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8

  crossover(population[r2=3]
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

  crossover(population[r1=4], population[r2=3])
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

突然変異 mutation(individual)
[1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7

交叉 crossover(population[r1=3], population[r2=7])

  crossover(population[r1=3]
   [1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8

  crossover(population[r2=7]
   [1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7

  crossover(population[r1=3], population[r2=7])
   [1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7

突然変異 mutation(individual)
[0, 1, 0, 1, 0, 1, 1, 1, 0, 1] 6

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7
[0, 1, 0, 1, 0, 1, 1, 1, 0, 1] 6

交叉 crossover(population[r1=1], population[r2=1])

  crossover(population[r1=1]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r2=1]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r1=1], population[r2=1])
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

突然変異 mutation(individual)
[1, 0, 0, 1, 1, 1, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7
[0, 1, 0, 1, 0, 1, 1, 1, 0, 1] 6
[1, 0, 0, 1, 1, 1, 1, 1, 1, 1] 8

最終結果 population
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 0, 1, 1, 1, 1, 0, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 0, 1, 1, 1, 0, 1] 7
[0, 1, 0, 1, 0, 1, 1, 1, 0, 1] 6
[1, 0, 0, 1, 1, 1, 1, 1, 1, 1] 8

----------
13世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8

交叉 crossover(population[r1=0], population[r2=0])

  crossover(population[r1=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=0], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

交叉 crossover(population[r1=1], population[r2=4])

  crossover(population[r1=1]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r2=4]
   [1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8

  crossover(population[r1=1], population[r2=4])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=4], population[r2=3])

  crossover(population[r1=4]
   [1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8

  crossover(population[r2=3]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r1=4], population[r2=3])
   [1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

突然変異 mutation(individual)
[0, 1, 1, 1, 1, 0, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[0, 1, 1, 1, 1, 0, 1, 1, 1, 1] 8

交叉 crossover(population[r1=3], population[r2=7])

  crossover(population[r1=3]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r2=7]
   [0, 1, 1, 1, 1, 0, 1, 1, 1, 1] 8

  crossover(population[r1=3], population[r2=7])
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 1, 1, 1, 1, 0] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[0, 1, 1, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 0] 8

交叉 crossover(population[r1=6], population[r2=4])

  crossover(population[r1=6]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=4]
   [1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8

  crossover(population[r1=6], population[r2=4])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[0, 1, 1, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 0, 1, 0, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[0, 1, 1, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 0, 1, 1, 1, 1, 1, 1, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

----------
14世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=1], population[r2=2])

  crossover(population[r1=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

  crossover(population[r1=1], population[r2=2])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=4], population[r2=2])

  crossover(population[r1=4]
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

  crossover(population[r1=4], population[r2=2])
   [1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9

突然変異 mutation(individual)
[1, 1, 0, 1, 0, 1, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 0, 1, 1, 1, 1, 1] 8

交叉 crossover(population[r1=1], population[r2=2])

  crossover(population[r1=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

  crossover(population[r1=1], population[r2=2])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 0, 1, 1, 1, 0, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 0, 1, 1, 1, 1, 1] 8
[1, 0, 1, 1, 1, 0, 1, 1, 1, 1] 8

交叉 crossover(population[r1=6], population[r2=6])

  crossover(population[r1=6]
   [1, 1, 0, 1, 0, 1, 1, 1, 1, 1] 8

  crossover(population[r2=6]
   [1, 1, 0, 1, 0, 1, 1, 1, 1, 1] 8

  crossover(population[r1=6], population[r2=6])
   [1, 1, 0, 1, 0, 1, 1, 1, 1, 1] 8

突然変異 mutation(individual)
[1, 0, 0, 1, 0, 1, 1, 1, 1, 1] 7

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 0, 1, 1, 1, 1, 1] 8
[1, 0, 1, 1, 1, 0, 1, 1, 1, 1] 8
[1, 0, 0, 1, 0, 1, 1, 1, 1, 1] 7

交叉 crossover(population[r1=0], population[r2=3])

  crossover(population[r1=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

  crossover(population[r1=0], population[r2=3])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 0, 1, 1, 1, 1, 1] 8
[1, 0, 1, 1, 1, 0, 1, 1, 1, 1] 8
[1, 0, 0, 1, 0, 1, 1, 1, 1, 1] 7
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 0, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 1, 0, 1, 0, 1, 1, 1, 1, 1] 8
[1, 0, 1, 1, 1, 0, 1, 1, 1, 1] 8
[1, 0, 0, 1, 0, 1, 1, 1, 1, 1] 7
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

----------
15世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

交叉 crossover(population[r1=3], population[r2=1])

  crossover(population[r1=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

  crossover(population[r2=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=3], population[r2=1])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=5], population[r2=2])

  crossover(population[r1=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=5], population[r2=2])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=1], population[r2=2])

  crossover(population[r1=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=1], population[r2=2])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 0, 1, 1, 1, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 0, 1, 1, 1, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=6], population[r2=3])

  crossover(population[r1=6]
   [1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r2=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

  crossover(population[r1=6], population[r2=3])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 0, 1, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=1], population[r2=4])

  crossover(population[r1=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

  crossover(population[r1=1], population[r2=4])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 0, 1, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 0, 1, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

----------
16世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=3], population[r2=0])

  crossover(population[r1=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=3], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=2], population[r2=4])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=4])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=4], population[r2=3])

  crossover(population[r1=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=4], population[r2=3])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 0, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 0, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=5], population[r2=5])

  crossover(population[r1=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=5], population[r2=5])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 0, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 0, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 0, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=2], population[r2=0])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 0, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 0, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 0, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 0, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

----------
17世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=2], population[r2=2])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=2])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=2], population[r2=3])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=3])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=5], population[r2=6])

  crossover(population[r1=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=6]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=5], population[r2=6])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=6], population[r2=4])

  crossover(population[r1=6]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=6], population[r2=4])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

交叉 crossover(population[r1=2], population[r2=2])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=2])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

----------
18世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=4], population[r2=0])

  crossover(population[r1=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=4], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=2], population[r2=2])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=2])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=3], population[r2=4])

  crossover(population[r1=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=3], population[r2=4])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

交叉 crossover(population[r1=7], population[r2=0])

  crossover(population[r1=7]
   [1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

  crossover(population[r2=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=7], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9

突然変異 mutation(individual)
[1, 0, 1, 0, 1, 1, 1, 1, 0, 1] 7

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 0, 1, 0, 1, 1, 1, 1, 0, 1] 7

交叉 crossover(population[r1=2], population[r2=3])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=3])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 0, 1, 0, 1, 1, 1, 1, 0, 1] 7
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 1] 9
[1, 0, 1, 0, 1, 1, 1, 1, 0, 1] 7
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

----------
19世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=0], population[r2=1])

  crossover(population[r1=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=0], population[r2=1])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

交叉 crossover(population[r1=2], population[r2=1])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=1])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=5], population[r2=1])

  crossover(population[r1=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

  crossover(population[r2=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=5], population[r2=1])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

交叉 crossover(population[r1=6], population[r2=6])

  crossover(population[r1=6]
   [0, 1, 1, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r2=6]
   [0, 1, 1, 1, 1, 1, 1, 1, 1, 1] 9

  crossover(population[r1=6], population[r2=6])
   [0, 1, 1, 1, 1, 1, 1, 1, 1, 1] 9

突然変異 mutation(individual)
[0, 1, 1, 1, 1, 1, 1, 1, 0, 1] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8
[0, 1, 1, 1, 1, 1, 1, 1, 0, 1] 8

交叉 crossover(population[r1=7], population[r2=2])

  crossover(population[r1=7]
   [1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=7], population[r2=2])
   [1, 1, 1, 1, 1, 1, 0, 1, 1, 1] 9

突然変異 mutation(individual)
[1, 1, 1, 1, 0, 1, 0, 1, 1, 1] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8
[0, 1, 1, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 1, 1, 0, 1, 0, 1, 1, 1] 8

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9
[0, 1, 1, 1, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8
[0, 1, 1, 1, 1, 1, 1, 1, 0, 1] 8
[1, 1, 1, 1, 0, 1, 0, 1, 1, 1] 8

----------
20世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=0], population[r2=3])

  crossover(population[r1=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=0], population[r2=3])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8

交叉 crossover(population[r1=5], population[r2=2])

  crossover(population[r1=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=5], population[r2=2])
   [1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8

交叉 crossover(population[r1=1], population[r2=5])

  crossover(population[r1=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8

  crossover(population[r1=1], population[r2=5])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 0] 9

突然変異 mutation(individual)
[1, 1, 1, 1, 0, 1, 1, 1, 1, 0] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8
[1, 1, 1, 1, 0, 1, 1, 1, 1, 0] 8

交叉 crossover(population[r1=2], population[r2=1])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=1])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8
[1, 1, 1, 1, 0, 1, 1, 1, 1, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=7], population[r2=2])

  crossover(population[r1=7]
   [1, 1, 1, 1, 0, 1, 1, 1, 1, 0] 8

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=7], population[r2=2])
   [1, 1, 1, 1, 0, 1, 1, 1, 1, 0] 8

突然変異 mutation(individual)
[1, 1, 1, 1, 0, 1, 1, 1, 1, 0] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8
[1, 1, 1, 1, 0, 1, 1, 1, 1, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 0, 1, 1, 1, 1, 0] 8

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 0, 0] 8
[1, 1, 1, 1, 0, 1, 1, 1, 1, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 0, 1, 1, 1, 1, 0] 8

----------
21世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=4], population[r2=0])

  crossover(population[r1=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=4], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=0], population[r2=4])

  crossover(population[r1=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=0], population[r2=4])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=5], population[r2=0])

  crossover(population[r1=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=5], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=4], population[r2=2])

  crossover(population[r1=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=4], population[r2=2])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9

交叉 crossover(population[r1=7], population[r2=7])

  crossover(population[r1=7]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=7]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=7], population[r2=7])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9
[1, 1, 1, 0, 1, 1, 1, 1, 1, 1] 9

----------
22世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=2], population[r2=3])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=3])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

交叉 crossover(population[r1=4], population[r2=5])

  crossover(population[r1=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=5]
   [1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8

  crossover(population[r1=4], population[r2=5])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=2], population[r2=3])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=3])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=4], population[r2=0])

  crossover(population[r1=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=4], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

交叉 crossover(population[r1=1], population[r2=0])

  crossover(population[r1=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=1], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 0, 1, 1, 0, 1, 1, 1, 1] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

----------
23世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=4], population[r2=4])

  crossover(population[r1=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=4], population[r2=4])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1] 9

交叉 crossover(population[r1=2], population[r2=1])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=1])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=5], population[r2=1])

  crossover(population[r1=5]
   [1, 1, 1, 1, 1, 1, 0, 1, 1, 1] 9

  crossover(population[r2=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=5], population[r2=1])
   [1, 1, 1, 1, 1, 1, 0, 1, 1, 1] 9

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

交叉 crossover(population[r1=6], population[r2=0])

  crossover(population[r1=6]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=6], population[r2=0])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=7], population[r2=7])

  crossover(population[r1=7]
   [1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

  crossover(population[r2=7]
   [1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

  crossover(population[r1=7], population[r2=7])
   [1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 0, 1, 1, 0] 8

----------
24世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=1], population[r2=1])

  crossover(population[r1=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=1], population[r2=1])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=4], population[r2=4])

  crossover(population[r1=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=4], population[r2=4])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=5], population[r2=3])

  crossover(population[r1=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=5], population[r2=3])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9

交叉 crossover(population[r1=0], population[r2=2])

  crossover(population[r1=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=0], population[r2=2])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=1], population[r2=4])

  crossover(population[r1=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=4]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=1], population[r2=4])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 0, 1, 1, 0, 1, 1] 8

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 0, 1, 1, 0, 1, 1] 8

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 0, 1, 1, 1, 1] 9
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 0, 1, 1, 0, 1, 1] 8

----------
25世代

選択 selection(population)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=1], population[r2=1])

  crossover(population[r1=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=1], population[r2=1])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=2], population[r2=5])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=5])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=2], population[r2=1])

  crossover(population[r1=2]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=1]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=2], population[r2=1])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=6], population[r2=3])

  crossover(population[r1=6]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=3]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=6], population[r2=3])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

交叉 crossover(population[r1=0], population[r2=5])

  crossover(population[r1=0]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r2=5]
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

  crossover(population[r1=0], population[r2=5])
   [1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

突然変異 mutation(individual)
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

暫定結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10

最終結果 population
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1] 10
```