# 配置模型（网络科学）

配置模型是一种随机图模型，它通过为每个顶点分配固定数量的半边（stub），并将这些半边均匀随机地连接在一起，从而生成具有给定度序列的网络。半边匹配是在可区分半边的配对（半边标记的构型）上均匀进行的；其在顶点标记的多重图上诱导出的分布通常是非均匀的，但若以简单性为条件，则每个简单图出现的概率相等。该模型充当网络科学的保度零模型：它保持经验度序列不变，而将其他所有结构随机化。<sup>[1](https://www.cs.cornell.edu/courses/cs6241/2019sp/readings/Fosdick-2018-configuration.pdf)</sup>“给定度序列”意味着每个顶点 i 恰好有 \( k_{i} \) 个关联的边端，因此数据中超出度序列之外的任何结构模式，都必须通过相对于这一基线的偏离来确立。

| 关键事实 | 详情 |
|---|---|
| 输出 | 具有恰好指定度序列的均匀随机半边标记（多重）图，通过均匀半边匹配构建<sup>[1](https://www.cs.cornell.edu/courses/cs6241/2019sp/readings/Fosdick-2018-configuration.pdf)</sup> |
| 顶点对之间的期望边数 | 在均匀半边匹配下为 \( p_{ij} = k_{i} \cdot k_{j}/(2m-1) \approx k_{i} \cdot k_{j}/(2m) \)；至少存在一条边的概率通常有所不同，但当重复边稀少时趋近于该值<sup>[2](https://sites.santafe.edu/~aaronc/courses/5352/fall2013/csci5352_2013_L11.pdf)</sup> |
| 巨连通分量判据 | 当 \( \sum_{i} i(i-2)\lambda_{i} > 0 \) 时（在正则性假设下），几乎必然存在巨连通分量，其中 \( \lambda_{i} \) 是度为 i 的顶点比例<sup>[3](https://doi.org/10.1002/rsa.3240060204)</sup> |
| 软约束变体 | Chung–Lu 模型：对于不同顶点，边 (i,j) 以概率 \( P_{ij} = \min(1, k_{i} \cdot k_{j}/(2m)) \) 存在，在适当条件下度仅在期望意义下正确<sup>[4](https://network-science-notes.github.io/chapters/10-configuration-model.html)</sup> |
| 拒绝采样成本 | 对于 k = 10 且 n → ∞ 的 k-正则简单图，完全重启的半边匹配在期望上需要约 \( 10^{10} \) 次尝试<sup>[5](https://www.tandfonline.com/doi/full/10.1080/10618600.2024.2418817)</sup> |
| 软件 | NetworkX 的 `configuration_model`（返回 MultiGraph）和 `expected_degree_graph`；igraph 带有一个实验性的快速最大熵采样器<sup>[6](https://networkx.org/documentation/networkx-1.6/documentation.html)</sup><sup> • </sup><sup>[7](https://arxiv.org/html/2509.13230)</sup> |

## 工作原理

**半边匹配**是核心机制。每个顶点 i 被恰好分配 \( k_{i} \) 个半边，然后均匀随机地选择半边对并连接，直到没有未配对的半边为止；唯一的要求是半边总数为偶数。结果是一个具有恰好指定度序列的带环多重图，从半边标记的带环多重图中均匀采样得到。<sup>[1](https://www.cs.cornell.edu/courses/cs6241/2019sp/readings/Fosdick-2018-configuration.pdf)</sup> 均匀性有一个组合学上的原因：每个简单实现都以相同的重数 \( \prod_{i} (d_{i}!) \) 出现，因此整体拒绝非简单结果后，每个简单图出现的概率相等。<sup>[8](https://iopscience.iop.org/article/10.1088/2632-072X/abced5/meta)</sup> 该模型也可以被表述为最大熵构造：在满足度约束的所有图中，它集中于结构最少的分配。<sup>[7](https://arxiv.org/html/2509.13230)</sup>

在均匀随机匹配下，不同顶点 i 和 j 之间的期望边数为 \( p_{ij} = k_{i} \cdot k_{j}/(2m-1) \simeq k_{i} \cdot k_{j}/(2m) \)；它们之间至少存在一条边的概率通常不同，但当重复边稀少时趋近于该值，因此度更高的顶点更可能相连；这是模型内置的结构性度偏置，而非数据的性质。<sup>[2](https://sites.santafe.edu/~aaronc/courses/5352/fall2013/csci5352_2013_L11.pdf)</sup> 在稀疏极限下，该概率与 Chung–Lu 连接规则一致。<sup>[9](https://arxiv.org/pdf/0708.2610)</sup>

区分两种系综。微正则系综将一个度序列作为硬约束固定；正则系综则以软约束方式限制度，仅在期望意义下固定它们，因此实现的度在样本之间会波动。<sup>[10](https://doi.org/10.1103/physreve.64.026118)</sup>

莫洛伊和里德证明，一个具有大约 \( \lambda_{i} \cdot n \) 个度为 i 的顶点的随机图，当 \( \sum_{i} i(i-2)\lambda_{i} > 0 \) 时（在正则性假设下）几乎必然存在巨连通分量，而当该和为负时几乎必然只有小连通分量。<sup>[3](https://doi.org/10.1002/rsa.3240060204)</sup> 纽曼、斯特罗加茨和瓦茨推导出了巨连通分量首次形成时相变位置的精确表达式、平均分量大小、巨连通分量的大小、距随机选取顶点给定距离的期望顶点数，以及顶点间的平均距离。<sup>[10](https://doi.org/10.1103/physreve.64.026118)</sup> 这些分支过程计算基于余度分布 \( q_{k} = (k+1) \cdot p_{k+1}/\langle k \rangle \)，即沿一条随机边到达的度分布。<sup>[4](https://network-science-notes.github.io/chapters/10-configuration-model.html)</sup>

非简单边的稀疏性可以被量化。对于大的 m，顶点 i 处自环的期望数量约为 \( k_{i} \cdot (k_{i}-1)/4m \)（精确期望为 \( k_{i} \cdot (k_{i}-1)/2(2m-1) \)），多重边的期望数量是一个仅依赖于度序列前两阶矩的常数，这意味着当 \( \langle k^{2} \rangle \) 有限时，在大 \( n \) 极限下所有边中非简单边的比例为消失的 \( O(1/n) \)。<sup>[2](https://sites.santafe.edu/~aaronc/courses/5352/fall2013/csci5352_2013_L11.pdf)</sup> 博洛巴什在 1980 年证明，当图是稀疏的时，多重边和自环的期望数量不随网络规模增长，因此通常可以将其丢弃而对度序列影响很小。<sup>[11](https://doi.org/10.1016/s0195-6698%2880%2980030-8)</sup><sup> • </sup><sup>[4](https://network-science-notes.github.io/chapters/10-configuration-model.html)</sup> 当度分布是幂律且指数 \( \alpha < 3 \) 时，二阶矩发散，有限性论证失效。<sup>[2](https://sites.santafe.edu/~aaronc/courses/5352/fall2013/csci5352_2013_L11.pdf)</sup>

## 实现方法

一种实用的半边匹配采样器将每个顶点索引 i 恰好 \( k_{i} \) 次写入一个长度为 \( 2m \) 的数组中，对数组元素取随机排列，然后按顺序成对读取数组；每一对成为一条边。随机排列可以用原地随机化器在 \( O(m) \) 时间内生成，因此整个构造在 \( O(m) \) 时间内运行。<sup>[2](https://sites.santafe.edu/~aaronc/courses/5352/fall2013/csci5352_2013_L11.pdf)</sup> 在代码中，每个节点 i 在半边列表中出现 \( k_{i} \) 次，列表被洗牌，连续的元素被配对；自环和多重边可能出现，这就是 NetworkX 返回 `MultiGraph` 的原因。<sup>[4](https://network-science-notes.github.io/chapters/10-configuration-model.html)</sup><sup> • </sup><sup>[6](https://networkx.org/documentation/networkx-1.6/documentation.html)</sup>

对于简单图，两种广泛使用的方法是带拒绝的半边匹配和带保度边交换的马尔可夫链蒙特卡洛（MCMC）。<sup>[8](https://iopscience.iop.org/article/10.1088/2632-072X/abced5/meta)</sup> 拒绝采样有一条严格的规则：如果结果包含多重边或自环，生成必须从头开始；仅仅拒绝有问题的配对并另选一个半边会破坏均匀性，使样本偏向于枢纽之间的边。<sup>[8](https://iopscience.iop.org/article/10.1088/2632-072X/abced5/meta)</sup><sup> • </sup><sup>[12](https://snap.stanford.edu/class/cs224w-readings/milo04random.pdf)</sup> 交换算法从给定网络开始，反复选择一对边（A → B, C → D），交换端点得到（A → D, C → B），仅当交换不产生多重边或自环时才保留；在原始研究中，执行 \( Q \cdot E \) 次交换（\( Q \approx 100 \)）在经验上足以实现良好的混合。<sup>[12](https://snap.stanford.edu/class/cs224w-readings/milo04random.pdf)</sup> 对于顶点标记的采样，一种加权变体以概率 \( \min(1,\, w_{uy} \cdot w_{xv}/(w_{uv} \cdot w_{xy})) \) 接受将 (u,v),(x,y) 交换为 (u,y),(x,v)，在高度数序列上混合速度显著更快。<sup>[1](https://www.cs.cornell.edu/courses/cs6241/2019sp/readings/Fosdick-2018-configuration.pdf)</sup> 第三类方法在多项式时间内直接且独立地构造每个样本，无需拒绝；这些方法不进行均匀采样，而是计算每个样本的精确概率，从而允许无偏估计。<sup>[8](https://iopscience.iop.org/article/10.1088/2632-072X/abced5/meta)</sup>

成本和失败模式有充分的文献记载。对于任意度分布，基于交换的 MCMC 的混合时间了解甚少。<sup>[13](https://www.nature.com/articles/s41598-021-92519-y)</sup> 拒绝采样可能是灾难性的：据报道，一个配置模型代码在超过 24 小时后未能产生一个均匀分布的可图序列的样本，而一种无交换算法在 30 秒内产生了同一序列的样本。<sup>[14](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0010012)</sup> 对于收敛检测，一种基于迪基–富勒广义最小二乘（DFGLS）检验的方法，应用于采样图的同配性，估计有效独立 MCMC 状态之间的间隔；对于 \( \max_{i} k_{i}^{2} \le 2m/3 \) 的网络，标度律 \( \eta_{0} = 2.3m \) 给出了采样间隔的保守上界。<sup>[5](https://www.tandfonline.com/doi/full/10.1080/10618600.2024.2418817)</sup>

## 起源

配置方法所依据的枚举结果是 本德和坎菲尔德 1978 年发表在《组合理论杂志 A 辑》上的论文，关于给定度序列的标记图的渐近数量。<sup>[15](https://doi.org/10.1016/0097-3165%2878%2990059-6)</sup> 1980 年，博洛巴什在《欧洲组合学杂志》上引入了配对（构型）方法，证明了标记正则图数量的渐近公式，并将每个半边标记图称为“构型”（configuration），这就是模型名称的由来。<sup>[11](https://doi.org/10.1016/s0195-6698%2880%2980030-8)</sup><sup> • </sup><sup>[1](https://www.cs.cornell.edu/courses/cs6241/2019sp/readings/Fosdick-2018-configuration.pdf)</sup> 莫洛伊和里德 1995 年发表在《随机结构与算法》上的论文证明了给定度序列随机图的巨连通分量判据，后来推广了该模型，通常称为莫洛伊–里德配置模型。<sup>[3](https://doi.org/10.1002/rsa.3240060204)</sup><sup> • </sup><sup>[13](https://www.nature.com/articles/s41598-021-92519-y)</sup> 纽曼、斯特罗加茨和瓦茨随后在 2001 年于《物理评论 E》上发展了生成函数形式体系，推导出了相变、分量大小和距离的精确表达式，并区分了微正则系综与正则系综。<sup>[10](https://doi.org/10.1103/physreve.64.026118)</sup> 钟和卢在 2002 年于《美国国家科学院院刊》上分析了给定期望度的随机图中的平均距离，即软约束变体。<sup>[16](https://doi.org/10.1073/pnas.252631999)</sup> 福斯迪克及其同事在 2018 年于《SIAM 评论》上系统化了保度模型家族，根据标记方式以及是否允许自环和多重边，识别出八种配置模型。<sup>[1](https://www.cs.cornell.edu/courses/cs6241/2019sp/readings/Fosdick-2018-configuration.pdf)</sup> 乔德罗在 2020 年于《复杂网络杂志》上将半边标记思想扩展到超图，发展了顶点标记超图的微正则配置模型。<sup>[17](https://doi.org/10.1093/comnet/cnaa018)</sup>

## 变体

**Chung–Lu 模型**放宽了对度的精确约束：不同顶点 i 和 j 之间的边以概率 \( P_{ij} = \min(1, k_{i} \cdot k_{j}/(2m)) \) 放置，在适当条件下给出近似为 \( k \) 的期望度；NetworkX 将其实现为 `expected_degree_graph`。<sup>[4](https://network-science-notes.github.io/chapters/10-configuration-model.html)</sup> 用这些术语来说，标准配置模型是 \( G(n, m) \) 模型的保度对应物，而 Chung–Lu 推广了 \( G(n, p) \)。<sup>[13](https://www.nature.com/articles/s41598-021-92519-y)</sup> 一种超几何瓮变体将边抽取映射为无放回抽样球，在期望意义下保持度，并精确保持边数，其度序列偏差的均方误差显著小于 Chung–Lu（p < 1e-16，单侧 Welch t 检验）。<sup>[13](https://www.nature.com/articles/s41598-021-92519-y)</sup>

近期工作针对长期存在的采样问题。2024 年的一种序贯半边匹配算法在最大度渐近地被 \( m^{1/4} \) 支配的稀疏区域中，渐近均匀地采样给定度序列的简单有向图，具有线性期望运行时间 \( O(m) \) 以及给定度序列的有向图数量的后验估计。<sup>[18](https://link.springer.com/article/10.1007/s00026-024-00715-0)</sup> Hypercurveball 算法（克拉科曼和斯特赫伊斯，2025）将 Curveball 方法推广到具有固定度的无向和有向超图；当允许多重超边时它均匀采样，但当允许退化超边而不允许多重超边时可能有偏。<sup>[19](https://doi.org/10.1093/comnet/cnaf007)</sup> VaLUH 系列 MCMC 算法均匀采样具有给定顶点度和超边大小的非退化、顶点标记、无向超图，在步数和墙钟时间上比现有方法快达 6 倍。<sup>[20](https://matteo.rionda.to/papers/AbuissaRiondato-VaLUH-KDD.pdf)</sup> 对于软约束模型，2025 年的一种算法将米勒–哈格伯格拒绝采样适配到最大熵配置模型，实现了接近 \( O(M) \) 的采样，而非 \( O(N^{2}) \) 的暴力边概率评估；无权重变体在 igraph 中作为实验性功能实现。<sup>[7](https://arxiv.org/html/2509.13230)</sup>

## 应用

作为零模型，配置模型用于通过将真实网络的小子图与具有相同度序列的随机网络系综进行比较来发现模体，应用于生物、工程和生态网络，<sup>[9](https://arxiv.org/pdf/0708.2610)</sup> 度约束随机图可作为检测前馈环等模体的零模型。<sup>[12](https://snap.stanford.edu/class/cs224w-readings/milo04random.pdf)</sup> 它也被用于网络鲁棒性和流行病传播的研究。<sup>[9](https://arxiv.org/pdf/0708.2610)</sup> NetworkX 还提供了 `random_degree_sequence_graph`，一种序贯算法，当最大度为 \( O(m^{1/4}) \) 时在 \( O(m \cdot d_{m}) \) 时间内产生几乎均匀的随机简单图。<sup>[6](https://networkx.org/documentation/networkx-1.6/documentation.html)</sup>

## 局限与替代方案

该模型的主要失败模式源于其构造方式。均匀半边匹配仅在允许自环和多重边的半边标记图空间中有理论依据；事后移除自环或合并多重边会产生非均匀抽样，因为度较高的节点更可能参与其中。<sup>[5](https://www.tandfonline.com/doi/full/10.1080/10618600.2024.2418817)</sup> 半边标记与顶点标记图空间的选择对于简单图无关紧要，但对多重图或带自环图的分析有显著影响，并可能翻转研究结论。<sup>[1](https://www.cs.cornell.edu/courses/cs6241/2019sp/readings/Fosdick-2018-configuration.pdf)</sup> 拒绝采样对于重尾序列变得不切实际，上文引用的 k-正则图 \( 10^{10} \) 次尝试期望即是例证。<sup>[5](https://www.tandfonline.com/doi/full/10.1080/10618600.2024.2418817)</sup>

与其邻近模型比较：当度服从 \( k \sim \mathrm{Poisson}(c) \) 时，即 \( G(n, c/(n-1)) \) 的极限度分布，配置模型类似于 Erdős–Rényi 随机图，因此 Erdős–Rényi 近似于同质度特例。<sup>[2](https://sites.santafe.edu/~aaronc/courses/5352/fall2013/csci5352_2013_L11.pdf)</sup> Chung–Lu 模型通过构造避免了某些自环和多重边问题，但相对于最大熵目标，它过度采样了大度节点之间的边，这促使了无偏最大熵替代方案的发展。<sup>[7](https://arxiv.org/html/2509.13230)</sup>

## References

1. [Configuring Random Graph Models with Fixed Degree Sequences (Fosdick et al., SIAM Review 2018)](https://www.cs.cornell.edu/courses/cs6241/2019sp/readings/Fosdick-2018-configuration.pdf)
2. [Configuration model lecture notes (Aaron Clauset, Santa Fe Institute)](https://sites.santafe.edu/~aaronc/courses/5352/fall2013/csci5352_2013_L11.pdf)
3. [Michael Molloy, Bruce Reed (1995). A critical point for random graphs with a given degree sequence. Random Structures and Algorithms.](https://doi.org/10.1002/rsa.3240060204)
4. [Degree-Preserving Random Graphs (Network Science: Models, Mathematics, and Computation)](https://network-science-notes.github.io/chapters/10-configuration-model.html)
5. [Sampling Random Graphs with Specified Degree Sequences (J. Comput. Graph. Stat., 2024)](https://www.tandfonline.com/doi/full/10.1080/10618600.2024.2418817)
6. [networkx.generators.degree_seq, NetworkX documentation](https://networkx.org/documentation/networkx-1.6/documentation.html)
7. [Fast unbiased sampling of networks with given expected degrees and strengths (arXiv, 2025)](https://arxiv.org/html/2509.13230)
8. [Connectedness matters: construction and exact random sampling of connected networks (J. Phys. Complex., 2021)](https://iopscience.iop.org/article/10.1088/2632-072X/abced5/meta)
9. [Connection probability of the configuration model (arXiv paper)](https://arxiv.org/pdf/0708.2610)
10. [M. E. J. Newman, S. H. Strogatz, D. J. Watts (2001). Random graphs with arbitrary degree distributions and their applications. Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics.](https://doi.org/10.1103/physreve.64.026118)
11. [A Probabilistic Proof of an Asymptotic Formula for the Number of Labelled Regular Graphs (European Journal of Combinatorics, 1980)](https://doi.org/10.1016/s0195-6698%2880%2980030-8)
12. [On the uniform generation of random graphs with prescribed degree sequences (Milo et al., 2004)](https://snap.stanford.edu/class/cs224w-readings/milo04random.pdf)
13. [Configuration models as an urn problem (Scientific Reports, 2021)](https://www.nature.com/articles/s41598-021-92519-y)
14. [Efficient and Exact Sampling of Simple Graphs with Given Arbitrary Degree Sequence (PLOS ONE, 2010)](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0010012)
15. [The asymptotic number of labeled graphs with given degree sequences (Journal of Combinatorial Theory Series A, 1978)](https://doi.org/10.1016/0097-3165%2878%2990059-6)
16. [Fan Chung, Linyuan Lu (2002). The average distances in random graphs with given expected degrees. Proceedings of the National Academy of Sciences.](https://doi.org/10.1073/pnas.252631999)
17. [Philip S Chodrow (2020). Configuration models of random hypergraphs. Journal of Complex Networks.](https://doi.org/10.1093/comnet/cnaa018)
18. [Sequential Stub Matching for Asymptotically Uniform Generation of Directed Graphs with a Given Degree Sequence (Annals of Combinatorics, 2024)](https://link.springer.com/article/10.1007/s00026-024-00715-0)
19. [Yanna J Kraakman, Clara Stegehuis (2025). Hypercurveball algorithm for sampling hypergraphs with fixed degrees. Journal of Complex Networks.](https://doi.org/10.1093/comnet/cnaf007)
20. [VaLUH: Fast Algorithms for the Configuration Model of Vertex-Labeled Undirected Hypergraphs (KDD)](https://matteo.rionda.to/papers/AbuissaRiondato-VaLUH-KDD.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 21, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/configuration-model-network-science

English original: https://www.edgepedia.org/configuration-model-network-science
