58#include <lal/graphs/rooted_tree.hpp>
59#include <lal/detail/linarr/D/DMax/utils.hpp>
60#include <lal/detail/linarr/D/Dopt_utils.hpp>
80template <
bool make_arrangement>
81[[nodiscard]] std::conditional_t<
83 std::pair<uint64_t, linear_arrangement>,
89 assert(t.is_rooted_tree());
92 const uint64_t n = t.get_num_nodes();
94 if constexpr (make_arrangement) {
102 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
Maximum projective arrangement of a rooted tree.
Definition Projective_AEF.hpp:86
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
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