![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
#include <MeekRules.h>
Public Member Functions | |
| MixedGraph | propagate (const MixedGraph &mg) |
| Propagates the orientation of a MixedGraph (no double-headed arcs) and return a PDAG. | |
| PDAG | propagateToCPDAG (const MixedGraph &mg) |
| Propagates the orientation of a MixedGraph (no double-headed arcs) and return a PDAG. | |
| DAG | propagateToDAG (const MixedGraph &mg) |
| Propagates the orientation of a MixedGraph and completes it as a DAG. | |
| std::vector< Arc > | choices () const |
| Get the Choices object : the list of arcs that the algorithm has to choose from a double arc or a double non-arc. | |
Constructors / Destructors | |
| MeekRules () | |
| default constructor | |
| virtual | ~MeekRules () |
| destructor | |
Private Member Functions | |
| MixedGraph | _propagates_ (const MixedGraph &graph) |
| bool | _applyMeekRules_ (MixedGraph &graph, NodeId xj) |
| Propagates the orientation from a node to its neighbours. | |
| void | _propagatesOrientationInChainOfRemainingEdges_ (gum::MixedGraph &graph) |
| heuristic for remaining edges when everything else has been tried | |
| void | _orientDoubleHeadedArcs_ (MixedGraph &mg) |
| Tells us if we can orient the edge xi - xj to xi -> xj. | |
| bool | _isOrientable_ (const gum::MixedGraph &graph, gum::NodeId xi, gum::NodeId xj) const |
| void | _complete_ (MixedGraph &graph) |
| gum::Arc | _critereMinParents_ (const gum::MixedGraph &graph, gum::NodeId x, gum::NodeId y) |
| When resolving double-headed arcs, prioritize selecting the option that minimizes the number of parent nodes in the graph. | |
Static Private Member Functions | |
| static bool | _existsDirectedPath_ (const MixedGraph &graph, NodeId n1, NodeId n2) |
Private Attributes | |
| std::vector< Arc > | _choices_ |
Definition at line 56 of file MeekRules.h.
| gum::MeekRules::MeekRules | ( | ) |
default constructor
Definition at line 54 of file MeekRules.cpp.
References MeekRules().
Referenced by MeekRules(), and ~MeekRules().
|
virtual |
destructor
Definition at line 57 of file MeekRules.cpp.
References MeekRules().
|
private |
Propagates the orientation from a node to its neighbours.
| graph | graph in which to which to propagate arcs |
| node | node on which neighbours to propagate th orientation |
| force | : true if an orientation has always to be found. |
Definition at line 206 of file MeekRules.cpp.
References _applyMeekRules_(), _choices_, _isOrientable_(), gum::DiGraph::addArc(), gum::EdgeGraphPart::eraseEdge(), and gum::EdgeGraphPart::neighbours().
Referenced by _applyMeekRules_(), _complete_(), _propagates_(), and _propagatesOrientationInChainOfRemainingEdges_().
|
private |
Definition at line 190 of file MeekRules.cpp.
References _applyMeekRules_(), _propagatesOrientationInChainOfRemainingEdges_(), gum::Set< Key >::empty(), gum::NodeGraphPart::nodes(), and gum::ArcGraphPart::parents().
Referenced by propagateToDAG().
|
private |
When resolving double-headed arcs, prioritize selecting the option that minimizes the number of parent nodes in the graph.
Definition at line 236 of file MeekRules.cpp.
References gum::EdgeGraphPart::neighbours(), gum::ArcGraphPart::parents(), and gum::Set< Key >::size().
Referenced by _orientDoubleHeadedArcs_().
|
staticprivate |
Definition at line 340 of file MeekRules.cpp.
References gum::List< Val >::empty(), gum::Set< Key >::exists(), gum::ArcGraphPart::existsArc(), gum::List< Val >::front(), gum::Set< Key >::insert(), gum::ArcGraphPart::parents(), gum::List< Val >::popFront(), and gum::List< Val >::pushBack().
Referenced by _isOrientable_(), and _orientDoubleHeadedArcs_().
|
private |
Definition at line 253 of file MeekRules.cpp.
References _existsDirectedPath_(), gum::MixedGraph::boundary(), gum::MixedGraph::mixedOrientedPath(), and gum::ArcGraphPart::parents().
Referenced by _applyMeekRules_().
|
private |
Tells us if we can orient the edge xi - xj to xi -> xj.
Orient double-headed arcs while avoiding cycles.
| graph | the graph |
| xi | the tail of the arc |
| xj | the head of the arc |
| mg | the MixedGraph the graph from which the double headed arcs will be oriented. |
Definition at line 112 of file MeekRules.cpp.
References _critereMinParents_(), _existsDirectedPath_(), gum::Set< Key >::begin(), gum::Set< Key >::contains(), gum::Set< Key >::empty(), gum::Set< Key >::erase(), gum::ArcGraphPart::eraseArc(), gum::Set< Key >::insert(), gum::NodeGraphPart::nodes(), and gum::ArcGraphPart::parents().
Referenced by propagateToCPDAG(), and propagateToDAG().
|
private |
Definition at line 177 of file MeekRules.cpp.
References _applyMeekRules_(), gum::Set< Key >::empty(), gum::NodeGraphPart::nodes(), and gum::ArcGraphPart::parents().
Referenced by propagate(), propagateToCPDAG(), and propagateToDAG().
|
private |
heuristic for remaining edges when everything else has been tried
Arbitrary propagation if we can't propagate thanks to MeekRules.
| graph | graph in which to which to propagate arcs |
| _latentCouples_ |
Definition at line 284 of file MeekRules.cpp.
References _applyMeekRules_(), _choices_, gum::DiGraph::addArc(), gum::Set< Key >::begin(), gum::ArcGraphPart::children(), gum::Set< Key >::clear(), gum::Set< Key >::contains(), gum::EdgeGraphPart::edges(), gum::Set< Key >::empty(), gum::Set< Key >::erase(), gum::EdgeGraphPart::eraseEdge(), gum::ArcGraphPart::existsArc(), gum::Set< Key >::insert(), gum::EdgeGraphPart::neighbours(), and gum::Set< Key >::size().
Referenced by _complete_().
|
inline |
Get the Choices object : the list of arcs that the algorithm has to choose from a double arc or a double non-arc.
Definition at line 95 of file MeekRules.h.
References _choices_.
| MixedGraph gum::MeekRules::propagate | ( | const MixedGraph & | mg | ) |
Propagates the orientation of a MixedGraph (no double-headed arcs) and return a PDAG.
Propagates MeekRules in a MixedGraph.
| graph | the graph in which to which to propagate arcs |
Definition at line 60 of file MeekRules.cpp.
References _choices_, and _propagates_().
| PDAG gum::MeekRules::propagateToCPDAG | ( | const MixedGraph & | mg | ) |
Propagates the orientation of a MixedGraph (no double-headed arcs) and return a PDAG.
| graph | the graph in which to which to propagate arcs |
Definition at line 66 of file MeekRules.cpp.
References _choices_, _orientDoubleHeadedArcs_(), _propagates_(), gum::PDAG::addArc(), gum::PDAG::addEdge(), gum::NodeGraphPart::addNodeWithId(), gum::ArcGraphPart::arcs(), and gum::EdgeGraphPart::edges().
| DAG gum::MeekRules::propagateToDAG | ( | const MixedGraph & | mg | ) |
Propagates the orientation of a MixedGraph and completes it as a DAG.
Propagates the orientation of a MixedGraph and return a DAG.
| graph | the graph in which to which to propagate arcs |
Definition at line 89 of file MeekRules.cpp.
References _choices_, _complete_(), _orientDoubleHeadedArcs_(), _propagates_(), gum::DAG::addArc(), gum::NodeGraphPart::addNodeWithId(), gum::ArcGraphPart::arcs(), and gum::NodeGraphPart::nodes().
|
private |
Definition at line 100 of file MeekRules.h.
Referenced by _applyMeekRules_(), _propagatesOrientationInChainOfRemainingEdges_(), choices(), propagate(), propagateToCPDAG(), and propagateToDAG().