48#ifndef GUM_MEEKRULES_H
49#define GUM_MEEKRULES_H
115 const std::vector< Arc >&
choices()
const;
Inline implementations of MeekRules.
Base classes for partially directed acyclic graphs.
The base class for all directed edges.
MixedGraph _propagates_(const MixedGraph &graph)
Applies Meek rules R1–R4 exhaustively and returns the resulting graph.
PDAG propagateToCPDAG(const MixedGraph &mg)
Applies Meek rules and returns a CPDAG (completed PDAG).
static bool _isOrientable_(const MixedGraph &graph, NodeId xi, NodeId xj)
Returns true if the edge xi–xj can be oriented as xi→xj under Meek rules R1–R3.
MixedGraph propagate(const MixedGraph &mg)
Applies Meek rules to a MixedGraph and returns the partially oriented result.
std::vector< Arc > _choices_
static bool _existsDirectedPath_(const MixedGraph &graph, NodeId n1, NodeId n2)
Returns true if there is a directed path from n1 to n2 (BFS, double arcs ignored).
bool _applyMeekRules_(MixedGraph &graph, NodeId xj)
Tries to orient edges incident to xj using Meek rules R1–R4.
static Arc _selectArcToEraseByMinParents_(const MixedGraph &graph, NodeId x, NodeId y)
Returns the arc to erase when resolving a double-headed arc, using a min-parents heuristic.
virtual ~MeekRules()
destructor
void _complete_(MixedGraph &graph)
Orients all remaining undirected edges, applying Meek rules then a chain heuristic.
static void _orientDoubleHeadedArcs_(MixedGraph &mg)
Resolves double-headed arcs (x→y and y→x simultaneously) to avoid cycles.
DAG propagateToDAG(const MixedGraph &mg)
Applies Meek rules and completes the result into a DAG.
const std::vector< Arc > & choices() const
Returns the arcs for which the algorithm made an arbitrary orientation choice.
void _propagatesOrientationInChainOfRemainingEdges_(MixedGraph &graph)
Arbitrarily orients remaining undirected edges when no Meek rule applies.
MeekRules()
default constructor
Base class for mixed graphs.
Base class for partially directed acyclic graphs.
Size NodeId
Type for node ids.
gum is the global namespace for all aGrUM entities