KirchhoffMatrix
KirchhoffMatrix[g] gives the Kirchhoff matrix (Laplacian matrix) of the graph g.
KirchhoffMatrix[{v -> w, ...}] uses rules v -> w to specify the graph g.
Examples
Kirchhoff matrix of a path graph:
KirchhoffMatrix[PathGraph[{1, 2, 3}]] // MatrixFormFrom edge rules:
KirchhoffMatrix[{1 -> 2, 2 -> 3, 3 -> 1}]Please visit the official Wolfram Language Reference for more details.