{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $A$ be an $m \\times n$ [[matrix|0VD9ZSWWJG]], and let $\\operatorname{nnz}(A)$ be the number of its nonzero entries.\nThe matrix $A$ is *sparse* when $\\operatorname{nnz}(A)$ is small compared with $mn$, so that it pays to store and process only the nonzero entries.\nFor a family of $n \\times n$ matrices with $n$ growing, a common precise form of this condition is $\\operatorname{nnz}(A) = O(n)$.\n\n## Remarks\n\nThe notion has no fixed threshold; it depends on the size of the matrix and on the algorithms in use.\nThe *density* of $A$ is $\\operatorname{nnz}(A) / (mn)$, and a matrix that is not sparse is called *dense*.\nExample: the $n \\times n$ [[tridiagonal matrix|DARX1KZRHZ]] with $2$ on the diagonal and $-1$ beside it has $3n - 2$ nonzero entries, which is $O(n)$, so the family is sparse.\nNon-example: the $n \\times n$ matrix with all entries $1$ has $n^2$ nonzero entries, so it is dense.\nCommon storage formats are the coordinate list and the compressed sparse row format.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "JGACZYEEY7",
    "kind": "definition",
    "msc": [
      "65F50",
      "15B99"
    ],
    "name": "Sparse matrix",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Sparse_matrix"
      }
    ],
    "tag": "71K5G4GNNZ",
    "uses": [
      "0VD9ZSWWJG"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/71K5G4GNNZ/",
  "links": [
    {
      "field": "defines",
      "target": "JGACZYEEY7"
    },
    {
      "field": "uses",
      "target": "0VD9ZSWWJG"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/71K5G4GNNZ.md",
  "msc": [
    "65F50",
    "15B99"
  ],
  "name": "Sparse matrix",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/71K/71K5G4GNNZ.md",
  "status": null,
  "tag": "71K5G4GNNZ",
  "uri": "m2://71K5G4GNNZ",
  "url": "https://math2.tamnd.com/wiki/sparse-matrix-definition/",
  "writing": {
    "tag": "71K5G4GNNZ",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
