55#include <lal/graphs/rooted_tree.hpp>
56#include <lal/detail/linarr/Dmin_utils.hpp>
57#include <lal/detail/linarr/Dopt_utils.hpp>
81template <
bool make_arrangement>
84 std::pair<uint64_t, linear_arrangement>,
90 assert(t.is_rooted_tree());
93 const uint64_t n = t.get_num_nodes();
94 const node r = t.get_root();
96 if constexpr (make_arrangement) {
108 std::vector<std::vector<node_size>> L(n);
115 if constexpr (make_arrangement) {
117 const uint64_t D = Dmin_utils::embed<true>(L, r, arr);
118 return {D, std::move(arr)};
122 const uint64_t D = Dmin_utils::embed<false>(L, r, arr);
Rooted tree graph class.
Definition: rooted_tree.hpp:103
Linear arrangement of vertices.
Definition: linear_arrangement.hpp:103
void identity() noexcept
Makes this arrangement an identity arrangement.
Definition: linear_arrangement.hpp:452
std::conditional_t< make_arrangement, std::pair< uint64_t, linear_arrangement >, uint64_t > HS(const graphs::rooted_tree &t) noexcept
Minimum projective arrangement of a rooted tree.
Definition: Dmin_Projective_HS.hpp:87
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:115
@ projective
Projective structures.
Main namespace of the library.
Definition: basic_types.hpp:50
uint64_t node
Node type. See Node / Vertex page for further details.
Definition: basic_types.hpp:53
Non-increasing sort.
Definition: sorting_types.hpp:51