LAL: Linear Arrangement Library 24.10.00
A library focused on algorithms on linear arrangements of graphs.
Loading...
Searching...
No Matches
lal::detail::Dmin::unconstrained::Shiloach Namespace Reference

Functions for Shiloach's minimum linear arrangement algorithm. More...

Typedefs

typedef array< node_sizeordering
 Typedef for a useful type.
 

Functions

template<char anchored>
uint64_t calculate_p_alpha (const uint64_t n, const ordering &ord, uint64_t &s_0, uint64_t &s_1) noexcept
 Calculate \(p_{\alpha}\).
 
template<char alpha, bool make_arrangement>
void calculate_mla (graphs::free_tree &t, const node root_or_anchor, position start, position end, linear_arrangement &mla, uint64_t &cost) noexcept
 Calculate a minimum linear arrangment using Shiloach's algorithm.
 

Detailed Description

Functions for Shiloach's minimum linear arrangement algorithm.

Namespace that holds function for Shiloach's algorithm for the minimum linear arrangement problem. See [43] for further details.

Function Documentation

◆ calculate_mla()

template<char alpha, bool make_arrangement>
void lal::detail::Dmin::unconstrained::Shiloach::calculate_mla ( graphs::free_tree & t,
const node root_or_anchor,
position start,
position end,
linear_arrangement & mla,
uint64_t & cost )
noexcept

Calculate a minimum linear arrangment using Shiloach's algorithm.

For further details, see [43].

Template Parameters
alphaindicates whether the connected component of 't' is rooted or anchored.
make_arrangementWhether or not the arrangement should be constructed.
Parameters
tinput forest a single connected component of which has to be arranged.
root_or_anchornode used as a reference to the said connected component. Its value is within [1,n]
startposition where to start placing the vertices (the leftmost position in the mla for the subtree).
endposition where to end placing the vertices (the rightmost position int the mla for the subtree).
[out]mlaA minimum arrangement.
[out]costThe cost of the minimum arrangement.

◆ calculate_p_alpha()

template<char anchored>
uint64_t lal::detail::Dmin::unconstrained::Shiloach::calculate_p_alpha ( const uint64_t n,
const ordering & ord,
uint64_t & s_0,
uint64_t & s_1 )
nodiscardnoexcept

Calculate \(p_{\alpha}\).

See [43] for details.

Template Parameters
anchoredIs the tree anchored?
Parameters
nNumber of vertices of the tree.
ordOrdering of the children of a vertex in non-increasing order.
s_0Value \(s_0\).
s_1Value \(s_1\).
Returns
Maximum \(p_\alpha\).