---
id: wiki-2026-0508-biological-inspired-algorithms
title: Biological Inspired Algorithms
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Bio-Inspired Computing, Nature-Inspired Algorithms, Bionic Algorithms]
duplicate_of: none
source_trust_level: A
confidence_score: 0.88
verification_status: applied
tags: [optimization, metaheuristics, evolutionary, swarm]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
  language: Python
  framework: DEAP, pyswarms, scikit-opt
---

# Biological Inspired Algorithms

## 매 한 줄
> **"매 nature 의 problem-solving 을 computational metaheuristic 로 abstract"**. 1950s cybernetics → 1970s GA → 1990s ACO/PSO → 2020s neuroevolution + LLM-guided search 까지, 매 NP-hard / black-box optimization 의 main toolkit 으로 evolved.

## 매 핵심

### 매 분류
- **Evolutionary**: GA, GP, ES, DE, CMA-ES, NEAT.
- **Swarm intelligence**: PSO (bird flocks), ACO (ant pheromone), ABC (bee colony), Firefly.
- **Immune-inspired**: Clonal Selection, Negative Selection.
- **Neural-inspired**: ANN, Spiking NN, Hebbian learning.
- **Physical/biological hybrid**: Slime mould (Physarum), DNA computing.

### 매 공통 구조
1. **Population** of candidates.
2. **Fitness** function (objective).
3. **Variation** operators (mutation, crossover, social update).
4. **Selection** pressure (tournament, roulette, elitism).
5. **Iteration** until convergence / budget.

### 매 강점
- 매 derivative-free, black-box-friendly.
- 매 multimodal landscape 의 escape from local optima.
- 매 parallel-friendly (population evaluation).
- 매 hybridize easily with local search (memetic).

## 💻 패턴

### Genetic Algorithm (DEAP)
```python
from deap import base, creator, tools, algorithms
import random

creator.create("FitnessMax", base.Fitness, weights=(1.0,))
creator.create("Individual", list, fitness=creator.FitnessMax)

tb = base.Toolbox()
tb.register("attr", random.randint, 0, 1)
tb.register("individual", tools.initRepeat, creator.Individual, tb.attr, n=100)
tb.register("population", tools.initRepeat, list, tb.individual)
tb.register("evaluate", lambda ind: (sum(ind),))
tb.register("mate", tools.cxTwoPoint)
tb.register("mutate", tools.mutFlipBit, indpb=0.05)
tb.register("select", tools.selTournament, tournsize=3)

pop = tb.population(n=300)
algorithms.eaSimple(pop, tb, cxpb=0.7, mutpb=0.2, ngen=40, verbose=False)
```

### Particle Swarm Optimization (pyswarms)
```python
import numpy as np, pyswarms as ps

def sphere(x): return np.sum(x**2, axis=1)

opt = ps.single.GlobalBestPSO(
    n_particles=30, dimensions=10,
    options={"c1": 0.5, "c2": 0.3, "w": 0.9},
    bounds=(np.full(10, -5), np.full(10, 5)),
)
cost, pos = opt.optimize(sphere, iters=200)
```

### Ant Colony Optimization (TSP)
```python
import numpy as np
def aco_tsp(dist, n_ants=20, n_iter=200, alpha=1, beta=5, rho=0.1, q=1):
    n = len(dist); pher = np.ones((n,n))
    best_len, best_path = np.inf, None
    for _ in range(n_iter):
        paths = []
        for _ in range(n_ants):
            unvis = list(range(n)); cur = unvis.pop(0); path = [cur]
            while unvis:
                p = (pher[cur,unvis]**alpha) * ((1/dist[cur,unvis])**beta)
                nxt = unvis[np.random.choice(len(unvis), p=p/p.sum())]
                path.append(nxt); unvis.remove(nxt); cur = nxt
            paths.append(path)
        pher *= (1-rho)
        for path in paths:
            L = sum(dist[path[i],path[i+1]] for i in range(n-1))
            if L < best_len: best_len, best_path = L, path
            for i in range(n-1): pher[path[i], path[i+1]] += q/L
    return best_path, best_len
```

### CMA-ES (continuous, modern default)
```python
import cma
es = cma.CMAEvolutionStrategy(8 * [0.5], 0.5)
es.optimize(lambda x: sum(xi**2 for xi in x))
print(es.result.xbest)
```

### Differential Evolution (scipy)
```python
from scipy.optimize import differential_evolution
res = differential_evolution(lambda x: (x[0]-3)**2 + (x[1]+1)**2,
                             bounds=[(-5,5),(-5,5)], strategy="best1bin",
                             popsize=30, mutation=(0.5,1.0), recombination=0.7)
```

### NEAT (neuroevolution)
```python
import neat
config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction,
                     neat.DefaultSpeciesSet, neat.DefaultStagnation, "config-neat")
pop = neat.Population(config)
def eval_genomes(genomes, cfg):
    for gid, g in genomes:
        net = neat.nn.FeedForwardNetwork.create(g, cfg)
        g.fitness = simulate(net)  # env-specific
winner = pop.run(eval_genomes, n=50)
```

## 매 결정 기준
| 상황 | Approach |
|---|---|
| Continuous, smooth | Gradient / L-BFGS |
| Continuous, black-box, ≤ 100 dim | **CMA-ES** |
| Continuous, parallel, robust | **Differential Evolution** |
| Combinatorial (TSP, scheduling) | **GA + local search (memetic)**, ACO |
| Real-time multi-agent | **PSO** |
| Neural architecture / policy | **NEAT, evolution strategies** |
| Very expensive eval | Bayesian optimization |

**기본값**: 매 continuous black-box 면 **CMA-ES**, 매 combinatorial 이면 **memetic GA**.

## 🔗 Graph
- 부모: [[Metaheuristics]] · [[Optimization]]
- 변형: [[Genetic-Algorithm]] · [[Particle-Swarm-Optimization]] · [[Ant-Colony-Optimization]] · [[Differential-Evolution]] · [[CMA-ES]] · [[NEAT]]
- 응용: [[Hyperparameter-Optimization]] · [[Neural-Architecture-Search]] · [[Robot-Control]] · [[Scheduling]]
- Adjacent: [[Bayesian-Optimization]] · [[Reinforcement-Learning]] · [[Simulated-Annealing]]

## 🤖 LLM 활용
**언제**: 매 black-box objective + non-differentiable + multimodal landscape, 매 prompt-search / hyperparameter tuning, 매 NAS.
**언제 X**: 매 differentiable + convex (gradient 의 압도적 빠름), 매 budget < 100 evaluations (Bayesian opt 의 선호).

## ❌ 안티패턴
- **Premature convergence**: 매 selection pressure 의 too-high → 매 diversity collapse. 매 niching, fitness sharing 사용.
- **Hyperparameter neglect**: 매 GA 의 cx/mut prob 의 untuned → 매 random search 의 못함.
- **Reinventing wheels**: 매 "Whale Optimization", "Grey Wolf" 등 매 metaphor-only papers — 매 CMA-ES / DE 의 거의 항상 better baseline.
- **No restart**: 매 stuck — 매 IPOP/BIPOP restart 의 critical.

## 🧪 검증 / 중복
- Verified (Holland 1975 GA; Kennedy & Eberhart 1995 PSO; Dorigo 1992 ACO; Hansen 2001 CMA-ES; Stanley 2002 NEAT).
- 신뢰도 A.

## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 placeholder |
| 2026-05-10 | Manual cleanup — taxonomy, 6 algo patterns, decision matrix |
