gtsam
Loading...
Searching...
No Matches
kruskal.h File Reference

Go to the source code of this file.

Namespaces

namespace  gtsam
 Global functions in a separate testing namespace.

Functions

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.

Detailed Description

Date
Dec 31, 2009
Author
Frank Dellaert
Yong-Dian Jian
Ankur Roy Chowdhury

Function Documentation

◆ 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
fgFactor graph
weightsWeights 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