outils/lib.rs
1//! **outils** is a graph and tree data structure library. It provides utilities which at the
2//! time of writing were not available through other crates.
3//!
4//! As of this version of **outils**, those utilities are:
5//!
6//! **Fully dynamic connectivity** for general graphs: A dynamic graph data structure is able to
7//! answer queries as to whether two vertices are connected in a graph through a path of edges.
8//! In this context, _fully dynamic_ means that the graph can be updated by insertions or
9//! deletions of edges between queries (see also [Dynamic Connectivity][1]).
10//!
11//! - [`DynamicGraph`][2]: Deterministic dynamic connectivity with query cost **O(log(n))** and
12//! update costs of **O(log^2 (n))**. The structure also supports vertex weights, dynamically
13//! maintaining the total weight of connected components.
14//!
15//! **Balanced binary search trees**: A [balanced binary search tree][3] organizes search keys and
16//! their associated payload in a way such that the resulting binary tree has a minimal height,
17//! given the number of items stored, resulting in query and update costs of O(log(n)). This library
18//! uses [AA trees][4], an abstraction of red-black trees, for balancing the trees after updates.
19//!
20//! - [`AaTree`][5]: An iterative AA tree implementation using [arena allocation][6]. For most use
21//! cases, it is recommended to simply use the [`BTreeMap`][7] provided by the standard library, as
22//! it is considerably faster (appr. 50%). However, if information on parent and child relations
23//! between tree nodes, or custom traversal of the tree as such, are needed, `AaTree` has an advantage
24//! over `BTreeMap`.
25//!
26//! - [`WeightedAaTree`][8]: This is similar to `AaTree`. However, in addition to the actual
27//! payload, node weights can be stored and tree subweights are maintained.
28//!
29//! **Balanced binary forests**: A balanced binary forest is a forest of [balanced binary trees][3].
30//! In contrast to the tree data structures above, the order of the payload is not determined by
31//! associated search keys but by the relations of the nodes to each other: the in-order traversal
32//! of a forest tree alone represents the order of its nodes. Forest trees can be concatenated or
33//! split in order to manage those sequences. Parent and child relations are available, facilitating
34//! analysis of the represented sequences.
35//!
36//! - [`AaForest`][9]: A forest of trees balanced by the [AA tree][4] algorithm. Concatenation and
37//! separation do not require a reorganisation of the tree according to search keys - only
38//! rebalancing will take place, the order of the sequence being the responsibility of the user.
39//! The implementation is based on [arena allocation][6], and tree queries and updates are conducted
40//! iteratively, as in the corresponding AA tree structures above.
41//!
42//! - [`WeightedAaForest`][10]: This is similar to `AaForest`. However, in addition to the actual
43//! payload, a node weight can be stored and tree subweights are maintained.
44//!
45//! **General purpose tree data structures**:
46//!
47//! - [`Forest`][11]: A generic forest of trees. The implementation is based on
48//! [arena allocation][6] and a [first child/next sibling][12] representation, thus storing the
49//! children of a node as a linked list headed by the first child of the parent node.
50//!
51//! [1]: https://en.wikipedia.org/wiki/Dynamic_connectivity
52//! [2]: ./graph/dynconn/hdt/struct.DynamicGraph.html
53//! [3]: https://en.wikipedia.org/wiki/Self-balancing_binary_search_tree
54//! [4]: https://en.wikipedia.org/wiki/AA_tree
55//! [5]: ./tree/bst/aatree/struct.AaTree.html
56//! [6]: https://en.wikipedia.org/wiki/Region-based_memory_management
57//! [7]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html
58//! [8]: ./tree/bst/waatree/struct.WeightedAaTree.html
59//! [9]: ./tree/bst/aaforest/struct.AaForest.html
60//! [10]: ./tree/bst/waaforest/struct.WeightedAaForest.html
61//! [11]: ./tree/generic/struct.Forest.html
62//! [12]: https://en.wikipedia.org/wiki/Left-child_right-sibling_binary_tree
63
64#![warn(missing_docs)]
65
66
67pub mod graph;
68pub mod prelude;
69pub mod tree;
70pub mod types;