LAL: Linear Arrangement Library 24.10.00
A library focused on algorithms on linear arrangements of graphs.
|
The C++ implementation of the library, offers three quick and useful ways of constructing free and rooted trees in a single line using head vectors (see Head vector for a definition of head vectors).
To start with, recall that there exist functions that convert a head vector into a free tree (see lal::graphs::from_head_vector_to_free_tree) or a rooted tree (see lal::graphs::from_head_vector_to_rooted_tree). The former returns a pair of lal::graphs::free_tree and lal::node, and the latter a lal::graphs::rooted_tree.
In LAL there are defined two literal types to ease the construction of these objects.
Attention! Notice the p before free_tree in the literal.
Since, when creating a free tree, we often only want the tree structure (and ignore the root denoted explicitly in the head vector with the '0' character), users can write
or simply
Attention! Notice that there is no p before free_tree in this literal.