aGrUM  0.14.2
graphChangesGenerator4UndiGraph.h File Reference

The basic class for computing the set of undigraph changes allowed by the user to be executed by the learning algorithms. More...

+ Include dependency graph for graphChangesGenerator4UndiGraph.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gum::learning::GraphChangesGenerator4UndiGraph< STRUCT_CONSTRAINT >
 The basic class for computing the next graph changes possible in an undirected structure learning algorithm. More...
 

Namespaces

 gum
 gum is the global namespace for all aGrUM entities
 
 gum::learning
 

Detailed Description

The basic class for computing the set of undigraph changes allowed by the user to be executed by the learning algorithms.

Structure learning algorithm try different modifications of the graph. Class GraphChangesGenerator4UndiGraph provides a simple way to compute those that we wish to perform. For instance, in the basic PC algorithm for learning undirected graphs, one may expect that all possible edge additions and deletions can be applied and GraphChangesGenerator4UndiGraph provides exactly this set of operations. This class provides the following minimal methods:

  • void setGraph ( const UndiGraph& ) : assigns a new graph as a starting point to the generator of graph change operators
  • void modifyGraph ( const GraphChange& ) : indicate to the operator set that the graph has been changed and that we need to compute the new operators that result from this change
  • void clearChanges () : empty the set of possible operators
  • methods begin () and end () that return iterators allowing to parse the available set of operators.

Basically, the idea is to use method setGraph at the beginning of the structure learning in order to initialize the possible set of operators. Then, parse this set using a for ( auto iter = operator_set.begin (); iter != operator_set.end (); ++iter ) loop and compute the scores induced by these changes. When this is done, flush the operator set by calling method clearChanges. Then iterate changes and after each new change applied, used again the iterator for loop, and so on. Note that, whenever you execute method modifyGraph, this will automatically flush the current list of changes and put into the list only the changes that are affected by the graph modification.

Author
Christophe GONZALES and Pierre-Henri WUILLEMIN

Definition in file graphChangesGenerator4UndiGraph.h.