aGrUM  0.16.0
spanningForestPrim.h
Go to the documentation of this file.
1 
28 #ifndef GUM_SPANNING_FOREST_PRIM_H
29 #define GUM_SPANNING_FOREST_PRIM_H
30 
33 
34 namespace gum {
35 
36  /* ===========================================================================
37  */
42  /* ===========================================================================
43  */
45  public:
46  // ############################################################################
48  // ############################################################################
50 
52 
62  SpanningForestPrim(const UndiGraph* graph,
63  const EdgeProperty< float >* costTable);
64 
67 
69  virtual ~SpanningForestPrim();
70 
72 
73  // ############################################################################
75  // ############################################################################
77 
79 
81 
83 
84  const UndiGraph& spanningForest();
85 
87 
88  float costOfSpanningForest();
89 
91 
92  private:
95 
98 
101 
104 
107 
110 
112  void __compute();
113 
115  void __computeInAComponent(const NodeId id);
116 
118  void __exploreNode(const NodeId id);
119 
122  };
123 
124 } /* namespace gum */
125 
126 #endif /* GUM_SPANNING_FOREST_PRIM_H */
const EdgeProperty< float > & __costTable
the costs of the edges
const UndiGraph & __graph
the graph the spanning tree of which we wish to compute
UndiGraph __spanning_tree
the computed spanning tree
SpanningForestPrim(const UndiGraph *graph, const EdgeProperty< float > *costTable)
Default constructor.
const UndiGraph & spanningForest()
Construct the spanning forest.
The Prim algorithm for computing min cost spanning trees or forests.
void __computeInAComponent(const NodeId id)
compute a spanning tree in a given connected component of __graph
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
const EdgeSet & edgesInSpanningForest()
Returns the edges in a min cost spanning forest.
The class for generic Hash Tables.
Definition: hashTable.h:679
float costOfSpanningForest()
Returns the cost of the spanning forest.
A priorityQueue is a heap in which each element has a mutable priorityA priority queue is quite simil...
Definition: priorityQueue.h:51
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual ~SpanningForestPrim()
Destructor.
SpanningForestPrim & operator=(const SpanningForestPrim &toCopy)
Copy operator: private to prevent using it.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __exploreNode(const NodeId id)
explore the neighborhood of a node belonging to the spanning tree
Base class for undirected graphs.
Definition: undiGraph.h:109
float __spanning_tree_cost
the cost of the spanning tree
void __compute()
Computes the spanning forest.
PriorityQueue< Edge, float > __edgesToExplore
the next edges that may be added to the spanning tree
Base class for computing min cost spanning trees or forests.
Size NodeId
Type for node ids.
Definition: graphElements.h:98
bool __require_computation
a Boolean indicating whether we need recompute the spanning tree