25#include <py2cpp/set.hpp>
46 template <
typename Node,
typename Val
idator>
51 if (!std::forward<Validator>(
is_valid)()) {
71template <
typename Graph,
typename WeightMap,
typename RNG>
89template <
typename Graph,
typename WeightMap>
91 std::optional<unsigned int>
seed = std::optional<unsigned int>{0},
96 if (
seed.has_value()) {
100 std::random_device
rd;
101 std::mt19937
rng{
rd()};
124template <
typename Graph,
typename WeightMap>
Read-only map of maps of maps (view into a dict-of-dict-of-dict structure)
Definition coreviews.hpp:109
AdjacencyView(Atlas &d)
Construct an AdjacencyView from an Atlas container.
Definition coreviews.hpp:115
Definition hadlock.hpp:40
void reverse_delete_cover(py::set< Node > &soln, const std::vector< Node > &added_order, Validator &&is_valid)
Reverse-delete post-processing step.
Definition rand_cover.hpp:47
auto rand_vertex_cover_trial(const Graph &ugraph, const WeightMap &weight, const py::set< typename Graph::node_t > &coverset, RNG &rng) -> std::pair< py::set< typename Graph::node_t >, typename WeightMap::mapped_type >
Single trial of Pitt's randomized vertex cover algorithm.
auto rand_vertex_cover(const Graph &ugraph, const WeightMap &weight, std::optional< unsigned int > seed=std::optional< unsigned int >{0}, const py::set< typename Graph::node_t > &coverset={}) -> std::pair< py::set< typename Graph::node_t >, typename WeightMap::mapped_type >
Single-trial randomized vertex cover (seeded convenience wrapper).
Definition rand_cover.hpp:90
auto rand_vertex_cover_mt(const Graph &ugraph, const WeightMap &weight, unsigned int num_trials=64, unsigned int seed=0, const py::set< typename Graph::node_t > &coverset={}) -> std::pair< py::set< typename Graph::node_t >, typename WeightMap::mapped_type >
Multi-threaded randomized vertex cover.