57#include <lal/linear_arrangement.hpp>
58#include <lal/graphs/rooted_tree.hpp>
59#include <lal/detail/array.hpp>
60#include <lal/iterators/E_iterator.hpp>
61#include <lal/detail/graphs/size_subtrees.hpp>
62#include <lal/detail/sorting/counting_sort.hpp>
63#include <lal/detail/properties/tree_centroid.hpp>
64#include <lal/detail/macros/basic_convert.hpp>
65#include <lal/detail/linarr/D/Dopt_utils.hpp>
103template <Dopt_utils::place r_place,
bool make_arrangement>
106 const std::vector<std::vector<node_size>>& L,
118 if constexpr (make_arrangement) {
132 const auto& children = L[r];
135 uint64_t acc_size = 0;
144 position next_ini = 0, next_fin = 0;
153 for (
const auto& [vi, ni] : children) {
155 if constexpr (make_arrangement) {
157 next_ini = ini + acc_size + 1;
158 next_fin = next_ini + ni - 1;
165 next_fin = fin - acc_size - 1;
166 next_ini = next_fin - ni + 1;
198template <
bool make_arrangement>
202 const std::vector<std::vector<node_size>>& L,
Linear arrangement of vertices.
Definition linear_arrangement.hpp:103
uint64_t arrange(const std::vector< std::vector< node_size > > &L, const node r, const position ini, const position fin, linear_arrangement &arr) noexcept
Make a maximum projective arrangement using the sorted, rooted adjacency list L.
Definition utils.hpp:105
uint64_t arrange_projective(const uint64_t n, const std::vector< std::vector< node_size > > &L, const node r, linear_arrangement &arr) noexcept
Wrapper method for the recursive method arrange.
Definition utils.hpp:200
static constexpr place PLACE_RIGHT_OF
A vertex is to be placed to the right of a vertex.
Definition Dopt_utils.hpp:79
static constexpr place PLACE_LEFT_OF
A vertex is to be placed to the left of a vertex.
Definition Dopt_utils.hpp:77
static constexpr place PLACE_NONE_OF
There is no vertex to use as reference to determine the side.
Definition Dopt_utils.hpp:81
unsigned char place
Useful typedef to denote relative position.
Definition Dopt_utils.hpp:72
Main namespace of the library.
Definition basic_types.hpp:48
uint64_t position
Node's position type.
Definition basic_types.hpp:53
uint64_t node
Node type. See Node / Vertex page for further details.
Definition basic_types.hpp:51