线性代数#

图矩阵#

图的邻接矩阵和关联矩阵。

adjacency_matrix(G[, nodelist, dtype, weight])

返回 G 的邻接矩阵。

incidence_matrix(G[, nodelist, edgelist, ...])

返回 G 的关联矩阵。

拉普拉斯矩阵#

图的拉普拉斯矩阵。

这里所有的计算都使用出度。对于使用入度的拉普拉斯矩阵,请使用 G.reverse(copy=False) 代替 G 并取转置。

函数 laplacian_matrix 提供未归一化的矩阵,而 normalized_laplacian_matrixdirected_laplacian_matrixdirected_combinatorial_laplacian_matrix 都已归一化。

laplacian_matrix(G[, nodelist, weight])

返回 G 的拉普拉斯矩阵。

normalized_laplacian_matrix(G[, nodelist, ...])

返回 G 的归一化拉普拉斯矩阵。

directed_laplacian_matrix(G[, nodelist, ...])

返回 G 的有向拉普拉斯矩阵。

directed_combinatorial_laplacian_matrix(G[, ...])

返回 G 的有向组合拉普拉斯矩阵。

total_spanning_tree_weight(G[, weight, root])

返回 G 的所有生成树的总权重。

Bethe Hessian 矩阵#

图的 Bethe Hessian 或变形拉普拉斯矩阵。

bethe_hessian_matrix(G[, r, nodelist])

返回 G 的 Bethe Hessian 矩阵。

代数连通性#

无向图的代数连通性和 Fiedler 向量。

algebraic_connectivity(G[, weight, ...])

返回无向图的代数连通性。

fiedler_vector(G[, weight, normalized, tol, ...])

返回连通无向图的 Fiedler 向量。

spectral_ordering(G[, weight, normalized, ...])

计算图的谱排序(spectral ordering)。

spectral_bisection(G[, weight, normalized, ...])

使用 Fiedler 向量对图进行二分。

属性矩阵#

根据图属性构建类似矩阵对象的函数。

attr_matrix(G[, edge_attr, node_attr, ...])

返回使用 G 中的属性构建的 numpy 数组形式的属性矩阵。

attr_sparse_matrix(G[, edge_attr, ...])

返回使用 G 中的属性构建的 SciPy 稀疏数组。

模块度矩阵#

图的模块度矩阵。

modularity_matrix(G[, nodelist, weight])

返回 G 的模块度矩阵。

directed_modularity_matrix(G[, nodelist, weight])

返回 G 的有向模块度矩阵。

#

图的特征值谱。

adjacency_spectrum(G[, weight])

返回 G 的邻接矩阵的特征值。

laplacian_spectrum(G[, weight])

返回 G 的拉普拉斯矩阵的特征值

bethe_hessian_spectrum(G[, r])

返回 G 的 Bethe Hessian 矩阵的特征值。

normalized_laplacian_spectrum(G[, weight])

返回 G 的归一化拉普拉斯矩阵的特征值

modularity_spectrum(G)

返回 G 的模块度矩阵的特征值。