27 #ifndef GUM_SPANNING_FOREST_PRIM_H 28 #define GUM_SPANNING_FOREST_PRIM_H 30 #include <agrum/tools/core/priorityQueue.h> 31 #include <agrum/tools/graphs/algorithms/spanningForest.h> bool _require_computation_
a Boolean indicating whether we need recompute the spanning tree
UndiGraph _spanning_tree_
the computed spanning tree
SpanningForestPrim(const SpanningForestPrim &toCopy)
Copy constructor.
float _spanning_tree_cost_
the cost of the spanning tree
void _compute_()
Computes the spanning forest.
INLINE void emplace(Args &&... args)
SpanningForestPrim(const UndiGraph *graph, const EdgeProperty< float > *costTable)
Default constructor.
const EdgeProperty< float > & _costTable_
the costs of the edges
const UndiGraph & spanningForest()
Construct the spanning forest.
The Prim algorithm for computing min cost spanning trees or forests.
const EdgeSet & edgesInSpanningForest()
Returns the edges in a min cost spanning forest.
float costOfSpanningForest()
Returns the cost of the spanning forest.
PriorityQueue< Edge, float > _edgesToExplore_
the next edges that may be added to the spanning tree
virtual ~SpanningForestPrim()
Destructor.
SpanningForestPrim & operator=(const SpanningForestPrim &toCopy)
Copy operator: private to prevent using it.
void _exploreNode_(const NodeId id)
explore the neighborhood of a node belonging to the spanning tree
void _computeInAComponent_(const NodeId id)
compute a spanning tree in a given connected component of graph
const UndiGraph & _graph_
the graph the spanning tree of which we wish to compute