# 平均首次通过时间

平均首次通过时间（MFPT），也称平均命中时间，是马尔可夫链从某一指定状态出发、首次到达另一指定状态所需步数的期望。对于转移矩阵为 P 的链，从状态 i 到状态 j 的 MFPT 记作 \( m_{ij} \) 或 \( T_{ij} \)，所有这类值构成的集合形成平均首次通过时间矩阵，它是有限马尔可夫链的一种标准描述量。<sup>[1](https://link.springer.com/article/10.1007/s10543-026-01152-6)</sup><sup> • </sup><sup>[2](https://server.math.umanitoba.ca/~kirkland/LAA_mfp_lowerbound2.pdf)</sup>

| 关键事实 | 细节 |
|---|---|
| 定义 | 若 \( i = j \)，则 \( T_{ij} = 0 \)；否则 \( T_{ij} = 1 + \sum_{k \ne i} P_{ik} T_{kj} \)；它表示从 \( i \) 首次到达 \( j \) 的期望步数<sup>[1](https://link.springer.com/article/10.1007/s10543-026-01152-6)</sup> |
| 矩阵方程 | MFPT 矩阵 \( M \) 是 \( M = A(M - M_{\mathrm{diag}}) + J \) 的唯一解，其中 \( J \) 为全 1 矩阵<sup>[2](https://server.math.umanitoba.ca/~kirkland/LAA_mfp_lowerbound2.pdf)</sup> |
| 群逆公式 | 对于 \( i \ne j \)，\( m_{ij} = (q^{\#}_{jj} - q^{\#}_{ij})/\pi_j \)，其中 \( Q^{\#} \) 是 \( I - P \) 的群逆，\( \pi \) 是平稳分布<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC7676669/)</sup> |
| 平均返回时间 | 对于不可约链，\( m_{jj} = 1/\pi_j \)（卡茨（Kac）引理）；在具有标准随机游走的无向图上，\( \pi_j = k_j / \sum_i k_i \)<sup>[4](https://computational-methods-network-science.github.io/phys7332_fa25/notebooks/class_16/class_16_dynamics1.html)</sup> |
| 凯梅尼常数 | \( K = \sum_j \pi_j m_{ij} \) 对每个起始状态 \( i \) 都相同，这一结果最早由凯梅尼与斯内尔（Kemeny and Snell，1960）给出<sup>[5](https://arxiv.org/abs/1208.4716)</sup> |
| 谱形式 | 若 \( P \) 的特征值为 \( \lambda_1 = 1, \lambda_2, \ldots, \lambda_n \)，则 \( K = \sum_{j=2}^{n} 1/(1 - \lambda_j) \)<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC7676669/)</sup> |
| 下界 | 对于不可约 \( n \times n \) 随机矩阵，对每个状态 \( j \)，有 \( \max_{i \ne j} m_{ij} \ge 1/w_j - 1 \)，其中 \( w \) 为平稳向量<sup>[2](https://server.math.umanitoba.ca/~kirkland/LAA_mfp_lowerbound2.pdf)</sup> |

## 定义与首步方程

设 \( \{X_t\}_{t \ge 0} \) 是状态空间为 \( 1, \ldots, N \)、转移矩阵为 \( P \) 的马尔可夫链，其中 \( P_{ij} \) 为一步内从 \( i \) 转移到 \( j \) 的概率。从 \( i \) 出发对 \( j \) 的命中时间是随机变量 \( H_{ij} = \min\{t \ge 0 : X_t = j \mid X_0 = i\} \)，而 MFPT 是它的期望 \( T_{ij} = \mathbb{E}[H_{ij}] \)。<sup>[4](https://computational-methods-network-science.github.io/phys7332_fa25/notebooks/class_16/class_16_dynamics1.html)</sup> 施普林格文献中的表述以递推方式给出同一对象：

\[ T_{ij} = \begin{cases} 0, & i = j, \\ 1 + \sum_{k \ne i} P_{ik} T_{kj}, & i \ne j. \end{cases} \]

这是首步分析：若链从 \( i \ne j \) 出发，它先付出一步转移到某处，然后仍需要从落点出发的期望时间。<sup>[1](https://link.springer.com/article/10.1007/s10543-026-01152-6)</sup><sup> • </sup><sup>[4](https://computational-methods-network-science.github.io/phys7332_fa25/notebooks/class_16/class_16_dynamics1.html)</sup> 当 \( i = j \) 时，类似量是平均首次返回时间（或平均回归时间），对于不可约链它等于 \( 1/\pi_j \)，即 \( j \) 的平稳概率的倒数。<sup>[4](https://computational-methods-network-science.github.io/phys7332_fa25/notebooks/class_16/class_16_dynamics1.html)</sup><sup> • </sup><sup>[5](https://arxiv.org/abs/1208.4716)</sup> 有些文献把 \( m_{jj} = 1/\pi_j \) 放在 \( M \) 的对角线上，另一些则采用零对角命中时间约定 \( m_{jj} = 0 \)；这两种约定使按平稳分布加权的和相差 1。<sup>[6](https://spedygiorgio.github.io/markovchain/reference/kemenyConstant.html)</sup>

**矩阵形式。** 将 \( m_{ij} \) 收集成矩阵 \( M \)，该递推等价于 \( M = A(M - M_{\mathrm{diag}}) + J \)，其中 \( M_{\mathrm{diag}} \) 承载对角元素，\( J \) 为全 1 矩阵；非对角元素是首次通过时间分析所关心的对象。<sup>[2](https://server.math.umanitoba.ca/~kirkland/LAA_mfp_lowerbound2.pdf)</sup> 计算时，固定目标 \( j \) 并从 \( P \) 中删去其行和列，得到一个 \( (N-1) \times (N-1) \) 方程组 \( (\mathbf{I} - \mathbf{P}^{(j)}) \mathbf{t}^{(j)} = \mathbf{1} \)，因此到达 \( j \) 的 MFPT 可通过一次线性求解得到。<sup>[4](https://computational-methods-network-science.github.io/phys7332_fa25/notebooks/class_16/class_16_dynamics1.html)</sup>

## 通过广义逆计算

对于不可约链，\( I - P \) 是奇异的，因为 1 是 \( P \) 的单特征值，但它有群逆 \( (I - P)^{\#} \)，即满足三条群逆定义恒等式的唯一矩阵 \( Q^{\#} \)。于是 MFPT 为

\[ m_{ij} = \frac{q^{\#}_{jj} - q^{\#}_{ij}}{\pi_j}, \qquad i, j = 1, \ldots, n, \; i \ne j, \]

其中在零对角约定下 \( m_{ii} = 0 \)。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC7676669/)</sup> 等价地，基本矩阵 \( Z = (I - P + \mathbf{1}\pi)^{-1} \) 给出 \( T_{ij} = (Z_{jj} - Z_{ij})/\pi_j \)（\( i \ne j \)）。<sup>[4](https://computational-methods-network-science.github.io/phys7332_fa25/notebooks/class_16/class_16_dynamics1.html)</sup><sup> • </sup><sup>[6](https://spedygiorgio.github.io/markovchain/reference/kemenyConstant.html)</sup> R 包 markovchain 用稠密 LAPACK 求解实现这一点，耗时 \( O(n^3) \)、占用 \( O(n^2) \) 内存。<sup>[6](https://spedygiorgio.github.io/markovchain/reference/kemenyConstant.html)</sup> 对于生成矩阵为 \( G \) 的连续时间链，完整的首次通过时间分布可由拉普拉斯变换 \( \mathbb{E}[e^{-\lambda \tau}] = \lambda [ (\lambda - G^{?})^{-1} ]_{s,f} \) 得到，其中 \( G^{?} \) 是在目标处终止的链的生成矩阵，各阶矩则来自该变换的导数。<sup>[7](https://pages.uoregon.edu/plr/plr-thesis-ch3.pdf)</sup>

## 凯梅尼常数

MFPT 可聚合成一个具有出人意料性质的单一数值。固定起始状态 \( i \)，并对按平稳分布 \( \pi \) 抽取的目标 \( j \) 求 MFPT 的平均：

\[ K = \sum_{j=1}^{n} \pi_j m_{ij}. \]

凯梅尼与斯内尔在其 1960 年著作《有限马尔可夫链》（*Finite Markov Chains*）中证明，该值不依赖于 \( i \)；它现在被称为凯梅尼常数。<sup>[5](https://arxiv.org/abs/1208.4716)</sup><sup> • </sup><sup>[8](https://link.springer.com/book/9780387901923)</sup> 它可以理解为到达随机选取目标的期望时间，或理解为混合的期望时间，并且与链的良态程度有关。<sup>[5](https://arxiv.org/abs/1208.4716)</sup><sup> • </sup><sup>[9](https://www.sciencedirect.com/science/article/abs/pii/S0024379526000923)</sup> 由于目标的分布恰好与链在平衡态下的行为一致，再走一步不会改变到目标的统计距离，这就是该常数不变性的直觉来源。<sup>[10](https://kemenystudio.com/kemeny-constant)</sup>

凯梅尼常数也是一个谱量。若 \( P \) 的特征值为 \( \lambda_1 = 1, \lambda_2, \ldots, \lambda_n \)，则

\[ K = \sum_{j=2}^{n} \frac{1}{1 - \lambda_j}, \]

所以当任一非单位特征值接近 1 时，\( K \) 会变得非常大。用控制论的话说，第二特征值界定收敛速率，而凯梅尼常数类似于系统所有模态上升时间的平均值。<sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC7676669/)</sup> 莱文（Levene）与洛伊祖（Loizou）在 2002 年注意到了这个特征值表达式，这激发了对 \( K \) 作为图上随机游走谱图不变量的兴趣。<sup>[9](https://www.sciencedirect.com/science/article/abs/pii/S0024379526000923)</sup> 对于 \( n \) 阶随机矩阵，一个下界是 \( K \ge (n-1)/2 \)。<sup>[2](https://server.math.umanitoba.ca/~kirkland/LAA_mfp_lowerbound2.pdf)</sup> \( K \) 的代数定义或其与起始状态无关性并不需要非周期性；某些处理保留该假设，只是因为不可约非周期链是遍历的，从而有 \( (P^{\top})^k \to \mathbf{1}\pi^{\top} \) 以及自然的动力学解释。<sup>[1](https://link.springer.com/article/10.1007/s10543-026-01152-6)</sup> 该常数已被推广到离散时间之外：对于连续时间马尔可夫过程，到达按平稳分布抽取的目标的类似平均命中时间，关于平稳分布几乎必然是常数。<sup>[11](https://arxiv.org/abs/2509.19273)</sup>

## 界与连通性

MFPT 衡量链在短期内的连通程度，补充了平稳分布给出的长期图景。对于具有平稳向量 \( w \) 的不可约 \( n \times n \) 随机矩阵，每个状态都满足

\[ \max_{1 \le i \le n,\, i \ne j} m_{ij} \ge \frac{1}{w_j} - 1, \]

等号仅在特定结构条件下成立，其中包括 \( a_{jj} = 0 \)。凯梅尼常数取值低同样表明链连通良好。<sup>[2](https://server.math.umanitoba.ca/~kirkland/LAA_mfp_lowerbound2.pdf)</sup> 在无向图上，一个有用的启发式来自把混合后对 \( j \) 的访问视为成功概率为 \( \pi_j \) 的伯努利试验：期望命中时间近似为 \( 1/\pi_j = \sum_i k_i / k_j \)，因此高度数节点会被很快到达，而低度数节点较难命中。<sup>[4](https://computational-methods-network-science.github.io/phys7332_fa25/notebooks/class_16/class_16_dynamics1.html)</sup>

## 应用

MFPT 回答的是关于到达而非停留的问题：信息到达某一特定服务器需要多久，随机游走者多快到达目标节点（如医院、充电站或枢纽机场），或者天气从雨转晴需要多久。<sup>[4](https://computational-methods-network-science.github.io/phys7332_fa25/notebooks/class_16/class_16_dynamics1.html)</sup> 在网络科学中，凯梅尼常数可作为网络连通程度和韧性的度量；它还出现在道路交通和流行病传播模型中，并有助于识别消除后对网络损害最大的关键连边；一种关键性度量给每个节点赋予删除该节点后所得图的凯梅尼常数。<sup>[10](https://kemenystudio.com/kemeny-constant)</sup><sup> • </sup><sup>[3](https://pmc.ncbi.nlm.nih.gov/articles/PMC7676669/)</sup> 在分子科学中，MFPT 量化生化网络以及蛋白质折叠的马尔可夫状态模型中的转变时间，是用于验证和改进动力学模型的可观测量之一。<sup>[12](https://pmc.ncbi.nlm.nih.gov/articles/PMC4222613/)</sup>

精确计算的可扩展性很差：它需要矩阵求逆，对于拥有数百万节点的网络代价高昂，因此人们为有向图上的凯梅尼常数开发了具有理论误差保证的近似算法。<sup>[13](https://arxiv.org/abs/2409.05471)</sup> 当前研究还把 \( K \) 本身作为优化目标，在保持平稳分布固定的同时，在稀疏性约束下对可逆链最小化它。<sup>[14](https://arxiv.org/abs/2510.24679)</sup>

## References

1. [Kemeny's constant minimization for reversible Markov chains via structure-preserving perturbations, BIT Numerical Mathematics](https://link.springer.com/article/10.1007/s10543-026-01152-6)
2. [Minimising the largest mean first passage time of a Markov chain (Kirkland et al., Linear Algebra and its Applications)](https://server.math.umanitoba.ca/~kirkland/LAA_mfp_lowerbound2.pdf)
3. [Kemeny-based testing for COVID-19, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC7676669/)
4. [Class 16: Dynamics on Networks 1 — Diffusion and Random Walks, PHYS 7332](https://computational-methods-network-science.github.io/phys7332_fa25/notebooks/class_16/class_16_dynamics1.html)
5. [Jeffrey J. Hunter (2012). The Role of Kemeny's Constant in Properties of Markov Chains. arXiv.](https://arxiv.org/abs/1208.4716)
6. [kemenyConstant, markovchain R package documentation](https://spedygiorgio.github.io/markovchain/reference/kemenyConstant.html)
7. [Computing first-passage times of Markov chains (thesis chapter, University of Oregon)](https://pages.uoregon.edu/plr/plr-thesis-ch3.pdf)
8. [John G. Kemeny and J. Laurie Snell, Finite Markov Chains, Springer (orig. Van Nostrand, 1960)](https://link.springer.com/book/9780387901923)
9. [On defining Kemeny's constant for non-backtracking random walks, Linear Algebra and its Applications](https://www.sciencedirect.com/science/article/abs/pii/S0024379526000923)
10. [Kemeny's Constant: Mean Recurrence Time, Kemeny Studio](https://kemenystudio.com/kemeny-constant)
11. [P. J. Fitzsimmons (2025). On Kemeny's Constant for Markov Processes. arXiv.](https://arxiv.org/abs/2509.19273)
12. [RaTrav: a tool for calculating mean first-passage times on biochemical networks, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC4222613/)
13. [Haisong Xia and Zhongzhi Zhang (2024). Fast Computation of Kemeny's Constant for Directed Graphs. arXiv.](https://arxiv.org/abs/2409.05471)
14. [Durastante, Gnazzo, Meini (2025). Kemeny's constant minimization for reversible Markov chains via structure-preserving perturbations. arXiv.](https://arxiv.org/abs/2510.24679)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Stochastic processes › Markov chains and processes › Discrete-time Markov chains › Hitting times and absorption analysis

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/mean-first-passage-time

English original: https://www.edgepedia.org/mean-first-passage-time
