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

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

Functions

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

Detailed Description

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

Function Documentation

◆ compute() [1/2]

template<bool decide_upper_bound, class arrangement_t >
uint64_t lal::detail::crossings::brute_force::compute ( const graphs::directed_graph & g,
const arrangement_t & arr,
const uint64_t upper_bound )
nodiscardnoexcept

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.
arrangement_tType 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, class arrangement_t >
uint64_t lal::detail::crossings::brute_force::compute ( const graphs::undirected_graph & g,
const arrangement_t & arr,
const uint64_t upper_bound = 0 )
nodiscardnoexcept

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.
arrangement_tType 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, class arrangement_t >
uint64_t lal::detail::crossings::brute_force::inner_compute ( const graphs::directed_graph & g,
const position pu,
const position pv,
const arrangement_t & arr,
uint64_t C,
const uint64_t upper_bound )
nodiscardnoexcept

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.
arrangement_tType 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.