The oriented incidence matrix of a simple graph #
SimpleGraph.orientedIncMatrix G is the integer V × G.edgeSet matrix whose column at an edge
e has 1 in the row of one endpoint of e, -1 in the row of the other, and 0 elsewhere.
The orientation of each edge is the arbitrary but fixed one given by the representative
Quot.out e of e : Sym2 V. No order on V is needed. Mathlib's SimpleGraph.incMatrix is the
unoriented incidence matrix.
The Gram matrix of this orientation is the Laplacian: N * Nᵀ = G.lapMatrix ℤ
(SimpleGraph.orientedIncMatrix_mul_transpose). Each column of N sums to zero, and pairing a
column with a vertex function f gives the difference of the values of f at the two endpoints
(SimpleGraph.sum_mul_orientedIncMatrix).
For edge weights w : Sym2 V → R, the weighted adjacency matrix SimpleGraph.weightedAdjMatrix G w
has entry w s(u, v) at adjacent u, v. The weighted Gram identity
N * diagonal w * Nᵀ = (G.weightedAdjMatrix w).laplacian
(SimpleGraph.orientedIncMatrix_map_mul_diagonal_mul_transpose) generalizes
SimpleGraph.orientedIncMatrix_mul_transpose, which is its case of all weights 1; here
Matrix.laplacian is the diagonal matrix of row sums minus the matrix.
Main definitions #
SimpleGraph.orientedIncMatrix: the oriented incidence matrix.SimpleGraph.weightedAdjMatrix: the weighted adjacency matrix.
Main results #
SimpleGraph.sum_mul_orientedIncMatrix: a vertex function paired with a column is the difference of its values at the endpoints.SimpleGraph.orientedIncMatrix_mul_self,SimpleGraph.orientedIncMatrix_mul_of_ne: products of two entries in one column.SimpleGraph.orientedIncMatrix_mul_transpose:N * Nᵀ = G.lapMatrix ℤ.SimpleGraph.weightedAdjMatrix_one,SimpleGraph.lapMatrix_eq_laplacian_adjMatrix,SimpleGraph.lapMatrix_eq_laplacian_weightedAdjMatrix: the adjacency matrix is the weighted adjacency matrix with all weights1, andG.lapMatrix Ris the Laplacian of either.SimpleGraph.orientedIncMatrix_map_mul_diagonal_mul_transpose: the weighted Gram identityN * diagonal w * Nᵀ = (G.weightedAdjMatrix w).laplacian.
The two endpoints (Quot.out e).1 and (Quot.out e).2 of an edge are distinct.
The weighted adjacency matrix of G for edge weights w : Sym2 V → R: the entry (u, v)
is w s(u, v) if u and v are adjacent and 0 otherwise. Only the values of w on the edges
of G matter.
The entries of the weighted adjacency matrix.
The oriented incidence matrix of G: the column of an edge e is 1 at the endpoint
(Quot.out e).1, -1 at the endpoint (Quot.out e).2, and 0 elsewhere.
The entries of the oriented incidence matrix.
Pairing a vertex function with a column of the oriented incidence matrix gives the difference of its values at the two endpoints. In particular every column sums to zero.
The square of an entry of the oriented incidence matrix is 1 at the endpoints of the edge
and 0 elsewhere.
An entry of the oriented incidence matrix vanishes off the endpoints of its edge.
For distinct vertices u and w, the product of their entries in the column of e is -1
when e joins them and 0 otherwise.
The Laplacian is the Gram matrix of the oriented incidence matrix:
N * Nᵀ = G.lapMatrix ℤ, for the orientation of SimpleGraph.orientedIncMatrix.
The adjacency matrix of G is its weighted adjacency matrix with all weights 1.
The Laplacian of G is the Laplacian (Matrix.laplacian) of its adjacency matrix.
The Laplacian of G is the Laplacian (Matrix.laplacian) of its weighted adjacency matrix
with all weights 1.
The weighted Laplacian is a weighted Gram matrix of the oriented incidence matrix:
N * diagonal w * Nᵀ is the Laplacian of the weighted adjacency matrix G.weightedAdjMatrix w,
where N is SimpleGraph.orientedIncMatrix G cast to R.