---
tag: AB5CY2E7BK
kind: concept
name: Lowest common ancestor
aliases: [least-common-ancestor, least-common-subsumer, nearest-common-ancestor]
sources:
  - wikipedia: en:7196522@r1373894477
    locator: Lowest common ancestor
    note: adopted
    mention: wikipedia://en/7196522
    sections: [Summary]
same_as:
  wikidata: Q4312352
  wikipedia: Lowest common ancestor
inventory: [V2HMNJ9XKX]
---

## Summary

In 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).
