【智能算法】回溯搜索算法(BSA)原理及实现

目录


1.背景

2013年,P Civicioglu等人受到当前种群与历史种群之间的差分向量的引导启发,提出了回溯搜索算法(Backtracking Search Algorithm, BSA)。

2.算法原理

2.1算法思想

BSA通过当前种群与历史种群之间的差分向量的引导来执行搜索任务,主要分为三部分:筛选-I、交叉和变异和筛选-II

2.2算法过程

筛选-I

更新历史种群 Xoldt ,分为以下两步:
X o l d t = { X t , i f φ > θ X o l d t , o t h e r w i s e (1) \boldsymbol{X}{\mathrm{old}}^t=\begin{cases}\boldsymbol{X}^t,&\mathrm{if~}\varphi{>}\theta\\\boldsymbol{X}{\mathrm{old}}^t,&\mathrm{otherwise}&\end{cases}\tag{1} Xoldt={Xt,Xoldt,if φ>θotherwise(1)

其中, φ , θ \varphi,\theta φ,θ为随机数。接下来:
X o l d t = p e r m u t i n g ( X o l d t ) (2) \boldsymbol{X}\mathrm{old}^t\mathrm{=permuting}{\left(\boldsymbol{X}\mathrm{old}^t\right)}\tag{2} Xoldt=permuting(Xoldt)(2)

permuting 是一个随机改组函数,使得历史种群 Xold t 中包含的 N 个个体随机排序。

交叉和变异

变异操作由历史种群 Xold t 引导:
z i t = x i t + F × ( x o l d , i t − x i t ) (3) \boldsymbol{z}_i^t=\boldsymbol{x}i^t+F\times\left(\boldsymbol{x}{\mathrm{old},i}^t-\boldsymbol{x}_i^t\right)\tag{3} zit=xit+F×(xold,it−xit)(3)

F 为缩放因子,表述为:
F = 3 × ξ (4) F{=}3{\times}\xi \tag{4} F=3×ξ(4)

交叉操作是由一个 N 行 D 列的二进制矩阵 M 来引导:
x i , j t + 1 = { x i , j t , i f M i , j = 1 z i , j t , i f M i , j = 0 (5) x_{i,j}^{t+1}=\begin{cases}x_{i,j}^t,\mathrm{if~}\boldsymbol{M}{i,j}=1\\z{i,j}^t,\mathrm{if~}\boldsymbol{M}_{i,j}=0\end{cases}\tag{5} xi,jt+1={xi,jt,if Mi,j=1zi,jt,if Mi,j=0(5)

筛选-II

为了加快收敛过程,执行:
x i t + 1 = { x i t , i f f ( x i t ) < f ( x i t + 1 ) x i t + 1 , o t h e r w i s e (6) \boldsymbol{x}_i^{t+1}=\begin{cases}\boldsymbol{x}_i^t,&\mathrm{if~}f(\boldsymbol{x}_i^t)<f(\boldsymbol{x}_i^{t+1})\\\boldsymbol{x}_i^{t+1},&\mathrm{otherwise}&\end{cases}\tag{6} xit+1={xit,xit+1,if f(xit)<f(xit+1)otherwise(6)

伪代码

3.结果展示

作者提供了拟合圆、图像聚类两个案例:


4.参考文献

1 Civicioglu P. Backtracking search optimization algorithm for numerical optimization problemsJ. Applied Mathematics and computation, 2013, 219(15): 8121-8144.

相关推荐
地平线开发者1 天前
J6B vio scenario sample
算法
BothSavage2 天前
Trae远程开发中DeepSeek自定义模型4054错误的排查与修复
算法
小林ixn2 天前
从暴力到KMP:一道题彻底搞懂字符串匹配的前世今生
算法
烬羽2 天前
字符串算法入门:从反转字符串到回文判断,面试不再慌
算法·面试
先吃饱再说2 天前
判断回文字符串,从一行代码到双指针优化
算法
黄敬峰2 天前
深入理解算法核心:从递归思想、数组扁平化到快速排序
算法
得物技术2 天前
从狂野代码到按目标生产:得物推荐 AI Harness 的工程化实践|AICon 演讲整理
人工智能·算法·架构
AI小老六3 天前
SkillOpt 架构拆解:把 Skill 文本当参数,用执行轨迹训练 Agent
后端·算法·ai编程