Incidence Matrix in LaTeX (B)
- LaTeX command
B- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Where it is used
Capital B, conventionally the incidence matrix of a graph, with rows for vertices and columns for edges.
For an undirected graph, B_{ve} = 1 when vertex v is an endpoint of edge e. For a directed or arbitrarily oriented graph, entries are -1 at the tail and +1 at the head (or the reverse, depending on the author), and then BB^\top = L = D - A, the graph Laplacian. Some books call the matrix M or N instead of B. It is an n \times m matrix, so state dimensions. For an unoriented incidence matrix, BB^\top equals D + A, the signless Laplacian, a frequent source of sign mistakes.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Incidence Matrix: $B$
\[ B B^{\top} = D - A = L \]
\end{document}Related symbols
All グラフ理論 →Frequently asked questions
- How do I write Incidence Matrix in LaTeX?
- Type B in math mode, for example $B B^{\top} = D - A = L$. It works in plain LaTeX without loading any package.
- Which package do I need for B?
- None. B is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use B in text mode, or only in math mode?
- Both. B compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.