lca: O(log n) persistent online lowest common ancestor search without preprocessing

[ algorithms, bsd3, data-structures, library ] [ Propose Tags ] [ Report a vulnerability ]

This package provides a reference implementation of my skew binary random access algorithm for performing an online lowest common ancestor search (and online level ancestor search) in logarithmic time without preprocessing. This improves the previous known asymptotic bound for both of these problems from O(h) to O(log h), where h is the height of the tree. Mostly importantly this bound is completely independent of the width or overall size of the tree, enabling you to calculate lowest common ancestors in a distributed fashion with good locality.

While offline algorithms exist for both of these algorithms that that provide O(1) query time, they all require at least O(n) preprocessing, where n is the size of the entire tree, and so are less suitable for LCA search in areas such as revision control where the tree is constantly updated, or distributed computing where the tree may be too large to fit in any one computer's memory.

Slides are available from

http://www.slideshare.net/ekmett/skewbinary-online-lowest-common-ancestor-search


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.1.0.1, 0.2, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.3, 0.3.1, 0.4
Change log CHANGELOG.md
Dependencies base (>=4 && <5) [details]
Tested with ghc ==7.0.4, ghc ==7.2.2, ghc ==7.4.2, ghc ==7.6.3, ghc ==7.8.4, ghc ==7.10.3, ghc ==8.0.2, ghc ==8.2.2, ghc ==8.4.4, ghc ==8.6.5, ghc ==8.8.3, ghc ==8.10.1
License BSD-3-Clause
Copyright Copyright (C) 2011-2015 Edward A. Kmett
Author Edward A. Kmett
Maintainer Edward A. Kmett <ekmett@gmail.com>
Category Algorithms, Data Structures
Home page http://github.com/ekmett/lca/
Bug tracker http://github.com/ekmett/lca/issues
Source repo head: git clone git://github.com/ekmett/lca.git
Uploaded by ryanglscott at 2021-02-17T23:53:00Z
Distributions LTSHaskell:0.4, NixOS:0.4, Stackage:0.4
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 9000 total (44 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-02-18 [all 1 reports]

Readme for lca-0.4

[back to package description]

lca: O(log h) Online Lowest Common Ancestor Search

Hackage Build Status

This package provides a reference implementation of my skew binary random access algorithm for performing an online lowest common ancestor in logarithmic time without preprocessing. This improves the previous known asymptotic bound for this problem from O(h) to O(log h), where h is the height of the tree. Mostly importantly this bound is completely independent of the width or overall size of the tree, enabling you to calculate lowest common ancestors in a distributed fashion with good locality.

While algorithms exist that that provide O(1) query time, they all require O(n) preprocessing, where n is the size of the entire tree, and so are less suitable for LCA search in areas such as revision control where the tree is constantly updated, or distributed computing where the tree may be too large to fit in any one computer's memory.

Slides are available as Purely Functional Data Structures for On-Line LCA

Contact Information

Contributions and bug reports are welcome!

Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net.

-Edward Kmett