LAL: Linear Arrangement Library 23.01.00
A library focused on algorithms on linear arrangements of graphs.
Loading...
Searching...
No Matches
Functions
lal::detail::crossings::brute_force Namespace Reference

Namespace for the brute force algorithm to calculate \(C\). More...

Functions

template<bool decide_upper_bound, linarr_type arr_type>
uint64_t compute (const graphs::undirected_graph &g, const linarr_wrapper< arr_type > &arr, uint64_t upper_bound=0) noexcept
 Brute force computation of \(C\) for undirected graphs. More...
 
template<bool decide_upper_bound, linarr_type arr_type>
uint64_t inner_compute (const graphs::directed_graph &g, position pu, position pv, const linarr_wrapper< arr_type > &arr, uint64_t C, uint64_t upper_bound) noexcept
 Brute force computation of \(C\) for directed graphs. More...
 
template<bool decide_upper_bound, linarr_type arr_type>
uint64_t compute (const graphs::directed_graph &g, const linarr_wrapper< arr_type > &arr, uint64_t upper_bound) noexcept
 Brute force computation of \(C\) for directed graphs. More...
 

Detailed Description

Namespace for the brute force algorithm to calculate \(C\).

Function Documentation

◆ compute() [1/2]

template<bool decide_upper_bound, linarr_type arr_type>
uint64_t lal::detail::crossings::brute_force::compute ( const graphs::directed_graph g,
const linarr_wrapper< arr_type > &  arr,
uint64_t  upper_bound 
)
noexcept

Brute force computation of \(C\) for directed graphs.

When template parameter decide_upper_bound is false, the function returns the number of crossings.

Template Parameters
decide_upper_boundBoolean value to choose the nature of the return type.
arr_typeType of arrangement.
Parameters
gInput graph.
arrInput arrangement.
upper_boundUpper bound on the number of crossings.
Returns
When decide_upper_bound is true, the return value is:
  • one unit larger than the upper bound passed as parameter if \(C>\) upper bound.
  • \(C\) if the number of crossings is less or equal than the upper bound.

◆ compute() [2/2]

template<bool decide_upper_bound, linarr_type arr_type>
uint64_t lal::detail::crossings::brute_force::compute ( const graphs::undirected_graph g,
const linarr_wrapper< arr_type > &  arr,
uint64_t  upper_bound = 0 
)
noexcept

Brute force computation of \(C\) for undirected graphs.

When template parameter decide_upper_bound is false, the function returns the number of crossings.

Template Parameters
decide_upper_boundBoolean value to choose the nature of the return type.
arr_typeType of arrangement.
Parameters
gInput graph.
arrInput arrangement.
upper_boundUpper bound on the number of crossings.
Returns
When decide_upper_bound is true, the return value is:
  • one unit larger than the upper bound passed as parameter if \(C>\) upper bound.
  • \(C\) if the number of crossings is less or equal than the upper bound.

◆ inner_compute()

template<bool decide_upper_bound, linarr_type arr_type>
uint64_t lal::detail::crossings::brute_force::inner_compute ( const graphs::directed_graph g,
position  pu,
position  pv,
const linarr_wrapper< arr_type > &  arr,
uint64_t  C,
uint64_t  upper_bound 
)
noexcept

Brute force computation of \(C\) for directed graphs.

When template parameter decide_upper_bound is false, the function returns the number of crossings.

Template Parameters
decide_upper_boundBoolean value to choose the nature of the return type.
arr_typeType of arrangement.
Parameters
gInput graph.
puStarting position of the computation.
pvEnding position of the computation.
arrInput arrangement.
CCurrent number of crossings.
upper_boundUpper bound on the number of crossings.
Returns
When decide_upper_bound is true, the return value is:
  • one unit larger than the upper bound passed as parameter if \(C>\) upper bound.
  • \(C\) if the number of crossings is less or equal than the upper bound.