# 关联矩阵

关联矩阵是一种矩阵，用来记录一个集合中的哪些元素与另一个集合中的元素相关联，即属于或接触后者。在图论中，它的每一行对应一个顶点，每一列对应一条边，当顶点 v_i 位于边 e_j 上时，(i, j) 位置的元素为 1，否则为 0；对于有向边或定向边，元素则取 0、+1 和 −1，以记录方向<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup><sup> • </sup><sup>[2](https://mathworld.wolfram.com/IncidenceMatrix.html)</sup>。物理学家古斯塔夫·基尔霍夫（Gustav Kirchhoff）在 1847 年关于伽伐尼电流线性分布规律的论文中，首次定义了关联矩阵<sup>[2](https://mathworld.wolfram.com/IncidenceMatrix.html)</sup>。

| 关键事实 | 详情 |
|---|---|
| 无向形式 | n × m 矩阵 Σ，若 v_i ∈ E_j 则 Σ_ij = 1，否则为 0；行对应顶点，列对应边<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup> |
| 有向形式 | 元素为 0、±1：若边从 v_i 出发则为 +1，若指向 v_i 则为 −1，否则为 0<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup> |
| 拉普拉斯分解 | 对于图，L = ΣΣᵀ 是图的拉普拉斯矩阵；对无向图任意定向后，L = D − A，与所选定向无关<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup><sup> • </sup><sup>[3](https://www.geneseo.edu/~aguilar/public/assets/courses/310/algebraic-graph-theory.pdf)</sup> |
| 矩阵树定理 | 拉普拉斯矩阵的每个余子式都等于 τ(G)，即生成树的数目；对于 K_ν，由此得到 τ(K_ν) = ν^(ν−2)，即凯莱公式<sup>[4](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup> |
| 秩 | 对于具有 n 个顶点、p 个二部连通分支和 q 个孤立顶点的图，顶点-边关联矩阵的秩为 n − p − q<sup>[5](https://arxiv.org/abs/2409.16055)</sup> |
| 线图关系 | 若 C 是图的关联矩阵，L 是其线图的邻接矩阵，则 L = CᵀC − 2I<sup>[2](https://mathworld.wolfram.com/IncidenceMatrix.html)</sup> |
| 软件 | NetworkX 提供 incidence_matrix(G, nodelist, edgelist, oriented, weight)，其中定向边的尾端为 −1，头端为 +1<sup>[6](https://networkx.org/documentation/stable/reference/generated/networkx.linalg.graphmatrix.incidence_matrix.html)</sup> |

## 定义与约定

对于顶点集 V = {v_1, …, v_n} 和边族 E = {E_1, …, E_m} 构成的有限超图，当 v ∈ E 时，称顶点 v 与边 E 相关联，因此超图是一种关联系统，其关联关系就是属于关系。关联矩阵 Σ 满足：若 v_i ∈ E_j 则 Σ_ij = 1，否则为 0<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup>。普通的无向图是每条边的大小均为 2 的特殊情形；若允许自环，则边的大小可为 1<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup>。

对于边为有序对的有向图，关联矩阵的元素取 0、±1：在边出发的顶点所在行为 +1，在边指向的顶点所在行为 −1，其余位置为 0<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup>。不同作者的符号约定有所不同。一种教科书定义将每条定向边的头端记为 +1、尾端记为 −1<sup>[3](https://www.geneseo.edu/~aguilar/public/assets/courses/310/algebraic-graph-theory.pdf)</sup>，而《数学百科全书》的约定则将尾端记为 +1、头端记为 −1<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup>；NetworkX 库采用头端为正的形式<sup>[6](https://networkx.org/documentation/stable/reference/generated/networkx.linalg.graphmatrix.incidence_matrix.html)</sup>。这些选择只会改变符号，不会改变代数上的结论。

即使对于无向图，也常常方便地为每条边任意指定一个定向，并使用定向关联矩阵<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup>。G 的一个定向是一个函数，它对每条边 {u, v} 指定一个端点为尾端，另一个端点为头端<sup>[3](https://www.geneseo.edu/~aguilar/public/assets/courses/310/algebraic-graph-theory.pdf)</sup>。

有些作者采用转置约定，即每一列对应一个顶点、每一行对应一条边，刚性矩阵的标准形式即属此类<sup>[2](https://mathworld.wolfram.com/IncidenceMatrix.html)</sup>。在矩阵树定理文献的混合约定中，顶点处的自环对关联矩阵元素的贡献为 2，对 MMᵀ 相应对角元素的贡献为 4<sup>[4](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。

## 拉普拉斯矩阵作为关联矩阵的乘积

核心的代数恒等式是：对于图，乘积 L = ΣΣᵀ 就是图的拉普拉斯矩阵<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup>。其非对角元素 L_ij 带符号地计数 v_i 与 v_j 之间的边，对角元素则计数每个顶点处的总边数<sup>[1](https://encyclopediaofmath.org/wiki/Incidence_matrix)</sup>。对于无向图的定向关联矩阵 N，拉普拉斯矩阵 L(G) = NNᵀ 是对称的，且 L(G) = D − A，其中 D 是顶点度数的对角矩阵，A 是邻接矩阵；因此 L 与所选定向无关<sup>[3](https://www.geneseo.edu/~aguilar/public/assets/courses/310/algebraic-graph-theory.pdf)</sup>。这一分解正是关联矩阵在谱图论、扩散和网络分析中随处可见的原因<sup>[7](https://leelemacjames.github.io/adjacencyMatrix/)</sup>；现代关于复单位增益网络的研究仍然通过将拉普拉斯矩阵分解为关联矩阵与其埃尔米特转置的乘积，来证明矩阵树型结果<sup>[8](https://www.sciencedirect.com/science/article/pii/S0377042726004498)</sup>。

## 矩阵树定理

经典的矩阵树定理隐含于基尔霍夫 1847 年的工作中，它将关联矩阵与生成树计数联系起来。设 M 是图 G 的关联矩阵，G 有 ν 个顶点和 ε 条边，L = MMᵀ 是其混合拉普拉斯矩阵。若从 L 中删去任意第 s 行和第 t 列得到 L*，则 τ(G) = (−1)^(s+t) det(L*)：L 的每个余子式都等于 G 的树数，即忽略定向后的生成树数目<sup>[4](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。等价地，伴随矩阵满足 adj(L) = τ(G)J，其中 J 是全 1 矩阵<sup>[4](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。

证明利用比内-柯西定理展开 L 的余子式，并结合这样一个事实：M 的每个非奇异 (ν − 1) × (ν − 1) 子式都来自 G 的一棵生成树，且其值为 ±1<sup>[4](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。将该定理应用于完全图 K_ν（此时 L = νI − J），得到 τ(K_ν) = ν^(ν−2)，即凯莱关于 ν 个顶点上标号树数目的公式<sup>[4](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。该定理的各种变体被用于无源电网络的拓扑分析，这正是基尔霍夫最初需要该结果的场景<sup>[4](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)</sup>。

## 秩与连通性

关联矩阵的秩编码了图的连通结构。对于具有 n 个顶点、p 个二部连通分支和 q 个孤立顶点的图，顶点-边关联矩阵的秩为 n − p − q<sup>[5](https://arxiv.org/abs/2409.16055)</sup>。在具有 n 个顶点和 n 条边、且恰好包含一个圈 C 的连通图中，若 C 的长度为奇数，则边-顶点关联矩阵的秩为 n；若 C 的长度为偶数，则秩为 n − 1<sup>[5](https://arxiv.org/abs/2409.16055)</sup>。在任何二部图中，边-顶点关联矩阵永远不是满秩的：将二部划分的一部分赋为 +1、另一部分赋为 −1 的向量总是位于其零空间中<sup>[5](https://arxiv.org/abs/2409.16055)</sup>。这些事实可以推广：对于长度为 n 的 k-一致圈，只要 gcd(k, n) > 1，关联矩阵就不是满秩的，其零空间中的向量由 k 次单位根构造<sup>[5](https://arxiv.org/abs/2409.16055)</sup>。

定向关联矩阵还给出了连通性的同调描述。将图视为一维复形时，其列生成该复形的边界映射；定向关联矩阵各行之和为零，因为每一列恰好有一个 +1 和一个 −1；圈空间的秩为 m − n + β₀(G)，其中 β₀(G) 计数连通分支的数目<sup>[9](https://www.isibang.ac.in/~d.yogesh/Course_Notes/DM1/Ch12.S1.html)</sup>。

## 超图与其他关联结构

由于图是 2-一致超图，关联矩阵自然可以推广到超图，其中超边可以包含任意数目的顶点。边-顶点关联矩阵 B_H 满足：若 v ∈ e 则 b_ev = 1，否则为 0；顶点-边关联矩阵 I_H 是它的转置<sup>[5](https://arxiv.org/abs/2409.16055)</sup>。超图的结构特征体现在矩阵中：将恰好与同一组超边相关联的顶点（称为一个单元）等同起来，通过单元收缩可以得到一个更小的超图，而原超图与其收缩后的边-顶点关联矩阵的秩相同<sup>[5](https://arxiv.org/abs/2409.16055)</sup>。超图邻接矩阵的某些特征值可以通过关联矩阵各列的内积（以超边值加权）来表示<sup>[5](https://arxiv.org/abs/2409.16055)</sup>。

关联矩阵也出现在图论之外。对于 k 维多胞形，当 (k−1)-维面属于某个 k-维面时，关联矩阵的元素为 1，否则为 0，因此每一行列出围绕给定 (k−1)-维面的 k-维面；关联矩阵同样用于描述射影平面<sup>[2](https://mathworld.wolfram.com/IncidenceMatrix.html)</sup>。

## 与线图的关系

关联矩阵将图与其线图联系起来，线图的顶点是原图的边，其邻接关系记录共享端点的边。若 C 是图的关联矩阵，L 是其线图的邻接矩阵，则 L = CᵀC − 2I，其中 I 是单位矩阵<sup>[2](https://mathworld.wolfram.com/IncidenceMatrix.html)</sup>。线图理论中的一个定理以这种方式将原图的关联矩阵与其线图的邻接矩阵联系起来<sup>[10](https://arxiv.org/abs/2205.05375)</sup>。

## 计算

标准软件同时提供两种约定。NetworkX 函数 incidence_matrix(G, nodelist=None, edgelist=None, oriented=False, weight=None, dtype=None) 返回每个节点一行、每条边一列的矩阵；当 oriented=False 时，以 1 标记关联；当 oriented=True 时，每条边获得一个定向——无向图的定向是任意的，有向图则与方向一致——尾端为 −1，头端为 +1<sup>[6](https://networkx.org/documentation/stable/reference/generated/networkx.linalg.graphmatrix.incidence_matrix.html)</sup>。Wolfram 语言提供 IncidenceMatrix[g]，并可通过 GraphData[graph, "IncidenceMatrix"] 获取许多命名图的预计算关联矩阵<sup>[2](https://mathworld.wolfram.com/IncidenceMatrix.html)</sup>。

## References

1. [Incidence matrix, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Incidence_matrix)
2. [Incidence Matrix, Wolfram MathWorld](https://mathworld.wolfram.com/IncidenceMatrix.html)
3. [An Introduction to Algebraic Graph Theory, lecture notes, SUNY Geneseo](https://www.geneseo.edu/~aguilar/public/assets/courses/310/algebraic-graph-theory.pdf)
4. [Matrix tree theorem, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Matrix_tree_theorem)
5. [Samiron Parui, On the Incidence matrices of hypergraphs, arXiv:2409.16055](https://arxiv.org/abs/2409.16055)
6. [incidence_matrix, NetworkX 3.7 documentation](https://networkx.org/documentation/stable/reference/generated/networkx.linalg.graphmatrix.incidence_matrix.html)
7. [Incidence Matrices: From Fibonacci to Graph Topology](https://leelemacjames.github.io/adjacencyMatrix/)
8. [Matrix-Tree Theorems for complex unit gain networks, Numerical Algorithms / ScienceDirect](https://www.sciencedirect.com/science/article/pii/S0377042726004498)
9. [Chapter 12, Graphs and matrices, Discrete Mathematics lecture notes, ISI Bangalore](https://www.isibang.ac.in/~d.yogesh/Course_Notes/DM1/Ch12.S1.html)
10. [Incidence matrices and line graphs of mixed graphs, arXiv:2205.05375](https://arxiv.org/abs/2205.05375)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Computational and symbolic algebra › Algebraic combinatorics and graph theory › Algebraic graph theory

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/incidence-matrix

English original: https://www.edgepedia.org/incidence-matrix
