Go to the source code of this file.
|
| namespace | gtsam |
| | Global functions in a separate testing namespace.
|
|
|
std::vector< size_t > | gtsam::utils::sortedIndices (const std::vector< double > &weights) |
| template<class FACTOR> |
| std::vector< size_t > | gtsam::utils::kruskal (const FactorGraph< FACTOR > &fg, const std::vector< double > &weights) |
| | Compute the minimum spanning tree (MST) using Kruskal's algorithm.
|
- Date
- Dec 31, 2009
- Author
- Frank Dellaert
-
Yong-Dian Jian
-
Ankur Roy Chowdhury
◆ kruskal()
template<class FACTOR>
| std::vector< size_t > gtsam::utils::kruskal |
( |
const FactorGraph< FACTOR > & | fg, |
|
|
const std::vector< double > & | weights ) |
Compute the minimum spanning tree (MST) using Kruskal's algorithm.
- Parameters
-
| fg | Factor graph |
| weights | Weights of the edges/factors in the factor graph |
- Returns
- Edge/factor indices spanning the MST
- Note
- Only binary factors are considered while constructing the spanning tree
-
The indices of 'weights' should match the indices of the edges in the factor graph