55#include <lal/graphs/rooted_tree.hpp>
56#include <lal/detail/linarr/D/Dmin/utils.hpp>
57#include <lal/detail/linarr/D/Dopt_utils.hpp>
77template <
bool make_arrangement>
78[[nodiscard]] std::conditional_t<
80 std::pair<uint64_t, linear_arrangement>,
86 assert(t.is_rooted_tree());
89 const uint64_t n = t.get_num_nodes();
91 if constexpr (make_arrangement) {
103 std::vector<std::vector<node_size>> L(n);
112 (n, L, t.get_root(), arr);
114 if constexpr (make_arrangement) {
115 return {D, std::move(arr)};
Rooted tree graph class.
Definition rooted_tree.hpp:109
Linear arrangement of vertices.
Definition linear_arrangement.hpp:103
void identity() noexcept
Makes this arrangement an identity arrangement.
Definition linear_arrangement.hpp:507
std::conditional_t< make_arrangement, std::pair< uint64_t, linear_arrangement >, uint64_t > AEF(const graphs::rooted_tree &t) noexcept
Minimum projective arrangement of a rooted tree.
Definition Projective_AEF.hpp:83
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:236
void make_sorted_adjacency_list_rooted(const graphs::rooted_tree &t, std::vector< std::vector< node_size > > &L) noexcept
Make a sorted, rooted adjacency list sorted according to the sizes of the subtrees of the input roote...
Definition Dopt_utils.hpp:125
@ non_increasing
Non-increasing sort.
Main namespace of the library.
Definition basic_types.hpp:48