{
  "aliases": [
    "least-common-ancestor",
    "least-common-subsumer",
    "nearest-common-ancestor"
  ],
  "backlinks": null,
  "body": "\n## Summary\n\nIn graph theory and computer science, the **lowest common ancestor** (**LCA**) (also called **least common ancestor**) of two nodes $v$ and $w$ in a [[tree|062D9KXJB1]] or directed acyclic graph (DAG) $T$ is the lowest (i.e. deepest) node that has both $v$ and $w$ as descendants, where we define each node to be a descendant of itself (so if $v$ has a direct connection from $w$, $w$ is the lowest common ancestor).\n",
  "commit": "68a8c3dc73fd55004b2796431c607c30960d1a85",
  "front": {
    "aliases": [
      "least-common-ancestor",
      "least-common-subsumer",
      "nearest-common-ancestor"
    ],
    "inventory": [
      "V2HMNJ9XKX"
    ],
    "kind": "concept",
    "name": "Lowest common ancestor",
    "same_as": {
      "wikidata": "Q4312352",
      "wikipedia": "Lowest common ancestor"
    },
    "sources": [
      {
        "locator": "Lowest common ancestor",
        "mention": "wikipedia://en/7196522",
        "note": "adopted",
        "sections": [
          "Summary"
        ],
        "wikipedia": "en:7196522@r1373894477"
      }
    ],
    "tag": "AB5CY2E7BK"
  },
  "kind": "concept",
  "link": "https://math2.tamnd.com/node/AB5CY2E7BK/",
  "links": null,
  "markdown": "https://math2.tamnd.com/node/AB5CY2E7BK.md",
  "msc": null,
  "name": "Lowest common ancestor",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/AB5/AB5CY2E7BK.md",
  "status": null,
  "tag": "AB5CY2E7BK",
  "uri": "m2://AB5CY2E7BK",
  "url": "https://math2.tamnd.com/wiki/lowest-common-ancestor/",
  "writing": {
    "tag": "AB5CY2E7BK",
    "kind": "concept",
    "level": "W1",
    "next": [
      {
        "what": "edge defines in",
        "note": "at least one definition",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge instance_of in",
        "note": "at least two examples",
        "have": 0,
        "want": 2
      },
      {
        "what": "edge not_instance_of in",
        "note": "at least one non-example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge specializes both",
        "note": "the more general notions and the special cases",
        "have": 0,
        "want": 1
      }
    ]
  }
}
