Random generation of arrangements of any bipartite graph.
More...
#include <rand_bipartite_arrangements.hpp>
|
void | init (const uint64_t seed) noexcept |
| Initializes this class.
|
|
void | init_arrangement (const bool red_first) noexcept |
| Initializes this class.
|
|
Random generation of arrangements of any bipartite graph.
This class generates bipartite linear arrangements uniformly at random (see page Types of arrangements for a definition of bipartite arrangements). This class can be instantiated with a (bipartite) graph, or with the coloring of one.
A possible usage of this class is the following:
for (int i = 0; i < 100; ++i) {
}
Random generation of arrangements of any bipartite graph.
Definition rand_bipartite_arrangements.hpp:84
Linear arrangement of vertices.
Definition linear_arrangement.hpp:103
Equivalently,
for (int i = 0; i < 100; ++i) {
}
A class to represent a coloring of the vertices of a bipartite graph.
Definition bipartite_graph_coloring.hpp:60
◆ rand_bipartite_arrangements() [1/5]
template<class graph_t >
lal::generate::rand_bipartite_arrangements::rand_bipartite_arrangements |
( |
const graph_t & | g, |
|
|
const uint64_t | seed = 0 ) |
|
inlinenoexcept |
Constructor with graph.
This constructor needs to calculate the bipartite coloring of the graph.
- Template Parameters
-
- Parameters
-
g | Input graph. |
seed | Integer value to seed the random number generator. |
- Precondition
- The input graph g is bipartite.
◆ rand_bipartite_arrangements() [2/5]
Default copy constructor.
- Parameters
-
Gen | Exhaustive bipartite arrangement generator. |
◆ rand_bipartite_arrangements() [3/5]
Default move constructor.
- Parameters
-
Gen | Exhaustive bipartite arrangement generator. |
◆ rand_bipartite_arrangements() [4/5]
Constructor with coloring.
- Parameters
-
c | Input coloring of a bipartite graph. |
seed | Integer value to seed the random number generator. |
◆ rand_bipartite_arrangements() [5/5]
Constructor with coloring.
- Parameters
-
c | Input coloring of a bipartite graph. |
seed | Integer value to seed the random number generator. |
◆ init()
void lal::generate::rand_bipartite_arrangements::init |
( |
const uint64_t | seed | ) |
|
|
privatenoexcept |
Initializes this class.
Initializes the arrangement (m_arr) and the number of blue and red vertices (m_n_blue and m_n_red).
- Parameters
-
seed | Seed for the random number generator. |
◆ init_arrangement()
void lal::generate::rand_bipartite_arrangements::init_arrangement |
( |
const bool | red_first | ) |
|
|
privatenoexcept |
Initializes this class.
Initializes the arrangement by placing the red or blue vertices in the left side of the arrangement depending on the value of the parameter.
- Parameters
-
red_first | Place red vertices first if true. |
◆ m_arr
The arrangement generated by this class.
Actually, generated by the std::next_permutation algorithm.
◆ m_red_or_blue
std::bernoulli_distribution lal::generate::rand_bipartite_arrangements::m_red_or_blue |
|
private |
Boolean values generator.
To decide what color goes at the left half.
The documentation for this class was generated from the following file: