Skip to contents

Introduction

The BioGA utilizes multi-objective Genetic Algorithm (GA) specifically tailored for the optimization and analysis of genomic data. A detailed mathematical and theoretical analysis of the algorithms implemented within this package is described below; covering all major components of the evolutionary process with formal mathematical notation, proofs, and a discussion of key properties.

The Genetic Algorithm Framework

The BioGA package employs a standard generational Genetic Algorithm structure, modified for multi-objective optimization. This framework involves the iterative evolutionary cycle of initialization, evaluation, selection, reproduction (crossover and mutation), and replacement.

Mathematical Representation

Let us define the core elements of the search space and the algorithm’s state:

  • G=(V,E)G = (V, E) is the gene network, where V={g1,g2,…,gn}V = \{g_1, g_2, \ldots, g_n\} are nn genes.
  • X∈ℝn×mX \in \mathbb{R}^{n \times m} is the genomic data matrix, consisting of nn genes across mm samples.
  • Pt∈ℝp×nP_t \in \mathbb{R}^{p \times n} is the population matrix at generation tt, containing pp individuals (rows) and nn gene values (columns).

The evolution from one generation to the next, Pt→Pt+1P_t \to P_{t+1}, is described by the following functional relationship:

Pt+1=R(M(C(S(Pt,f(Pt)),X)),Pt,f(Pt)) P_{t+1} = R(M(C(S(P_t, f(P_t)), X)), P_t, f(P_t))

Where the functions represent the core operators:

  • ff: Fitness Evaluation function.
  • SS: Selection operator (NSGA-II inspired).
  • CC: Crossover operator (SBX).
  • MM: Mutation operator (Adaptive).
  • RR: Replacement operator (Elitism + Diversity Preservation).

Population Initialization

The initialization phase creates the starting population, P0P_0, by drawing random samples directly from the measured genomic data XX.

Mathematical Formulation

Given the genomic data X∈ℝn×mX \in \mathbb{R}^{n \times m} and a population size pp, the value of gene jj in the ii-th individual of the initial population is set as:

P0[i,j]=X[j,k]wherek∼Uniform{1,…,m} P_0[i,j] = X[j, k] \quad \text{where} \quad k \sim \text{Uniform}\{1, \ldots, m\} This means that for each element (i,j)(i, j) in P0P_0, a sample kk is chosen uniformly at random from the mm available samples, and the corresponding gene expression value X[j,k]X[j, k] is used.

Initialization with Clustering:

If a clustering breakdown is provided (e.g., CC is the set of clusters), the initialization respects the structure: P0[i,j]=X[j,k]∀j∈c,k∼Uniform{1,…,m} P_0[i,j] = X[j, k] \quad \forall j \in c, \quad k \sim \text{Uniform}\{1, \ldots, m\} for all genes jj belonging to the same cluster cc.

Statistical Properties

  1. Distribution Preservation: This method ensures that the initial population individuals maintain the original statistical distribution of expression values for each gene jj.
  2. Structural Integrity: If clustering is used, the method preserves the pre-defined cluster structure within the initial population.
  3. Expected Value: The expected value of any element P0[i,j]P_0[i,j] over the initialization process is the mean of the observed expression for gene jj: 𝔼[P0[i,j]]=μj=1m∑k=1mX[j,k] \mathbb{E}[P_0[i,j]] = \mu_j = \frac{1}{m}\sum_{k=1}^m X[j,k]

Fitness Evaluation

The BioGA package uses a two-objective formulation. Both objectives are minimised. The package supports two representations, and the meaning of the objectives depends on which one is used.

Real representation

In the real representation an individual ii is a continuous expression profile Pi∈ℝnP_i \in \mathbb{R}^n.

Objective 1: Data fidelity (f1f_1). The squared Euclidean distance between the individual and every observed sample. It is minimised when each gene value equals the per-gene mean μj\mu_j:

f1(i)=∑j=1n∑k=1m(Xjk−Pij)2 f_1(i) = \sum_{j=1}^n \sum_{k=1}^m (X_{jk} - P_{ij})^2

Objective 2: Parsimony (f2f_2). The mean absolute gene value (an L1L_1 penalty). It is minimised by driving gene values toward zero:

f2(i)=1n∑j=1n|Pij| f_2(i) = \frac{1}{n}\sum_{j=1}^n |P_{ij}|

Binary representation

In the binary representation an individual ii is a selection indicator Pi∈{0,1}nP_i \in \{0,1\}^n and class labels y∈{1,…,c}my \in \{1,\dots,c\}^m are required.

Objective 1: Predictive signal (f1f_1). For each gene jj an ANOVA FF-statistic measures how strongly it separates the classes: Fj=SSBj/(c−1)SSWj/(m−c) F_j = \frac{\mathrm{SSB}_j/(c-1)}{\mathrm{SSW}_j/(m-c)} where SSBj\mathrm{SSB}_j and SSWj\mathrm{SSW}_j are the between- and within-class sums of squares. The objective is the negated mean FjF_j over the selected genes (so that better-separating subsets have a smaller value): f1(i)=−1|Si|∑j∈SiFj,Si={j:Pij>0.5} f_1(i) = -\frac{1}{|S_i|}\sum_{j \in S_i} F_j, \qquad S_i = \{j : P_{ij} > 0.5\} with f1(i)=0f_1(i) = 0 when no gene is selected.

Objective 2: Sparsity (f2f_2). The fraction of selected genes: f2(i)=|Si|n f_2(i) = \frac{|S_i|}{n}

Because f1f_1 rewards including informative genes while f2f_2 rewards including few genes, the two objectives conflict and the solution is a Pareto front rather than a single point.

Selection (NSGA-II)

The selection mechanism is based on the principles of the Non-dominated Sorting Genetic Algorithm II (NSGA-II), ensuring that evolutionary pressure drives the population toward the Pareto front.

Domination Criteria

Individual ii dominates individual jj (denoted i≻ji \succ j) if and only if:

  1. Individual ii is no worse than jj on all objectives, and
  2. Individual ii is strictly better than jj on at least one objective.

Formally: i≻jiff∀k∈{1,2}:fk(i)≤fk(j)and∃k∈{1,2}:fk(i)<fk(j) i \succ j \quad \text{iff} \quad \forall k \in \{1, 2\}: f_k(i) \leq f_k(j) \quad \text{and} \quad \exists k \in \{1, 2\}: f_k(i) < f_k(j)

Proof of Partial Order

The two-objective domination relation (≻)(\succ) defines a partial order on the solution set because it satisfies the following properties:

  1. Irreflexive: No individual dominates itself. If i=ji = j, the second condition (∃k:fk(i)<fk(j)\exists k: f_k(i) < f_k(j)) is false.
  2. Antisymmetric Property: If i≻ji \succ j, then jj cannot dominate ii. If ii is strictly better on at least one objective, jj must be strictly worse (∀k:fk(j)≰fk(i)\forall k: f_k(j) \not\leq f_k(i)).
  3. Transitive: If i≻ji \succ j and j≻kj \succ k, then i≻ki \succ k. This follows directly from the transitivity of the combined ≤\leq and << relations.

Front Construction

The population is sorted into non-dominated fronts:

  1. Domination Metrics: For every individual, we compute its domination count (number of individuals that dominate it) and its dominated set (set of individuals it dominates).
  2. First Front (ℱ1\mathcal{F}_1): This front consists of all individuals whose domination count is 00. These are the current non-dominated solutions.
  3. Subsequent Fronts: Individuals in ℱt\mathcal{F}_t are temporarily removed. The domination counts of the individuals they dominated are reduced by one. The next front, ℱt+1\mathcal{F}_{t+1}, consists of all remaining individuals whose updated domination count is 00. This process continues until the entire population is sorted.

Theorem on Computational Complexity

The non-dominated sorting and front construction algorithm terminates in quadratic time complexity relative to the population size.

Theorem: The front construction algorithm terminates in O(p2o)O(p^2o) time, where pp is the population size and oo is the number of objectives.

Proof Sketch:

  • The pairwise domination check between any two individuals is an O(o)O(o) operation.
  • The computation of the domination count and dominated set for all individuals requires O(p2o)O(p^2o) time, as it involves (p2)\binom{p}{2} comparisons.
  • Once these metrics are computed, the iterative process of assigning individuals to fronts requires O(p)O(p) time per front, leading to an overall complexity dominated by the O(p2o)O(p^2o) initial comparison phase.

Crossover (Simulated Binary Crossover - SBX)

The Simulated Binary Crossover (SBX) is a prominent operator for real-coded GAs, designed to mimic the convergence properties of binary crossover while operating directly on continuous variables.

Given two parent individuals, x,y∈ℝnx, y \in \mathbb{R}^n, the SBX operator generates two complementary offspring vectors. For each gene jj:

With crossover probability pcp_c, the offspring genes are determined: 1. A random number uu is drawn: u∼Uniform(0,1)u \sim \text{Uniform}(0,1). 2. The spreading factor β\beta is computed based on the distribution index η\eta: β={(2u)1/(η+1)if u≤0.5(12(1−u))1/(η+1)otherwise \beta = \begin{cases} (2u)^{1/(\eta+1)} & \text{if } u \leq 0.5 \\ \left(\frac{1}{2(1-u)}\right)^{1/(\eta+1)} & \text{otherwise} \end{cases} 3. The two complementary gene values are calculated: c1=0.5[(1+β)xj+(1−β)yj],c2=0.5[(1−β)xj+(1+β)yj] c_1 = 0.5[(1+\beta)x_j + (1-\beta)y_j], \qquad c_2 = 0.5[(1-\beta)x_j + (1+\beta)y_j] and one of them is assigned to the offspring.

Otherwise (with probability 1−pc1-p_c) the gene is copied unchanged from one of the parents. In the binary representation uniform crossover is used instead: each gene is copied from a randomly chosen parent.

Properties of SBX

  1. Mean Preservation: The two complementary children satisfy c1+c2=xj+yjc_1 + c_2 = x_j + y_j, so the expected value of an offspring gene (with the child chosen uniformly at random) is the parents’ average: 𝔼[zj]=xj+yj2\mathbb{E}[z_j] = \frac{x_j + y_j}{2}.
  2. Distribution Control: The distribution index η\eta controls the proximity of the offspring to the parents.
  3. Low η\eta (e.g., η→0\eta \to 0): Produces a wide spread and approaches uniform crossover, generating many extreme values.
  4. High η\eta (e.g., η→∞\eta \to \infty): Clusters offspring tightly around the parents, approaching no crossover.

Mutation

The mutation operation introduces random small changes to the offspring for exploration. The BioGA uses an adaptive mutation rate and incorporates network constraints.

For each gene jj, with adaptive probability pm(t)p_m(t): pm(t)=p0(1+0.5tT) p_m(t) = p_0\left(1 + 0.5\frac{t}{T}\right) where p0p_0 is the initial rate, tt is the current generation, and TT is the total number of generations. This rate increases linearly over time to enhance exploration in later stages.

In the real representation the change applied to gene value zjz_j is:

  1. A Gaussian perturbation is generated: Δj∼N(0,σ2)\Delta_j \sim N(0, \sigma^2).

  2. If a gene network NN is provided (adjacency matrix NjkN_{jk}), the perturbation is damped by the gene’s relative connectivity. With the degree dj=∑k≠j|Njk|d_j = \sum_{k \neq j}|N_{jk}| and dmax=max⁡jdjd_{\max} = \max_j d_j: zj←zj+Δj(1−djdmax) z_j \leftarrow z_j + \Delta_j\left(1 - \frac{d_j}{d_{\max}}\right) so highly connected genes mutate less.

  3. If no network is provided, standard Gaussian mutation is applied: zj←zj+Δj z_j \leftarrow z_j + \Delta_j

In the binary representation mutation is a bit flip: with the adaptive probability the selected/not-selected state of a gene is inverted.

Properties of Adaptive Network Mutation

  1. Adaptive Rate: The mutation rate increases with generation tt, maintaining exploration later in the run.
  2. Network Constraint Impact: The damping factor (1−dj/dmax)∈[0,1](1 - d_j/d_{\max}) \in [0, 1] reduces the mutation magnitude for highly connected genes, preserving known network structure. It is a normalised, non-negative quantity, so mutation is never amplified.
  3. Expected Change: Since 𝔼[Δj]=0\mathbb{E}[\Delta_j] = 0, the expected change remains zero: 𝔼[Δzj]=0\mathbb{E}[\Delta z_j] = 0.
  4. Variance Control: The variance of the change is Var(Δzj)=σ2(1−djdmax)2, \text{Var}(\Delta z_j) = \sigma^2\left(1 - \frac{d_j}{d_{\max}}\right)^2, which shrinks monotonically with the gene’s connectivity.

Replacement

The replacement operator RR constructs the next population Pt+1P_{t+1} from the current population PtP_t and the offspring OtO_t using NSGA-II environmental selection.

  1. Rank and crowding. The candidates are sorted into non-dominated fronts and a crowding distance is computed within each front (as in selection).
  2. Elitist retention. The best p−k0p - k_0 parents, where k0k_0 is the replacement budget num_to_replace, are retained.
  3. Offspring admission. The best k0k_0 offspring, ranked by the same (rank, crowding) criterion, fill the remaining slots.

Because rank\text{rank} dominates crowding\text{crowding}, non-dominated solutions are never discarded in favour of dominated ones; ties are broken towards less crowded (more diverse) solutions. The best solution with respect to the first objective is non-dominated by construction, so it is always retained when k0<pk_0 < p, giving monotonic non-increasing best f1f_1. If num_to_replace is zero the population is returned unchanged.

Convergence Analysis

BioGA is a heuristic. It does not provide a guarantee of finding the global Pareto front in a finite number of generations; the results below only outline the idealised conditions under which asymptotic convergence is expected, and should not be read as a practical guarantee.

Assumptions

For convergence results in MOEAs, the following are typically assumed:

  1. Finite Search Space: While the gene values are continuous, they can be discretised in theory (or bounded in practice). The real-coded search space is not finite, so this assumption does not strictly hold for "real" mode.
  2. Strictly Positive Mutation Probability: pm(t)>0p_m(t) > 0 for all tt, which enables ergodicity. This fails when mutation_rate = 0.
  3. Elitism: The best solutions are preserved across generations. This holds only when num_to_replace < population_size.

Result (idealised)

Statement: Under the assumptions above, standard MOEA theory (e.g. Rudolph 1998, and analyses of NSGA-II) indicates that the population converges in probability to the true Pareto front as t→∞t \to \infty.

Sketch:

  1. Preservation of optimality: Elitist replacement retains non-dominated solutions across generations.
  2. Ergodicity: A strictly positive mutation probability lets any point be reached from any other in finitely many steps.
  3. Convergence: Selection pressure toward non-dominated solutions, combined with ergodic variation, drives the population toward the Pareto front in the limit.

In practice, the useful convergence diagnostics are the per-generation best objective (history) and the final Pareto front; the theoretical guarantee above requires assumptions that real runs may violate.

Computational Complexity

Analyzing the complexity is crucial for understanding the algorithm’s performance on large genomic datasets. Key variables are defined:

  • pp = population size
  • nn = number of genes
  • mm = number of samples
  • oo = number of objectives (o=2o=2 in BioGA)
  • TT = number of generations

Component Complexities

GA Component Complexity (Per Generation) Dominating Variables
Initialization O(pn)O(pn) p,np, n
Fitness Evaluation O(pn)×O(m)O(pn) \times O(m)→\toO(pmn)O(pmn) p,m,np, m, n
Selection (NSGA-II sort) O(p2o)O(p^2o) pp (quadratic)
Crossover (SBX) O(pn)O(pn) p,np, n
Mutation (Adaptive) O(pn)O(pn) p,np, n
Replacement (environmental selection) O((p+q)2o)O((p+q)^2o) p,qp, q

Total Complexity

The total complexity for TT generations is dominated by the Fitness Evaluation and the Selection phases:

Total Complexity=O(T⋅(pmn+p2o)) \text{Total Complexity} = O(T \cdot (pmn + p^2o)) Factoring pp: Total Complexity=O(Tp(mn+po)) \text{Total Complexity} = O(Tp(mn + po)) This result highlights that scalability is limited by the quadratic dependency on population size pp (due to sorting) and the linear dependency on the product of genes/samples mnmn (due to fitness evaluation).

Mathematical Optimization Interpretation

From a purely mathematical perspective, the BioGA algorithm serves as a robust stochastic optimization solver for the following multi-objective problem:

minimize (f1(P),f2(P))subject to P∈ℝp×n \begin{aligned} \text{minimize } & (f_1(P), f_2(P)) \\ \text{subject to } & P \in \mathbb{R}^{p \times n} \end{aligned}

Core Characteristics that Favor GA:

  1. Multi-Objective Nature: Explicitly seeking a set of trade-off solutions (the Pareto front).
  2. High Dimensionality: The real search space is p×np \times n, making deterministic grid search intractable.
  3. Non-Differentiable Objective: The sparsity objective f2f_2 in the binary representation is non-differentiable, so gradient-based methods do not apply.
  4. Non-Convexity: The combined fitness landscape may be non-convex, so global search heuristics are useful to avoid poor local optima.

Biological Interpretation and Relevance

The mathematical operations within the BioGA framework have direct analogues in the biological context of genomic data analysis, ensuring the algorithm is biologically meaningful.

Mathematical Component Biological Concept Function
Population Initialization Initial Biological Variability Starting the search process by sampling observed expression levels.
Fitness (f1,f2f_1, f_2) Functional Efficacy & Parsimony f1f_1 ensures the optimized solution is relevant to observed data; f2f_2 enforces biological simplicity (Minimal Regulatory Model).
Network Constraints Gene-Gene Interactions Incorporating known biological constraints (e.g., regulatory or metabolic pathways) to guide mutation.
Clustering Co-expressed Gene Modules Respecting known functional groupings during initialization.

Conclusion

The BioGA package implements a structured multi-objective evolutionary algorithm. Its components—NSGA-II rank and crowding for selection and environmental replacement, SBX (or uniform) crossover, and adaptive mutation with optional degree-based network damping—provide a coherent framework for trade-offs between data fidelity (or predictive signal) and model sparsity in genomic data optimisation.

Session Info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.6.1 (2026-06-24)
#>  os       Ubuntu 24.04.5 LTS
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language en
#>  collate  C.UTF-8
#>  ctype    C.UTF-8
#>  tz       UTC
#>  date     2026-10-17
#>  pandoc   3.8.3 @ /opt/hostedtoolcache/pandoc/3.8.3/x64/ (via rmarkdown)
#>  quarto   NA
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  bookdown      0.48    2026-08-28 [1] RSPM
#>  bslib         0.12.0  2026-08-04 [1] RSPM
#>  cachem        1.1.0   2024-05-16 [1] RSPM
#>  cli           3.6.6   2026-04-09 [1] RSPM
#>  desc          1.4.3   2023-12-10 [1] RSPM
#>  digest        0.6.39  2025-11-19 [1] RSPM
#>  evaluate      1.0.5   2025-08-27 [1] RSPM
#>  fastmap       1.2.0   2024-05-15 [1] RSPM
#>  fs            2.1.0   2026-04-18 [1] RSPM
#>  htmltools     0.5.9   2025-12-04 [1] RSPM
#>  htmlwidgets   1.6.4   2023-12-06 [1] RSPM
#>  jquerylib     0.1.4   2021-04-26 [1] RSPM
#>  jsonlite      2.0.0   2025-03-27 [1] RSPM
#>  knitr         1.52    2026-09-06 [1] RSPM
#>  lifecycle     1.0.5   2026-01-08 [1] RSPM
#>  otel          0.2.0   2025-08-29 [1] RSPM
#>  pkgdown       2.2.1   2026-07-07 [1] RSPM
#>  R6            2.6.1   2025-02-15 [1] RSPM
#>  ragg          1.5.2   2026-03-23 [1] RSPM
#>  rlang         1.3.0   2026-07-05 [1] RSPM
#>  rmarkdown     2.32    2026-09-01 [1] RSPM
#>  sass          0.4.10  2025-04-11 [1] RSPM
#>  sessioninfo   1.2.4   2026-06-04 [1] RSPM
#>  systemfonts   1.3.2   2026-03-05 [1] RSPM
#>  textshaping   1.0.5   2026-03-06 [1] RSPM
#>  xfun          0.62    2026-10-16 [1] RSPM
#>  yaml          2.3.12  2025-12-10 [1] RSPM
#> 
#>  [1] /home/runner/work/_temp/Library
#>  [2] /opt/R/4.6.1/lib/R/site-library
#>  [3] /opt/R/4.6.1/lib/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────