Module 4b ‐ Metaheuristic Algorithms - hellochishing/Intelligent-Agents-and-Search-Algorithms GitHub Wiki
In Artificial Intelligence and optimization theory, search algorithms aim to navigate a state space
Traditional local search techniques, such as standard greedy hill climbing, operate by maintaining a single state and moving incrementally to neighboring states that offer immediate objective improvements. While computationally efficient, greedy local search methods suffer from a fundamental vulnerability: they are highly prone to getting trapped in local optima—suboptimal points in the state space where every immediate neighbor yields a worse objective value than the current state.
Metaheuristic algorithms are high-level, problem-independent algorithmic frameworks designed to address these limitations. Rather than guaranteeing an exact global optimal solution, metaheuristics employ guided stochastic search mechanics to efficiently explore vast, high-dimensional, or non-convex search spaces. They achieve this by combining heuristic search principles with strategies to escape local optima.
The primary roles of metaheuristics in intelligent agent search include:
- Navigating complex search spaces where brute-force enumeration or exact mathematical programming (e.g., dynamic programming or mixed-integer linear programming) is computationally intractable.
- Escaping local optima by allowing controlled non-improving (stochastic) transitions or by maintaining multiple candidate solutions simultaneously.
- Operating without requiring derivative or analytical structural properties of the target objective function
$f(\overrightarrow{x})$ , making them broadly applicable black-box optimizers.
In this module, metaheuristic techniques are broadly categorized into two main structural paradigms:
- Single-point search algorithms: Algorithms that maintain and evolve a single candidate state
$\overrightarrow{x}$ at any given time, incorporating acceptance probabilities for worse states (e.g., Simulated Annealing). - Population-based search algorithms: Algorithms that maintain a set of
$K$ candidate states simultaneously, evolving the quality of the population over multiple generations using collective operators such as selection, recombination, and mutation (e.g., Genetic Algorithms).
The fundamental performance driver of any metaheuristic algorithm lies in balancing two opposing search mechanics: Exploration (Diversity) and Exploitation (Intensity).
- Exploration (Diversity)
Exploration refers to the algorithm's capacity to broadly search across diverse regions of the state space
$\mathcal{S}$ . It allows the search process to discover unvisited, promising regions and prevents premature convergence into local sub-optimal basins.
- In single-point search (Simulated Annealing): Exploration is facilitated by accepting worse/uphill moves with high probability during initial phases when the control temperature parameter
$T$ is high. - In population-based search (Genetic Algorithms): Exploration is sustained by maintaining high diversity across the population of candidate solutions, utilizing random mutation operators, and using larger population sizes
$K$ .
- Exploitation (Intensity) Exploitation refers to the algorithm's ability to concentrate search efforts within a refined, promising region of the search space to maximize solution quality. It acts as a local optimizer to fine-tune candidates.
- In single-point search (Simulated Annealing): Exploitation increases as the system temperature
$T$ gradually cools, causing the algorithm to behave like a conservative greedy hill climber. - In population-based search (Genetic Algorithms): Exploitation is driven by selection pressure that favors higher-fitness individuals to reproduce and pass partial structures (building blocks) to offspring through crossover.
Achieving an optimal balance between exploration and exploitation is critical. An improper configuration leads to two distinct failure modes:
- Over-Exploration (Excessive Randomness)
- Cause: Unusually high mutation rates, over-inflated control parameters, or persistent high acceptance of deteriorating moves.
- Consequence: The metaheuristic degrades into an undirected random search. The algorithm wanders continuously across the state space without settling long enough to refine and converge upon high-quality solutions.
- Over-Exploitation (Premature Convergence)
- Cause: Overly aggressive selection pressure toward current top-performing states, zero/negligible mutation, or excessively rapid cooling schedules.
- Consequence: The algorithm experiences premature collapse of population/state diversity. The search becomes trapped in a local optimum with no mechanism to escape or incorporate alternative partial solutions.
Mathematical Intuition for Exploration vs. Exploitation Trade-off:
Consider evaluating a search state
Simulated Annealing (SA) is a single-point metaheuristic optimization technique inspired by the physical process of annealing in metallurgy. In metalworking, annealing is a heat treatment process wherein a solid metal is heated to a high temperature—causing its constituent atoms to increase thermal motion and move freely—and then slowly cooled in a controlled manner.
If the cooling process is sufficiently slow, thermal mobility allows the atoms to settle into a state of minimal internal energy, forming a highly ordered crystalline lattice structure. Conversely, if the metal is cooled too rapidly (quenched), the thermal energy dissipates before the atoms can reach equilibrium, leaving them trapped in random, imperfect, or disordered arrangements.
In computational optimization, Simulated Annealing establishes a formal analogy between physical thermodynamic systems and mathematical search spaces:
- System State (
$\overrightarrow{x}$ ): The physical arrangement or position of atoms corresponds to a candidate solution state$\overrightarrow{x} \in \mathcal{S}$ in the optimization search space. - Energy Level (
$E(\overrightarrow{x}) $ ): The internal potential energy of the physical system corresponds to the cost or objective function value$E(\overrightarrow{x}) = f(\overrightarrow{x})$ to be minimized. - Crystalline Structure vs. Imperfect State: A perfectly ordered, lowest-energy crystalline lattice represents the global minimum solution
$\overrightarrow{x}^*$ , whereas a disordered or defective atomic arrangement represents a suboptimal local minimum. - Temperature Control Parameter (
$T$ ): Physical temperature acts as a control parameter governing the thermal fluctuations of the physical system. In SA,$T$ is a computational control parameter that dictates the probability of accepting non-improving (deteriorating) state transitions.
| Physical Metallurgy (Annealing) | Computational Optimization (SA) |
|---|---|
| Atomic Configuration | Candidate Solution Vector |
| Internal Energy |
Objective / Cost Function |
| Crystalline Minimum Energy State | Global Optimum |
| Amorphous / Imperfect Defects | Local Sub-optimal Traps |
| Physical Temperature |
Control Temperature Parameter |
| Slow Cooling Schedule | Temperature Decay Function |
At any iteration
The change in energy (objective cost difference) between the proposed neighbor state and the current state is defined as:
The decision to transition from
- Improving Move (
$\Delta E \le 0$ ): If the new state yields an equal or lower cost, the proposed state represents a non-deteriorating transition and is accepted deterministically with probability$P_{accept} = 1.0$ . - Deteriorating Move (
$\Delta E > 0$ ): If the new state yields a higher cost, it is accepted with a probability$P_{accept}$ that depends on both the magnitude of energy increase$\Delta E$ and the current temperature parameter$T$ :
In physical statistical mechanics, this expression derives from the Boltzmann distribution
graph TD
A["Compute ΔE = E(x_new) - E(x_curr)"] --> B{"ΔE ≤ 0 ?"}
B -- "Yes (Improving Move)" --> C["Accept Transition<br/>P_accept = 1.0"]
B -- "No (Deteriorating Move)" --> D["Compute Probability<br/>P = exp(-ΔE / T)"]
D --> E["Draw r ~ Uniform[0, 1]"]
E --> F{"r ≤ P ?"}
F -- "Yes" --> G["Accept Transition<br/>x_curr = x_new"]
F -- "No" --> H["Reject Transition<br/>Maintain x_curr"]
The Metropolis probability function exhibits two essential properties:
- Sensitivity to Energy Difference (
$\Delta E$ ): For a fixed temperature$T$ , small deteriorating moves ($\Delta E \to 0^+$ ) yield acceptance probabilities close to$1.0$ , whereas severe cost increases ($\Delta E \gg 0$ ) yield exponentially vanishing probabilities ($P_{accept} \to 0$ ). - Sensitivity to Control Temperature (
$T$ ):- At High Temperature (
$T \to \infty$ ): The exponent approaches zero, yielding:$$\lim\limits_{T \to \infty} \exp\left(-\dfrac{\Delta E}{T}\right) = \exp(0) = 1.0$$ Under high initial temperatures, the algorithm accepts almost all proposed moves regardless of cost increase, enabling extensive global exploration across energy barriers. - At Low Temperature (
$T \to 0^+$ ): For any$\Delta E > 0$ , the exponent approaches negative infinity, yielding:$$\lim\limits_{T \to 0^+} \exp\left(-\dfrac{\Delta E}{T}\right) = 0.0$$ As the system cools toward absolute zero, non-improving moves are strictly rejected, transforming SA into a purely deterministic greedy hill climber focused on local exploitation.
- At High Temperature (
Consider a Traveling Salesperson Problem (TSP) delivery route optimization where an agent must depart from warehouse
-
Step 1 (Initial Improving Move):
- Initial state
$\overrightarrow{x}_1 = (A, B, C, D, E, A)$ with cost$E(\overrightarrow{x}_1) = 116$ . Temperature is set to$T = 50$ . - A neighbor route
$\overrightarrow{x}_2 = (A, C, E, D, B, A)$ is generated by swapping middle nodes, yielding$E(\overrightarrow{x}_2) = 94$ . - Cost evaluation:
$\Delta E = 94 - 116 = -22 \le 0$ . - Outcome: Accepted deterministically (
$\overrightarrow{x}_{current} \leftarrow \overrightarrow{x}_2$ ). Temperature updates to$T = 40$ .
- Initial state
-
Step 2 (Second Improving Move):
- Neighbor route
$\overrightarrow{x}_3 = (A, C, D, E, B, A)$ is generated with cost$E(\overrightarrow{x}_3) = 88$ . - Cost evaluation:
$\Delta E = 88 - 94 = -6 \le 0$ . - Outcome: Accepted deterministically (
$\overrightarrow{x}_{current} \leftarrow \overrightarrow{x}_3$ ). Temperature updates to$T = 32$ .
- Neighbor route
-
Step 3 (Evaluating Deteriorating Move):
- A subsequent neighbor route
$\overrightarrow{x}_4$ is generated with cost$E(\overrightarrow{x}_4) = 105$ . - Cost evaluation:
$\Delta E = 105 - 88 = 17 > 0$ . - Metropolis probability derivation:
- A subsequent neighbor route
- Stochastic decision: A uniform random variable
$r \in [1, 100]$ is sampled. If$r \le 58$ (or$r \le 59$ depending on rounding), the deteriorating route$\overrightarrow{x}_4$ is accepted, allowing the agent to break out of local optima. If$r \in [60, 100]$ ,$\overrightarrow{x}_4$ is discarded, maintaining$\overrightarrow{x}_3$ .
The cooling schedule defines the mathematical rule used to decrease the temperature parameter
Temperature Decay Profiles T(t):
T
| \
| \___ Exponential: Smooth, predictable decay T(t+1) = alpha * T(t)
| \
|-----\------------------------------------------------------
| \ Linear: Uniform decay T(t+1) = T(t) - eta
|_______\________________------------------------------------
| \ Logarithmic: Extremely slow optimal decay T(t) = T_0 / ln(1+t)
+------------------------------------------------------------> Time (t)
Exponential decay scales the temperature by a fixed constant factor
- Strengths: Computationally simple, smooth, and predictable. Widely accepted as the standard practical baseline.
- Weaknesses: Highly sensitive to parameter selection. If
$\alpha$ is too small (e.g.,$\alpha = 0.5$ ), the system quenches prematurely and traps in local minima; if$\alpha$ is too close to$1.0$ (e.g.,$\alpha = 0.9999$ ), execution time becomes unnecessarily long.
Linear decay subtracts a fixed constant value
- Strengths: Delivers a steady, uniform cooling rate that is easy to analyze and configure.
- Weaknesses: Lacks flexibility across complex objective landscapes. It tends to cool too rapidly during early high-temperature exploration stages and too slowly during late low-temperature exploitation stages.
Logarithmic decay reduces temperature according to the inverse logarithm of iteration count
- Strengths: Mathematically proven by Geman and Geman to guarantee asymptotic convergence to the global optimum
$\overrightarrow{x}^*$ with probability$1$ . - Weaknesses: Extremely slow cooling rate. The computational time required to reach low temperatures makes logarithmic schedules intractable for practical optimization problems.
Adaptive cooling schedules adjust the temperature dynamically based on search feedback, such as recent variances in energy changes
- Strengths: Highly responsive to local landscape topology. Accelerates cooling when search progress is steady and retards cooling when the algorithm enters highly constrained or rugged search regions.
- Weaknesses: Introduces additional algorithmic complexity, memory overhead, and parameter tuning requirements.
The full procedural execution of Simulated Annealing is structured as follows:
Algorithm 1: Simulated Annealing (Single-Point Optimization)
--------------------------------------------------------------------------------
Input : Objective function E(x_vec), Initial temperature T_0,
Cooling parameter alpha, Minimum temperature T_min
Output : Best global solution state x_vec_best
1: x_vec_curr <- GenerateRandomInitialState()
2: x_vec_best <- x_vec_curr
3: T <- T_0
4: t <- 0
5: while NOT TerminationConditionMet(T, t, x_vec_curr) do
6: x_vec_new <- SampleNeighbor(x_vec_curr)
7: Delta_E <- E(x_vec_new) - E(x_vec_curr)
8:
9: if Delta_E <= 0 then
10: x_vec_curr <- x_vec_new
11: if E(x_vec_curr) < E(x_vec_best) then
12: x_vec_best <- x_vec_curr
13: end if
14: else
15: r <- UniformRandom(0.0, 1.0)
16: if r <= exp(-Delta_E / T) then
17: x_vec_curr <- x_vec_new
18: end if
19: end if
20:
21: T <- UpdateTemperature(T, t, alpha)
22: t <- t + 1
23: end while
24: return x_vec_best
--------------------------------------------------------------------------------
Simulated Annealing iterations continue until one or more termination conditions are satisfied:
- Minimum Temperature Threshold (
$T \le T_{min}$ ): The classic stopping rule. Execution terminates when$T$ drops below a preset lower bound$T_{min}$ , at which point acceptance of non-improving moves becomes virtually zero and further exploration ceases. - Maximum Iteration Budget (
$t \ge t_{max}$ ): Sets an upper bound on total function evaluations, guaranteeing deterministic computational runtime limits. - Solution Stagnation: The algorithm tracks performance history and terminates if no objective improvement (
$\Delta E < 0$ ) or minimal state changes occur over$X$ consecutive iterations. - Target Cost Threshold (
$E(\overrightarrow{x}_{current}) \le E_{target} $ ): Search terminates immediately once the candidate solution achieves a predefined acceptable quality threshold.
Genetic Algorithms (GAs) are population-based metaheuristic search techniques inspired by the mechanics of natural selection and biological evolution. Unlike single-point search algorithms such as Simulated Annealing—which evaluate and transform a single candidate vector
The fundamental computational rationale of population-based search is the Building Block Hypothesis: even suboptimal or low-performing individual solutions within a population may contain high-quality partial structures (schemata or building blocks). By maintaining a diverse candidate population, a GA can explore multiple distinct regions of the search space
GAs establish a direct mapping between biological evolution and computational search:
- Individual / Candidate Solution: A single state vector
$\overrightarrow{x}_i \in \mathcal{S}$ represents an organism or individual within the population. - Chromosome / Genome: The encoded string representation of the solution vector
$\overrightarrow{x}_i$ composed of individual variables or characters (genes). - Fitness Function
$f(\overrightarrow{x})$ : The objective measure evaluating an individual's quality or adaptation to the environment, determining its reproductive capability. - Natural Selection: A stochastic operator favoring higher-fitness individuals to pass their genetic material to the next generation (survival of the fittest).
- Crossover (Recombination): An operator combining genetic material from two parent individuals to produce new offspring.
- Mutation: A stochastic background operator introducing small random alterations into an individual's chromosome to maintain genetic diversity.
To apply Genetic Algorithms to a problem, candidate states must be encoded into digital chromosome strings over a finite alphabet. The choice of encoding directly dictates how genetic operators manipulate solution structures.
Common encoding paradigms include:
- Permutation Encoding In permutation encoding, a chromosome represents an ordered list or permutation of discrete items.
- Example (8-Queens Problem): An 8-queen chessboard arrangement can be represented as a 1D permutation vector
$\overrightarrow{x} = \left( r_0, r_1, r_2, r_3, r_4, r_5, r_6, r_7 \right)$ , where the array index$i \in {0, 1, \dots, 7}$ denotes the column index and the value$r_i \in {0, 1, \dots, 7}$ denotes the row placement of the queen in column$i$ . Because$\overrightarrow{x}$ is constrained to be a permutation of${0, 1, \dots, 7}$ , no two queens can share the same row by construction. - For example, the chromosome vector
$\overrightarrow{x} = (4, 7, 0, 2, 5, 1, 6, 3)$ places the queen in Column 0 at Row 4, Column 1 at Row 7, and so on.
- Binary Matrix / Bitstring Encoding A candidate state is flattened into a binary string of 0s and 1s.
- Example (8-Queens Problem): An
$8 \times 8$ grid is represented as a flattened bitstring of length$64$ , where a bit value of$1$ indicates the presence of a queen at grid position$(i, j)$ and$0$ indicates an empty square. While versatile, binary encodings for constrained problems often require repair mechanisms or penalty functions to handle invalid states (e.g., boards with more or fewer than 8 total queens).
The fitness function
For the 8-Queens problem, fitness
Under standard fitness-proportional selection, the probability
Consider a small population of
Maintaining non-zero probability for lower-fitness individuals (e.g.,
Crossover combines genetic material from two parent vectors
- Single-Point Crossover
A random crossover index
$k \in {1, 2, \dots, L-1}$ is selected along chromosome length$L$ . The parents are split at position$k$ :
- Offspring
$\overrightarrow{c}_1$ inherits genes$1 \dots k$ from$\overrightarrow{p}_1$ and$k+1 \dots L$ from$\overrightarrow{p}_2$ . - Offspring
$\overrightarrow{c}_2$ inherits genes$1 \dots k$ from$\overrightarrow{p}_2$ and$k+1 \dots L$ from$\overrightarrow{p}_1$ . - Limitation: Single-point crossover preserves contiguous segments but risks breaking critical building blocks if the split point falls inside a functional contiguous group.
- Multi-Point Crossover
Two or more crossover indices
${k_1, k_2, \dots}$ are chosen, and segments between split points are alternated between parents.
- Advantage: Facilitates greater genetic mixing across non-contiguous building blocks.
- Disadvantage: Higher risk of disrupting established co-adapted gene combinations.
- Uniform / Positional Crossover
For each gene position
$i \in {1, \dots, L}$ , a gene is inherited independently from$\overrightarrow{p}_1$ with probability$p = 0.5$ , or from$\overrightarrow{p}_2$ with probability$1 - p$ .
- Application: Effective when gene positions have no spatial linkage or order dependencies.
- Order Crossover (OX) Designed specifically for permutation-based representations (e.g., TSP or row permutations) to avoid duplicate elements.
- Procedure: A contiguous sub-segment is copied directly from
$\overrightarrow{p}_1$ into offspring$\overrightarrow{c}_1$ . The remaining unassigned positions are filled sequentially using elements from$\overrightarrow{p}_2$ in the exact relative order in which they appear, skipping elements already present in the segment.
Mutation introduces random changes into offspring chromosomes with a low mutation probability per gene
Functions of Mutation:
- Diversity Restoration: Injects new genetic variations into the population that may have been lost due to selection pressure.
- Local Perturbation: Allows localized fine-tuning around parent solutions in continuous or discrete state spaces.
For 8-Queens permutation encoding, a mutation can swap the row assignments of two columns or assign a single column to a new random row index.
graph TD
A["Initialize Random Population P_0 of K Individuals"] --> B["Evaluate Fitness f(x_i) for all x_i in P_t"]
B --> C{"Termination Condition Met?"}
C -- "Yes" --> D["Return Best Solution x*"]
C -- "No" --> E["Select Parent Pairs via Selection Mechanics"]
E --> F["Apply Crossover with Probability P_c to create Offspring"]
F --> G["Apply Mutation with Probability P_m to Offspring"]
G --> H["Form Next Population P_{t+1}"]
H --> B
| Operational Aspect | Over-Exploration (Excessive Randomness) | Over-Exploitation (Premature Convergence) |
|---|---|---|
| Root Causes | Extremely high mutation rate |
Low mutation rate |
| Search Behavior | Search degenerates into undirected random sampling | Population homogeneity collapses rapidly into a single local sub-optimal peak |
| Consequences | Inability to refine high-fitness building blocks into an optimal solution | Loss of genetic diversity; trapped in local optima with no capacity to escape |
-
Standard Baseline Recommendations:
- Population Size (
$K$ ):$50 \le K \le 300$ individuals. - Crossover Probability (
$P_c$ ):$0.70 \le P_c \le 0.90$ . - Mutation Probability (
$P_m$ ):$0.01 \le P_m \le 0.05$ (or$\dfrac{1}{L}$ per gene, where$L$ is chromosome length).
- Population Size (
-
Diagnostic Monitoring and Parameter Sweeping:
-
Diversity Collapse: If all chromosomes in
$\mathcal{P}_t$ become identical early in execution, increase mutation rate$P_m$ , reduce selection pressure, or expand population size$K$ . - Parameter Sweeping Workflow: Adjust one parameter systematically while holding all other parameters fixed to isolate non-linear parameter interactions.
- Domain Alignment: Align encoding schemes and crossover operators with natural problem constraints (e.g., using Order Crossover for permutation-based ordering tasks).
-
Diversity Collapse: If all chromosomes in
To effectively select and configure metaheuristic search algorithms for intelligent agents, it is essential to compare the structural differences, memory requirements, and search dynamics between single-point local search frameworks and population-based evolutionary frameworks.
- Single-Point Search (Simulated Annealing)
- Memory Complexity: Maintains a single active candidate state vector
$\overrightarrow{x}_{current} \in \mathcal{S}$ and a proposed neighbor candidate state vector$\overrightarrow{x}_{new} \in \mathcal{N}(\overrightarrow{x}_{current})$ at any given iteration$t$ . The memory footprint is$\mathcal{O}(d)$ , where$d$ is the dimensionality of the solution vector. - Computational Overhead: Requires evaluating a single objective function call
$E(\overrightarrow{x}_{new})$ per transition step. This low overhead makes Simulated Annealing exceptionally fast per iteration and suitable for resource-constrained embedded intelligent agents or systems with high state space dimensions.
- Population-Based Search (Genetic Algorithms)
- Memory Complexity: Maintains a set of
$K$ candidate solutions simultaneously, forming a population$\mathcal{P}_t = \left\{ \overrightarrow{x}_1^{(t)}, \overrightarrow{x}_2^{(t)}, \dots, \overrightarrow{x}_K^{(t)} \right\}$ . The memory footprint scales linearly with population size as$\mathcal{O}(K \cdot d)$ . - Computational Overhead: Requires
$K$ fitness evaluations$f(\overrightarrow{x}_i)$ per generation, alongside matrix/string operations for selection, crossover, and mutation. While computationally more expensive per iteration, population dynamics allow for parallel evaluation across multiple compute worker nodes.
The core distinction between SA and GA lies in how candidate solution knowledge is accumulated and transferred across the search space.
- Trajectory Search vs. Recombinative Search
- Simulated Annealing performs a trajectory-based local search. It navigates
$\mathcal{S}$ through continuous local transitions from neighbor to neighbor. Knowledge is retained temporally through a scalar state parameter (the control temperature$T_t$ ). - Genetic Algorithms perform a recombinative search. They jump across disconnected regions of
$\mathcal{S}$ by recombining partial structural components (building blocks) from two or more parent solutions. Knowledge is retained spatially across the diverse candidate pool in the population$\mathcal{P}_t$ .
- Mathematical Formulation of Acceptance and Selection Mechanics
In Simulated Annealing, the probability of transitioning from state
$\overrightarrow{x}_{current}$ to a worse state$\overrightarrow{x}_{new}$ with$\Delta E = E(\overrightarrow{x}_{new}) - E(\overrightarrow{x}_{current}) > 0$ decreases exponentially according to the Boltzmann factor:
In Genetic Algorithms, the probability of selecting an individual
To illustrate the structural difference in how probability mass shifts during execution, consider evaluating the ratio of selection/acceptance probabilities between a high-performing candidate
In Simulated Annealing, the relative acceptance probability of accepting a worse move
This demonstrates that in SA, the relative acceptance ratio between two deteriorating moves depends strictly on the absolute energy gap
In Genetic Algorithms, the relative selection ratio between two candidate individuals
This highlights that in proportional selection, the relative preference between two individuals depends strictly on their relative fitness ratio
Choosing between Simulated Annealing, Genetic Algorithms, or deterministic local search requires analyzing the structural properties of the problem domain, constraints on execution latency, and representation requirements.
- Continuous vs. Discrete / Combinatorial Landscapes
- Simulated Annealing excels in smooth or moderately non-convex continuous optimization, as well as combinatorial routing problems (e.g., Traveling Salesperson Problem) where local neighbor moves (swapping adjacent nodes) correspond to small, meaningful variations in cost
$E(\overrightarrow{x})$ . - Genetic Algorithms excel in complex combinatorial spaces where solutions can be decomposed into meaningful sub-components or building blocks (e.g., subset selection, schedule allocation, or neural architecture search).
- Building Block Preservation vs. Epistasis
- If a problem exhibits low epistasis (i.e., genes/variables interact weakly, allowing partial solutions to be optimized independently), Genetic Algorithms with crossover operators (e.g., single-point or order crossover) rapidly recombine high-fitness schemas.
- If a problem exhibits high epistasis (i.e., highly coupled variables where changing one position invalidates the entire chromosome structure), crossover operators become destructive. In such domains, Simulated Annealing or GAs with high mutation rates perform superior search.
| Selection Dimension | Simulated Annealing (SA) | Genetic Algorithms (GA) |
|---|---|---|
| Search Paradigm | Single-Point Trajectory Search | Population-Based Recombinative Search |
| Memory Requirement | Minimal ( |
High ( |
| Evaluation Overhead | Single cost evaluation per step |
|
| Primary Operators | Stochastic Neighbor Generation, Temperature Decay | Selection, Crossover, Mutation |
| Escaping Local Optima | Accepts uphill moves with |
Maintains population diversity, random mutation |
| Parallelizability | Low (inherently sequential state history) | High (evaluations easily distributed across threads/GPUs) |
| Best Suited For | Fast single-agent pathing, continuous functions, low memory | Decomposable tasks, multi-objective search, schema recombination |
In modern Artificial Intelligence and intelligent agent design, state-of-the-art metaheuristics often combine the strengths of both paradigms into hybrid algorithms:
- Memetic Algorithms (GA + Local Search) Memetic algorithms integrate population-based genetic evolution with local search heuristics (such as Simulated Annealing or greedy hill climbing). In each generation, after crossover and mutation create offspring, a local search procedure is applied to refine individuals to local optima before selection.
- Genetic Operators explore distant regions of the search space (global exploration).
- Local Heuristics (e.g., SA) rapidly refine individual solutions within promising basins (local exploitation).
- Parallel Simulated Annealing & Island Models To overcome the sequential limitations of standard SA, multi-agent frameworks deploy multiple independent SA chains in parallel across worker nodes. Periodically, agents exchange top-performing states, mirroring the diversity preservation of population-based methods while retaining fast single-point trajectory speeds.