{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $G$ be a finite [[graph|0JD5C82QMB]] with vertices $v_1, \\dots, v_n$ and edges $e_1, \\dots, e_m$.\nThe incidence matrix of $G$ is the $n \\times m$ matrix $B$ with $B_{ij} = 1$ if $v_i$ is an end of $e_j$, and $B_{ij} = 0$ otherwise.\nSuppose that each edge $e_j$ is given an orientation, from a tail to a head.\nThe oriented incidence matrix is the $n \\times m$ matrix $N$ with $N_{ij} = 1$ if $v_i$ is the head of $e_j$.\nAlso $N_{ij} = -1$ if $v_i$ is the tail of $e_j$, and $N_{ij} = 0$ otherwise.\n\n## Remarks\n\nExample: for the triangle with edges $e_1 = v_1 v_2$, $e_2 = v_2 v_3$, $e_3 = v_1 v_3$,\n$$B = \\begin{pmatrix} 1 \u0026 0 \u0026 1 \\\\ 1 \u0026 1 \u0026 0 \\\\ 0 \u0026 1 \u0026 1 \\end{pmatrix},$$\nand each column has exactly two entries $1$, at the ends of its edge.\nNon-example: a $0$–$1$ matrix with a column containing three entries $1$ is not the incidence matrix of a graph, since an edge has exactly two ends; such matrices describe hypergraphs.\nLet $D$ be the diagonal matrix of degrees and $A$ the [[adjacency matrix|0NZ8MDBN6Q]] of a simple graph.\nThen $B B^{T} = D + A$, and $N N^{T} = D - A$ is the [[Laplacian matrix|TN6M6DVZRP]] for every orientation.\nSome authors use the transpose, with rows indexed by edges, or the opposite sign convention for $N$.\nMathlib defines the unoriented incidence matrix as `SimpleGraph.incMatrix`.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "9DNFN8M83X",
    "kind": "definition",
    "msc": [
      "05C50"
    ],
    "name": "Incidence matrix",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Incidence_matrix"
      }
    ],
    "tag": "YNFT400EV9",
    "uses": [
      "0JD5C82QMB",
      "0R5HTV7REV",
      "0NZ8MDBN6Q",
      "TN6M6DVZRP"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/YNFT400EV9/",
  "links": [
    {
      "field": "defines",
      "target": "9DNFN8M83X"
    },
    {
      "field": "uses",
      "target": "0JD5C82QMB"
    },
    {
      "field": "uses",
      "target": "0R5HTV7REV"
    },
    {
      "field": "uses",
      "target": "0NZ8MDBN6Q"
    },
    {
      "field": "uses",
      "target": "TN6M6DVZRP"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/YNFT400EV9.md",
  "msc": [
    "05C50"
  ],
  "name": "Incidence matrix",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/YNF/YNFT400EV9.md",
  "status": null,
  "tag": "YNFT400EV9",
  "uri": "m2://YNFT400EV9",
  "url": "https://math2.tamnd.com/wiki/incidence-matrix-definition/",
  "writing": {
    "tag": "YNFT400EV9",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
