# 黄金分割搜索

黄金分割搜索是一种无导数方法，用于在已知区间上求单变量单峰函数的最小值（或最大值）。它通过在两个按黄金比例放置的内点处反复计算函数值，并舍弃不可能包含极值的子区间来实现。<sup>[1](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)</sup> 由于它只使用函数值，因此适用于导数不可用、计算代价高昂或不可靠的情形，甚至对不可微函数也有效。<sup>[2](https://people.csail.mit.edu/jsolomon/share/book/numerical_book_submitted.pdf)</sup>

| 关键事实 | 细节 |
|---|---|
| 问题类别 | 在包围区间 [a, b] 上求单峰函数的最小值（或最大值）；单峰函数在到达某点 m 之前单调下降、之后单调上升，因此极值在该区间上唯一<sup>[1](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)</sup> |
| 所用信息 | 仅函数求值；不使用导数<sup>[1](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)</sup> |
| 点的放置 | 内点到区间左端点的距离分别为区间长度的 φ 和 1 − φ 倍，其中 φ = (√5 − 1)/2 ≈ 0.618<sup>[3](https://stat243.berkeley.edu/fall-2024/units/unit11-optim.html)</sup> |
| 每次迭代代价 | 一次新的函数求值，因为有一个内点会保留到下一区间<sup>[4](https://optimization.cbe.cornell.edu/index.php?title=Derivative_free_optimization)</sup> |
| 收敛性 | 线性；每轮迭代区间按因子 φ ≈ 0.618 缩短，比基于导数的二分法每次减半更慢<sup>[5](https://www.cs.cornell.edu/courses/cs4210/2014fa/CVLBook/chap8.pdf)</sup><sup> • </sup><sup>[3](https://stat243.berkeley.edu/fall-2024/units/unit11-optim.html)</sup> |
| 停止准则 | 区间长度低于用户给定的容差，或达到设定的迭代次数<sup>[1](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)</sup><sup> • </sup><sup>[4](https://optimization.cbe.cornell.edu/index.php?title=Derivative_free_optimization)</sup> |
| 软件 | 在 SciPy 中可用 `scipy.optimize.golden`；在通用极小化器中作为布伦特方法（Brent's method）的组成部分提供<sup>[6](https://scipy.github.io/devdocs/reference/generated/scipy.optimize.golden.html)</sup><sup> • </sup><sup>[7](https://maths-people.anu.edu.au/brent/pub/pub011.html)</sup> |

## 工作原理

该方法要求有一个包围区间：即一个已知包含单峰函数极小点的区间 [a, b]。若存在 [a, b] 中的点 m，使得 f 在 x ≤ m 时单调下降、在 x ≥ m 时单调上升（求最大值时则相反），则称 f 在 [a, b] 上为单峰函数；这样的函数在该区间上有唯一最小值。<sup>[1](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)</sup> 求最大值可通过最小化取负后的函数来处理。<sup>[1](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)</sup>

**两个内点决定舍弃哪一段。** 算法在 [a, b] 内的两点 x₁ < x₂ 处计算 f。若 f(x₁) ≤ f(x₂)，单峰性保证极小点位于 [a, x₂] 内，于是该区间成为新区间；若 f(x₁) > f(x₂)，则极小点位于 [x₁, b] 内。无论哪种情况，区间都会缩短，且不会丢弃任何可能的极小点。<sup>[1](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)</sup>

**为什么是黄金比例。** 有两个条件使迭代高效。第一，两个内点对称放置，因此两种可能的新区间长度相同。第二，间距必须能够自我复制：若 [a, x₂] 成为新区间，则旧内点 x₁ 必须恰好落在新内点将被放置的位置。将各段长度记为 l₁、l₂、l₃，这些条件给出方程

\[ \left(\frac{l_2+l_3}{l_1}\right)^2 - \frac{l_2+l_3}{l_1} - 1 = 0, \]

其正解为 r = (√5 + 1)/2，即黄金比例。<sup>[1](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)</sup> 等价地，φ 满足 φ − φ² = 2φ − 1。<sup>[3](https://stat243.berkeley.edu/fall-2024/units/unit11-optim.html)</sup> 于是内点为

\[ x_1 = a + \frac{3-\sqrt{5}}{2}(b-a), \qquad x_2 = a + \frac{\sqrt{5}-1}{2}(b-a). \]

一种常见实现使用常数 c = (−1 + √5)/2 ≈ 0.618，并令 x₁ = c·a + (1 − c)·b、x₂ = (1 − c)·a + c·b。<sup>[4](https://optimization.cbe.cornell.edu/index.php?title=Derivative_free_optimization)</sup>

**每步只做一次求值。** 由于保留下来的内点恰好落在下一次迭代将放置点的位置，因此可以复用：每次更新区间后，只需为被舍弃点的替代点做一次新的函数求值。<sup>[4](https://optimization.cbe.cornell.edu/index.php?title=Derivative_free_optimization)</sup> 这种复用正是黄金比例布点的实际收益。

当区间长度降到规定容差以下，或在固定步数之后，迭代停止；最终估计值取函数值较小的那个端点。<sup>[1](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)</sup> 算法返回的是一个区间，而不是精确的极小点；它给出预测：最小值位于最终的 a 与 b 之间。<sup>[4](https://optimization.cbe.cornell.edu/index.php?title=Derivative_free_optimization)</sup>

## 收敛性与比较

每次迭代区间都乘以 φ ≈ 0.618，因此该方法线性收敛，类似求根中的二分法。<sup>[5](https://www.cs.cornell.edu/courses/cs4210/2014fa/CVLBook/chap8.pdf)</sup> 与基于二分法的极小化方法比较很有启发：基于导数的二分法每步将区间减半，单步更快，但它要求一阶导数存在且可计算。<sup>[3](https://stat243.berkeley.edu/fall-2024/units/unit11-optim.html)</sup> 黄金分割搜索只需要函数值，因此适合不便计算导数的黑箱、含噪或基于仿真的目标函数。<sup>[4](https://optimization.cbe.cornell.edu/index.php?title=Derivative_free_optimization)</sup>

一个算例具体展示了区间收缩。对 [0, 5] 上的 f(x) = (x − 2)² + 1，最初的内点为 x₁ ≈ 1.91 和 x₂ ≈ 3.09；由于 f(x₁) ≈ 1.01 ≤ f(x₂) ≈ 2.19，区间变为 [0, 3.09]，反复迭代后区间在 x = 2 附近收窄，此处 f(x) = 1。<sup>[4](https://optimization.cbe.cornell.edu/index.php?title=Derivative_free_optimization)</sup> 对 [0, 0.5] 上的多项式 f(x) = 3x⁴ + 2x² − x − 1，容差为 10⁻⁹，该方法返回最小值 −1.1161775914507224，位于 x ≈ 0.21864；对 [0, π] 上的 f(x) = −sin x，容差为 10⁻⁵，它恢复出已知最小值 −1，位于 x ≈ 1.57080。<sup>[1](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)</sup>

该方法的保证取决于单峰性。若包围区间内的函数有多个局部极小值，黄金分割搜索可能找不到全局解。<sup>[8](https://bpb-us-e1.wpmucdn.com/sites.psu.edu/dist/d/166843/files/2023/06/Math555.pdf)</sup>

## 变体与相关方法

**斐波那契（Fibonacci）搜索**是用于单峰函数的密切相关的区间缩减方法；对于某些期望的最终不确定范围，它所需的迭代次数少于黄金分割法；黄金分割法对应于点数无界时[斐波那契](https://www.edgepedia.org/zh/fibonacci)布点的极限。<sup>[9](https://sci.uobasrah.edu.iq/images/Math/436/436.pdf)</sup>

**布伦特方法**将黄金分割搜索与逐次抛物线插值结合起来：在函数光滑处用抛物线拟合加速收敛，在其他地方退回到黄金分割步以保证安全；它是数值库中推荐的通用一维极小化方法。<sup>[7](https://maths-people.anu.edu.au/brent/pub/pub011.html)</sup><sup> • </sup><sup>[10](https://roesner.pages.ub.uni-bielefeld.de/lectures/computational-physics/semester/sose2026/lecture/05_optimization/01_one_dimensional.html)</sup> SciPy 既提供独立的黄金分割例程 `scipy.optimize.golden`，也通过 `scipy.optimize.minimize_scalar` 提供基于布伦特方法的选项。<sup>[6](https://scipy.github.io/devdocs/reference/generated/scipy.optimize.golden.html)</sup>

**线搜索中的用途。** 在多变量优化中，一维搜索方法充当线搜索步骤，用来选择沿选定方向移动多远；黄金分割搜索是承担这一角色的标准精确线搜索工具之一。<sup>[11](https://www.oreilly.com/library/view/an-introduction-to/9781118515150/OEBPS/c07.htm)</sup>

## References

1. [Golden-section search, First Semester in Numerical Analysis with Python (Yaning Liu and Giray Okten)](https://yaningliucudenver.github.io/Numerical-Analysis-I/bookchapter7-1.html)
2. [Unconstrained Optimization, J. R. Solomonoff](https://people.csail.mit.edu/jsolomon/share/book/numerical_book_submitted.pdf)
3. [Optimization, Stat 243, UC Berkeley](https://stat243.berkeley.edu/fall-2024/units/unit11-optim.html)
4. [Derivative free optimization, Cornell University Computational Optimization Open Textbook](https://optimization.cbe.cornell.edu/index.php?title=Derivative_free_optimization)
5. [Chapter 8, Cornell CS4210 course notes](https://www.cs.cornell.edu/courses/cs4210/2014fa/CVLBook/chap8.pdf)
6. [scipy.optimize.golden, SciPy documentation](https://scipy.github.io/devdocs/reference/generated/scipy.optimize.golden.html)
7. [R. P. Brent, Algorithms for Minimization without Derivatives (1973), ANU](https://maths-people.anu.edu.au/brent/pub/pub011.html)
8. [Numerical Optimization, Penn State Math 555 notes](https://bpb-us-e1.wpmucdn.com/sites.psu.edu/dist/d/166843/files/2023/06/Math555.pdf)
9. [An Introduction to Optimization](https://sci.uobasrah.edu.iq/images/Math/436/436.pdf)
10. [One-Dimensional Problems, Computational Physics lecture notes, Universität Bielefeld](https://roesner.pages.ub.uni-bielefeld.de/lectures/computational-physics/semester/sose2026/lecture/05_optimization/01_one_dimensional.html)
11. [An Introduction to Optimization, 4th Edition, Chapter 7: One-Dimensional Search Methods](https://www.oreilly.com/library/view/an-introduction-to/9781118515150/OEBPS/c07.htm)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods › Optimization and dynamic programming › Mathematical programming methods

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/golden-section-search

English original: https://www.edgepedia.org/golden-section-search
