目录
前言
多数优化问题的目标函数和约束条件存在非凸性,致使难以使用依托于导数和微分运算的传统优化算法对该类问题进行直接求解。受自然中生物种群捕食、遗传、进化等活动启发而提出的启发式优化算法具有容错度高、对初始值要求低、无需目标函数和约束条件可微的特征,在处理多目标、强耦合、非线性的优化问题时相较于传统优化算法更具优势。然而现有的优化算法在处理约束优化问题时,一般需要通过罚函数法、可行性法则、随机排序法、约束处理法、多目标优化法、混合法等约束处理方法,将优化问题中的约束条件转化为新的目标函数,并将原有目标与转化后的新目标一并优化,从而将约束优化问题转化为只包含变量上下界约束但不包含其它约束条件的无约束优化问题。由此可见,该类方法仅仅是将原有的硬约束转化为软约束,只能保证获得的解能够满足控制变量的上下界约束而无法保证解能够严格满足优化问题的所有约束条件,这使得该类方法在处理变量上下界范围广阔但约束条件严苛的优化问题,特别是等式约束优化问题时性能不佳,该类处理约束方法存在的不足亟待通过提出新的约束处理方法解决。
启发式优化算法的基本思路是随机生成一定规模的初始种群并计算种群的适应度,然后按照一定的更新规则朝着当前适应度最优的方向迭代更新,最终收敛于全局最优解。基于启发式优化算法的以上特征,本系列博客将从生成随机数的修正入手,通过提出的修正方法将不满足约束条件的生成随机数通过适当的修正方法,使得修正后的随机数能够严格满足所有约束条件,并尝试将该修正方法与启发式优化算法的迭代更新机制有机结合,以期解决基于现有约束处理方法下的启发式优化算法在解决约束优化问题时存在的生成解无法严格满足优化问题约束条件的不足。在约束优化问题中,线性方程约束是优化问题中最简单和最重要的约束,因此本系列博客将从线性方程约束中最简单的求和方程约束入手,随后逐步推广到一般的线性方程约束场景,给出能够满足上述约束条件的生成随机数修正方法,从而为解决各类线性约束和某些非线性约束下的生成随机数修正问题提供可行思路。
本系列博客的建议阅读顺序
1. 《一种单线性方程约束下的生成随机数修正方法(推导与证明)》
2. 《一种单线性方程约束下的生成随机数修正方法(结论与应用)》
3. 《一种多线性方程约束下的生成随机数修正方法(上)》
4. 《一种多线性方程约束下的生成随机数修正方法(下)》
5. 《一种线性方程约束下生成随机数修正的一般性方法(上)》
6. 《一种线性方程约束下生成随机数修正的一般性方法(中)》
7. 《一种线性方程约束下生成随机数修正的一般性方法(下)》
8. 《一种线性不等式约束下的生成随机数修正方法》
9. 《线性方程约束下修正方法的可行性分析(演绎推理,一)》
10. 《线性方程约束下修正方法的可行性分析(演绎推理,二)》
11. 《线性方程约束下修正方法的可行性分析(演绎推理,三)》
12. 《线性方程约束下修正方法的可行性分析(演绎推理,四)》
13. 《线性方程约束下修正方法的可行性分析(演绎推理,五)》
14. 《线性方程约束下修正方法的可行性分析(演绎推理,六)》
15. 《线性方程约束下修正方法的可行性分析(实例分析)》
16. 《线性方程约束下修正方法的可行性分析(程序设计)》
修正方法
引理:求和方程约束下非负变量之和大于常数项限定时的修正方法
设需要生成一组
N
N
N维随机向量
x
=
[
x
1
⋯
x
i
⋯
x
N
]
T
\boldsymbol{x}=\left[ \begin{matrix} x_1 & \cdots & x_i & \cdots & x_N \end{matrix} \right]^T
x=[x1⋯xi⋯xN]T满足如式(1)所示的约束条件
{
x
i
∈
[
0
,
x
‾
i
]
,
i
∈
{
1
,
⋯
,
N
}
∑
i
=
1
N
x
i
=
b
\begin{equation} \begin{cases} x_i ∈ \left[ 0, \overline{x}_i \right], i ∈ \{ 1, \cdots, N \} \\ \displaystyle \sum_{i = 1}^{N} x_i = b \\ \end{cases} \end{equation}
⎩
⎨
⎧xi∈[0,xi],i∈{1,⋯,N}i=1∑Nxi=b
其中:
x
‾
i
\overline{x}_i
xi为第
i
i
i维随机数
x
i
x_i
xi的上界(
x
‾
i
≥
0
\overline{x}_i ≥ 0
xi≥0),
b
b
b为方程的常数项(
0
≤
b
≤
∑
i
=
1
N
x
‾
i
0 ≤ b ≤ \displaystyle \sum_{i = 1}^{N} \overline{x}_i
0≤b≤i=1∑Nxi)。
若按照如式(2)所示的随机数生成方法生成随机数
x
g
e
n
=
[
x
g
e
n
,
1
⋯
x
g
e
n
,
i
⋯
x
g
e
n
,
N
]
T
\boldsymbol{x_{gen}} = \left[ \begin{matrix} x_{gen, 1} & \cdots & x_{gen, i} \cdots & x_{gen, N} \end{matrix} \right]^T
xgen=[xgen,1⋯xgen,i⋯xgen,N]T作为式(1)所示问题的其中一个测试解
x
g
e
n
,
i
=
r
i
(
x
‾
i
−
x
‾
i
)
+
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
\begin{equation} x_{gen, i} = r_i \left(\overline{x}_i - \underline{x}_i \right) + \underline{x}_i, i ∈ \{ 1,\cdots, N \} \end{equation}
xgen,i=ri(xi−xi)+xi,i∈{1,⋯,N}
其中:
r
i
r_i
ri为
[
0
,
1
]
[0,1]
[0,1]上满足特定概率分布的随机数,易得
x
‾
i
≤
x
g
e
n
,
i
≤
(
x
‾
i
−
x
‾
i
)
+
x
‾
i
=
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
\begin{equation} \underline{x}_i ≤ x_{gen, i} ≤ \left( \overline{x}_i - \underline{x}_i \right) + \underline{x}_i = \underline{x}_i, i ∈ \{ 1, \cdots, N \} \end{equation}
xi≤xgen,i≤(xi−xi)+xi=xi,i∈{1,⋯,N}
满足式(1)中的变量上下界约束,但该随机数生成方法无法保证满足式(1)中的线性方程约束。当生成的随机数
∑
i
=
1
N
x
g
e
n
,
i
>
b
≥
0
\displaystyle \sum_{i = 1}^{N} x_{gen, i} > b ≥ 0
i=1∑Nxgen,i>b≥0时,试给出适当的修正方法,将
x
g
e
n
\boldsymbol{x_{gen}}
xgen修正为
x
c
o
r
=
[
x
c
o
r
,
1
⋯
x
c
o
r
,
i
⋯
x
c
o
r
,
N
]
T
\boldsymbol{x_{cor}} = \left[ \begin{matrix}x_{cor, 1} & \cdots & x_{cor, i} & \cdots & x_{cor, N} \end{matrix} \right]^T
xcor=[xcor,1⋯xcor,i⋯xcor,N]T,以使修正后的
x
c
o
r
\boldsymbol{x_{cor}}
xcor满足式(1)中的所有约束。
解:对于
∀
i
∈
{
1
,
⋯
,
N
}
\forall i ∈ \{ 1,\cdots, N \}
∀i∈{1,⋯,N},按如式(4)所示的方法构造
x
c
o
r
,
i
x_{cor, i}
xcor,i,即
x
c
o
r
,
i
=
b
∑
i
=
1
N
x
g
e
n
,
i
x
g
e
n
,
i
\begin{equation} x_{cor, i} = \dfrac{b} {\displaystyle \sum_{i = 1}^{N} x_{gen, i}} x_{gen, i} \end{equation}
xcor,i=i=1∑Nxgen,ibxgen,i
易得
0
≤
x
c
o
r
,
i
=
b
∑
i
=
1
N
x
g
e
n
,
i
x
g
e
n
,
i
<
x
g
e
n
,
i
≤
x
‾
i
\begin{equation} 0 ≤ x_{cor, i} = \dfrac{b} {\displaystyle \sum_{i = 1}^{N} x_{gen, i}} x_{gen, i} < x_{gen, i} ≤ \overline{x}_i \end{equation}
0≤xcor,i=i=1∑Nxgen,ibxgen,i<xgen,i≤xi
∑
i
=
1
N
x
c
o
r
,
i
=
∑
i
=
1
N
[
b
∑
i
=
1
N
x
g
e
n
,
i
]
x
g
e
n
,
i
=
∑
i
=
1
N
x
g
e
n
,
i
∑
i
=
1
N
x
g
e
n
,
i
b
=
b
\begin{equation} \displaystyle \sum_{i = 1}^{N} x_{cor, i} = \displaystyle \sum_{i = 1}^{N} \left[ \dfrac{b} {\displaystyle \sum_{i = 1}^{N} x_{gen, i}} \right] x_{gen, i} = \dfrac{\displaystyle \sum_{i = 1}^{N} x_{gen, i}} {\displaystyle \sum_{i = 1}^{N} x_{gen, i}} b = b \end{equation}
i=1∑Nxcor,i=i=1∑N
i=1∑Nxgen,ib
xgen,i=i=1∑Nxgen,ii=1∑Nxgen,ib=b
满足式(1)中所有变量的上下界约束与变量求和约束,因此修正后的
x
c
o
r
\boldsymbol{x_{cor}}
xcor满足式(1)的所有约束,可以作为式(1)所示问题的其中一个可行解。
推论1(平移推论):求和方程约束下实变量之和大于常数项限定时的修正方法
设需要生成一组
N
N
N维随机向量
x
=
[
x
1
⋯
x
i
⋯
x
N
]
T
\boldsymbol{x}=\left[ \begin{matrix} x_1 & \cdots & x_i & \cdots & x_N \end{matrix} \right]^T
x=[x1⋯xi⋯xN]T满足如式(7)所示的约束条件
{
x
i
∈
[
x
‾
i
,
x
‾
i
]
,
i
∈
{
1
,
⋯
,
N
}
∑
i
=
1
N
x
i
=
b
\begin{equation} \begin{cases} x_i ∈ \left[ \underline{x}_i, \overline{x}_i \right], i ∈ \{ 1, \cdots, N \} \\ \displaystyle \sum_{i = 1}^{N} x_i = b \\ \end{cases} \end{equation}
⎩
⎨
⎧xi∈[xi,xi],i∈{1,⋯,N}i=1∑Nxi=b
其中:
x
‾
i
\underline{x}_i
xi和
x
‾
i
\overline{x}_i
xi为第
i
i
i维随机数
x
i
x_i
xi的下界和上界,
b
b
b为方程的常数项(
∑
i
=
1
N
x
‾
i
≤
b
≤
∑
i
=
1
N
x
‾
i
\displaystyle \sum_{i = 1}^{N} \underline{x}_i ≤ b ≤ \displaystyle \sum_{i = 1}^{N} \overline{x}_i
i=1∑Nxi≤b≤i=1∑Nxi)。
若按照如式(8)所示的随机数生成方法生成随机数
x
g
e
n
=
[
x
g
e
n
,
1
⋯
x
g
e
n
,
i
⋯
x
g
e
n
,
N
]
T
\boldsymbol{x_{gen}} = \left[ \begin{matrix} x_{gen, 1} & \cdots & x_{gen, i} \cdots & x_{gen, N} \end{matrix} \right]^T
xgen=[xgen,1⋯xgen,i⋯xgen,N]T作为式(7)所示问题的其中一个测试解
x
g
e
n
,
i
=
r
i
(
x
‾
i
−
x
‾
i
)
+
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
\begin{equation} x_{gen, i} = r_i \left(\overline{x}_i - \underline{x}_i \right) + \underline{x}_i, i ∈ \{ 1,\cdots, N \} \end{equation}
xgen,i=ri(xi−xi)+xi,i∈{1,⋯,N}
其中:
r
i
r_i
ri为
[
0
,
1
]
[0,1]
[0,1]上满足特定概率分布的随机数,易得
x
‾
i
≤
x
g
e
n
,
i
≤
(
x
‾
i
−
x
‾
i
)
+
x
‾
i
=
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
\begin{equation} \underline{x}_i ≤ x_{gen, i} ≤ \left( \overline{x}_i - \underline{x}_i \right) + \underline{x}_i = \underline{x}_i, i ∈ \{ 1, \cdots, N \} \end{equation}
xi≤xgen,i≤(xi−xi)+xi=xi,i∈{1,⋯,N}
满足式(7)中的变量上下界约束,但该随机数生成方法无法保证满足式(7)中的线性方程约束。当生成的随机数
∑
i
=
1
N
x
g
e
n
,
i
>
b
\displaystyle \sum_{i = 1}^{N} x_{gen, i} > b
i=1∑Nxgen,i>b时,试给出适当的修正方法,将
x
g
e
n
\boldsymbol{x_{gen}}
xgen修正为
x
c
o
r
=
[
x
c
o
r
,
1
⋯
x
c
o
r
,
i
⋯
x
c
o
r
,
N
]
T
\boldsymbol{x_{cor}} = \left[ \begin{matrix}x_{cor, 1} & \cdots & x_{cor, i} & \cdots & x_{cor, N} \end{matrix} \right]^T
xcor=[xcor,1⋯xcor,i⋯xcor,N]T,以使修正后的
x
c
o
r
\boldsymbol{x_{cor}}
xcor满足式(7)中的所有约束。
解:对于
∀
i
∈
{
1
,
⋯
,
N
}
\forall i ∈ \{ 1,\cdots, N \}
∀i∈{1,⋯,N},按如式(10)所示的方法构造
x
i
′
x'_i
xi′
x
i
′
=
x
i
−
x
‾
i
\begin{equation} x'_i = x_i - \underline{x}_i \end{equation}
xi′=xi−xi
则此时的优化问题变为如式(11)所示的形式
{
x
i
′
∈
[
0
,
x
‾
i
′
]
,
i
∈
{
1
,
⋯
,
N
}
∑
i
=
1
N
x
i
′
=
b
′
\begin{equation} \begin{cases} x'_i ∈ \left[ 0, \overline{x}'_i \right], i ∈ \{ 1, \cdots, N \} \\ \displaystyle \sum_{i = 1}^{N} x'_i = b' \\ \end{cases} \end{equation}
⎩
⎨
⎧xi′∈[0,xi′],i∈{1,⋯,N}i=1∑Nxi′=b′
其中:
x
‾
i
′
=
x
‾
i
−
x
‾
i
\overline{x}'_i = \overline{x}_i - \underline{x}_i
xi′=xi−xi,
b
′
=
b
−
∑
i
=
1
N
x
‾
i
b' = b - \displaystyle \sum_{i = 1}^{N} \underline{x}_i
b′=b−i=1∑Nxi。
显见式(11)所示的优化问题形式上即为式(1)所示的优化问题,根据该优化问题下导出的引理可知,按如式(12)所示的方法构造
x
c
o
r
,
i
′
=
x
c
o
r
,
i
−
x
‾
i
x'_{cor, i} = x_{cor, i} - \underline{x}_i
xcor,i′=xcor,i−xi,即可使生成的
x
c
o
r
,
i
′
x'_{cor, i}
xcor,i′满足式(11)中的所有约束条件
x
c
o
r
,
i
′
=
b
′
∑
i
=
1
N
x
g
e
n
,
i
′
x
g
e
n
,
i
′
\begin{equation} x'_{cor, i} = \dfrac{b'} {\displaystyle \sum_{i = 1}^{N} x'_{gen, i}} x'_{gen, i} \end{equation}
xcor,i′=i=1∑Nxgen,i′b′xgen,i′
其中:
x
g
e
n
,
i
′
=
x
g
e
n
,
i
−
x
‾
i
x'_{gen, i} = x_{gen, i} - \underline{x}_i
xgen,i′=xgen,i−xi,
∑
i
=
1
N
x
g
e
n
,
i
′
>
b
′
\displaystyle \sum_{i = 1}^{N} x'_{gen, i} > b'
i=1∑Nxgen,i′>b′。
将式(12)所示的
b
′
b'
b′、
x
g
e
n
,
i
′
x'_{gen, i}
xgen,i′、
x
c
o
r
,
i
′
x'_{cor, i}
xcor,i′分别用
b
b
b、
x
g
e
n
,
i
x_{gen, i}
xgen,i、
x
c
o
r
,
i
x_{cor, i}
xcor,i表示,则有
x
c
o
r
,
i
−
x
‾
i
=
b
−
∑
i
=
1
N
x
‾
i
∑
i
=
1
N
(
x
g
e
n
,
i
−
x
‾
i
)
(
x
g
e
n
,
i
−
x
‾
i
)
\begin{equation} x_{cor, i} - \underline{x}_i = \dfrac{b - \displaystyle \sum_{i = 1}^{N} \underline{x}_i} {\displaystyle \sum_{i = 1}^{N} \left( x_{gen, i} - \underline{x}_i \right) } \left( x_{gen, i} - \underline{x}_i \right) \end{equation}
xcor,i−xi=i=1∑N(xgen,i−xi)b−i=1∑Nxi(xgen,i−xi)
此时
x
c
o
r
,
i
=
b
−
∑
i
=
1
N
x
‾
i
∑
i
=
1
N
(
x
g
e
n
,
i
−
x
‾
i
)
(
x
g
e
n
,
i
−
x
‾
i
)
+
x
‾
i
\begin{equation} x_{cor, i} = \dfrac{b - \displaystyle \sum_{i = 1}^{N} \underline{x}_i} {\displaystyle \sum_{i = 1}^{N} \left( x_{gen, i} - \underline{x}_i \right) } \left( x_{gen, i} - \underline{x}_i \right) + \underline{x}_i \end{equation}
xcor,i=i=1∑N(xgen,i−xi)b−i=1∑Nxi(xgen,i−xi)+xi
结合式(11)可知,修正后的
x
c
o
r
,
i
x_{cor, i}
xcor,i满足
{
x
‾
i
≤
x
c
o
r
,
i
=
x
c
o
r
,
i
′
+
x
‾
i
≤
x
‾
i
′
+
x
‾
i
=
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
∑
i
=
1
N
x
c
o
r
,
i
=
∑
i
=
1
N
x
c
o
r
,
i
′
+
∑
i
=
1
N
x
‾
i
=
b
′
+
∑
i
=
1
N
x
‾
i
=
b
\begin{equation} \begin{cases} \underline{x}_i ≤ x_{cor, i} = x'_{cor, i} + \underline{x}_i ≤ \overline{x}'_i + \underline{x}_i = \overline{x}_i, i ∈ \{ 1, \cdots, N \} \\ \displaystyle \sum_{i = 1}^{N} x_{cor, i} = \displaystyle \sum_{i = 1}^{N} x'_{cor, i} + \displaystyle \sum_{i = 1}^{N} \underline{x}_i = b' + \sum_{i = 1}^{N} \underline{x}_i = b \\ \end{cases} \end{equation}
⎩
⎨
⎧xi≤xcor,i=xcor,i′+xi≤xi′+xi=xi,i∈{1,⋯,N}i=1∑Nxcor,i=i=1∑Nxcor,i′+i=1∑Nxi=b′+i=1∑Nxi=b
满足式(7)中所有变量的上下界约束与变量求和约束,因此修正后的
x
c
o
r
\boldsymbol{x_{cor}}
xcor满足式(7)的所有约束,可以作为式(7)所示问题的其中一个可行解。
推论2(倍乘推论):一般单线性方程约束下实变量之和大于常数项限定时的修正方法
设需要生成一组
N
N
N维随机向量
x
=
[
x
1
⋯
x
i
⋯
x
N
]
T
\boldsymbol{x}=\left[ \begin{matrix} x_1 & \cdots & x_i & \cdots & x_N \end{matrix} \right]^T
x=[x1⋯xi⋯xN]T满足如式(16)所示的约束条件
{
x
i
∈
[
x
‾
i
,
x
‾
i
]
,
i
∈
{
1
,
⋯
,
N
}
∑
i
=
1
N
a
i
x
i
=
b
\begin{equation} \begin{cases} x_i ∈ \left[ \underline{x}_i, \overline{x}_i \right], i ∈ \{ 1, \cdots, N \} \\ \displaystyle \sum_{i = 1}^{N} a_i x_i = b \\ \end{cases} \end{equation}
⎩
⎨
⎧xi∈[xi,xi],i∈{1,⋯,N}i=1∑Naixi=b
其中:
x
‾
i
\underline{x}_i
xi和
x
‾
i
\overline{x}_i
xi分别是第
i
i
i维随机数
x
i
x_i
xi的下界和上界;
a
i
a_i
ai为线性方程约束中随机数
x
i
x_i
xi的系数,方程中的
a
i
a_i
ai不能全部等于
0
0
0;
b
b
b为方程的常数项(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
≤
b
≤
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \underline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \overline{x}_i ≤ b ≤ \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \overline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \underline{x}_i
i=1,ai>0∑Naixi+i=1,ai<0∑Naixi≤b≤i=1,ai>0∑Naixi+i=1,ai<0∑Naixi)。
若按照如式(17)所示的随机数生成方法生成随机数
x
g
e
n
=
[
x
g
e
n
,
1
⋯
x
g
e
n
,
i
⋯
x
g
e
n
,
N
]
T
\boldsymbol{x_{gen}} = \left[ \begin{matrix} x_{gen, 1} & \cdots & x_{gen, i} \cdots & x_{gen, N} \end{matrix} \right]^T
xgen=[xgen,1⋯xgen,i⋯xgen,N]T作为式(16)所示问题的其中一个测试解
x
g
e
n
,
i
=
r
i
(
x
‾
i
−
x
‾
i
)
+
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
\begin{equation} x_{gen, i} = r_i \left(\overline{x}_i - \underline{x}_i \right) + \underline{x}_i, i ∈ \{ 1,\cdots, N \} \end{equation}
xgen,i=ri(xi−xi)+xi,i∈{1,⋯,N}
其中:
r
i
r_i
ri为
[
0
,
1
]
[0,1]
[0,1]上满足特定概率分布的随机数,易得
x
‾
i
≤
x
g
e
n
,
i
≤
(
x
‾
i
−
x
‾
i
)
+
x
‾
i
=
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
\begin{equation} \underline{x}_i ≤ x_{gen, i} ≤ \left( \overline{x}_i - \underline{x}_i \right) + \underline{x}_i = \underline{x}_i, i ∈ \{ 1, \cdots, N \} \end{equation}
xi≤xgen,i≤(xi−xi)+xi=xi,i∈{1,⋯,N}
满足式(16)中的变量上下界约束,但该随机数生成方法无法保证满足式(16)中的线性方程约束。当生成的随机数
∑
i
=
1
N
a
i
x
g
e
n
,
i
>
b
\displaystyle \sum_{i = 1}^{N} a_i x_{gen, i} > b
i=1∑Naixgen,i>b时,试给出适当的修正方法,将
x
g
e
n
\boldsymbol{x_{gen}}
xgen修正为
x
c
o
r
=
[
x
c
o
r
,
1
⋯
x
c
o
r
,
i
⋯
x
c
o
r
,
N
]
T
\boldsymbol{x_{cor}} = \left[ \begin{matrix}x_{cor, 1} & \cdots & x_{cor, i} & \cdots & x_{cor, N} \end{matrix} \right]^T
xcor=[xcor,1⋯xcor,i⋯xcor,N]T,以使修正后的
x
c
o
r
\boldsymbol{x_{cor}}
xcor满足式(16)中的所有约束。
解:对于
∀
i
∈
{
1
,
⋯
,
N
}
\forall i ∈ \{ 1,\cdots, N \}
∀i∈{1,⋯,N},按如式(19)所示的方法构造
x
i
′
′
x''_i
xi′′
x
i
′
′
=
a
i
x
i
\begin{equation} x''_i = a_i x_i \end{equation}
xi′′=aixi
则此时的优化问题变为如式(20)所示的形式
{
x
i
′
′
∈
[
x
‾
i
′
′
,
x
‾
i
′
′
]
,
i
∈
{
1
,
⋯
,
N
}
∑
i
=
1
N
x
i
′
′
=
b
′
′
\begin{equation} \begin{cases} x''_i ∈ \left[ \underline{x}''_i, \overline{x}''_i \right], i ∈ \{ 1, \cdots, N \} \\ \displaystyle \sum_{i = 1}^{N} x''_i = b'' \\ \end{cases} \end{equation}
⎩
⎨
⎧xi′′∈[xi′′,xi′′],i∈{1,⋯,N}i=1∑Nxi′′=b′′
其中:
x
‾
i
′
′
=
{
a
i
x
‾
i
(
a
i
>
0
)
0
(
a
i
=
0
)
a
i
x
‾
i
(
a
i
<
0
)
\underline{x}''_i = \begin{cases} a_i \underline{x}_i & \left( a_i > 0 \right) \\ 0 & \left( a_i = 0 \right) \\ a_i \overline{x}_i & \left( a_i < 0 \right) \\ \end{cases}
xi′′=⎩
⎨
⎧aixi0aixi(ai>0)(ai=0)(ai<0),
x
‾
i
′
′
=
{
a
i
x
‾
i
(
a
i
>
0
)
0
(
a
i
=
0
)
a
i
x
‾
i
(
a
i
<
0
)
\overline{x}''_i = \begin{cases} a_i \overline{x}_i & \left( a_i > 0 \right) \\ 0 & \left( a_i = 0 \right) \\ a_i \underline{x}_i & \left( a_i < 0 \right) \\ \end{cases}
xi′′=⎩
⎨
⎧aixi0aixi(ai>0)(ai=0)(ai<0),
b
′
′
=
b
b'' = b
b′′=b。
显见式(20)所示的优化问题形式上即为式(7)所示的优化问题,根据该优化问题下导出的**推论1(平移推论)**可知,按如式(21)所示的方法构造
x
c
o
r
,
i
′
′
=
a
i
x
c
o
r
,
i
x''_{cor, i} = a_i x_{cor, i}
xcor,i′′=aixcor,i,即可使生成的
x
c
o
r
,
i
′
′
x''_{cor, i}
xcor,i′′满足式(20)中的所有约束条件
x
c
o
r
,
i
′
′
=
b
′
′
−
∑
i
=
1
N
x
‾
i
′
′
∑
i
=
1
N
(
x
g
e
n
,
i
′
′
−
x
‾
i
′
′
)
(
x
g
e
n
,
i
′
′
−
x
‾
i
′
′
)
+
x
‾
i
′
′
\begin{equation} x''_{cor, i} = \dfrac{b'' - \displaystyle \sum_{i = 1}^{N} \underline{x}''_i} {\displaystyle \sum_{i = 1}^{N} \left( x''_{gen, i} - \underline{x}''_i \right) } \left( x''_{gen, i} - \underline{x}''_i \right) + \underline{x}''_i \end{equation}
xcor,i′′=i=1∑N(xgen,i′′−xi′′)b′′−i=1∑Nxi′′(xgen,i′′−xi′′)+xi′′
其中:
x
g
e
n
,
i
′
′
=
a
i
x
g
e
n
,
i
x''_{gen, i} = a_i x_{gen, i}
xgen,i′′=aixgen,i,
∑
i
=
1
N
x
g
e
n
,
i
′
′
>
b
′
′
\displaystyle \sum_{i = 1}^{N} x''_{gen, i} > b''
i=1∑Nxgen,i′′>b′′。
将式(21)所示的
b
′
′
b''
b′′、
x
g
e
n
,
i
′
′
x''_{gen, i}
xgen,i′′、
x
c
o
r
,
i
′
′
x''_{cor, i}
xcor,i′′分别用
b
b
b、
x
g
e
n
,
i
x_{gen, i}
xgen,i、
x
c
o
r
,
i
x_{cor, i}
xcor,i表示,则:
情况2.1:当
a
i
>
0
a_i > 0
ai>0时,
a
i
x
c
o
r
,
i
=
b
−
(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
)
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
+
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
+
a
i
x
‾
i
\begin{equation} a_i x_{cor, i} = \dfrac{b - \left( \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \underline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \overline{x}_i \right)} {\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \underline{x}_i \right) + \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \overline{x}_i \right)} a_i \left( x_{gen, i} - \underline{x}_i \right) + a_i \underline{x}_i \end{equation}
aixcor,i=i=1,ai>0∑Nai(xgen,i−xi)+i=1,ai>0∑Nai(xgen,i−xi)b−(i=1,ai>0∑Naixi+i=1,ai<0∑Naixi)ai(xgen,i−xi)+aixi
此时
x
c
o
r
,
i
=
b
−
(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
)
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
+
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
(
x
g
e
n
,
i
−
x
‾
i
)
+
x
‾
i
\begin{equation} x_{cor, i} = \dfrac{b - \left( \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \underline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \overline{x}_i \right)} {\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \underline{x}_i \right) + \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \overline{x}_i \right)} \left( x_{gen, i} - \underline{x}_i \right) + \underline{x}_i \end{equation}
xcor,i=i=1,ai>0∑Nai(xgen,i−xi)+i=1,ai>0∑Nai(xgen,i−xi)b−(i=1,ai>0∑Naixi+i=1,ai<0∑Naixi)(xgen,i−xi)+xi
情况2.2:当
a
i
<
0
a_i < 0
ai<0时,
a
i
x
c
o
r
,
i
=
b
−
(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
)
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
+
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
+
a
i
x
‾
i
\begin{equation} a_i x_{cor, i} = \dfrac{b - \left( \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \underline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \overline{x}_i \right)} {\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \underline{x}_i \right) + \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \overline{x}_i \right)} a_i \left( x_{gen, i} - \overline{x}_i \right) + a_i \overline{x}_i \end{equation}
aixcor,i=i=1,ai>0∑Nai(xgen,i−xi)+i=1,ai>0∑Nai(xgen,i−xi)b−(i=1,ai>0∑Naixi+i=1,ai<0∑Naixi)ai(xgen,i−xi)+aixi
此时
x
c
o
r
,
i
=
b
−
(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
)
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
+
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
(
x
g
e
n
,
i
−
x
‾
i
)
+
x
‾
i
\begin{equation} x_{cor, i} = \dfrac{b - \left( \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \underline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \overline{x}_i \right)} {\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \underline{x}_i \right) + \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \overline{x}_i \right)} \left( x_{gen, i} - \overline{x}_i \right) + \overline{x}_i \end{equation}
xcor,i=i=1,ai>0∑Nai(xgen,i−xi)+i=1,ai>0∑Nai(xgen,i−xi)b−(i=1,ai>0∑Naixi+i=1,ai<0∑Naixi)(xgen,i−xi)+xi
情况2.3:当
a
i
=
0
a_i = 0
ai=0时,对于
∀
x
c
o
r
,
i
∈
[
x
‾
i
,
x
‾
i
]
\forall x_{cor, i} ∈ \left[ \underline{x}_i, \overline{x}_i \right]
∀xcor,i∈[xi,xi],均有
a
i
x
c
o
r
,
i
≡
0
\begin{equation} a_i x_{cor, i} \equiv 0 \end{equation}
aixcor,i≡0
此时可在变量
x
i
x_i
xi的取值范围内任意取值作为修正后的
x
c
o
r
,
i
x_{cor, i}
xcor,i,可不改变其取值,即
x
c
o
r
,
i
=
x
g
e
n
,
i
x_{cor, i} = x_{gen, i}
xcor,i=xgen,i。
结合式(20)可知,修正后的
x
c
o
r
,
i
x_{cor, i}
xcor,i满足
{
x
‾
i
≤
x
c
o
r
,
i
≤
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
∑
i
=
1
N
a
i
x
c
o
r
,
i
=
∑
i
=
1
N
x
c
o
r
,
i
′
′
=
b
′
′
=
b
\begin{equation} \begin{cases} \underline{x}_i ≤ x_{cor, i} ≤ \overline{x}_i, i ∈ \{ 1, \cdots, N \} \\ \displaystyle \sum_{i = 1}^{N} a_i x_{cor, i} = \displaystyle \sum_{i = 1}^{N} x''_{cor, i} = b'' = b \\ \end{cases} \end{equation}
⎩
⎨
⎧xi≤xcor,i≤xi,i∈{1,⋯,N}i=1∑Naixcor,i=i=1∑Nxcor,i′′=b′′=b
满足式(16)中所有变量的上下界约束与变量求和约束,因此修正后的
x
c
o
r
\boldsymbol{x_{cor}}
xcor满足式(16)的所有约束,可以作为式(16)所示问题的其中一个可行解。
推论3(取反推论):一般单线性方程约束下实变量之和小于常数项限定时的修正方法
设需要生成一组
N
N
N维随机向量
x
=
[
x
1
⋯
x
i
⋯
x
N
]
T
\boldsymbol{x}=\left[ \begin{matrix} x_1 & \cdots & x_i & \cdots & x_N \end{matrix} \right]^T
x=[x1⋯xi⋯xN]T满足如式(28)所示的约束条件
{
x
i
∈
[
x
‾
i
,
x
‾
i
]
,
i
∈
{
1
,
⋯
,
N
}
∑
i
=
1
N
a
i
x
i
=
b
\begin{equation} \begin{cases} x_i ∈ \left[ \underline{x}_i, \overline{x}_i \right], i ∈ \{ 1, \cdots, N \} \\ \displaystyle \sum_{i = 1}^{N} a_i x_i = b \\ \end{cases} \end{equation}
⎩
⎨
⎧xi∈[xi,xi],i∈{1,⋯,N}i=1∑Naixi=b
其中:
x
‾
i
\underline{x}_i
xi和
x
‾
i
\overline{x}_i
xi分别是第
i
i
i维随机数
x
i
x_i
xi的下界和上界;
a
i
a_i
ai为线性方程约束中随机数
x
i
x_i
xi的系数,方程中的
a
i
a_i
ai不能全部等于
0
0
0;
b
b
b为方程的常数项(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
≤
b
≤
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \underline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \overline{x}_i ≤ b ≤ \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \overline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \underline{x}_i
i=1,ai>0∑Naixi+i=1,ai<0∑Naixi≤b≤i=1,ai>0∑Naixi+i=1,ai<0∑Naixi)。
若按照如式(29)所示的随机数生成方法生成随机数
x
g
e
n
=
[
x
g
e
n
,
1
⋯
x
g
e
n
,
i
⋯
x
g
e
n
,
N
]
T
\boldsymbol{x_{gen}} = \left[ \begin{matrix} x_{gen, 1} & \cdots & x_{gen, i} \cdots & x_{gen, N} \end{matrix} \right]^T
xgen=[xgen,1⋯xgen,i⋯xgen,N]T作为式(28)所示问题的其中一个测试解
x
g
e
n
,
i
=
r
i
(
x
‾
i
−
x
‾
i
)
+
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
\begin{equation} x_{gen, i} = r_i \left(\overline{x}_i - \underline{x}_i \right) + \underline{x}_i, i ∈ \{ 1,\cdots, N \} \end{equation}
xgen,i=ri(xi−xi)+xi,i∈{1,⋯,N}
其中:
r
i
r_i
ri为
[
0
,
1
]
[0,1]
[0,1]上满足特定概率分布的随机数,易得
x
‾
i
≤
x
g
e
n
,
i
≤
(
x
‾
i
−
x
‾
i
)
+
x
‾
i
=
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
\begin{equation} \underline{x}_i ≤ x_{gen, i} ≤ \left( \overline{x}_i - \underline{x}_i \right) + \underline{x}_i = \underline{x}_i, i ∈ \{ 1, \cdots, N \} \end{equation}
xi≤xgen,i≤(xi−xi)+xi=xi,i∈{1,⋯,N}
满足式(16)中的变量上下界约束,但该随机数生成方法无法保证满足式(16)中的线性方程约束。当生成的随机数
∑
i
=
1
N
a
i
x
g
e
n
,
i
<
b
\displaystyle \sum_{i = 1}^{N} a_i x_{gen, i} < b
i=1∑Naixgen,i<b时,试给出适当的修正方法,将
x
g
e
n
\boldsymbol{x_{gen}}
xgen修正为
x
c
o
r
=
[
x
c
o
r
,
1
⋯
x
c
o
r
,
i
⋯
x
c
o
r
,
N
]
T
\boldsymbol{x_{cor}} = \left[ \begin{matrix}x_{cor, 1} & \cdots & x_{cor, i} & \cdots & x_{cor, N} \end{matrix} \right]^T
xcor=[xcor,1⋯xcor,i⋯xcor,N]T,以使修正后的
x
c
o
r
\boldsymbol{x_{cor}}
xcor满足式(16)中的所有约束。
解:对于
∀
i
∈
{
1
,
⋯
,
N
}
\forall i ∈ \{ 1,\cdots, N \}
∀i∈{1,⋯,N},按如式(31)所示的方法构造
x
i
′
′
′
x'''_i
xi′′′
x
i
′
′
′
=
−
x
i
\begin{equation} x'''_i = -x_i \end{equation}
xi′′′=−xi
则此时的优化问题变为如式(32)所示的形式
{
x
i
′
′
′
∈
[
x
‾
i
′
′
′
,
x
‾
i
′
′
′
]
,
i
∈
{
1
,
⋯
,
N
}
∑
i
=
1
N
a
i
x
i
′
′
′
=
b
′
′
′
\begin{equation} \begin{cases} x'''_i ∈ \left[ \underline{x}'''_i, \overline{x}'''_i \right], i ∈ \{ 1, \cdots, N \} \\ \displaystyle \sum_{i = 1}^{N} a_i x'''_i = b''' \\ \end{cases} \end{equation}
⎩
⎨
⎧xi′′′∈[xi′′′,xi′′′],i∈{1,⋯,N}i=1∑Naixi′′′=b′′′
其中:
x
‾
i
′
′
′
=
−
x
‾
i
\underline{x}'''_i = -\overline{x}_i
xi′′′=−xi,
x
‾
i
′
′
′
=
−
x
‾
i
\overline{x}'''_i = -\underline{x}_i
xi′′′=−xi,
b
′
′
′
=
−
b
b''' = -b
b′′′=−b。
显见式(32)所示的优化问题形式上即为式(16)所示的优化问题,根据该优化问题下导出的** 推论2(倍乘推论)**可知,按如式(33)所示的方法构造
x
c
o
r
,
i
′
′
′
=
−
x
c
o
r
,
i
x'''_{cor, i} = -x_{cor, i}
xcor,i′′′=−xcor,i,即可使生成的
x
c
o
r
,
i
′
′
′
x'''_{cor, i}
xcor,i′′′满足式(32)中的所有约束条件
x
c
o
r
,
i
′
′
′
=
{
b
′
′
′
−
(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
′
′
′
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
′
′
′
)
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
′
′
′
−
x
‾
i
′
′
′
)
+
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
′
′
′
−
x
‾
i
′
′
′
)
(
x
g
e
n
,
i
′
′
′
−
x
‾
i
′
′
′
)
+
x
‾
i
′
′
′
(
a
i
>
0
)
x
g
e
n
,
i
′
′
′
(
a
i
=
0
)
b
′
′
′
−
(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
′
′
′
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
′
′
′
)
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
′
′
′
−
x
‾
i
′
′
′
)
+
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
′
′
′
−
x
‾
i
′
′
′
)
(
x
g
e
n
,
i
′
′
′
−
x
‾
i
′
′
′
)
+
x
‾
i
′
′
′
(
a
i
<
0
)
\begin{equation} x'''_{cor, i} = \begin{cases} \dfrac{b''' - \left( \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \underline{x}'''_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \overline{x}'''_i \right)} {\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x'''_{gen, i} - \underline{x}'''_i \right) + \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x'''_{gen, i} - \overline{x}'''_i \right)} \left( x'''_{gen, i} - \underline{x}'''_i \right) + \underline{x}'''_i & \left( a_i > 0 \right) \\ x'''_{gen, i} & \left( a_i = 0 \right) \\ \dfrac{b''' - \left( \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \underline{x}'''_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \overline{x}'''_i \right)} {\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x'''_{gen, i} - \underline{x}'''_i \right) + \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x'''_{gen, i} - \overline{x}'''_i \right)} \left( x'''_{gen, i} - \overline{x}'''_i \right) + \overline{x}'''_i & \left( a_i < 0 \right) \\ \end{cases} \end{equation}
xcor,i′′′=⎩
⎨
⎧i=1,ai>0∑Nai(xgen,i′′′−xi′′′)+i=1,ai>0∑Nai(xgen,i′′′−xi′′′)b′′′−(i=1,ai>0∑Naixi′′′+i=1,ai<0∑Naixi′′′)(xgen,i′′′−xi′′′)+xi′′′xgen,i′′′i=1,ai>0∑Nai(xgen,i′′′−xi′′′)+i=1,ai>0∑Nai(xgen,i′′′−xi′′′)b′′′−(i=1,ai>0∑Naixi′′′+i=1,ai<0∑Naixi′′′)(xgen,i′′′−xi′′′)+xi′′′(ai>0)(ai=0)(ai<0)
其中:
x
g
e
n
,
i
′
′
′
=
−
x
g
e
n
,
i
x'''_{gen, i} = -x_{gen, i}
xgen,i′′′=−xgen,i,
∑
i
=
1
N
a
i
x
g
e
n
,
i
′
′
′
>
b
′
′
′
\displaystyle \sum_{i = 1}^{N} a_i x'''_{gen, i} > b'''
i=1∑Naixgen,i′′′>b′′′。
将式(33)所示的
b
′
′
′
b'''
b′′′、
x
g
e
n
,
i
′
′
′
x'''_{gen, i}
xgen,i′′′、
x
c
o
r
,
i
′
′
′
x'''_{cor, i}
xcor,i′′′分别用
b
b
b、
x
g
e
n
,
i
x_{gen, i}
xgen,i、
x
c
o
r
,
i
x_{cor, i}
xcor,i表示,则:
−
x
c
o
r
,
i
=
{
−
b
+
(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
)
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
+
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
(
x
g
e
n
,
i
−
x
‾
i
)
−
x
‾
i
(
a
i
>
0
)
−
x
g
e
n
,
i
(
a
i
=
0
)
−
b
+
(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
)
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
+
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
(
x
g
e
n
,
i
−
x
‾
i
)
−
x
‾
i
(
a
i
<
0
)
\begin{equation} -x_{cor, i} = \begin{cases} \dfrac{-b + \left( \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \overline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \underline{x}_i \right)} {\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \overline{x}_i \right) + \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \underline{x}_i \right)} \left( x_{gen, i} - \overline{x}_i \right) - \overline{x}_i & \left( a_i > 0 \right) \\ -x_{gen, i} & \left( a_i = 0 \right) \\ \dfrac{-b + \left( \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \overline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \underline{x}_i \right)} {\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \overline{x}_i \right) + \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \underline{x}_i \right)} \left( x_{gen, i} - \underline{x}_i \right) - \underline{x}_i & \left( a_i < 0 \right) \\ \end{cases} \end{equation}
−xcor,i=⎩
⎨
⎧i=1,ai>0∑Nai(xgen,i−xi)+i=1,ai>0∑Nai(xgen,i−xi)−b+(i=1,ai>0∑Naixi+i=1,ai<0∑Naixi)(xgen,i−xi)−xi−xgen,ii=1,ai>0∑Nai(xgen,i−xi)+i=1,ai>0∑Nai(xgen,i−xi)−b+(i=1,ai>0∑Naixi+i=1,ai<0∑Naixi)(xgen,i−xi)−xi(ai>0)(ai=0)(ai<0)
此时
x
c
o
r
,
i
=
{
b
−
(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
)
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
+
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
(
x
g
e
n
,
i
−
x
‾
i
)
+
x
‾
i
(
a
i
>
0
)
x
g
e
n
,
i
(
a
i
=
0
)
b
−
(
∑
i
=
1
,
a
i
>
0
N
a
i
x
‾
i
+
∑
i
=
1
,
a
i
<
0
N
a
i
x
‾
i
)
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
+
∑
i
=
1
,
a
i
>
0
N
a
i
(
x
g
e
n
,
i
−
x
‾
i
)
(
x
g
e
n
,
i
−
x
‾
i
)
+
x
‾
i
(
a
i
<
0
)
\begin{equation} x_{cor, i} = \begin{cases} \dfrac{b - \left( \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \overline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \underline{x}_i \right)} {\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \overline{x}_i \right) + \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \underline{x}_i \right)} \left( x_{gen, i} - \overline{x}_i \right) + \overline{x}_i & \left( a_i > 0 \right) \\ x_{gen, i} & \left( a_i = 0 \right) \\ \dfrac{b - \left( \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \overline{x}_i + \displaystyle \sum_{i = 1, a_i < 0}^{N} a_i \underline{x}_i \right)} {\displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \overline{x}_i \right) + \displaystyle \sum_{i = 1, a_i > 0}^{N} a_i \left( x_{gen, i} - \underline{x}_i \right)} \left( x_{gen, i} - \underline{x}_i \right) + \underline{x}_i & \left( a_i < 0 \right) \\ \end{cases} \end{equation}
xcor,i=⎩
⎨
⎧i=1,ai>0∑Nai(xgen,i−xi)+i=1,ai>0∑Nai(xgen,i−xi)b−(i=1,ai>0∑Naixi+i=1,ai<0∑Naixi)(xgen,i−xi)+xixgen,ii=1,ai>0∑Nai(xgen,i−xi)+i=1,ai>0∑Nai(xgen,i−xi)b−(i=1,ai>0∑Naixi+i=1,ai<0∑Naixi)(xgen,i−xi)+xi(ai>0)(ai=0)(ai<0)
结合式(32)可知,修正后的
x
c
o
r
,
i
x_{cor, i}
xcor,i满足
{
x
‾
i
=
−
x
‾
i
′
′
′
≤
x
c
o
r
,
i
=
−
x
c
o
r
,
i
′
′
′
≤
−
x
‾
′
′
′
=
x
‾
i
,
i
∈
{
1
,
⋯
,
N
}
∑
i
=
1
N
a
i
x
c
o
r
,
i
=
−
∑
i
=
1
N
a
i
x
c
o
r
,
i
=
−
b
′
′
′
=
b
\begin{equation} \begin{cases} \underline{x}_i = -\overline{x}'''_i ≤ x_{cor, i} = -x'''_{cor, i} ≤ -\underline{x}'''= \overline{x}_i, i ∈ \{ 1, \cdots, N \} \\ \displaystyle \sum_{i = 1}^{N} a_i x_{cor, i} = -\displaystyle \sum_{i = 1}^{N} a_i x_{cor, i} = -b''' = b \\ \end{cases} \end{equation}
⎩
⎨
⎧xi=−xi′′′≤xcor,i=−xcor,i′′′≤−x′′′=xi,i∈{1,⋯,N}i=1∑Naixcor,i=−i=1∑Naixcor,i=−b′′′=b
满足式(28)中所有变量的上下界约束与变量求和约束,因此修正后的
x
c
o
r
\boldsymbol{x_{cor}}
xcor满足式(28)的所有约束,可以作为式(28)所示问题的其中一个可行解。
研究目标
(1) 探究满足一般线性约束的生成随机数的修正方法;
(2) 探究满足某些非线性约束的生成随机数修正方法;
(3) 将生成随机数修正方法应用到基于启发式优化算法的优化问题求解中,使得启发式优化算法能够始终在优化问题的可行域中搜寻问题的解,从而加快启发式优化算法的收敛速度。