9 #ifndef CGRAPHPARTITIONER_H 10 #define CGRAPHPARTITIONER_H 40 template <
class GRAPH_MATRIX,
typename num_t =
typename GRAPH_MATRIX::Scalar>
76 GRAPH_MATRIX& in_A, std::vector<std::vector<uint32_t>>& out_parts,
77 num_t threshold_Ncut = 1,
bool forceSimetry =
true,
78 bool useSpectralBisection =
true,
bool recursive =
true,
79 unsigned minSizeClusters = 1,
const bool verbose =
false);
106 GRAPH_MATRIX& in_A, std::vector<uint32_t>& out_part1,
107 std::vector<uint32_t>& out_part2, num_t& out_cut_value,
108 bool forceSimetry =
true);
135 GRAPH_MATRIX& in_A, std::vector<uint32_t>& out_part1,
136 std::vector<uint32_t>& out_part2, num_t& out_cut_value,
137 bool forceSimetry =
true);
143 const GRAPH_MATRIX& in_A,
const std::vector<uint32_t>& in_part1,
144 const std::vector<uint32_t>& in_part2);
This file implements miscelaneous matrix and matrix/vector operations, and internal functions in mrpt...
static void SpectralBisection(GRAPH_MATRIX &in_A, std::vector< uint32_t > &out_part1, std::vector< uint32_t > &out_part2, num_t &out_cut_value, bool forceSimetry=true)
Performs the spectral bisection of a graph.
static num_t nCut(const GRAPH_MATRIX &in_A, const std::vector< uint32_t > &in_part1, const std::vector< uint32_t > &in_part2)
Returns the normaliced cut of a graph, given its adjacency matrix A and a bisection: ...
Versatile class for consistent logging and management of output messages.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
static void exactBisection(GRAPH_MATRIX &in_A, std::vector< uint32_t > &out_part1, std::vector< uint32_t > &out_part2, num_t &out_cut_value, bool forceSimetry=true)
Performs an EXACT minimum n-Cut graph bisection, (Use CGraphPartitioner::SpectralBisection for a fast...
Algorithms for finding the min-normalized-cut of a weighted undirected graph.
static void RecursiveSpectralPartition(GRAPH_MATRIX &in_A, std::vector< std::vector< uint32_t >> &out_parts, num_t threshold_Ncut=1, bool forceSimetry=true, bool useSpectralBisection=true, bool recursive=true, unsigned minSizeClusters=1, const bool verbose=false)
Performs the spectral recursive partition into K-parts for a given graph.