XNetwork 1.7.5; VERSION ${PROJECT_VERSION}
Loading...
Searching...
No Matches
graph_algo.hpp
Go to the documentation of this file.
1
9#pragma once
10
11#include <cassert>
12#include <py2cpp/dict.hpp>
13#include <py2cpp/set.hpp>
14#include <utility>
15
29template <typename Graph, typename WeightMap, typename CoverSet>
31 -> std::pair<CoverSet, typename WeightMap::mapped_type>;
32
36template <typename Graph, typename WeightMap>
37auto min_vertex_cover_fast(const Graph& ugraph, WeightMap& weight)
38 -> std::pair<py::set<typename Graph::node_t>, typename WeightMap::mapped_type> {
40 return min_vertex_cover_fast(ugraph, weight, coverset);
41}
42
58template <typename Graph, typename WeightMap, typename IndSet, typename DepSet>
60 DepSet& dep) -> std::pair<IndSet, typename WeightMap::mapped_type>;
61
65template <typename Graph, typename WeightMap>
66auto min_maximal_independant_set(const Graph& ugraph, WeightMap& weight)
67 -> std::pair<py::set<typename Graph::node_t>, typename WeightMap::mapped_type> {
71}
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
auto min_maximal_independant_set(const Graph &ugraph, WeightMap &weight, IndSet &indset, DepSet &dep) -> std::pair< IndSet, typename WeightMap::mapped_type >
Performs minimum weighted maximal independent set using primal-dual algorithm.
auto min_vertex_cover_fast(const Graph &ugraph, WeightMap &weight, CoverSet &coverset) -> std::pair< CoverSet, typename WeightMap::mapped_type >
Performs minimum weighted vertex cover using a primal-dual approximation algorithm.