Skip to content

Algorithms

Benjamin Saunders edited this page May 26, 2020 · 1 revision

Finding the closest ancestor in the graph

For any two nodes, the closest common ancestor can be found efficiently by tracking two nodes and iteratively replacing the longer of the two with its parent until a common node is reached. This could be a foundation for a procedure to find a shortest path as well.

Clone this wiki locally