{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $G$ be a finite simple [[graph|0JD5C82QMB]] with vertices $v_1, \\dots, v_n$.\nLet $D$ be the diagonal matrix with $D_{ii} = \\deg(v_i)$, the [[degree|0T0F6CCS9W]] of $v_i$, and let $A$ be the [[adjacency matrix|0NZ8MDBN6Q]] of $G$.\nThe Laplacian matrix of $G$ is the $n \\times n$ matrix $L = D - A$.\nSo $L_{ii} = \\deg(v_i)$, $L_{ij} = -1$ if $i \\ne j$ and $v_i v_j$ is an edge, and $L_{ij} = 0$ otherwise.\n\n## Remarks\n\nFor every real vector $x$, $x^{T} L x = \\sum (x_i - x_j)^2$, the sum running over the edges $v_i v_j$.\nHence $L$ is [[symmetric|0N28QN4CYA]] and [[positive semidefinite|0880F9EQCP]], the all-ones vector lies in its kernel, and the multiplicity of the eigenvalue $0$ equals the number of connected components of $G$.\nExample: for the path $v_1 v_2 v_3$,\n$$L = \\begin{pmatrix} 1 \u0026 -1 \u0026 0 \\\\ -1 \u0026 2 \u0026 -1 \\\\ 0 \u0026 -1 \u0026 1 \\end{pmatrix},$$\nwhose eigenvalues are $0$, $1$ and $3$, with eigenvectors $(1,1,1)$, $(1,0,-1)$ and $(1,-2,1)$.\nNon-example: the matrix $D + A$ has the right diagonal but the wrong sign off the diagonal.\nIt is the signless Laplacian, and it has the same spectrum as $L$ when $G$ is bipartite, but not in general.\nThe normalized Laplacian $D^{-1/2} L D^{-1/2}$, defined when no vertex is isolated, is also common.\nMathlib defines the Laplacian matrix as `SimpleGraph.lapMatrix`.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "TN6M6DVZRP",
    "kind": "definition",
    "msc": [
      "05C50"
    ],
    "name": "Laplacian matrix",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Laplacian_matrix"
      }
    ],
    "tag": "7YBM0AXY23",
    "uses": [
      "0JD5C82QMB",
      "0NZ8MDBN6Q",
      "0T0F6CCS9W",
      "0N28QN4CYA",
      "0880F9EQCP"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/7YBM0AXY23/",
  "links": [
    {
      "field": "defines",
      "target": "TN6M6DVZRP"
    },
    {
      "field": "uses",
      "target": "0JD5C82QMB"
    },
    {
      "field": "uses",
      "target": "0NZ8MDBN6Q"
    },
    {
      "field": "uses",
      "target": "0T0F6CCS9W"
    },
    {
      "field": "uses",
      "target": "0N28QN4CYA"
    },
    {
      "field": "uses",
      "target": "0880F9EQCP"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/7YBM0AXY23.md",
  "msc": [
    "05C50"
  ],
  "name": "Laplacian matrix",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/7YB/7YBM0AXY23.md",
  "status": null,
  "tag": "7YBM0AXY23",
  "uri": "m2://7YBM0AXY23",
  "url": "https://math2.tamnd.com/wiki/laplacian-matrix-definition/",
  "writing": {
    "tag": "7YBM0AXY23",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
